Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

test(doctor): drop the hot-check golden day fix from the wave; #6866 owns it (#6712 wave)

garrytan0cb7e71c9dd6
diff --git a/test/doctor-hot-checks-sync-day.test.ts b/test/doctor-hot-checks-sync-day.test.ts
index 332b1b6454..11fca77f39 100644
--- a/test/doctor-hot-checks-sync-day.test.ts
+++ b/test/doctor-hot-checks-sync-day.test.ts
@@ -40,15 +40,6 @@ describe('Postgres hot-check golden: the fence trend day', () => {
expect(() => stampSyncDay(runOn('2026-11-19'), '2026-11-20', ['2026-11-20', '2026-11-20'])).toThrow('not the day the fixture sync stamped');
});
- test('the soak counters day is stamped too, inside the run and nowhere else', () => {
- const soakDays = (report: Report) => report.checks.filter(c => c.name === 'sync_soak_counters').flatMap(c => (c.details as { by_day?: Array<{ day: string }> } | undefined)?.by_day ?? []).map(d => d.day);
- expect(soakDays(golden)).toEqual([SYNC_DAY]);
- const acrossMidnight = runOn('2026-11-20');
- for (const c of acrossMidnight.checks) if (c.name === 'sync_soak_counters') for (const d of (c.details as { by_day: Array<{ day: string }> }).by_day) d.day = '2026-11-21';
- expect(stampSyncDay(acrossMidnight, '2026-11-20', ['2026-11-20', '2026-11-20'], '2026-11-21')).toEqual(golden);
- expect(() => stampSyncDay(acrossMidnight, '2026-11-20', ['2026-11-20', '2026-11-20'])).toThrow('outside the fixture run');
- });
-
test('only the trend day is replaced: other date-like drift still differs', () => {
const drifted = runOn('2026-11-20');
const other = drifted.checks.find(c => c.name !== 'fence_integrity' && typeof c.message === 'string')!;
diff --git a/test/e2e/doctor-hot-checks-golden.test.ts b/test/e2e/doctor-hot-checks-golden.test.ts
index b56732803c..9986bd84e3 100644
--- a/test/e2e/doctor-hot-checks-golden.test.ts
+++ b/test/e2e/doctor-hot-checks-golden.test.ts
@@ -80,8 +80,7 @@ async function capture(adminUrl: string): Promise<PgCaptures> {
const stamped = await db.unsafe(`SELECT DISTINCT completed_keys->0->>'day' AS day FROM op_checkpoints WHERE op = $1`, [FENCE_TREND_OP]).finally(() => db.end());
expect(stamped.length).toBe(1);
const day = stamped[0]!.day as string;
- const runEnd = new Date().toISOString().slice(0, 10);
- for (const run of [first, second]) run.json = stampSyncDay(run.json, day, syncDays, runEnd);
+ for (const run of [first, second]) run.json = stampSyncDay(run.json, day, syncDays);
return { first, second, url, name };
}
diff --git a/test/fixtures/goldens/README.md b/test/fixtures/goldens/README.md
index de8e713afa..8b9aea529e 100644
--- a/test/fixtures/goldens/README.md
+++ b/test/fixtures/goldens/README.md
@@ -121,9 +121,7 @@ reproduce byte for byte. Each file is written by `test/helpers/golden.ts` as
`test/helpers/fixed-clock-preload.ts`); Postgres, whose server stamps its own times,
stores `fence_integrity.details.trend[].by_day[].day` as `<sync-day>` only after
`stampSyncDay` checks it equals the day the fixture's sync stamped (one of the days
- read around the sync). The soak counters' `sync_soak_counters.details.by_day[].day`
- is stored the same way, after checking it falls between the day before the sync and
- the day read after the last doctor run. Regenerating writes the marker again.
+ read around the sync). Regenerating writes the marker again.
## Setup migration ledger
diff --git a/test/fixtures/goldens/doctor/hot-checks-postgres-json.json b/test/fixtures/goldens/doctor/hot-checks-postgres-json.json
index a4981991cd..8565982aaf 100644
--- a/test/fixtures/goldens/doctor/hot-checks-postgres-json.json
+++ b/test/fixtures/goldens/doctor/hot-checks-postgres-json.json
@@ -677,7 +677,7 @@
"by_day": [
{
"content_decisions": 0,
- "day": "<sync-day>",
+ "day": "2026-10-16",
"interventions": 1
}
],
@@ -4602,7 +4602,7 @@
"by_day": [
{
"content_decisions": 0,
- "day": "<sync-day>",
+ "day": "2026-10-16",
"interventions": 1
}
],
diff --git a/test/helpers/doctor-hot-checks-fixture.ts b/test/helpers/doctor-hot-checks-fixture.ts
index eaf474ea50..3aab6be94d 100644
--- a/test/helpers/doctor-hot-checks-fixture.ts
+++ b/test/helpers/doctor-hot-checks-fixture.ts
@@ -173,15 +173,12 @@ export const SYNC_DAY = '<sync-day>';
* exactly that field, and only after checking it: `stamped` is the day read
* back from the trend row, it must be one of the days read just before and
* after the sync (two only when the sync crossed midnight UTC), and every
- * `fence_integrity.details.trend[].by_day[].day` must equal it. The soak
- * counters (`sync_soak_counters.details.by_day[].day`) are stamped by the
- * gbrain process's own clock while doctor runs, so each must fall between the
- * day before the sync and `runEnd`, the day read after the last doctor run.
- * Any other field, date-like or not, is left for the golden to compare.
+ * `fence_integrity.details.trend[].by_day[].day` must equal it. Any other
+ * field, date-like or not, is left for the golden to compare.
*/
-export function stampSyncDay(report: unknown, stamped: string, syncDays: readonly [string, string], runEnd = syncDays[1]): unknown {
+export function stampSyncDay(report: unknown, stamped: string, syncDays: readonly [string, string]): unknown {
if (!syncDays.includes(stamped)) throw new Error(`fence trend day ${stamped} is neither the day before (${syncDays[0]}) nor after (${syncDays[1]}) the fixture sync`);
- const copy = structuredClone(report) as { checks?: Array<{ name: string; details?: { trend?: Array<{ by_day?: Array<{ day: string }> }>; by_day?: Array<{ day: string }> } }> };
+ const copy = structuredClone(report) as { checks?: Array<{ name: string; details?: { trend?: Array<{ by_day?: Array<{ day: string }> }> } }> };
for (const check of copy.checks ?? []) {
if (check.name !== 'fence_integrity') continue;
for (const trend of check.details?.trend ?? []) for (const entry of trend.by_day ?? []) {
@@ -189,13 +186,6 @@ export function stampSyncDay(report: unknown, stamped: string, syncDays: readonl
entry.day = SYNC_DAY;
}
}
- for (const check of copy.checks ?? []) {
- if (check.name !== 'sync_soak_counters') continue;
- for (const entry of check.details?.by_day ?? []) {
- if (entry.day < syncDays[0] || entry.day > runEnd) throw new Error(`sync_soak_counters day ${entry.day} is outside the fixture run (${syncDays[0]} to ${runEnd})`);
- entry.day = SYNC_DAY;
- }
- }
return copy;
}