Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
docs(architecture): classify the unfenced-facts fence and take-supersession repair writers in the attribution and canonical-writer inventories
garrytana78fd5f261ab
diff --git a/docs/architecture/canonical-writers.tsv b/docs/architecture/canonical-writers.tsvindex 764f72e6d3..ed390de6db 100644--- a/docs/architecture/canonical-writers.tsv+++ b/docs/architecture/canonical-writers.tsv@@ -208,3 +208,5 @@ src/commands/sources-mirror.ts 1 engine_guard `gbrain sources mirror-readonly|misrc/core/sync-upstream.ts 1 engine_guard `recordUpstreamObservation` (#5255/#5176) updates only sources.upstream_checked_at, upstream_commit and upstream_behind, observations of the checkout's Git upstream outside managed_writer_guard's protected topology and checkpoint tuples; no page, fact or file is written, and a failure never fails the sync.src/core/persistence/mirror-read-only.ts 1 coordinator classifyMirrorPage stamps pages.database_only_reason=mirror_read_only only inside the coordinator publication transaction of a page write that published no file into a read-only mirror source (#5409), as classifyUnboundPage does for unbound sources.src/core/persistence/worktree-refresh.ts 1 coordinator `gbrain sources refresh` (F0) is the one sanctioned managed Git writer: it fast-forwards the checkout only under the worktree native lock after admission refused and claims stopped every checkout write (`fenced`), then updates only sources.upstream_checked_at/upstream_commit/upstream_behind in the merged bookkeeping transaction; pages and the checkpoint advance through the ordinary managed --no-pull sync.+src/core/facts/unfenced-facts.ts 3 coordinator The extract_facts cycle phase and the v0.32.2 migration fence row_num-NULL facts onto their entity pages. On a managed brain the fence publishes through a coordinated maintenance request; an unmanaged brain writes the page file under the source filesystem and page locks, then mirrors the body and stamps row numbers in one maintenanceTransaction.+src/core/repair/take-supersession.ts 1 coordinator gbrain repair take-supersession reprojects superseded_by for a page whose fence is already right: inside withCoordinatedWrite under the page key on a managed brain (revision-checked), maintenanceTransaction on an unmanaged one. Fence edits go through a revision-bound put_page request.diff --git a/docs/architecture/system-of-record.md b/docs/architecture/system-of-record.mdindex 3750c6d9c7..5fb44dba56 100644--- a/docs/architecture/system-of-record.md+++ b/docs/architecture/system-of-record.md@@ -213,6 +213,7 @@ or a physical projection that leaves attribution untouched):- `src/core/embed-facts.ts` (1): embedding columns only (physical projection).- `src/core/embedding-dim-check.ts` (1): embedding columns only (physical projection).- `src/core/facts/relink-publish.ts` (2): `relink_facts` request preparer.+- `src/core/facts/unfenced-facts.ts` (2): the cycle and v0.32.2 fence of `row_num`-NULL facts: a maintenance request on managed brains; the unmanaged body mirror and row-number stamp run in `maintenanceTransaction`.- `src/core/facts/withdrawal.ts` (1): runs inside the `forget` request's coordinated write.- `src/core/page-state/materialize.ts` (1): coordinated maintenance.- `src/core/page-state/versions.ts` (1): `createVersion` itself; the caller's scope supplies the actor.@@ -234,6 +235,7 @@ or a physical projection that leaves attribution untouched):- `src/core/persistence/sync-prepare.ts` (4): managed sync request preparer.- `src/core/persistence/takes-prepare.ts` (3): takes request preparer.- `src/core/repair/frontmatter.ts` (1): a `managed_file_repair` request on managed sources; the unmanaged rename runs in `maintenanceTransaction`.+- `src/core/repair/take-supersession.ts` (1): `gbrain repair take-supersession` reprojection: `withCoordinatedWrite` under the page key on managed brains, `maintenanceTransaction` on unmanaged ones; fence edits go through a revision-bound `put_page`.- `src/core/repair/stale-atoms.ts` (3): a request on managed brains; the unmanaged retirement runs in `maintenanceTransaction`.<!-- write-attribution-covered:end -->