Skip to main content

Module def_slug_index

Module def_slug_index 

Source
Expand description

A cached index of every shared definition’s slug and former slugs, for the slug-to-uid reads that run on every message (docs/specs/SPEC_FORK_SLUG_MIGRATION_2026_10_22.md P0.1).

A file is parsed again only when it may have changed. Each lookup stats the files (no reads) and reparses one whose modification time or size differs from what was cached, or that this process wrote since ([SlugIndex::invalidate]). Other channels and instances write these files too, so the on-disk stamp, not an in-process signal, is what keeps the cache current. A stamp is trusted only once the file is older than [RACY_WINDOW] at parse time, as git does for its index: a filesystem with coarse timestamps could otherwise give a quick rewrite of the same size the same stamp.

Two views of one cache. [SlugIndex::all] is the records list_active would list, for resolving names. [SlugIndex::all_strict] is every record whose slug fields can be read, newer schemas included (slug_fields), and fails when any file or the directory can’t be: allocating a new slug against an incomplete view could take one an unseen agent holds.

Structs§

SlugEntry
The slug and former slugs of one active shared definition, and the display names it goes by now (its name and branch_label, non-empty), which a former display name of another agent never outranks.