@@ -20,7 +20,7 @@ For workflows that **persist state across runs** — deduplication, incremental
2020| Track a numeric metric and compare current vs. baseline (runs at least every 7 days) | ` cache-memory ` ✅ first choice |
2121| Long-lived knowledge base visible in PRs and code reviews | ` repo-memory ` |
2222| Baselines that must survive cache expiry (e.g. security findings, dedup lists) | ` repo-memory ` |
23- | Bounded append-only structured event history and built-in current-state projections | Experimental ` tools.ledger ` |
23+ | Bounded append-only structured event history and built-in current-state projections | Experimental ` tools.ledger ` — see [ ledger.md ] ( ledger.md ) |
2424| Human-readable wiki pages for knowledge accumulation | ` repo-memory ` with ` wiki: true ` |
2525| Persist notes/state inline on the triggering issue or PR | ` comment-memory ` |
2626| Private-preview GitHub Drives backend (enrolled repos only) | ` drive-memory ` — see [ drive-memory.md] ( drive-memory.md ) |
@@ -221,57 +221,10 @@ Compiler creates a separate `push_repo_memory` job with `contents: write`; main
221221
222222# ## Structured event history: standalone ledger (experimental)
223223
224- Use the ledger for immutable, structured events when each run should add records
225- and later runs need to query them. For example, a low-volume audit can append
226- one result per scan and query prior results by a stable application-level key.
227- Configure `tools.ledger` independently of repo-memory. The legacy
228- ` tools.repo-memory.ledger` declaration is unsupported. Each ledger has a
229- ` ledgers/<name>` branch and a disposable read-only SQLite projection rebuilt
230- from persisted JSONL shards.
231-
232- ` ` ` yaml
233- tools:
234- ledger:
235- audit-history:
236- type: log
237- compaction:
238- min-segments: 32
239- max-segments: 32
240- ` ` `
241-
242- Declare `type : log`, `set`, `map`, `table`, `counter`, or `notes` for built-in state
243- models. Schemas validate operation values, not envelopes; tables require a
244- string primary-key field through `key`. Maps expose `ledger_map_put` and
245- ` ledger_map_delete` ; notes expose `ledger_note_add` and `ledger_note_vote`.
246- Other types use typed `ledger_append` operations.
247-
248- Query `state` for current state or `records` for immutable history at
249- ` /tmp/gh-aw/ledgers/<name>/ledger.db` . For a log, submit `ledger_append` with
250- `operation : append` and the event in `value`. Requests are deferred and become
251- durable only when the trusted `push_ledger_changes` job succeeds; queued writes
252- are not immediately visible in the run's projection. Never edit SQLite or
253- canonical ledger files.
254-
255- Each record is limited to 32 KiB, each shard defaults to 100 KiB, and each run
256- defaults to a 10 KiB append budget. Configure per-ledger limits with
257- ` max-segment-kb` , `max-record-kb`, and `max-patch-kb`. Projection preparation
258- inspects at most 1024 canonical files and 100 MiB of history.
259- Each writing workflow invocation creates a shard, so a frequently running
260- workflow can exhaust the shard limit. Use ordinary repo-memory files for
261- replaceable snapshots, pruned baselines, or histories that need more than 1024
262- writer shards. Compaction belongs to Agentic Maintenance, never the agent or
263- persistence job. Use per-ledger `compaction` settings (`schedule`,
264- `min-segments`, `max-segments`) or disable it with `compaction : false`.
265- Custom `replay.script`, `replay.config`, and `compaction.script` settings are
266- rejected. Ordinary repo-memory `validation.script` remains a separate supported
267- file-storage validator.
268-
269- Removing custom replay does not rewrite history. Existing raw-record ledgers
270- can omit `type` and query `records.payload` with SQLite JSON functions. Do not
271- add a built-in type to raw history unless every payload already matches that
272- type's operation format. Use a new ledger name for a new typed state model.
273- See the [ledger replay reference](https://github.com/github/gh-aw/blob/main/docs/src/content/docs/experimental/ledger-replay.md)
274- and [compaction guide](https://github.com/github/gh-aw/blob/main/docs/src/content/docs/experimental/ledger-compaction.md).
224+ For immutable, structured events where each run appends records and later runs
225+ query them by a stable key, use experimental `tools.ledger` instead — configured
226+ independently of repo-memory. See [ledger.md](ledger.md) for configuration,
227+ state-model types, limits, and compaction.
275228
276229# ## Tradeoffs
277230
@@ -282,7 +235,6 @@ and [compaction guide](https://github.com/github/gh-aw/blob/main/docs/src/conten
282235| Survives cache invalidation | Not available for Copilot engine (requires GitHub tools) |
283236| Human-readable via GitHub branch UI | More complex setup |
284237| Can target a different repository | |
285- | Ledger mode provides immutable structured records and queries | Experimental, append-only, and limited to 1024 shard files by default |
286238
287239---
288240
0 commit comments