Skip to main content

Module refs

Module refs 

Source
Expand description

The uniform references field: an ID->title map linking a feature or work item to other features and work items.

Both document families share one references mapping (keys are FEAT-NNNN / <TYPE>-NNNN, values are the referenced doc’s title). Prefixes are self-describing, so a single field captures links in either direction. Entries are always serialized sorted by item number. A closed work item leaves a tombstone: its title value is struck through (~~title~~), which both marks it done and reserves its ID against reuse.

Constants§

BLOCKED_BY
The directional blocker-relation map fields: blocked_by lists the items blocking this one, blocks lists the items this one blocks. Maintained as inverses of each other by crate::links::reconcile_blockers.
BLOCKS
FIELD
The reserved frontmatter key holding the ID->title reference map.
RELATION_FIELDS
Every ID->title relation map field, in serialization order. Each behaves identically for resolution, tombstones, and ID reservation; only reconciliation differs (references is symmetric, blocked_by/blocks are inverses).

Functions§

add_to_map
Insert or update id’s entry in a relation map. Returns whether the map changed.
all_relation_ids
Every id appearing in any relation map (references, blocked_by, blocks), regardless of prefix — used to compute the global ID sequence so a closed item appearing in any map keeps its number reserved against reuse.
id_number
Numeric part of a PREFIX-NNNN id, for deterministic ordering. Ids that do not parse sort last.
ids_with_prefix
Ids in the references map carrying the given prefix (e.g. FEAT or BUG).
is_struck
Whether a reference value is a struck-through (closed) tombstone.
parse
Read the references map as (id, raw_value) pairs sorted by item number. raw_value retains any strikethrough so callers can distinguish a closed tombstone from a live link.
parse_in
Read an arbitrary ID->title relation map (references, blocked_by, blocks) as (id, raw_value) pairs sorted by item number.
remove_from_map
Remove id’s entry from a relation map. Returns whether anything was removed.
set
Replace the references map, sorted by item number. An empty list removes the field entirely (keeping frontmatter minimal).
set_in
Replace an arbitrary relation map, sorted by item number. An empty list removes the field entirely (keeping frontmatter minimal).
strike
Wrap a title as a struck-through tombstone value.
unstrike
The underlying title of a reference value, with any strikethrough removed.