Skip to content

Conditions cannot address an actor-owned array by id #418

Description

@The-Running-Dev

What changes, and for whom. A content author writing an event or goal condition can address a specific entry inside an actor-owned collection — "this NPC's relationship," "this course's enrollment" — the same way 03 §7.1 already documents for player.relationships.<npcId>.affinity. Right now they cannot: player.relationships and player.education.enrollments are arrays on the actor (kinds/simulation/actor.ts), and no existing addressing form reaches into them. The exists/count quantifiers throw on collection, and the documented natural-key path throws too, because resolveField's generic per-segment walk cannot key an array by an id — only an index, which §7.1 already rejects as unstable across reordering.

Why now. This blocked a real content slice in SubZeroDev.GameOfLife (S21.3): an event conditional on an NPC relationship and one on a course-in-progress, both wanted by the game design (03 §11.1/§11.3), are currently inexpressible and stayed omitted, visibly, per CP10. The engine's own docs already mark this "not yet" rather than "never" — see the natural-key path documented in 03 §7.1.

Done when

  • A condition can reference a specific entry in an actor-owned array collection by a stable id (not array index) — for player.relationships, keyed by NPC id; for player.education.enrollments, keyed by course id (optionally filtered on a field such as status).
  • exists/count (or an equivalent quantifier) works over such a collection, matching the same semantics already documented for object-valued collections.
  • A regression test exercises both player.relationships and player.education.enrollments addressed this way against a built campaign.

Agent instructions

Origin: SubZeroDev.GameOfLife issue #89 (S21), and design/90-decisions.md's S21.5 entry in that repo, which has the full investigation — verified against the pinned engine (54e2467c…) rather than inferred.

Reproduction, in the consuming repo: event-friend-needs-a-favor, event-neighbor-borrows-again, and event-landlord-inspection each want a condition over player.relationships (affinity, or "any NPC with resentment above 50"); event-tutor-offers-extra-session wants one over player.education.enrollments filtered on status: "active". All four are currently inexpressible and are omitted from the content, named at each authoring site.

Not the fix: player.relationships.0.affinity resolves today via index addressing, but 03 §7.1 already rejects this as the approximation CP10 forbids — it targets a different NPC after any reordering.

Likely surface: kinds/simulation/conditions.ts (the exists/count quantifiers) and resolveField's natural-key path — both currently only handle object-valued collections, not array-valued ones.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions