app.domain.values¶
Value types shared by record parsing, relationships and storage.
Public API: RecordKind, TitleSource, LinkType,
Links (to_dict / from_dict for the stored JSON shape),
Identity and record_key().
- class app.domain.values.RecordKind(*values)¶
Bases:
StrEnumKind of ADR record.
- DECISION = 'decision'¶
- ERRATUM = 'erratum'¶
- class app.domain.values.TitleSource(*values)¶
Bases:
StrEnumWhere the display title came from.
- FRONTMATTER = 'frontmatter'¶
- H1 = 'h1'¶
- FILENAME = 'filename'¶
- class app.domain.values.LinkType(*values)¶
Bases:
StrEnumOutbound relationship types, named as written in frontmatter.
- UPDATES = 'updates'¶
- OBSOLETES = 'obsoletes'¶
- CORRECTS = 'corrects'¶
- class app.domain.values.Links(updates=(), obsoletes=(), corrects=None)¶
Bases:
objectOutbound UUID relationships of one record.
- Parameters:
- pairs()¶
List every outbound link with its type, in a stable order.
- to_dict()¶
Convert to the JSON-serialisable shape stored in
record.links.
- class app.domain.values.Identity(source_id, project, record_key)¶
Bases:
objectLogical identity of an ADR: record key within registration + project.
- Parameters:
source_id (
str) – Source registration id.project (
str) – Owning project path.record_key (
str) – UUID string or fallback key (record_key()).
- app.domain.values.record_key(adr_uuid, source_id, project, path)¶
Compute the stable record key used in the logical identity.
- Parameters:
- Return type:
- Returns:
The lowercase UUID string, or
src:<source_id>/<project>/<path>when there is no valid UUID. A UUID is never invented.