Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

test(doctor): scrub the wall-clock fence-trend day in doctor-json-v1; the hot-check goldens broke at UTC midnight

garrytanac335fd672da
diff --git a/test/fixtures/goldens/doctor/hot-checks-pglite-json.json b/test/fixtures/goldens/doctor/hot-checks-pglite-json.json
index 0e6279db92..f55e847354 100644
--- a/test/fixtures/goldens/doctor/hot-checks-pglite-json.json
+++ b/test/fixtures/goldens/doctor/hot-checks-pglite-json.json
@@ -2418,7 +2418,7 @@
"by_day": [
{
"count": 1,
- "day": "2026-10-10"
+ "day": "<volatile>"
}
],
"normalized_7d": 1,
@@ -5450,7 +5450,7 @@
"by_day": [
{
"count": 1,
- "day": "2026-10-10"
+ "day": "<volatile>"
}
],
"normalized_7d": 1,
diff --git a/test/fixtures/goldens/doctor/hot-checks-postgres-json.json b/test/fixtures/goldens/doctor/hot-checks-postgres-json.json
index 9bb83f0a1f..82da926ca0 100644
--- a/test/fixtures/goldens/doctor/hot-checks-postgres-json.json
+++ b/test/fixtures/goldens/doctor/hot-checks-postgres-json.json
@@ -2409,7 +2409,7 @@
"by_day": [
{
"count": 1,
- "day": "2026-10-10"
+ "day": "<volatile>"
}
],
"normalized_7d": 1,
@@ -5430,7 +5430,7 @@
"by_day": [
{
"count": 1,
- "day": "2026-10-10"
+ "day": "<volatile>"
}
],
"normalized_7d": 1,
diff --git a/test/helpers/doctor-json-golden.ts b/test/helpers/doctor-json-golden.ts
index af71b375df..bbc96f81f8 100644
--- a/test/helpers/doctor-json-golden.ts
+++ b/test/helpers/doctor-json-golden.ts
@@ -14,8 +14,8 @@
* Normalizer `doctor-json-v1`: ordered checks (name, status, message,
* details, issues) plus the report envelope, with volatile tokens replaced:
* temp home / repo / os tmpdir paths, UUIDs, ISO timestamps, the running
- * package and Bun versions, the machine hostname, and `*_ms` / elapsed / pid-style
- * detail keys, and the latest schema migration number in the `schema_version`
+ * package and Bun versions, the machine hostname, `*_ms` / elapsed / pid-style
+ * detail keys, and wall-clock `day` keys (the fence trend's UTC day buckets), and the latest schema migration number in the `schema_version`
* message (`<latest>`, so a migration renumber does not churn the goldens;
* `expectSchemaLatestMatchesRegistry` keeps the hidden number honest). Check order is emitted order (deterministic; no Map/Set
* iteration is re-sorted). stderr lines are kept (normalized) because the
@@ -137,7 +137,7 @@ export function patchConfig(h: DoctorHome, patch: (cfg: Record<string, unknown>)
}
const UUID = /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi;
-const VOLATILE_KEYS = /(^|_)(ms|pid|elapsed|duration|uptime)$|_ms$|^elapsed/i;
+const VOLATILE_KEYS = /(^|_)(ms|pid|elapsed|duration|uptime)$|_ms$|^elapsed|^day$/i;
export function normalizeDoctorText(text: string, roots: Record<string, string>, extra: Array<[RegExp | string, string]> = []): string {
let out = scrubPaths(text, roots);