Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

Point three full-suite tests at the bookkeeping_gc phase and record upkeep's own config state

garrytana27d8239ab42
diff --git a/test/e2e/dream-cycle-phase-order-pglite.test.ts b/test/e2e/dream-cycle-phase-order-pglite.test.ts
index a81debedab..6cef8832ee 100644
--- a/test/e2e/dream-cycle-phase-order-pglite.test.ts
+++ b/test/e2e/dream-cycle-phase-order-pglite.test.ts
@@ -158,6 +158,7 @@ const EXPECTED_PHASES: CyclePhase[] = [
'orphans',
'schema-suggest', // v0.39.0.0 — passive schema-suggest after orphans
'purge', // v0.26.5
+ 'bookkeeping_gc', // GBRA-438: the GC that used to ride inside purge
];
describe('E2E full cycle phase order', () => {
diff --git a/test/fix-wave-structural.test.ts b/test/fix-wave-structural.test.ts
index 505db7eca8..db98d9d999 100644
--- a/test/fix-wave-structural.test.ts
+++ b/test/fix-wave-structural.test.ts
@@ -345,10 +345,12 @@ describe('v0.42.43.0 #2095 — volunteer-events sink + cycle purge wiring (struc
expect(src).toMatch(/order:\s*4/);
});
- test("the dream cycle's purge phase invokes purgeStaleVolunteerEvents and reports the count", () => {
- const src = readFileSync('src/core/cycle.ts', 'utf8');
+ test("the dream cycle's bookkeeping_gc phase invokes purgeStaleVolunteerEvents and reports the count", () => {
+ // GBRA-438 moved the bookkeeping GC out of purge into its own phase, which the cycle still runs.
+ const src = readFileSync('src/core/cycle/bookkeeping-gc.ts', 'utf8');
expect(src).toMatch(/purgeStaleVolunteerEvents\(engine\)/);
expect(src).toMatch(/purged_volunteer_events_count/);
+ expect(readFileSync('src/core/cycle.ts', 'utf8')).toMatch(/runPhaseBookkeepingGc\(engine/);
});
});
diff --git a/test/helpers/config-reader-registry.ts b/test/helpers/config-reader-registry.ts
index ff67c78d2b..c0e2fa015d 100644
--- a/test/helpers/config-reader-registry.ts
+++ b/test/helpers/config-reader-registry.ts
@@ -25,6 +25,8 @@ export interface InternalConfigState {
export const INTERNAL_CONFIG_STATE: readonly InternalConfigState[] = [
{ key: 'version', reason: 'schema version stamp written by migrate.ts' },
+ { key: 'maintenance.last_run', reason: 'the free-upkeep run record (steps, cursor, parked items, next due time) that maintenance/run.ts writes after each gbrain maintain --unattended run; maintain --status and doctor read it, so a hand edit would misreport upkeep' },
+ { key: 'maintenance.embed_spend', reason: 'the per-day dollar total the capped upkeep embed step has spent (maintenance/run.ts); the daily cap reads it, so a hand edit would let upkeep spend past maintenance.embed_daily_usd' },
{ key: 'heal.audit', reason: 'the bounded self-heal audit log (last 200 rows, 30 days) that heal-audit.ts writes for each heal; doctor reads it to count a heal\'s consecutive failures, so a hand edit would hide an escalation' },
{ key: 'access.serves_derived', reason: 'whether two or more members are enabled, kept by the v309 trigger on access_members (search/private-visibility.ts servesPolicyFrom); a hand edit would lie about whom the brain serves' },
{ key: 'access.serves_since', reason: 'when the brain first served several people, set once by the v309 trigger and never cleared; it starts the unscoped-read grace (access/requester-scope.ts)' },