Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
test: list the purge's fact expiry in the writer inventories
garrytan288490f77400
diff --git a/docs/architecture/canonical-writers.tsv b/docs/architecture/canonical-writers.tsvindex e9275ed74d..35b2c9772e 100644--- a/docs/architecture/canonical-writers.tsv+++ b/docs/architecture/canonical-writers.tsv@@ -90,6 +90,7 @@ src/core/extract-timeline-from-meetings.ts 2 coordinator #6273: on a managed brasrc/core/facts/backstop.ts 3 engine_guard Canonical table SQL trigger requires coordinator capability; legacy calls fail before canonical DB publication.src/core/facts/fence-fact-append.ts 1 coordinator prepareFenceFactAppend (G4) inserts one facts row only inside apply(tx), the coordinator's publication transaction, after the file holding its fence row was published and after the page row; index-existing mode first reads the cell back from the published file and refuses fence_row_changed, so no facts row exists ahead of its fence row.src/core/facts/fence-write.ts 2 coordinator Managed brains publish fence rows through the managed_facts_entity intent before any file or row write; unmanaged writes keep the source filesystem ownership check before editing canonical fact fences.+src/core/facts/gone-page-facts.ts 2 engine_guard A retention purge expires the purged pages' facts (filed on the page, or about it and held by no page row) inside the transaction that deletes the page rows; both unmanaged purges run in maintenanceTransaction (purge-deleted.ts), and on a managed brain the canonical table SQL trigger refuses the write outside the coordinator. Database only: the page file is already gone, and rows are expired, never deleted.src/core/facts/forget.ts 4 filesystem_guard Managed callers journal withdrawal; legacy filesystem helper and the supersession-only expiry require coordinated write.src/core/facts/ontology-rekey.ts 2 engine_guard B-10 (#6948 sweep): dropRekeyDuplicates deletes the ontology observations a re-key would duplicate on idx_facts_ontology_stint_dedup and repoints supersession links at the survivor, inside its caller's transaction immediately before the caller's UPDATE (the rename's maintenanceTransaction, the relink_facts publication, the phantom redirect's fact move, repair facts-rehome's move). The canonical table SQL trigger requires coordinator capability, so a legacy call fails before publication.src/core/facts/proposal-supersede.ts 4 filesystem_guard System One S9 accept/undo (local CLI only): unmanaged brains update the two facts rows and strike or restore the fence row in one transaction under the source filesystem lock and page lock, publishing the file last; managed brains run the same change as the coordinator mutation decide_proposal.diff --git a/test/trust-write-gate-drift.test.ts b/test/trust-write-gate-drift.test.tsindex 57cffcc91b..818a415afc 100644--- a/test/trust-write-gate-drift.test.ts+++ b/test/trust-write-gate-drift.test.ts@@ -32,6 +32,7 @@ const EXEMPT: Record<string, string> = {'src/core/extract/receipt-writer.ts': 'gbrain-generated extraction receipt page (counts, cost, model id); no external text','src/core/facts/derivation-inputs.ts': 'derivation edge ledger; ids only','src/core/facts/file-body-guard.ts': 'row-locked compare-and-swap body mirror: fence-write callers gate newly appended rows; forget, proposal-supersede, unfenced-facts and phantom-redirect only strike, adopt or relocate facts already stored; this helper adds no independently sourced text',+ 'src/core/facts/gone-page-facts.ts': 'retention purge expires the purged page\'s existing facts inside the purge\'s maintenance transaction (lifecycle); no new text','src/core/facts/forget.ts': 'withdrawal strike (lifecycle)','src/core/facts/ontology-rekey.ts': 'drops duplicate copies of existing ontology rows before a re-key (placement)','src/core/facts/proposal-supersede.ts': 'checked supersede of existing rows (lifecycle)',