Skip to content

The catalog and the ledger are not described: 4-resource-management.md has no section for what the catalog holds, what the ledger snapshot records, and when a digest is computed #906

Closed

Description

@David-Noble-at-work

Catalog (placed by the owner 2026-09-22; the section it writes describes both, and the ledger, #909, is the record the catalog leaves).

The gap

docs/architecture/4-resource-management.md describes resource identity (§2, §5), lifecycle states (§3), shadowing
(§4) and recovery (§6), and says the catalog travels with the graph -- but nowhere does it say, as a reader of
pkg/op/resource_catalog.go would need:

  • what the catalog holds: produced entries (claimed by a unit, ProducerID set) beside discovered ones (a
    boundary or an occupant observed by a provider, no producer), and how each arrives -- GetOrCreate, Discover,
    Shadow, MarkGone;
  • what the ledger snapshot is: the catalog serialized into a trace -- per entry, id, URI, producer, state, and
    for an Active entry its Etag and Digest -- and when it is captured (Run's defer, Trace(), a pause);
  • the Etag/Digest ladder: an etag is one lstat (size, mtime, ino); a digest is content, and for a directory a
    Merkle root of the whole tree; a changed etag is the trigger for a digest comparison
    (verifyLocationFreshness), and -- after The ledger snapshot digests every Active resource, twice per run: a discovered directory boundary such as ~ is Merkle-walked (1.7M files) at the end of every deploy, silently, and the walk is discarded #904 -- a snapshot recomputes a digest only on a changed etag and never
    digests a discovered directory;
  • what a reader of a trace's ledger may rely on: which fields are identity, which are observation, and what an
    empty digest means.

Found 2026-09-21 diagnosing #904: three correct rulings, each documented in its own place, composed into a
Merkle walk of the home directory, and no page of the architecture shows them side by side.

Done when

Catalog

Plan and design documents

Kind Document
Plan docs/plans/feature/906-catalog-and-ledger.md
Design docs/architecture/4-resource-management.md

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions