Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

test(doctor): ANALYZE in the hot-check fixture so Postgres planner estimates in the golden are exact (recaptured on 3f960312a)

time-attack573105841917
diff --git a/test/fixtures/goldens/doctor/hot-checks-postgres-json.json b/test/fixtures/goldens/doctor/hot-checks-postgres-json.json
index 8e0034b13c..623276f439 100644
--- a/test/fixtures/goldens/doctor/hot-checks-postgres-json.json
+++ b/test/fixtures/goldens/doctor/hot-checks-postgres-json.json
@@ -849,7 +849,7 @@
"details": {
"commands": [],
"docs": "docs/guides/repair.md#request-growth",
- "rows": 0,
+ "rows": 22,
"rows_exact": false,
"scopes": [
{
@@ -878,7 +878,7 @@
"verify": "gbrain doctor --json (check persistence_request_growth)",
"window_days": 7
},
- "message": "~0 request row(s); no scope exhausts its lifetime request IDs within 90 days at its last-7-day rate.",
+ "message": "~22 request row(s); no scope exhausts its lifetime request IDs within 90 days at its last-7-day rate.",
"name": "persistence_request_growth",
"status": "ok"
},
@@ -3832,7 +3832,7 @@
"details": {
"commands": [],
"docs": "docs/guides/repair.md#request-growth",
- "rows": 0,
+ "rows": 22,
"rows_exact": false,
"scopes": [
{
@@ -3861,7 +3861,7 @@
"verify": "gbrain doctor --json (check persistence_request_growth)",
"window_days": 7
},
- "message": "~0 request row(s); no scope exhausts its lifetime request IDs within 90 days at its last-7-day rate.",
+ "message": "~22 request row(s); no scope exhausts its lifetime request IDs within 90 days at its last-7-day rate.",
"name": "persistence_request_growth",
"status": "ok"
},
diff --git a/test/helpers/doctor-hot-checks-fixture.ts b/test/helpers/doctor-hot-checks-fixture.ts
index 21a5707984..ef5b291b1d 100644
--- a/test/helpers/doctor-hot-checks-fixture.ts
+++ b/test/helpers/doctor-hot-checks-fixture.ts
@@ -137,6 +137,8 @@ export async function buildHotCheckFixture(h: DoctorHome, sql: Sql): Promise<voi
[insert, ['notes/timeline-b', '2024-06-02', 'legacy', 'Hidden <!-- markup --> event']],
// A stored page whose fence is malformed (the file stays clean).
[`UPDATE pages SET compiled_truth = compiled_truth || $2 WHERE slug = $1 AND source_id = 'notes'`, ['notes/stored-fence', `\n\n## Facts\n\n${DETERMINISTIC_FENCE}`]],
+ // Planner estimates (doctor's "~N request row(s)") are exact, not whatever Postgres autovacuum last sampled.
+ ['ANALYZE', []],
]);
writeAll(src, { ...UNTRACKED, 'fences/untracked.md': `${fm('Untracked Fence')}\n## Facts\n\n${DETERMINISTIC_FENCE}` });
}
@@ -157,5 +159,6 @@ export async function editHotCheckFixture(h: DoctorHome, sql: Sql): Promise<void
["SELECT set_config('gbrain.write_sources', $1, true)", [JSON.stringify(['notes'])]],
[`INSERT INTO timeline_entries(page_id,date,source,summary,detail)
SELECT id, '2024-07-01', 'legacy', 'A later database-only event', '' FROM pages WHERE slug = 'companies/acme-example' AND source_id = 'notes'`, []],
+ ['ANALYZE', []],
]);
}