Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

fix(doctor): db_ahead_of_git drops the volatile HEAD sha from its details; goldens are deterministic across machines

garrytanbde08f69f170
diff --git a/src/commands/doctor/checks/db-ahead-of-git.ts b/src/commands/doctor/checks/db-ahead-of-git.ts
index 3fe09cd40e..49ad97b69c 100644
--- a/src/commands/doctor/checks/db-ahead-of-git.ts
+++ b/src/commands/doctor/checks/db-ahead-of-git.ts
@@ -20,7 +20,7 @@ export function gitGapScanTimeoutMs(): number {
return Number.isFinite(n) && n > 0 ? n : 10_000;
}
-type SourceTotals = Pick<GitGapCensus, 'source_id' | 'head' | 'complete' | 'pages' | 'states' | 'declared' | 'worktree'>;
+type SourceTotals = Pick<GitGapCensus, 'source_id' | 'complete' | 'pages' | 'states' | 'declared' | 'worktree'>;
const nonzero = (record: Record<string, number>) => Object.entries(record).filter(([, n]) => n > 0).map(([k, n]) => `${n} ${k}`).join(', ') || 'no pages';
@@ -36,8 +36,8 @@ async function runDbAheadOfGit(ctx: DoctorContext): Promise<Check[]> {
for (const row of withCheckout) {
if (Date.now() >= deadlineAt) { unread.push(row.id); continue; }
try {
- const { source_id, head, complete, pages, states, declared, worktree } = await censusGitGap(engine, row.id, { sample: 0, deadlineAt });
- sources.push({ source_id, head, complete, pages, states, declared, worktree });
+ const { source_id, complete, pages, states, declared, worktree } = await censusGitGap(engine, row.id, { sample: 0, deadlineAt });
+ sources.push({ source_id, complete, pages, states, declared, worktree });
} catch (error) {
errors.push({ source_id: row.id, message: error instanceof Error ? error.message : String(error) });
}
diff --git a/test/fixtures/goldens/doctor/content-pglite-json.json b/test/fixtures/goldens/doctor/content-pglite-json.json
index ed627462e0..0db03da0af 100644
--- a/test/fixtures/goldens/doctor/content-pglite-json.json
+++ b/test/fixtures/goldens/doctor/content-pglite-json.json
@@ -3509,7 +3509,6 @@
"mirror_source": 0,
"private": 0
},
- "head": "83e82926ae7b6963557e0071b0e3165248fb815b",
"pages": 5,
"source_id": "notes",
"states": {
diff --git a/test/fixtures/goldens/doctor/hot-checks-pglite-json.json b/test/fixtures/goldens/doctor/hot-checks-pglite-json.json
index 11baddfbf6..f9df03b86b 100644
--- a/test/fixtures/goldens/doctor/hot-checks-pglite-json.json
+++ b/test/fixtures/goldens/doctor/hot-checks-pglite-json.json
@@ -3732,7 +3732,6 @@
"mirror_source": 0,
"private": 0
},
- "head": "1c068d3facec1879b1763dd6f98d3849133473da",
"pages": 19,
"source_id": "notes",
"states": {
@@ -8424,7 +8423,6 @@
"mirror_source": 0,
"private": 0
},
- "head": "1c068d3facec1879b1763dd6f98d3849133473da",
"pages": 19,
"source_id": "notes",
"states": {
diff --git a/test/fixtures/goldens/doctor/hot-checks-postgres-json.json b/test/fixtures/goldens/doctor/hot-checks-postgres-json.json
index bfeb91268e..a93ad6facd 100644
--- a/test/fixtures/goldens/doctor/hot-checks-postgres-json.json
+++ b/test/fixtures/goldens/doctor/hot-checks-postgres-json.json
@@ -3735,7 +3735,6 @@
"mirror_source": 0,
"private": 0
},
- "head": "1c068d3facec1879b1763dd6f98d3849133473da",
"pages": 19,
"source_id": "notes",
"states": {
@@ -8428,7 +8427,6 @@
"mirror_source": 0,
"private": 0
},
- "head": "1c068d3facec1879b1763dd6f98d3849133473da",
"pages": 19,
"source_id": "notes",
"states": {