Expand description
Relationship extraction and validation (decided.services.references,
decided.services.relationships, decided.core.relationship_types), per
PORT-CONTRACT.d/05.
Covers the surfaces the validate/corpus parity gate needs:
validate_relationships (directory), validate_relationships_file, and
validate_document_against_corpus (the decided validate - --corpus seam).
Structs§
- Artifact
Relationships - One artifact’s relationships in a report (
ArtifactRelationships). - Corpus
Item - One parsed + classified item:
(display path, artifact, spec). - Edge
Spec - Relationship
- One declared cross-artifact reference with its resolution outcome
(
Relationship).resolved_pathis set only when the reference resolves uniquely to another artifact. - Relationship
Issue - Relationship
Report RelationshipReport(non-validate inspection).- Relationship
Summary - Relationship
Validation - Resolution
Index - Insertion-ordered
{casefold(ident) -> [(path, ident)]}index. - Validation
Row
Constants§
- ISSUE_
DUPLICATE_ IDENTIFIER - ISSUE_
EDGE_ UNSUPPORTED - ISSUE_
RELATIONSHIP_ CYCLE - ISSUE_
SCOPE_ TARGET_ NOT_ FOUND - ISSUE_
SELF_ REFERENCE - ISSUE_
TARGET_ AMBIGUOUS - ISSUE_
TARGET_ NOT_ FOUND - ISSUE_
TARGET_ SUPERSEDED - ISSUE_
TARGET_ TYPE_ MISMATCH
Functions§
- build_
relationship_ report - build_
relationship_ report_ file - corpus_
items _corpus_items(directory, recursive)— the sorted-path walk, parsed and classified.- edge_
spec edge_spec(name)over the built-in registry.- extract_
relationships extract_relationships(product, spec)— thedecided inspectextractor: identical to the full variant exceptsupersedesis excluded (it stays a top-level scalar in inspect output, ADR-007).- extract_
relationships_ full extract_relationships_full(product, spec):{snake_section -> refs}inspec.optionalorder, includingsupersedes.- parse_
references parse_references(body): one reference per non-empty line, one leading well-formed list marker stripped.- relationship_
severity - Canonical intrinsic severity per finding (
RELATIONSHIP_SEVERITY). - relationships_
from_ corpus relationships_from_corpus(entries)— every declared reference in a corpus snapshot, resolved. Ordering matches_resolve_references.- resolution_
index_ from_ rows - resolve_
relationships resolve_relationships(rows, index)— the single resolve loop. Rows in order, sections in each row’s schema order, refs in declaration order.- rows_
from_ corpus_ items - Public alias so callers outside this module build validation rows.
- summary_
from_ rows summary_from_rows(rows).- unsupported_
relationship_ sections unsupported_relationship_sections(product, spec): canonical-order relationship sections declared with refs but absent fromspec.optional.- validate_
document_ against_ corpus validate_document_against_corpus(product, source_path, directory)— thedecided validate - --corpus DIRseam (ADR-067).- validate_
relationships - validate_
relationships_ file - validation_
from_ rows validation_from_rows(directory, rows, recursive)— the single gate core.- validation_
row