Expand description
Cross-reference auto-sync: keep every doc’s references map bidirectional
and title-fresh, and rewrite bare FEAT-XXXX/WI-XXXX mentions in body
prose into readable markdown links. Run by sync after every mutating
command.
Functions§
- build_
index - Map of every present doc’s ID to (title, file path), for linkifying bodies.
- linkify
- Rewrite bare
FEAT-XXXX/WI-XXXXmentions (and refresh existing opys links) in body prose into[ID — Title](relpath). Idempotent; references inside fenced code blocks, inline code spans, or existing markdown link syntax (label or destination) are left untouched, and a mention whose target is absent fromindexis left as-is. - nested_
links - Scan a body for nested markdown links — a complete
[…](…)inside another link’s label. That is invalid markdown and, in an opys inventory, the footprint of linkify corruption;verifyflags each occurrence. Fenced code blocks and inline code spans are skipped, like inlinkify. Returns one truncated snippet per offending link. - reconcile
- Reconcile every doc’s
referencesmap: make links bidirectional between present docs and refresh each value to the referenced doc’s current title. A reference whose target is absent (a closed work item’s struck tombstone, or a dangling id) keeps its existing value untouched. - reconcile_
blockers - Reconcile the directional blocker relation:
blocked_byon one doc andblockson the other are kept as inverses, with titles refreshed from the referenced doc. An edge is asserted if either endpoint records it (union semantics, likereconcile); removal is therefore done on both sides by theunblockcommand. Edges whose other endpoint is absent (a struck tombstone or a dangling id) keep their existing value untouched. - ref_re
- Build the bare-ID matcher whose prefix alternation comes from the live configured type prefixes, so new types are linkified automatically.