Skip to content

resolve_reverse_segment degrades silently on two DB errors, producing a false 'broken path' rejection for a legitimate inherited reverse relationship #2885

Closed

Description

@mstomar125

Context

Surfaced by a codebase scan focused on the extends-chain/ADR-078 bug class. Related to (but distinct from) core#2885 (validate_play's own-hop error-blame issue).

Problem

resolve_reverse_segment (packages/core/src/playbook/validation.rs:739-763) has two silent-degradation points:

  • resolve_type_chain(...).unwrap_or_else(|_| vec![node_type]) collapses the ancestor chain to just the concrete type on error.
  • get_inbound_relationships's Err case does continue, skipping that candidate silently.

Either failure makes a legitimate inherited reverse relationship name (e.g. node.blocked_by declared on an ancestor, used on a subtype instance) resolve to None. The caller then reports this as a broken path, blaming the user's expression for a transient DB error — no log, no degraded_reasons entry, nothing to distinguish it from a genuine typo.

Suggested approach

Same pattern as the other validation.rs findings from this scan (core#2885): propagate the error instead of silently degrading to a possibly-wrong answer, or at minimum log loudly and/or surface it distinctly from a real "not found."

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions