Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

chore(trust): carry purge and trust tables through engine graduation

garrytan711cd17f25a1
diff --git a/src/core/persistence/graduation-inventory.ts b/src/core/persistence/graduation-inventory.ts
index e0db2e8f02..47c4c7cfd3 100644
--- a/src/core/persistence/graduation-inventory.ts
+++ b/src/core/persistence/graduation-inventory.ts
@@ -51,6 +51,7 @@ export const GRADUATION_INVENTORY: Inventory = {
carry('decide_state', 'operational', 'System One sweep cursors and slot state.'),
carry('decide_sweep_deferred', 'operational', 'Deferred System One sweep work with its schedule.'),
carry('decision_receipts', 'user_data', 'Durable System One decision receipts.'),
+ carry('derivation_inputs', 'user_data', 'Derivation dependency edges (#5575); purge needs them to find artifacts derived from purged content.'),
carry('dream_synthesis_completions', 'user_data', 'Dream synthesis idempotency ledger.'),
carry('dream_verdicts', 'operational', 'Paid dream triage verdict cache.'),
carry('drift_decisions', 'user_data', 'Take drift decisions and when they were applied.'),
@@ -63,6 +64,7 @@ export const GRADUATION_INVENTORY: Inventory = {
carry('extract_atoms_page_state', 'user_data', 'Atom extraction ledger per page.'),
carry('extract_atoms_transcript_state', 'user_data', 'Atom extraction ledger per transcript file.'),
carry('extract_rollup_7d', 'operational', 'Seven-day extraction rollup counters.'),
+ carry('fact_purges', 'user_data', 'Text-free fact purge tombstones (#5575); dropping them would let purged claims re-import.'),
carry('fact_relink_attempts', 'operational', 'Fact relink attempt log.'),
carry('fact_withdrawals', 'user_data', 'Fact withdrawal ledger (forget); must never be lost.'),
carry('facts', 'user_data', 'Facts with attribution columns and the superseded_by self-FK.'),
@@ -93,6 +95,7 @@ export const GRADUATION_INVENTORY: Inventory = {
}),
carry('minion_lease_pressure_log', 'operational', 'Lease pressure log.'),
carry('minion_self_fix_log', 'operational', 'Self-fix log.'),
+ carry('needs_rederive', 'user_data', 'Derived rows hidden by purge pending re-derivation (#5575); dropping them would resurface purged-derived content.'),
carry('oauth_clients', 'security', 'OAuth clients and their grants; client secrets stay valid.'),
carry('oauth_grant_audit', 'security', 'OAuth grant change audit trail.'),
carry('oauth_tokens', 'security', 'Issued OAuth access and refresh token hashes.'),
@@ -104,6 +107,7 @@ export const GRADUATION_INVENTORY: Inventory = {
carry('page_generation_clock', 'operational', 'Page generation clock (derived side table, verified equal).'),
carry('page_mention_state', 'operational', 'Entity mention index: per-page mention watermark; without it every page is due for a rescan.'),
carry('page_projection_jobs', 'operational', 'Pending page projection work (derived side table, verified equal).'),
+ carry('page_purges', 'user_data', 'Text-free page purge tombstones (#5575); dropping them would let purged pages re-import.'),
carry('page_versions', 'user_data', 'Page revision history with attribution.'),
carry('page_write_guards', 'user_data', 'Page write guards per source incarnation and slug.'),
carry('pages', 'user_data', 'Pages with ids, knowledge_revision, revision attribution and timestamps.'),
@@ -152,9 +156,11 @@ export const GRADUATION_INVENTORY: Inventory = {
carry('take_grade_cache', 'operational', 'Paid take grading cache; rebuilding spends money.'),
carry('take_nudge_log', 'operational', 'Take nudge log.'),
carry('take_proposals', 'user_data', 'Take proposals and their status.'),
+ carry('take_purges', 'user_data', 'Text-free take purge tombstones (#5575); dropping them would let purged takes re-project.'),
carry('takes', 'user_data', 'Takes with attribution and supersession.'),
carry('think_ab_results', 'operational', 'Think A/B eval results.'),
carry('timeline_entries', 'user_data', 'Timeline entries with attribution.'),
+ carry('trust_proposals', 'user_data', 'Pending and decided trust decisions (#5575); dropping them would lose owner review state.'),
carry('wanted_links', 'user_data', 'Unresolved authored links (wanted pages); the edge appears when the target page is written, so they are not re-derived without a full re-extraction.'),
carry('write_gate_holds', 'user_data', 'Facts and takes the write gate held for the owner\'s review (#5575); dropping them would lose content awaiting release or drop.'),
carry('write_gate_receipts', 'user_data', 'Write-gate verdicts (flag/quarantine) per persisted row (#5575); dropping them would forget which agent-written instructions are unconfirmed.'),
diff --git a/test/graduation-inventory.test.ts b/test/graduation-inventory.test.ts
index 1a122e6417..ea0824e615 100644
--- a/test/graduation-inventory.test.ts
+++ b/test/graduation-inventory.test.ts
@@ -60,7 +60,7 @@ describe('graduation inventory', () => {
expect(new Set(names).size).toBe(names.length);
const counts: Record<string, number> = {};
for (const e of GRADUATION_INVENTORY.entries) counts[e.class] = (counts[e.class] ?? 0) + 1;
- expect(counts).toEqual({ carry: 112, rebind: 2, rebuild: 2, discard: 6, schema_owned: 3 });
+ expect(counts).toEqual({ carry: 118, rebind: 2, rebuild: 2, discard: 6, schema_owned: 3 });
for (const e of GRADUATION_INVENTORY.entries) {
expect({ relation: e.relation, reason: e.reason.length > 5, present: e.engines.pglite || e.engines.postgres })
.toEqual({ relation: e.relation, reason: true, present: true });