Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
census: classify the belief purge epoch bump, restore replay and unmanaged retention expiry writes
garrytandd3f510b68e3
diff --git a/docs/architecture/canonical-writers.tsv b/docs/architecture/canonical-writers.tsvindex 3b40eed13a..94057b0f8f 100644--- a/docs/architecture/canonical-writers.tsv+++ b/docs/architecture/canonical-writers.tsv@@ -184,7 +184,7 @@ src/core/mentions/pass.ts 7 coordinator Derived page_aliases rows (origin declarsrc/core/page-state/rename-alias.ts 12 engine_guard Rename aliases (slug_aliases), moveSlugBindings (facts entity/fence slugs, page_aliases, withdrawal subjects) and movePageIdReferences (#5431: versions, timeline, links deduplicated on the links key) run inside the rename's maintenanceTransaction; the canonical table SQL trigger requires coordinator capability, so legacy calls fail before publication.src/core/timeline-extract.ts 1 engine_guard Retracting removed markdown timeline rows is canonical table SQL; the trigger requires coordinator capability, so legacy calls fail before canonical DB publication.src/core/persistence/connector-google-receipts.ts 1 coordinator Account and message-owned Gmail receipt metadata changes only under canonical source/page locks, identity/revision and file guards; guarded projection installation preserves withdrawal overlays without replaying bodies or extracting facts.-src/core/persistence/purge-deleted.ts 2 coordinator Unmanaged brains keep the engine bulk purge; a managed brain purges each expired tombstone through submitPageMutation delete_page purge bound to its revision. The second engine reference is the dry-run count for the D6 consent request (#6114), read-only.+src/core/persistence/purge-deleted.ts 3 coordinator Unmanaged brains keep the engine bulk purge; a managed brain purges each expired tombstone through submitPageMutation delete_page purge bound to its revision. The second engine reference is the dry-run count for the D6 consent request (#6114), read-only. W1 (BELIEF_LEDGER.md 6.5): the third reference is the unmanaged per-tombstone expiry for sources the belief ledger records; it deletes one expired tombstone under its page key inside a belief batch (page.expired), the same retention rule as the bulk purge.src/core/persistence/unbound-source.ts 1 coordinator Stamps the durable unbound_source classification on a page inside the coordinator publication transaction that published it; the column is not a canonical content column.src/core/persistence/detached-pages.ts 1 coordinator #6609 restore --detach: clears source_path and stamps database_only_reason='detached' on the restored page only from classifyUnboundPage inside the restore_page coordinator publication transaction; neither is a canonical content column.src/core/cycle/synthesize-concepts.ts 2 coordinator A managed brain publishes concepts through publishMaintenancePage after maintenancePreflight; the unmanaged importFromContent path refuses on managed brains.@@ -246,3 +246,5 @@ src/core/trust/timeline-projection.ts 2 engine_guard gbrain extract's timeline psrc/eval/brainbench/trust-scenario.ts 2 isolated_eval BrainBench trust suites register their fixture sources in the scenario's own isolated benchmark brain (persistence disabled for the registration, re-enabled after); never opened against the active managed brain.src/core/oversized-backfill.ts 1 coordinator The oversized-page backfill (gbrain reindex --oversized, the post-upgrade pass) rewrites a size-skipped page without its gate markers through importFromContent on unmanaged brains (assertUnmanagedCanonicalWriter applies) and through submitPageMutation put_page (managed_quarantine_clear, expected_revision) on managed brains; its only direct write is the page_embedding_budget hold row, which is derived spend state, not canonical content.src/core/belief/ledger.ts 0 contract The belief ledger finalization contract writes no canonical table: withBeliefBatch reads the held page keys before and after the caller's projections and appends belief_events in the same transaction (publications, coordinated database writes, and the unmanaged projection points in belief/projection-point.ts).+src/core/belief/purge.ts 1 engine_guard bumpPurgeEpoch updates only sources.purge_epoch, a counter the managed writer guard lets through because the identity and checkpoint columns stay unchanged; it runs inside the purge transaction that already holds the purge's admission and page keys.+src/core/belief/purge-mirror.ts 4 engine_guard W1 restore replay (BELIEF_LEDGER.md 8) of purges newer than the archive: runs only inside the backup restore's single transaction before the restored root is published, granting gbrain.write_sources for that one source in that transaction; its fact, take and page deletes repeat what purge_fact and purgePageInTransaction removed.