Skip to content

A bare property_key on a property_changed trigger never matches a real event #2753

Closed

Description

@malibio

Overview

A Play's property_changed trigger registers whatever property_key its author wrote, verbatim. Every real PropertyChanged event carries a type-namespaced key (PropertyChange::key — "namespaced, e.g. task.status", packages/core/src/db/events.rs). Nothing normalises either side.

So a Play written with "property_key": "status" is indexed under (task, "status"), while the event that should fire it arrives as (task, "task.status"). The Play never fires — silently. No error at save time, no log at runtime, no signal that the trigger is dead.

Problem Statement

This is a trap rather than a broken feature: the shipped core Play (ADR-079) correctly writes "task.status", so nothing in the product depends on the bare form today. The hazard is that the bare spelling is the obvious one to write, reads as correct, passes save-time validation, and then does nothing.

It also actively concealed a real bug. packages/core/src/playbook/lifecycle.rs's property_changed_keys_fan_out_to_ancestors_too asserts a match using a bare "status" — a match that cannot occur in production. Because the test used the one spelling where the namespace is absent, it could not catch a fan-out bug that dropped the namespace entirely; that bug (subtype events never reaching a base-scoped Play) survived until an end-to-end test with realistic keys exposed it. A test asserting a production-impossible match is worse than no test.

Proposed Solution

Pick one; they are alternatives, not steps.

A — Normalise at registration. When a graph_event/property_changed trigger declares a bare property_key, index it as <node_type>.<key>. Bare spellings then work as authors expect. Changes trigger matching for every existing Play, so it wants the same care as the fan-out fix.

B — Reject a bare key at save time. validate_play errors on a property_key with no namespace, naming the expected spelling. Smaller and safer; makes the failure loud at authoring time rather than silent at runtime. Rejects Plays that are already "wrong" but were never firing anyway.

Whichever is chosen, property_changed_keys_fan_out_to_ancestors_too must be updated — it currently encodes the impossible case as the expected one.

Acceptance Criteria

  • A bare property_key either matches real events (A) or is rejected with a clear message at save time (B) — not silently indexed under a key nothing emits
  • property_changed_keys_fan_out_to_ancestors_too no longer asserts a production-impossible match
  • A test covers the realistic namespaced spelling alongside whatever bare-key behavior is chosen
  • Existing Plays using namespaced keys are unaffected (regression coverage)
  • Tests pass (bun run test:all)
  • Code passes bun run quality:fix

Technical Specifications

Reference Files

Non-Goals

Context

Surfaced as Finding 15 of #2752's third review round. Deferred from that PR deliberately: normalising registration keys changes trigger matching for every Play in the system — the same blast radius as the fan-out fix in that PR — and deserves its own change and its own review rather than riding along.

Activity

  1. mstomar125 commented on Sep 21, 2026

    @mstomar125
    Contributor

    Frontend: 5226 passed (256 files). Rust playbook::validation + playbook:: lib tests: 446 passed. Baseline green; implementing option B (reject bare property_changed property_key at save time) in this worktree.

  2. self-assigned this
    on Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions