Expand description
agent_notes_since — walk a mem’s branch from a caller-provided
cursor to the current tip and return one CommitNote per commit
along the way, with the body parsed into structured fields.
This is the symmetric read-side of crate::vcs::format_commit_message:
the same engine layer that writes the trailer block (Tool:, Actor:,
Client:) parses it back out. Plugin and outer-repo cursor consumers
that want agent-note bullets read this surface instead of
shelling out to git log and re-implementing the trailer parser.
Subject shapes the engine emits (see callers of format_commit_message):
memstead: <verb> <id>(entity CRUD:create,update,delete; plusanchorfor an anchor-only update — sole delta the anchors sidecar, so it earns a distinct verb since it yields zero entity deltas and is otherwise invisible in the note log)memstead: <verb> <from> → <to>(rename,relate,unrelate)memstead: mem_<verb> <name>(lifecycle, with optional(config)/(seal)qualifier)
The parser captures the verb token and the remainder of the subject
verbatim into entity_id — callers that need to split rename/relate
arrows do so themselves; the engine does not over-structure here.
Empty-tree sentinel (EMPTY_TREE_SHA) is accepted as since and is
treated as “walk every commit reachable from head” — mirrors
crate::ops::changes::changes_since’s convention.
Structs§
- Agent
Notes Report - Walked output of
agent_notes_since.headechoes the resolved branch tip so callers record it as the next polling cursor without a follow-upmemstead_healthround-trip.memstead_refcarries the workspace-level__MEMSTEADref tip (unified schemas + per-mem configs) so consumers — today the outer-repo auto-commit cursor block — anchor it alongside the per-mem head without a second round-trip.Nonewhen the workspace has not been migrated to the unified layout yet. - Commit
Note - One commit’s worth of structured agent-note state. Fields are
populated best-effort: a body that doesn’t match the
memstead: <verb> <id>subject shape leavestool_verb/entity_idNone; absent trailers leave the corresponding fieldsNone. Callers branch onactorfor agent-vs-external classification. - Parsed
Commit - Parsed shape of one commit body. Mirrors the layout produced by
crate::vcs::format_commit_message:
Functions§
- agent_
notes_ since - Walk the per-mem branch from
since(exclusive) to the current branch tip (inclusive) and return oneCommitNoteper commit on the path, parsed viaparse_commit_message. Order: newest first (matchesgit logdefault). - parse_
commit_ message - Parse one commit body — subject on the first line, optional note
paragraph, then a trailer block. Trailers are recognised as lines
matching
<Capitalized>: <value>. The note is everything between the subject (after one blank line) and the first trailer (or end of body if none). - read_
memstead_ ref - Resolve
refs/heads/__MEMSTEAD(unified schemas + per-mem configs) in the mem-repo gitdir shared by every writable mem. ReturnsNonewhen the ref does not exist — pre-migration workspaces and fresh repos legitimately have no__MEMSTEADyet.