core icon indicating copy to clipboard operation
core copied to clipboard

relationships --validate reports 0 relationships checked in a federated root

Open tcballard opened this issue 1 month ago • 0 comments

Problem

In a repository with a .decided/corpus.md manifest, decided relationships <dir> --validate always reports Relationships Checked: 0, and relationships_checked: 0 in --json. This happens even when the root corpus contains resolvable references, including references between two of its own artifacts.

Validation itself still works: a broken reference still fails with exit code 1. Only the reported count is wrong, which makes a federated corpus look as if it has no relationships.

Reproduction (v0.30.0)

  1. Create a root corpus that inherits one parent through a version-2 manifest. The parent holds SEC-00000000001A.
  2. Add a root decision whose ## Related Decisions lists omarchy/security::SEC-00000000001A. Add a second root decision that lists the first one by its local ID.
  3. Run decided relationships decisions --validate.
Case relationships_checked Exit code
Same two root decisions, no manifest 1 0
Federated root, one cross-source reference 0 0
Federated root, cross-source reference plus a local-to-local reference 0 0
Federated root, local reference to a missing ID (error: corpus-federation-invalid-node … relationship-target-not-found) 1

decided relationships decisions without --validate lists both edges correctly. corpus explain resolves the qualified reference.

Where to look

cmd_relationships routes a federated root to ComposedCorpus::validate_relationships (composition.rs). That function calls validation_from_rows_with_index over effective_rows.

The count comes from resolve_references_full (relationships.rs). It counts only rows with spec_name set, and only their non-external edges. The likely cause is that the composed rows reach this counter without edges or without spec_name, while reference integrity is enforced earlier, when the federation is assembled. I have not confirmed this.

Expected

Federated output should count the same edges the non-federated path would, without changing exit codes or issue output.

Acceptance

  • A federated fixture asserts a non-zero relationships_checked, in both human and JSON output.
  • The existing no-manifest golden output is unchanged.

tcballard avatar Oct 03 '26 16:10 tcballard