Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

test: restore process.exitCode after the refused-extract scenario; regenerate Postgres doctor golden for captured_facts_active

garrytan440689a9712b
diff --git a/test/fixtures/goldens/doctor/json-postgres-fresh.json b/test/fixtures/goldens/doctor/json-postgres-fresh.json
index 59337fde0d..04e6c963ac 100644
--- a/test/fixtures/goldens/doctor/json-postgres-fresh.json
+++ b/test/fixtures/goldens/doctor/json-postgres-fresh.json
@@ -730,6 +730,20 @@
"name": "extractor_facts_expired",
"status": "ok"
},
+ {
+ "category": "brain",
+ "details": {
+ "ambiguous": 0,
+ "docs": "docs/guides/repair.md#explicit-only-repair-kinds",
+ "evidenced": 0,
+ "excluded": 0,
+ "repair": "captured-facts",
+ "unclassifiable": 0
+ },
+ "message": "No active fact from a gbrain self-capture or paste candidate remains. This counts facts in the database; the self_capture check counts corpus files.",
+ "name": "captured_facts_active",
+ "status": "ok"
+ },
{
"category": "brain",
"message": "Sampled 0 pages; no bare-tweet phrases or external links.",
diff --git a/test/helpers/extract-timeline-db-scenarios.ts b/test/helpers/extract-timeline-db-scenarios.ts
index 1b4f8736f3..ca5098d410 100644
--- a/test/helpers/extract-timeline-db-scenarios.ts
+++ b/test/helpers/extract-timeline-db-scenarios.ts
@@ -34,12 +34,14 @@ async function runCaptured(engine: BrainEngine, args: string[]) {
const error = console.error;
console.log = (...a: unknown[]) => { out.push(a.map(String).join(' ')); };
console.error = (...a: unknown[]) => { err.push(a.map(String).join(' ')); };
+ const priorExitCode = process.exitCode;
_resetCliExitVerdictForTests();
try {
await runExtract(engine, args);
} finally {
console.log = log;
console.error = error;
+ process.exitCode = priorExitCode ?? 0;
}
const exitCode = currentExitCode();
_resetCliExitVerdictForTests();