Expand description
Per-entity history — the narrative query behind an inspector’s “how did this entity get this way”.
The engine already records everything a story needs (commit subjects, provenance trailers, agent notes, batch entity lists, rename chains) but exposed it only as branch-wide feeds; every consumer filtered client-side. This module owns the per-entity filter, rename-chain attribution, and pagination — one semantic for every surface.
Data sources per backend, all pre-existing:
- git-branch: the commit-note walk that already rides
changes_since(BackendChanges::notes, newest-first) — full fidelity: sha, subject, trailers, batchEntities:lists, authoritative rename pairs in the subject. - folder / in-memory:
MemBackend::read_provenance(the.memstead/changes.jsonlline scan / its in-memory analogue, oldest-first) — same story, coarser: no batch entity lists, and rename records carry only the post-rename id, so chains are not stitchable. Both gaps surface as statedlimitations, never as silently absent entries. - archive: the seam records no history — typed refusal, never a fabricated empty story.
This query is read-only and mutates nothing; it deliberately stays
narrative-only (content-level diffs per touch are the pairwise
diff op’s job, git-branch consumers only).
Structs§
- Entity
History Report - Result of
Engine::entity_history— one page of the newest-first touch feed plus the explicit bounds of what it omits. - Entity
Provenance - The entity read’s derived provenance block: created-by and last-modified-by, derived from the append-only history record — never from anything an agent can edit after the fact.
- Entity
Touch - One recorded touch of an entity, newest-first in the report.
- Provenance
Record - One derived provenance record — who performed a boundary touch of an entity’s story, in what declared role, when (agent-trust plan 13). Served by the entity read’s opt-in provenance block.
Enums§
- Story
Start - Where the returned story starts — the visible-truncation contract: whatever the record cannot reach is stated, never silent.
Constants§
- HISTORY_
PAGE_ DEFAULT - Default page size when the caller passes
None. - HISTORY_
PAGE_ MAX - Hard page-size cap; larger requests clamp here.