relationships --validate reports 0 relationships checked in a federated root
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)
- Create a root corpus that inherits one parent through a version-2 manifest. The parent holds
SEC-00000000001A. - Add a root decision whose
## Related Decisionslistsomarchy/security::SEC-00000000001A. Add a second root decision that lists the first one by its local ID. - 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.