Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

chore(persistence): classify withheld_source_path in the bootstrap coverage and canonical-writer inventories

garrytan33eb4f540e8c
diff --git a/docs/architecture/canonical-writers.tsv b/docs/architecture/canonical-writers.tsv
index 9bf843ecaa..9c0751fad7 100644
--- a/docs/architecture/canonical-writers.tsv
+++ b/docs/architecture/canonical-writers.tsv
@@ -280,4 +280,4 @@ src/core/persistence/links-extraction-holds.ts 2 engine_guard GBRA-130 A-1: reco
src/core/repair/url-clone-fences.ts 3 engine_guard GBRA-130 C-2: unmanaged brains only (refused on managed). Keeps the fence rows the database already holds database-only in a maintenance transaction, then imports the clone file's HEAD bytes through importFromContent before restoring the file; preview-bound (--expect) with destructive consent and a file backup.
src/core/repair/visibility.ts 1 coordinator `gbrain repair visibility --apply` (GBRA-159) only tightens database-only active facts from world to private when their source page is private. On a managed brain the UPDATE runs only inside the managed_maintenance_tighten_fact_visibility publication (owner-checked by maintenancePreflight, page key locked); an unmanaged brain runs it in one maintenanceTransaction. The UPDATE rechecks visibility='world', row_num IS NULL and expired_at IS NULL under the row lock. Fenced rows are never updated here: they change in the page through a revision-bound put_page.
src/core/facts/file-body-guard.ts 1 engine_guard #6982 replaceStoredBody mirrors a checkout file body over the page row only inside its caller's maintenanceTransaction, after re-reading the row under a row lock and confirming it still equals the body the caller compared, and saves a page_versions row first; on a managed brain the canonical table trigger refuses the write outside the coordinator.
-src/core/persistence/git-declared.ts 3 coordinator GBRA-95 G7a declareStrictPublication stamps or clears pages.database_only_reason (and drops source_path/source_uri for a page turning private) inside the guarded publication transaction of publishMutation and publishGroup, after the door commit removed the file; it writes no content.
+src/core/persistence/git-declared.ts 4 coordinator GBRA-95 G7a declareStrictPublication stamps or clears pages.database_only_reason (and drops source_path/source_uri for a page turning private, keeping the path in withheld_source_path, which the publication that writes the file again clears) inside the guarded publication transaction of publishMutation and publishGroup, after the door commit removed the file; it writes no content.
diff --git a/test/schema-bootstrap-coverage.test.ts b/test/schema-bootstrap-coverage.test.ts
index c157030b74..fa68c3976c 100644
--- a/test/schema-bootstrap-coverage.test.ts
+++ b/test/schema-bootstrap-coverage.test.ts
@@ -1157,6 +1157,10 @@ const COLUMN_EXEMPTIONS = new Set<string>([
// index or function in either blob references it, and the doctor reader
// probes for the column on older brains.
'pages.links_extract_failure',
+ // GBRA-95 G7a follow-up (migration v274) - the file path a strict page's private transition withheld. Same posture as
+ // v258: absent from both schema blobs, so fresh and upgraded brains share its ordinal; column-only and nullable, no
+ // index or function in either blob references it, and only strict-source publications (v272+) write it.
+ 'pages.withheld_source_path',
// Wave B segmented page storage (migration v248). Deliberately absent from
// both schema blobs so fresh and upgraded brains share their ordinals; no
// index in either blob references them (content_chunks_occurrence_idx is