You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GraphResolver::is_declared_many_relationship uses own-schema-only lookup, misclassifying an inherited many-relationship #2837
Surfaced during review of PR #2817 (core#2769 — merging fields/relationships across the ADR-078 extends chain in get_workflow_state's diagnostic candidate enumeration). Same bug class as core#2819 (validate_play's write-time analog), found in a third location.
Problem
GraphResolver::is_declared_many_relationship (packages/core/src/playbook/graph_resolver.rs) looks up a relationship's cardinality via get_schema_node(node_type) — the type's own directly-declared relationships only, not merged across the extends chain the way NodeService::resolve_relationships (added in PR #2817) now does.
Impact
A relationship declared Many only on an ancestor schema and inherited by a subtype node (not redeclared) is misclassified as not-many when a subtype node currently has 0 or 1 related rows: is_declared_many_relationship returns false (the lookup finds nothing on the bare subtype schema), so the surrounding shape-inference logic falls through to count-based inference instead of forcing ResolvedValue::Collection — resolving the relationship as Missing or a bare node instead of a List, which is exactly the bug this cardinality check exists to prevent. GraphResolver is constructed inside get_workflow_state itself and used for its own condition evaluation, so this PR's now-fixed candidate enumeration can still evaluate an inherited many-relationship condition incorrectly via this separate resolver path.
Suggested approach
Not prescribed. NodeService::resolve_relationships (added in PR #2817, packages/core/src/services/node_service/schema.rs) already does the merge this needs — is_declared_many_relationship (or its caller) likely wants to go through it instead of get_schema_node directly.
Non-goals
No change to GraphResolver's traversal/caching architecture beyond this one lookup — scoped to the cardinality check reading the merged relationship set.
Activity
Address review: dedup degrade-recording, fix message overclaims, share
Merge inherited fields into get_workflow_state's candidate enumeration (
mstomar125 commentedon Sep 23, 2026
Frontend: 5264 passed