Skip to content

GraphResolver::is_declared_many_relationship uses own-schema-only lookup, misclassifying an inherited many-relationship #2837

Closed

Description

@mstomar125

Context

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

  1. added
    bug
    on Sep 22, 2026
  2. mstomar125 commented on Sep 23, 2026

    @mstomar125
    ContributorAuthor

    Frontend: 5264 passed

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

Metadata

Metadata

Assignees

Labels

backendbug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions