Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

chore(doctor): register legacy_job_authority and regenerate doctor goldens (#5157)

garrytan840497f09914
diff --git a/src/commands/doctor/checks/legacy-job-authority.ts b/src/commands/doctor/checks/legacy-job-authority.ts
index e85023aa6c..92c3a6821a 100644
--- a/src/commands/doctor/checks/legacy-job-authority.ts
+++ b/src/commands/doctor/checks/legacy-job-authority.ts
@@ -76,10 +76,17 @@ export async function legacyJobAuthorityCheck(engine: BrainEngine): Promise<Chec
};
}
+async function runLegacyJobAuthority(ctx: DoctorContext): Promise<Check[]> {
+ const checks: Check[] = [];
+ const { status, message, details } = await legacyJobAuthorityCheck(connectedEngine(ctx));
+ checks.push({ name: 'legacy_job_authority', status, message, details });
+ return checks;
+}
+
export const legacyJobAuthorityEntry: DoctorEntry = {
name: 'legacy_job_authority',
emits: ['legacy_job_authority'],
- run: async (ctx: DoctorContext) => [await legacyJobAuthorityCheck(connectedEngine(ctx))],
+ run: runLegacyJobAuthority,
};
/** `gbrain post-upgrade` banner line when live legacy rows block workers (read-only commands only). */
diff --git a/src/commands/doctor/registry.ts b/src/commands/doctor/registry.ts
index 62c46c1021..3ef6d0fe0c 100644
--- a/src/commands/doctor/registry.ts
+++ b/src/commands/doctor/registry.ts
@@ -76,6 +76,7 @@ import {
salienceEntry,
} from './checks/knowledge-health.ts';
import { queueHealthEntry, indexAuditEntry, imageAssetsEntry } from './checks/queue-assets.ts';
+import { legacyJobAuthorityEntry } from './checks/legacy-job-authority.ts';
import { syncFreshnessEntry, searchModeEntry } from './checks/sync-search.ts';
import { decideHealthEntry } from './checks/decide.ts';
import { STOP_DOCTOR, type DoctorContext, type DoctorEntry } from './context.ts';
@@ -127,6 +128,7 @@ export const DOCTOR_CHECK_REGISTRY: readonly DoctorEntry[] = [
effectiveDateEntry,
salienceEntry,
queueHealthEntry,
+ legacyJobAuthorityEntry,
indexAuditEntry,
imageAssetsEntry,
syncFreshnessEntry,
diff --git a/test/fixtures/goldens/doctor/json-pglite-degraded.json b/test/fixtures/goldens/doctor/json-pglite-degraded.json
index 68359d3129..174cc9e30a 100644
--- a/test/fixtures/goldens/doctor/json-pglite-degraded.json
+++ b/test/fixtures/goldens/doctor/json-pglite-degraded.json
@@ -806,6 +806,23 @@
"name": "facts_health",
"status": "ok"
},
+ {
+ "category": "ops",
+ "details": {
+ "active_ids": [],
+ "authorizable": {},
+ "authorizable_total": 0,
+ "docs": "docs/guides/repair.md#legacy-job-authority",
+ "live": 0,
+ "terminal_keyed": {},
+ "terminal_keyed_total": 0,
+ "unsupported": 0,
+ "unsupported_ids": []
+ },
+ "message": "No queued job predates submission authority.",
+ "name": "legacy_job_authority",
+ "status": "ok"
+ },
{
"category": "brain",
"message": "No image assets indexed yet",
diff --git a/test/fixtures/goldens/doctor/json-pglite-fresh.json b/test/fixtures/goldens/doctor/json-pglite-fresh.json
index 4dab2f566f..e1b52beaf5 100644
--- a/test/fixtures/goldens/doctor/json-pglite-fresh.json
+++ b/test/fixtures/goldens/doctor/json-pglite-fresh.json
@@ -806,6 +806,23 @@
"name": "facts_health",
"status": "ok"
},
+ {
+ "category": "ops",
+ "details": {
+ "active_ids": [],
+ "authorizable": {},
+ "authorizable_total": 0,
+ "docs": "docs/guides/repair.md#legacy-job-authority",
+ "live": 0,
+ "terminal_keyed": {},
+ "terminal_keyed_total": 0,
+ "unsupported": 0,
+ "unsupported_ids": []
+ },
+ "message": "No queued job predates submission authority.",
+ "name": "legacy_job_authority",
+ "status": "ok"
+ },
{
"category": "brain",
"message": "No image assets indexed yet",
diff --git a/test/fixtures/goldens/doctor/json-postgres-fresh.json b/test/fixtures/goldens/doctor/json-postgres-fresh.json
index e83fabc1d2..9cbcbe31d4 100644
--- a/test/fixtures/goldens/doctor/json-postgres-fresh.json
+++ b/test/fixtures/goldens/doctor/json-postgres-fresh.json
@@ -817,6 +817,23 @@
"name": "facts_health",
"status": "ok"
},
+ {
+ "category": "ops",
+ "details": {
+ "active_ids": [],
+ "authorizable": {},
+ "authorizable_total": 0,
+ "docs": "docs/guides/repair.md#legacy-job-authority",
+ "live": 0,
+ "terminal_keyed": {},
+ "terminal_keyed_total": 0,
+ "unsupported": 0,
+ "unsupported_ids": []
+ },
+ "message": "No queued job predates submission authority.",
+ "name": "legacy_job_authority",
+ "status": "ok"
+ },
{
"category": "brain",
"message": "No image assets indexed yet",
diff --git a/test/fixtures/goldens/doctor/registry-build-checks.json b/test/fixtures/goldens/doctor/registry-build-checks.json
index cc6eb10edb..5ba4f023e8 100644
--- a/test/fixtures/goldens/doctor/registry-build-checks.json
+++ b/test/fixtures/goldens/doctor/registry-build-checks.json
@@ -465,6 +465,10 @@
"category": "brain",
"name": "facts_health"
},
+ {
+ "category": "ops",
+ "name": "legacy_job_authority"
+ },
{
"category": "ops",
"name": "index_audit"