Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
test(inventory): classify the file-drift database-only keep as a coordinator writer (GBRA-133)
garrytand1b0d30a59fd
diff --git a/docs/architecture/canonical-writers.tsv b/docs/architecture/canonical-writers.tsvindex dac5445d2d..a408d4e94e 100644--- a/docs/architecture/canonical-writers.tsv+++ b/docs/architecture/canonical-writers.tsv@@ -229,6 +229,7 @@ src/core/repair/consolidate-ties.ts 1 coordinator `gbrain repair consolidate-tiesrc/core/repair/conversation-labels.ts 4 coordinator `gbrain repair conversation-labels` expires preview-approved label-misattributed conversation facts, expires the page completion marker and writes the not-extractable outcome, under the page key: one database-only managed_maintenance_conversation_label_retire request per batch of up to 25 pages on a managed brain (the preparer reclassifies each page under its lock), one maintenanceTransaction per batch on an unmanaged brain.src/core/persistence/atom-maintenance.ts 1 coordinator A managed atom retirement stamps retired_by/retired_at on the tombstone inside the coordinator publication of its managed_atom_delete request, after the page deletion path removed the canonical file, so the database row and file change commit or roll back together.src/core/repair/stale-atoms.ts 2 coordinator gbrain repair stale-atoms retires an atom on a managed brain through a managed_maintenance_retire_stale_atoms coordinated request (the marker stamp runs in its publication); only an unmanaged brain soft-deletes and stamps in a direct page-locked transaction, where no canonical writer enforcement applies.+src/core/repair/file-drift.ts 1 coordinator `gbrain repair file-drift --provenance never_committed --prefer database` (GBRA-133) keeps a held live page whose file no commit ever held as a database-only page: the UPDATE clearing source_path and source_uri runs only inside the managed_maintenance_file_drift_detach publication (submitDatabaseMaintenanceIntent, owner host only), whose preparer re-checks the page id, revision, recorded path and git provenance and re-locks the live page; it clears the resolved hold in the same transaction and writes no file. An unmanaged brain refuses with owner_unavailable.src/core/repair/atoms-restore.ts 2 coordinator gbrain repair atoms-restore (#7013) restores a preview-approved atom an empty re-extraction retired: on a managed brain only through a managed_maintenance_restore_reextract_atom request (deleted_page admission, revision-bound, the restore rule rechecked under the atom and origin locks, then a revert_version to the pre-stamp version); only an unmanaged brain archives, restores and unstamps the atom in one page-locked maintenanceTransaction, where no canonical writer enforcement applies.src/core/repair/ghost-pages.ts 1 coordinator `gbrain repair ghost-pages` (#6696 B5) retires a preview-approved ghost page (its canonical file is gone): on a managed brain only through a managed_maintenance_retire_ghost_page request whose preparer reruns the classifier under the approved owner and prepares a delete_page with allowMissingFile that refuses unless the file target is the approved path with no bytes (a restored file refuses at preparation or at filesystem publication); only an unmanaged brain versions and soft-deletes directly, inside maintenanceTransaction under the page lock after the revision, page id and file-absence recheck.src/core/repair/legacy-twins.ts 9 coordinator `gbrain repair legacy-twins` (#6885) merges a preview-approved legacy twin pair onto its legacy page: on a managed brain only through a managed_maintenance_merge_legacy_twin request on the twin, holding the legacy page's key, whose preparer re-checks both pages (ids, slugs, revisions, recorded path, same content, the file agreeing with the twin) under the approved owner and again under the publication locks, and publishes no file; only an unmanaged brain records the origin, moves the twin's references, versions and soft-deletes the twin directly, inside maintenanceTransaction under both page locks after the same recheck.