Skip to content

get_workflow_state builds property_changed lookup keys from bare field names, never matching a real rule #2763

Closed

Description

@mstomar125

Context

Surfaced during independent review of PR #2762 (#2753 — reject a bare property_key on a property_changed trigger at save time). Explicitly out of scope for that PR, filed here as a standalone follow-up.

Problem

get_workflow_state (packages/core/src/playbook/workflow_state.rs) answers "if this node's current state were evaluated right now, which rules would fire?" by looking up candidate rules in the engine's TriggerIndex. For property-key-scoped rules, it builds one lookup key per schema field, using the bare field name:

for field in &s.fields {
    keys.push(TriggerKey::NodeEvent {
        event: NodeEventType::PropertyChanged,
        node_type: node.node_type.clone(),
        property_key: Some(field.name.clone()),
    });
}

But every property_changed trigger a Play can now validly register is indexed under a type-namespaced key (<node_type>.<field>, e.g. task.status) — #2753 made this the only accepted spelling at save time, and it was already the only spelling any real PropertyChanged event ever carries. A bare-field lookup key like "status" can therefore never match anything in the trigger index: this branch of get_workflow_state's candidate search is effectively dead code today, and after #2753 it is guaranteed dead (previously it could, by accident, have matched a badly-authored but already-silently-broken bare-key rule; now it can't even do that).

Impact

get_workflow_state's wildcard (property_key: None) lookup still finds any rule with no specific property_key, so a rule scoped to a wildcard is still reported correctly. Only property-key-scoped property_changed rules are missed by this specific-field lookup path — such a rule is silently absent from a get_workflow_state response even when its condition would in fact be satisfied right now.

Suggested fix

Build the lookup key as format!("{}.{}", node.node_type, field.name) instead of the bare field.name, matching the namespaced shape trigger_keys_for_graph_event actually indexes under.

Non-goals

Same as #2753: no change to the stored property format or the namespaced event key shape.

Activity

  1. mstomar125 commented on Sep 21, 2026

    @mstomar125
    ContributorAuthor

    Frontend baseline: 256/257 test files passed, 5227/5229 tests passed. 2 pre-existing failures in src/tests/performance/architecture-benchmarks.test.ts (timing-sensitive perf thresholds, unrelated to this issue — bulk structural op took 116.9ms vs 40ms target, render scaling factor 2.44 vs 1.5 max). Starting work on the workflow_state.rs namespaced property-key fix.

  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

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions