Expand description
Artifact identity (decided.core.identity), per PORT-CONTRACT.d/04 §3.
Precedence: frontmatter id -> ## ID section -> spec.id_field (dead
today) -> filename-stem ^[A-Za-z]+-\d+ prefix -> whole stem. Pathlib
stem semantics and Unicode \d are replicated exactly.
Functions§
- artifact_
identifier artifact_identifier(product, spec, path).- artifact_
identifiers artifact_identifiers(product, spec, path): canonical first, then legacy aliases, de-duplicated case-insensitively (casefold).- first_
value_ list_ stripped - identity’s
_first_value(body): first non-empty stripped line, one leading list marker stripped, stripped again. - id_
prefix _ID_PREFIX_RE = ^[A-Za-z]+-\d+(ASCII letters, Unicode digits) — returns the matched prefix (.group(0)) or None.- identity_
conflict identity_conflict(product, spec)->(frontmatter_id, legacy_id).- path_
stem Path(path).stem— pathlib semantics: final component (trailing slashes and.segments dropped), minus the last suffix, where a suffix exists only when the final dot is neither at index 0 nor the last char.- strip_
list_ marker - Strip ONE leading well-formed Markdown list marker
(
^(?:[-*+]|\d+\.)\s+, Unicode\d/\s) froms, or return it as-is.