Skip to main content

Module relationships

Module relationships 

Source
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§

ArtifactRelationships
One artifact’s relationships in a report (ArtifactRelationships).
CorpusItem
One parsed + classified item: (display path, artifact, spec).
EdgeSpec
Relationship
One declared cross-artifact reference with its resolution outcome (Relationship). resolved_path is set only when the reference resolves uniquely to another artifact.
RelationshipIssue
RelationshipReport
RelationshipReport (non-validate inspection).
RelationshipSummary
RelationshipValidation
ResolutionIndex
Insertion-ordered {casefold(ident) -> [(path, ident)]} index.
ValidationRow

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) — the decided inspect extractor: identical to the full variant except supersedes is excluded (it stays a top-level scalar in inspect output, ADR-007).
extract_relationships_full
extract_relationships_full(product, spec): {snake_section -> refs} in spec.optional order, including supersedes.
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 from spec.optional.
validate_document_against_corpus
validate_document_against_corpus(product, source_path, directory) — the decided validate - --corpus DIR seam (ADR-067).
validate_relationships
validate_relationships_file
validation_from_rows
validation_from_rows(directory, rows, recursive) — the single gate core.
validation_row