Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
doctor: name the #7142 tier 'quick' (distinct from --fast, which skips DB checks); disclose the wave's behavior changes
garrytan9e3693047447
diff --git a/docs/architecture/key-files/commands-2-continued.md b/docs/architecture/key-files/commands-2-continued.mdindex db12f7438c..86812c7937 100644--- a/docs/architecture/key-files/commands-2-continued.md+++ b/docs/architecture/key-files/commands-2-continued.md@@ -31,7 +31,8 @@ Current behavior and load-bearing invariants; history belongs in Git and CHANGEL- `src/commands/doctor/checks/keyword-plan.ts` — `keyword_plan` (#6495, OPS, wave check with operator resolution; the keyword-side twin of `vector_plan` in commands-2.md). Postgres only: reads the commonest lexeme the planner knows for `content_chunks.search_vector` (`pg_stats.most_common_elems` with its frequency), EXPLAINs (no ANALYZE) the strict page-count statement for it (`buildKeywordCountStatement`, the builder the engine uses) and times the engine's own bounded `countKeywordPages(term, { timeoutMs: 2000 })`; warns `canary_timed_out` when that count hits its bound and `canary_slow` when it takes more than half of `search.keyword_statement_timeout_ms`, naming the knob with its range (1000-60000), the fail-open to the vector arm (`keyword_arm_failed`), that a longer bound buys time and not a cheaper statement, that one canary term is not workload coverage, and that a timed-out count is never "no matches". Skipped on PGLite, below 10,000 chunks (`pg_class.reltuples`) and without planner statistics (it names `ANALYZE content_chunks`); a failing probe reports unknown health. `engineKeywordPlanProbe(engine)` is the database side; `keywordPlanCheck(engine, probe?)` takes a fake for tests. Tested in `test/doctor-keyword-plan-6495.test.ts` (fake probe for every outcome; with DATABASE_URL the real probe on a seeded brain and a lock-forced timeout).- `src/commands/doctor/checks/image-embedding-coverage.ts` — `image_embedding_coverage` (#6529, brain category, after `image_assets`). Counts live image pages (`page_kind = 'image'`), those with no `embedding_image` chunk, those with a NULL `source_path`, and the `managed_image_sync_unsupported` holds per source, and reads `isMultimodalEnabled()`. Ok when the brain has no image pages, when every image page has an image vector and a `source_path` and nothing is held, or when multimodal embedding is off (the counts are then informational: image search is not expected to work). On a multimodal install it warns with the counts (text coverage counts those pages as embedded while image search does not see them) and names `gbrain embed --stale --images` and `gbrain sync --no-pull --source <id>` for the holds. Read-only; no paid call. Test: `test/doctor-image-embedding-coverage.test.ts`.- `src/commands/doctor/checks/provider-consent.ts` — `provider_consent` (OPS, engine-free filesystem lane right after `embedding_key_source`; not in `doctorReportRemote`): the provider-use decision `gbrain setup` recorded for this install (`localSetupRecords` in `src/core/setup/local-receipts.ts`). A decline (any live receipt; opt-outs win) is `ok` + info `disabled_by_choice`, "skipped by consent", naming the provider key variables present (names only) and carrying `providerConsentFix`: `gbrain setup <harness> --providers` (+ `--name`/`--scope project`), actor `user`, consent `paid`+`egress`, so `next: tell_user_to_run`. Accepted is plain `ok`; no receipt is info `not_applicable`. The same fix rides `embedding_provider`'s `--probe` skip (`checks/embedding-health.ts`), and `probe-consent.ts` authorizes nothing when a decline is recorded. Reads files only; sends nothing. Pinned by `test/doctor-provider-consent.serial.test.ts` (request counter: zero outbound under a decline, controls prove discovery and the probe are seen otherwise).-- `src/commands/doctor/budget.ts` + `checks/ops-sections.ts` + `checks/orphan-estimate.ts` — doctor tiers and budgets (#6696 B1). `parseDoctorTier` (`--tier ops|standard|deep`, a bad value is `invalid_params`), `parseBudgetMs` (`--budget-ms`, default 4000 under ops, none otherwise) and `startDoctorDeadline` build the `DoctorDeadline` the CLI starts before connecting. `runDoctorRegistry` runs the entries tagged `tier: 'ops'` (persistence capacity, terminal failures, managed sync movement, persistence compaction, serve build drift, schema-pack consistency, embedding state) right after the connection lane; under `--tier ops` it runs only those (each `executeRaw` gets the absolute `deadlineAt`, so `SET LOCAL statement_timeout` is the time left after the pool wait: `postgres-engine/bounded-statement.ts`), reports an entry marked `opsPglite: 'not_applicable'` as an `ok` info row on PGLite, and stays complete. Every other tier bounds each entry by `doctor.entry_budget_ms` (default 15000). An entry past its budget, an unknown reported after the overall deadline, or a connect the deadline ended becomes `budgetUnknownCheck` (warn, `details.health: 'unknown'`, `reason: 'budget'`, `exact: false`, a rerun-alone fix), never a clear result; every check carries `elapsed_ms`, and the report adds `tier`/`complete`/`unknown_sections`/`elapsed_ms`/`budget_ms` only when `--tier` or `--budget-ms` was given (`doctorRunSummary`). `doctorHealth(ctx)` memoizes `getHealth` for one run. `orphan_ratio` estimates from a `TABLESAMPLE SYSTEM` sample above `doctor.orphan_ratio.full_scan_max_pages` (default 50000) unless `--tier deep`. Capacity (`persistence_capacity`, PR A's forecast) and compaction freshness (`persistence_compaction`) run as ops entries in `checks/ops-sections.ts`. #6803 (Part 5): on every tier each entry runs inside its own `StatementDeadline` (`src/core/statement-deadline.ts`: an AsyncLocalStorage scope plus `deadlineBoundEngine`, one stable Proxy per real engine that refuses any engine call past the deadline, carries the deadline to the server on Postgres `executeRaw`, and marks the scope expired on a cancel even when the check catches it; `engineCacheKey` maps the wrapper to the real engine for engine-keyed caches; PGLite gets only the pre-statement refusal). The budget-config read is one bounded statement (2 s, default kept). `CHEAP_INCIDENT_CHECKS` (by check name: persistence capacity, managed sync movement, `text_projection_readiness`, `partial_embedding`, `links_extraction_lag`, now its own entry) run right after the ops sections, before any full scan. `scanDeadline` clips the frontmatter walk and the fence census to the entry deadline less 250 ms, so they report partial results. `--only` with an explicit `--budget-ms` gives the selected entries the whole overall budget; `budgetUnknownCheck` names the limiting budget (`details.limit`: `entry` or `overall`) and fixes with `--only <check> --budget-ms N` (N ten times that budget; actor agent while N fits `AGENT_TOOL_LIMIT_MS` less 10 s, else actor user). `--budget-ms 0` is no overall budget. `default-budget.ts`: a plain non-interactive CLI `doctor --json` (stderr not a TTY; no `--budget-ms`, `--tier`, `--fix`, `--remediate` or `--remediation-plan`) caps its check run at `doctor.default_budget_ms` (file plane, default 90000, 0 off), started by `startDeferredDeadline` when the registry starts (connect and migrations are outside it), with one stderr line; the report then carries the tier fields. `capacity-memo.ts` `doctorCapacityForecast`: one forecast per run (shared by `persistence_capacity` and `persistence_request_growth`) read under the run's overall deadline and dropped from the memo on a deadline failure, which makes the waiting check unknown instead of a counter-only verdict. `persistence_session_timeouts` reads `SHOW statement_timeout` outside the entry deadline. Tests: `test/doctor-tier-6696.test.ts`, `test/doctor-day-zero.test.ts` (`--tier ops`), `test/e2e/doctor-ops-tier-postgres.test.ts`, `test/doctor-entry-deadline-6803.test.ts` (plus `test/e2e/doctor-entry-deadline-postgres.test.ts`, in the PgBouncer matrix), `test/doctor-default-budget-6803.test.ts`; bench `scripts/bench/doctor-scale.ts`.+- `src/commands/doctor/budget.ts` + `checks/ops-sections.ts` + `checks/orphan-estimate.ts` — doctor tiers and budgets (#6696 B1). `parseDoctorTier` (`--tier ops|quick|standard|deep`, a bad value is `invalid_params`), `parseBudgetMs` (`--budget-ms`, default 4000 under ops, 10000 under quick, none otherwise) and `startDoctorDeadline` build the `DoctorDeadline` the CLI starts before connecting. `runDoctorRegistry` runs the entries tagged `tier: 'ops'` (persistence capacity, terminal failures, managed sync movement, persistence compaction, serve build drift, schema-pack consistency, embedding state) right after the connection lane; under `--tier ops` it runs only those (each `executeRaw` gets the absolute `deadlineAt`, so `SET LOCAL statement_timeout` is the time left after the pool wait: `postgres-engine/bounded-statement.ts`), reports an entry marked `opsPglite: 'not_applicable'` as an `ok` info row on PGLite, and stays complete. Every other tier bounds each entry by `doctor.entry_budget_ms` (default 15000). An entry past its budget, an unknown reported after the overall deadline, or a connect the deadline ended becomes `budgetUnknownCheck` (warn, `details.health: 'unknown'`, `reason: 'budget'`, `exact: false`, a rerun-alone fix), never a clear result; every check carries `elapsed_ms`, and the report adds `tier`/`complete`/`unknown_sections`/`elapsed_ms`/`budget_ms` only when `--tier` or `--budget-ms` was given (`doctorRunSummary`). `doctorHealth(ctx)` memoizes `getHealth` for one run. `orphan_ratio` estimates from a `TABLESAMPLE SYSTEM` sample above `doctor.orphan_ratio.full_scan_max_pages` (default 50000) unless `--tier deep`. Capacity (`persistence_capacity`, PR A's forecast) and compaction freshness (`persistence_compaction`) run as ops entries in `checks/ops-sections.ts`. #6803 (Part 5): on every tier each entry runs inside its own `StatementDeadline` (`src/core/statement-deadline.ts`: an AsyncLocalStorage scope plus `deadlineBoundEngine`, one stable Proxy per real engine that refuses any engine call past the deadline, carries the deadline to the server on Postgres `executeRaw`, and marks the scope expired on a cancel even when the check catches it; `engineCacheKey` maps the wrapper to the real engine for engine-keyed caches; PGLite gets only the pre-statement refusal). The budget-config read is one bounded statement (2 s, default kept). `CHEAP_INCIDENT_CHECKS` (by check name: persistence capacity, managed sync movement, `text_projection_readiness`, `partial_embedding`, `links_extraction_lag`, now its own entry) run right after the ops sections, before any full scan. `scanDeadline` clips the frontmatter walk and the fence census to the entry deadline less 250 ms, so they report partial results. `--only` with an explicit `--budget-ms` gives the selected entries the whole overall budget; `budgetUnknownCheck` names the limiting budget (`details.limit`: `entry` or `overall`) and fixes with `--only <check> --budget-ms N` (N ten times that budget; actor agent while N fits `AGENT_TOOL_LIMIT_MS` less 10 s, else actor user). `--budget-ms 0` is no overall budget. `default-budget.ts`: a plain non-interactive CLI `doctor --json` (stderr not a TTY; no `--budget-ms`, `--tier`, `--fix`, `--remediate` or `--remediation-plan`) caps its check run at `doctor.default_budget_ms` (file plane, default 90000, 0 off), started by `startDeferredDeadline` when the registry starts (connect and migrations are outside it), with one stderr line; the report then carries the tier fields. `capacity-memo.ts` `doctorCapacityForecast`: one forecast per run (shared by `persistence_capacity` and `persistence_request_growth`) read under the run's overall deadline and dropped from the memo on a deadline failure, which makes the waiting check unknown instead of a counter-only verdict. `persistence_session_timeouts` reads `SHOW statement_timeout` outside the entry deadline. Tests: `test/doctor-tier-6696.test.ts`, `test/doctor-day-zero.test.ts` (`--tier ops`), `test/e2e/doctor-ops-tier-postgres.test.ts`, `test/doctor-entry-deadline-6803.test.ts` (plus `test/e2e/doctor-entry-deadline-postgres.test.ts`, in the PgBouncer matrix), `test/doctor-default-budget-6803.test.ts`; bench `scripts/bench/doctor-scale.ts`.+- `src/commands/doctor/last-known.ts` — the quick tier's last known results (#7142). `--tier quick` (budget.ts: `QUICK_BUDGET_MS_DEFAULT` 10000, connect included; `entryRunsAt` orders ops ⊂ quick ⊂ standard ⊂ deep; `cheapTier` gives it the ops tier's round-trip connection check and counter-mode embedding state) runs the ops entries plus the entries tagged `tier: 'quick'` (schema version, the stub-guard entry with `sync_failures`, queue health, partial embeddings). `lastKnownMode` turns the store on only for a brain-wide local CLI run (`buildChecks(..., { lastKnown: 'cli' })` from `runDoctor`) or the refresh job, never under `--only`, `--source`, a remote scope, `--fix` or `--tier ops`. `runDoctorRegistry` records each entry's outcome (`done`, `expired` when it ran out of budget or emitted a budget unknown, `not_run` when the tier skipped a standard entry); `withLastKnown` writes the finished entries of a standard or deep run to `op_checkpoints` (op `doctor-last-known`, fingerprint = entry name, `completed_keys[0]` = `{ checks, measured_at, elapsed_ms }`, one bounded statement, best-effort) and `applyLastKnown` replaces an unfinished entry's checks with its last known ones when they are at most `LAST_KNOWN_MAX_AGE_MS` (24 h) old: same status, message prefixed `Last known, N ago (...)`, `details.last_known` `{ measured_at, age_ms, reason: not_in_tier | budget }`. The rest are named in one `doctor_last_known` warning (`details.health: 'unknown'`, `unknown_checks`), which `tierFields` expands into `unknown_sections`; served checks go to `last_known_sections` and make the report incomplete. An entry with no result younger than `REFRESH_AFTER_MS` (1 h) queues one `doctor-refresh` job on Postgres (idempotency key per hour, `maxWaiting: 1`); the handler (`runDoctorRefresh`, registered in `commands/jobs.ts`) runs `doctorRefreshRegistry()` (the connection lane plus every standard entry after the connection gate; filesystem entries are recorded only by CLI runs) with `REFRESH_ENTRY_BUDGET_MS` (600000) per entry and queues nothing itself. Tests: `test/doctor-quick-tier-7142.test.ts` (+ `test/e2e/doctor-quick-tier-7142-postgres.test.ts`).- `src/commands/doctor/brain-health-bands.ts` + `remote-tier.ts` + `ops-snapshot.ts`, `src/core/doctor-remote-tier.ts`, `src/core/persistence/capacity-view.ts` — the ops tier for agents and remote clients (#6696 B2). `readCapacityView` (for `/admin/api/ops`) reads the counter rows, `capacityDiagnostics`, the light `readCapacityForecast` (null when unreadable: days unknown) and `readLastCompaction`; the bands read `cachedCapacitySnapshot`; `capacityVerify()` is the verify of every capacity fix (`gbrain doctor --only persistence_capacity --json` plus MCP `get_brain_health`). `readBrainHealthBands` backs the read-scope `get_brain_health` op: capacity band and days band, write failures and active blockers as count bands for the caller's readable sources, no slugs or exact counters, cached 60 s per engine and scope. `runRemoteDoctorTier` backs `run_doctor`'s `tier: "ops"` / `only` (admin). `runScopedRemoteDoctor` is the thin client's `gbrain doctor --tier ops` / `--only <registry check>`: it reads `tools/list` and uses `run_doctor` with the parameters, else the bands (`BAND_CHECKS`), else refuses `doctor_tier_unavailable`; it never runs the full remote report in their place. `cachedOpsSnapshot` serves `/admin/api/ops` from one ops run a minute. Tests: `test/doctor-ops-remote-6696.test.ts`.- `src/commands/doctor/checks/rename-identity-downgrades.ts` — `rename_identity_downgrades` (#6729): warn while a downgraded rename record is open (`sync-identity-downgrades.ts`), naming up to 5 pairs with their facts and links; fix = the first pair's `gbrain repair rename-identity` apply (destructive, `ask_user`, `preview_argv`, `plan_hash`; `--close` on a managed brain), so unbound classic Postgres pairs get an actionable fix too; `gbrain restore <old-slug> --source-id <id> --force` is named as the alternative in its text only where `restore_available !== false`, and `restore_unavailable_sources` lists the rest.diff --git a/src/cli/help/doctor.ts b/src/cli/help/doctor.tsindex 7d872a0327..a28fec78ff 100644--- a/src/cli/help/doctor.ts+++ b/src/cli/help/doctor.ts@@ -5,7 +5,7 @@ export const help: CliHelpSpec = {summary: 'Check brain health; preview and run remediation.',usage: ['gbrain doctor [--fast] [--json] [--fix [--dry-run]] [--scope=brain] [--source <id>] [--no-migrate] [--locks]',- 'gbrain doctor --tier ops|fast|standard|deep [--budget-ms <n>] [--json]',+ 'gbrain doctor --tier ops|quick|standard|deep [--budget-ms <n>] [--json]','gbrain doctor --only <check>[,<check>…] [--tier ops] [--json]','gbrain doctor --remediation-plan [--target-score <n>] [--no-embed] [--json]','gbrain doctor --remediate [--yes [--expect <plan_hash>]] [--include-repairs] [--max-usd <n>] [--target-score <n>]',@@ -15,7 +15,7 @@ export const help: CliHelpSpec = {{ name: '--json', type: 'boolean', desc: 'Print one JSON document (checks, score, findings) on stdout.' },{ name: '--only', type: 'string', desc: 'Read-only: run just the named checks (comma-separated or repeated; no migrations). The usual fix.verify. An unknown name exits 2 with the valid list.' },{ name: '--fast', type: 'boolean', desc: 'Skip database checks; filesystem and config checks only.' },- { name: '--tier', type: 'enum', values: ['ops', 'fast', 'standard', 'deep'], desc: 'ops: only the operational sections (capacity, write failures, embedding state, sync movement, compaction, serve build, schema pack) under a 4 s deadline, observational (no migrations). fast: the health gate for agents on large brains: the ops sections plus schema version, sync failures, queue health, link-extraction lag and partial embeddings under a 10 s deadline; every other check is reported from its last known result with its age, checks with none from the last 24 h are named as unknown, and a background doctor-refresh job is queued to measure them. standard (default): ops first, then the rest; a brain-wide run records each finished check as its last known result. deep: adds full scans (orphan_ratio on brains over 50,000 pages).' },+ { name: '--tier', type: 'enum', values: ['ops', 'quick', 'standard', 'deep'], desc: 'ops: only the operational sections (capacity, write failures, embedding state, sync movement, compaction, serve build, schema pack) under a 4 s deadline, observational (no migrations). quick: the health gate for agents on large brains: the ops sections plus schema version, sync failures, queue health and partial embeddings under a 10 s deadline; every other check is reported from its last known result with its age, checks with none from the last 24 h are named as unknown, and a background doctor-refresh job is queued to measure them. standard (default): ops first, then the rest; a brain-wide run records each finished check as its last known result. deep: adds full scans (orphan_ratio on brains over 50,000 pages).' },{ name: '--budget-ms', type: 'number', desc: 'Absolute end-to-end deadline in ms, counted from before the connect (default 4000 with --tier ops; 0: none). A plain non-interactive --json run caps its check run at doctor.default_budget_ms (file plane, default 90000, 0 off) instead. With --only, the named checks get the whole budget. Checks past it report health unknown (reason budget, which budget in details.limit); the report says complete: false.' },{ name: '--fix', type: 'boolean', desc: 'Apply the local fixes doctor knows (skill files, stale locks); pair with --dry-run to preview.' },{ name: '--dry-run', type: 'boolean', desc: 'Preview --fix or --remediate without changing anything.' },diff --git a/src/commands/doctor.ts b/src/commands/doctor.tsindex 7d21b3f076..cca02211c7 100644--- a/src/commands/doctor.ts+++ b/src/commands/doctor.ts@@ -481,7 +481,7 @@ export async function buildChecks(...(remoteScope.entryBudgetOverrideMs ? { entryBudgetOverrideMs: remoteScope.entryBudgetOverrideMs } : {}),};- return remoteScope.refreshOnly ? runDoctorRegistry(ctx, doctorRefreshRegistry()) : runDoctorRegistry(ctx);+ return runDoctorRegistry(ctx, remoteScope.refreshOnly ? doctorRefreshRegistry() : undefined);}/**diff --git a/src/commands/doctor/budget.ts b/src/commands/doctor/budget.tsindex 2df94c1353..354fd334f2 100644--- a/src/commands/doctor/budget.ts+++ b/src/commands/doctor/budget.ts@@ -1,7 +1,7 @@/*** #6696 B1: doctor tiers and budgets.*- * `--tier ops|fast|standard|deep` selects which registry entries run (see+ * `--tier ops|quick|standard|deep` selects which registry entries run (see* `DoctorTier` in ./context.ts); `--budget-ms <n>` is one absolute end-to-end* deadline that starts before the CLI connects (default 4000 for `ops`, none* for the other tiers; `--budget-ms 0`: none). A plain non-interactive CLI@@ -31,11 +31,11 @@ import type { Check, DoctorReport } from '../doctor.ts';import { agentFix } from './check-fix.ts';import type { DoctorTier } from './context.ts';-export const DOCTOR_TIERS: readonly DoctorTier[] = ['ops', 'fast', 'standard', 'deep'];+export const DOCTOR_TIERS: readonly DoctorTier[] = ['ops', 'quick', 'standard', 'deep'];/** Default `--budget-ms` for `--tier ops`; the other tiers have no overall deadline unless one is given. */export const OPS_BUDGET_MS_DEFAULT = 4000;-/** #7142: default `--budget-ms` for `--tier fast` (connect included). */-export const FAST_BUDGET_MS_DEFAULT = 10_000;+/** #7142: default `--budget-ms` for `--tier quick` (connect included). */+export const QUICK_BUDGET_MS_DEFAULT = 10_000;/** Config key and default of the per-entry budget (standard and deep tiers; ops entries use the overall deadline). */export const ENTRY_BUDGET_KEY = 'doctor.entry_budget_ms';export const ENTRY_BUDGET_MS_DEFAULT = 15_000;@@ -86,7 +86,7 @@ export function parseDoctorTier(args: readonly string[]): DoctorTier {/** `--budget-ms <n>` (a non-negative integer; 0: no overall budget), else the tier default. */export function parseBudgetMs(args: readonly string[], tier: DoctorTier): number | null {const raw = flagValue(args, '--budget-ms');- if (raw === undefined) return tier === 'ops' ? OPS_BUDGET_MS_DEFAULT : tier === 'fast' ? FAST_BUDGET_MS_DEFAULT : null;+ if (raw === undefined) return tier === 'ops' ? OPS_BUDGET_MS_DEFAULT : tier === 'quick' ? QUICK_BUDGET_MS_DEFAULT : null;const n = Number(raw);if (!Number.isSafeInteger(n) || n < 0) {throw opError('invalid_params', `--budget-ms must be a whole number of milliseconds, 0 for no overall budget (got ${raw}).`, 'Example: --budget-ms 4000.');@@ -117,11 +117,11 @@ export function scanDeadline(ctx: { entryDeadlineAt?: number }, ownTimeoutMs: nureturn Math.min(now + ownTimeoutMs, (ctx.entryDeadlineAt ?? Infinity) - SCAN_REPORT_RESERVE_MS);}-/** Whether a registry entry runs at `tier` (each tier includes the ones before it: ops, fast, standard, deep). */+/** Whether a registry entry runs at `tier` (each tier includes the ones before it: ops, quick, standard, deep). */export function entryRunsAt(entryTier: DoctorTier | undefined, tier: DoctorTier): boolean {const own = entryTier ?? 'standard';if (tier === 'ops') return own === 'ops';- if (tier === 'fast') return own === 'ops' || own === 'fast';+ if (tier === 'quick') return own === 'ops' || own === 'quick';if (tier === 'standard') return own !== 'deep';return true;}diff --git a/src/commands/doctor/checks/content-quality.ts b/src/commands/doctor/checks/content-quality.tsindex 6d4b5cd9ec..7513a76374 100644--- a/src/commands/doctor/checks/content-quality.ts+++ b/src/commands/doctor/checks/content-quality.ts@@ -269,7 +269,7 @@ async function runPartialEmbedding(ctx: DoctorContext): Promise<Check[]> {export const partialEmbeddingEntry: DoctorEntry = {name: 'partial_embedding',emits: ['partial_embedding'],- tier: 'fast',+ tier: 'quick',run: runPartialEmbedding,};diff --git a/src/commands/doctor/checks/db-connection.ts b/src/commands/doctor/checks/db-connection.tsindex 1ca7e5d76c..5ef69f0a96 100644--- a/src/commands/doctor/checks/db-connection.ts+++ b/src/commands/doctor/checks/db-connection.ts@@ -23,7 +23,7 @@ import { BACKUP_SIZE_WARN_RATIO, PHYSICAL_COPY_RUNBOOK, estimatedTarBytes, formaimport type { Check } from '../../doctor.ts';import { classifyPgAccessError } from '../../../core/pg-access-classify.ts';import { dbRepairRecurrenceCheck } from './engine-fit.ts';-import { STOP_DOCTOR, connectedEngine, quickTier, type DoctorContext, type DoctorEntry } from '../context.ts';+import { STOP_DOCTOR, connectedEngine, cheapTier, type DoctorContext, type DoctorEntry } from '../context.ts';import { DoctorBudgetError, budgetUnknownCheck } from '../budget.ts';async function runPgliteDataDir(ctx: DoctorContext): Promise<Check[]> {@@ -313,7 +313,7 @@ async function runConnection(ctx: DoctorContext): Promise<Check[]> {progress.heartbeat('connection');try {// #6696 B1: the ops tier proves the round trip only; the page count is a full count the deadline does not afford.- if (quickTier(ctx.tier)) {+ if (cheapTier(ctx.tier)) {await engine.executeRaw('SELECT 1 AS ok');checks.push({ name: 'connection', status: 'ok', message: `Connected (${ctx.tier} tier: page count not read).` });} else {@@ -324,7 +324,7 @@ async function runConnection(ctx: DoctorContext): Promise<Check[]> {// A round trip the ops deadline ended (a saturated pool, a blocked server) is unknown, not a classified outage.const deadlineAt = ctx.deadline?.deadlineAt;if (e instanceof DoctorBudgetError) throw e;- if (quickTier(ctx.tier) && deadlineAt != null && Date.now() >= deadlineAt) throw new DoctorBudgetError(Date.now() - ctx.deadline!.startedAt);+ if (cheapTier(ctx.tier) && deadlineAt != null && Date.now() >= deadlineAt) throw new DoctorBudgetError(Date.now() - ctx.deadline!.startedAt);// db-availability loop (2c): classified + redacted, with the fix hint.checks.push(classifiedConnectionCheck(e));progress.finish();diff --git a/src/commands/doctor/checks/embedding-state.ts b/src/commands/doctor/checks/embedding-state.tsindex a7766318ae..b01c39fc0e 100644--- a/src/commands/doctor/checks/embedding-state.ts+++ b/src/commands/doctor/checks/embedding-state.ts@@ -13,7 +13,7 @@* still inside the window and a brain keyless by choice are information.*/import type { Check } from '../../doctor.ts';-import { connectedEngine, quickTier, type DoctorContext, type DoctorEntry } from '../context.ts';+import { connectedEngine, cheapTier, type DoctorContext, type DoctorEntry } from '../context.ts';import { agentFix, checkError, doctorVerify, infoCheck, keylessEnablementFix } from '../check-fix.ts';import { EMBEDDING_STATE_DOCS, embeddingStateFix, readEmbeddingState, type EmbeddingState } from '../../../core/embedding-state.ts';@@ -27,7 +27,7 @@ async function runEmbeddingState(ctx: DoctorContext): Promise<Check[]> {const checks: Check[] = [];ctx.progress.heartbeat('embedding_state');try {- const state = await readEmbeddingState(engine, { mode: quickTier(ctx.tier) ? 'ops' : 'full', ...(ctx.sourceIds ? { sourceIds: ctx.sourceIds } : {}) });+ const state = await readEmbeddingState(engine, { mode: cheapTier(ctx.tier) ? 'ops' : 'full', ...(ctx.sourceIds ? { sourceIds: ctx.sourceIds } : {}) });const details: Record<string, unknown> = { ...state, exact: state.basis === 'exact' };if (state.status === 'unknown') {checks.push({ name: 'embedding_state', status: 'warn',diff --git a/src/commands/doctor/checks/local-audits.ts b/src/commands/doctor/checks/local-audits.tsindex e6e2aaad49..54bfd2809a 100644--- a/src/commands/doctor/checks/local-audits.ts+++ b/src/commands/doctor/checks/local-audits.ts@@ -125,7 +125,7 @@ export const stubGuardEntry: DoctorEntry = {name: 'stub_guard_24h',emits: ['stub_guard_24h', 'sync_failures', 'managed_sync_backlog', 'slug_fallback_audit'],engineChecks: ['sync_failures', 'managed_sync_backlog'],- tier: 'fast',+ tier: 'quick',run: runStubGuard,};diff --git a/src/commands/doctor/checks/queue-assets.ts b/src/commands/doctor/checks/queue-assets.tsindex da8f7c79a0..5c995a3390 100644--- a/src/commands/doctor/checks/queue-assets.ts+++ b/src/commands/doctor/checks/queue-assets.ts@@ -88,7 +88,7 @@ async function runQueueHealth(ctx: DoctorContext): Promise<Check[]> {export const queueHealthEntry: DoctorEntry = {name: 'queue_health',emits: ['queue_health', 'subagent_capability', 'facts_health'],- tier: 'fast',+ tier: 'quick',run: runQueueHealth,};diff --git a/src/commands/doctor/checks/schema-health.ts b/src/commands/doctor/checks/schema-health.tsindex 9b7241f42c..eb4be20f67 100644--- a/src/commands/doctor/checks/schema-health.ts+++ b/src/commands/doctor/checks/schema-health.ts@@ -311,7 +311,7 @@ function missingTablesFields(report: MissingTablesReport): Omit<Check, 'name'> {export const schemaVersionEntry: DoctorEntry = {name: 'schema_version',emits: ['schema_version', 'schema_columns', 'schema_missing_tables'],- tier: 'fast',+ tier: 'quick',run: runSchemaVersion,};diff --git a/src/commands/doctor/context.ts b/src/commands/doctor/context.tsindex 0b712e218f..0bbae6f21b 100644--- a/src/commands/doctor/context.ts+++ b/src/commands/doctor/context.ts@@ -21,17 +21,17 @@ import type { BrainHealth } from '../../core/types.ts';export const STOP_DOCTOR: unique symbol = Symbol('STOP_DOCTOR');/**- * #6696 B1: `--tier ops|fast|standard|deep`. `ops` runs only the entries tagged- * `ops` (observational, under one absolute deadline); `fast` (#7142) adds the- * entries tagged `fast` under its own deadline and reports every other check+ * #6696 B1: `--tier ops|quick|standard|deep`. `ops` runs only the entries tagged+ * `ops` (observational, under one absolute deadline); `quick` (#7142) adds the+ * entries tagged `quick` under its own deadline and reports every other check* from its last known result; `standard` (default) runs ops entries first, then* the rest; `deep` adds the entries tagged `deep`.*/-export type DoctorTier = 'ops' | 'fast' | 'standard' | 'deep';+export type DoctorTier = 'ops' | 'quick' | 'standard' | 'deep';/** #7142: the tiers that answer from cheap reads only (a round-trip connection check, counter-mode sections). */-export function quickTier(tier: DoctorTier | undefined): boolean {- return tier === 'ops' || tier === 'fast';+export function cheapTier(tier: DoctorTier | undefined): boolean {+ return tier === 'ops' || tier === 'quick';}export interface DoctorEntry {diff --git a/src/commands/doctor/last-known.ts b/src/commands/doctor/last-known.tsindex 8a49104ae0..dba9c9bd6b 100644--- a/src/commands/doctor/last-known.ts+++ b/src/commands/doctor/last-known.ts@@ -2,11 +2,11 @@* #7142: last known doctor results.** On a large brain a standard run cannot finish every check inside the- * non-interactive default budget, and the fast tier does not run the slow+ * non-interactive default budget, and the quick tier does not run the slow* checks at all. Every completed standard or deep entry records the checks it* emitted in `op_checkpoints` (op `doctor-last-known`, one row per entry, so* the jobs worker and the CLI share it whatever GBRAIN_HOME each has). A later- * run that did not finish an entry, or a fast-tier run that did not run it,+ * run that did not finish an entry, or a quick-tier run that did not run it,* reports that entry's last known checks with their age instead of nothing or* an unknown. A result older than LAST_KNOWN_MAX_AGE_MS is not served: those* checks are named as unknown in one `doctor_last_known` check (status warn,@@ -86,7 +86,7 @@ function ageText(ms: number): string {/** One check from a last known result, with its age; its status is the one it had then. */export function lastKnownCheck(check: Check, measuredAt: string, reason: 'not_in_tier' | 'budget', now = Date.now()): Check {const age = Math.max(0, now - Date.parse(measuredAt));- const why = reason === 'budget' ? 'not finished within this run\'s budget' : 'not run by the fast tier';+ const why = reason === 'budget' ? 'not finished within this run\'s budget' : 'not run by the quick tier';return { ...check, message: `Last known, ${ageText(age)} ago (${why}): ${check.message}`,details: { ...check.details, last_known: { measured_at: measuredAt, age_ms: age, reason } } };}@@ -127,7 +127,7 @@ export function unmeasuredCheck(stale: readonly EntryOutcome[], cache: ReadonlyMname: 'doctor_last_known', status: 'warn',message: `${names.length} check(s) have no result from the last ${LAST_KNOWN_MAX_AGE_MS / 3_600_000} h (${old === stale.length ? 'their last results are too old' : old ? `${old} of ${stale.length} entries have only an older result, the rest were never measured` : 'never measured'}); their health is unknown, not clear.${queued} Measure them now with: ${argv.join(' ')}`,details: { health: 'unknown', reason: 'not_measured', exact: false, unknown_checks: names, ...(refreshJob ? { refresh_job: refreshJob.id } : {}) },- fix: { argv, consent: [], actor: 'user', requires_exclusive: false, why: 'Runs every standard check with no overall budget and records each result, so later fast runs report them; read-only, and it can take minutes on a large brain.' },+ fix: { argv, consent: [], actor: 'user', requires_exclusive: false, why: 'Runs every standard check with no overall budget and records each result, so later quick runs report them; read-only, and it can take minutes on a large brain.' },};}diff --git a/src/commands/doctor/registry.ts b/src/commands/doctor/registry.tsindex a5e25d543f..273586b589 100644--- a/src/commands/doctor/registry.ts+++ b/src/commands/doctor/registry.ts@@ -140,7 +140,7 @@ import {soakCountersEntry,schemaPackConsistencyEntry,} from './checks/ops-sections.ts';-import { STOP_DOCTOR, quickTier, type DoctorContext, type DoctorEntry, type DoctorTier } from './context.ts';+import { STOP_DOCTOR, cheapTier, type DoctorContext, type DoctorEntry, type DoctorTier } from './context.ts';import {BUDGET_EXPIRED, DoctorBudgetError, budgetExpired, type BudgetExpired, ENTRY_BUDGET_KEY, ENTRY_BUDGET_MS_DEFAULT, budgetUnknownCheck, entryRunsAt,isBudgetUnknown, opsNotApplicableCheck, raceBudget, startDeferredDeadline,@@ -379,7 +379,7 @@ export function runDoctorRegistry(ctx: DoctorContext, entries: readonly DoctorEnif (entryBudgetMs === null && ctx.engine && !ctx.fastMode && !ctx.connectionFailed && gateAt >= 0 && entries.indexOf(entry) > gateAt) {entryBudgetMs = await readEntryBudget(ctx);}- const overallOnly = quickTier(tier) || (!!ctx.only && ctx.deadline?.explicit === true);+ const overallOnly = cheapTier(tier) || (!!ctx.only && ctx.deadline?.explicit === true);const budgetMs = entryBudget(ctx, overallOnly, CONNECTION_LANE.has(entry) ? null : entryBudgetMs, started);const limit = budgetMs !== null && ctx.deadline?.deadlineAt != null && (overallOnly || entryBudgetMs === null || started + budgetMs >= ctx.deadline.deadlineAt) ? 'overall' : 'entry';if (budgetMs !== null && budgetMs <= 0) {diff --git a/src/core/behavior-change-notice.ts b/src/core/behavior-change-notice.tsindex f3dbaeb083..e0a8008e00 100644--- a/src/core/behavior-change-notice.ts+++ b/src/core/behavior-change-notice.ts@@ -1021,6 +1021,9 @@ export const BEHAVIOR_CHANGES: ReadonlyArray<{ since: string; text: ChangeText;{ since: '0.60.326.0', text: 'A write that ends `storage_error` on an unexpected database server error now keeps, owner-side in the receipt, the server message with any quoted value replaced by … (`error_text`; object names stay only in known catalog messages or when the statement names them), the failing statement with every literal, number and comment replaced and never its parameters (`statement`), and the error position; a PL/pgSQL RAISE or ASSERT keeps no text. On the brain host `gbrain write-request <id> --json` now prints the receipt\'s `error_detail`, and the persistence consumer log line adds `error_text=`, `statement=` and `position=`. Remote readers see no new field.' },// #7125 and #7117 (GBRA-145). `since` is restamped at the merge slot.{ since: '0.60.327.0', text: 'Fact extraction no longer rewrites the facts it stores: the prompt-injection filter used to delete words such as "System" before a parenthesis, so "Business System (ABS)" was saved as "Business [redacted](ABS)". Injection phrases are now neutralized only where stored facts are rendered into a model prompt (standing questions, turn context, proactive briefs). `gbrain doctor --only facts_redaction_marker` counts facts damaged earlier; `gbrain repair redacted-facts` previews what a source page can prove and changes nothing until you apply the printed `--apply --expect <hash>` command.' },+ { since: '0.60.327.0', text: '`gbrain doctor --tier quick` is the health gate for agents on large brains: the ops sections plus schema version, sync failures, queue health and partial embeddings under a 10 s deadline, with every other check reported from its last known result and its age (same status; `details.last_known`, `last_known_sections`). A brain-wide `gbrain doctor` run now records each check it finishes in `op_checkpoints` (op `doctor-last-known`), and a check that runs out of its budget reports that result instead of unknown while it is under 24 h old. Checks with no result that recent are named in one `doctor_last_known` warning, and a Postgres brain queues one background `doctor-refresh` job per hour to measure them (it needs a running jobs worker). `--only` and `--source` runs neither read nor record these results.' },+ { since: '0.60.327.0', text: '`gbrain doctor --only sync_failures` now connects the brain instead of reporting that durable sync state is unavailable. `sync_failures` ignores, and counts, local-ledger rows that no sync can retry or clear: rows on a source that is not registered, and rows whose file was deleted from its source after it failed. A process running under `bun test` (NODE_ENV=test) with neither GBRAIN_SYNC_FAILURES_DIR nor GBRAIN_HOME set writes a scratch sync-failure ledger instead of the real one.' },+ { since: '0.60.327.0', text: 'Behind a transaction-mode pooler, the "Prepared statements and statement pipelining disabled" banner prints once per database per gbrain home instead of on every call (`gbrain engine status` and doctor\'s `pgbouncer_prepare` still report it). A one-shot read command reads the config table once for its startup and once for the operation, and skips the retired managed-marker cleanup that only writes need.' },{ since: '0.60.327.0', text: 'The embed sweep that finds chunks whose text changed after they were embedded now runs in 5,000-chunk batches, keeps its place between runs (at most 60 seconds per run) and starts a new pass once a day (`embed.content_drift.pass_interval_hours`, default 24); before, one statement covered the whole brain and a large brain cancelled it on every run. `gbrain doctor --only content_drift_sweep` shows each pass and any error.' },];diff --git a/src/core/doctor-categories.ts b/src/core/doctor-categories.tsindex 6ce8815e28..dc4e0b2b95 100644--- a/src/core/doctor-categories.ts+++ b/src/core/doctor-categories.ts@@ -386,7 +386,7 @@ export const OPS_CHECK_NAMES: ReadonlySet<string> = new Set([export const META_CHECK_NAMES: ReadonlySet<string> = new Set([// The one-time behavior-change disclosure, readable again here (read-only).'behavior_changes',- // #7142: checks with no result from the last 24 h on a fast-tier or capped run (doctor/last-known.ts).+ // #7142: checks with no result from the last 24 h on a quick-tier or capped run (doctor/last-known.ts).'doctor_last_known',// Agent operator wave E11: recent agent dead ends from the agent-contract event log.'agent_contract',diff --git a/test/doctor-fast-tier-7142.test.ts b/test/doctor-quick-tier-7142.test.tssimilarity index 79%rename from test/doctor-fast-tier-7142.test.tsrename to test/doctor-quick-tier-7142.test.tsindex bad9651f53..13dee5d8fd 100644--- a/test/doctor-fast-tier-7142.test.ts+++ b/test/doctor-quick-tier-7142.test.ts@@ -1,23 +1,23 @@/*** #7142: on a large brain most doctor checks reported unknown at the 90 s non-interactive budget, every run.*- * - `--tier fast` runs only the ops and fast entries under a 10 s deadline and never a standard-only entry.+ * - `--tier quick` runs only the ops and quick entries under a 10 s deadline and never a standard-only entry.* - Every other check reports its last known result with its age (a recorded fail stays a fail); a check with no* result from the last 24 h is named, with the others like it, in one doctor_last_known warning, so the report is* never healthy or complete on it.* - A standard entry that runs out of its budget reports its fresh last known checks instead of an unknown.* - Only brain-wide runs read or write the results (`--only` and source-scoped runs do neither).* - The doctor-refresh job records every standard database entry and no filesystem entry, and queues nothing;- * a fast run on Postgres queues one refresh per hour for the entries it could not report.+ * a quick run on Postgres queues one refresh per hour for the entries it could not report.*- * Postgres arm: test/e2e/doctor-fast-tier-7142-postgres.test.ts.+ * Postgres arm: test/e2e/doctor-quick-tier-7142-postgres.test.ts.*/import { afterAll, beforeAll, describe, expect, test } from 'bun:test';import type { BrainEngine } from '../src/core/engine.ts';import { PGLiteEngine } from '../src/core/pglite-engine.ts';import { computeDoctorReport, type Check } from '../src/commands/doctor.ts';import { runDoctorRegistry, DOCTOR_CHECK_REGISTRY, doctorRefreshRegistry } from '../src/commands/doctor/registry.ts';-import { DOCTOR_TIERS, FAST_BUDGET_MS_DEFAULT, entryRunsAt, parseBudgetMs, startDoctorDeadline } from '../src/commands/doctor/budget.ts';+import { DOCTOR_TIERS, QUICK_BUDGET_MS_DEFAULT, entryRunsAt, parseBudgetMs, startDoctorDeadline } from '../src/commands/doctor/budget.ts';import { LAST_KNOWN_OP, REFRESH_JOB, runDoctorRefresh } from '../src/commands/doctor/last-known.ts';import { resolverHealthEntry } from '../src/commands/doctor/checks/skill-group.ts';import { graphCoverageEntry } from '../src/commands/doctor/checks/graph-health.ts';@@ -42,24 +42,24 @@ let standardRuns = 0;let slowStatus: Check['status'] = 'fail';let slowDelayMs = 0;const opsEntry: DoctorEntry = { name: 'ops_a', emits: ['ops_a'], tier: 'ops', run: async () => [ok('ops_a')] };-const fastEntry: DoctorEntry = { name: 'fast_a', emits: ['fast_a'], tier: 'fast', run: async () => [ok('fast_a')] };+const quickEntry: DoctorEntry = { name: 'quick_a', emits: ['quick_a'], tier: 'quick', run: async () => [ok('quick_a')] };const standardEntry: DoctorEntry = { name: 'slow_a', emits: ['slow_a', 'slow_b'], run: async () => {standardRuns++;if (slowDelayMs) await new Promise((r) => setTimeout(r, slowDelayMs));return [{ name: 'slow_a', status: slowStatus, message: 'two pages broke' }];} };-const entries = [opsEntry, fastEntry, standardEntry];+const entries = [opsEntry, quickEntry, standardEntry];const byName = (checks: Check[], name: string) => checks.find((c) => c.name === name);-test('the CLI accepts every tier and --tier fast defaults to a 10 s deadline', () => {+test('the CLI accepts every tier and --tier quick defaults to a 10 s deadline', () => {const tierFlag = help.flags?.find((f) => f.name === '--tier') as { values?: string[] } | undefined;expect(tierFlag?.values).toEqual([...DOCTOR_TIERS]);- expect(parseBudgetMs(['--tier', 'fast'], 'fast')).toBe(FAST_BUDGET_MS_DEFAULT);- expect([entryRunsAt('fast', 'fast'), entryRunsAt('ops', 'fast'), entryRunsAt(undefined, 'fast'), entryRunsAt('fast', 'standard'), entryRunsAt('fast', 'ops')]).toEqual([true, true, false, true, false]);+ expect(parseBudgetMs(['--tier', 'quick'], 'quick')).toBe(QUICK_BUDGET_MS_DEFAULT);+ expect([entryRunsAt('quick', 'quick'), entryRunsAt('ops', 'quick'), entryRunsAt(undefined, 'quick'), entryRunsAt('quick', 'standard'), entryRunsAt('quick', 'ops')]).toEqual([true, true, false, true, false]);});for (const kind of testBackends()) {- describe(`#7142 doctor fast tier and last known results (${kind})`, () => {+ describe(`#7142 doctor quick tier and last known results (${kind})`, () => {let engine: BrainEngine;let close: () => Promise<void> = async () => undefined;@@ -80,17 +80,17 @@ for (const kind of testBackends()) {const clear = () => engine.executeRaw('DELETE FROM op_checkpoints WHERE op = $1', [LAST_KNOWN_OP]);const recorded = async () => (await engine.executeRaw<{ fingerprint: string }>('SELECT fingerprint FROM op_checkpoints WHERE op = $1 ORDER BY fingerprint', [LAST_KNOWN_OP])).map((r) => r.fingerprint);- test('fast runs never run a standard entry; unmeasured checks are one unknown warning, then last known results with their status and age', async () => {+ test('quick runs never run a standard entry; unmeasured checks are one unknown warning, then last known results with their status and age', async () => {await clear();standardRuns = 0; slowStatus = 'fail'; slowDelayMs = 0;- const first = await runDoctorRegistry(ctxFor(engine, 'fast'), entries);+ const first = await runDoctorRegistry(ctxFor(engine, 'quick'), entries);expect(standardRuns).toBe(0);- expect(first.map((c) => c.name)).toEqual(['ops_a', 'fast_a', 'doctor_last_known']);+ expect(first.map((c) => c.name)).toEqual(['ops_a', 'quick_a', 'doctor_last_known']);const unmeasured = byName(first, 'doctor_last_known')!;expect(unmeasured.status).toBe('warn');expect(unmeasured.details).toMatchObject({ health: 'unknown', unknown_checks: ['slow_a', 'slow_b'] });expect(unmeasured.message).toContain('never measured');- const firstReport = computeDoctorReport(first, { run: { tier: 'fast', startedAt: Date.now(), budgetMs: FAST_BUDGET_MS_DEFAULT } });+ const firstReport = computeDoctorReport(first, { run: { tier: 'quick', startedAt: Date.now(), budgetMs: QUICK_BUDGET_MS_DEFAULT } });expect(firstReport.status).not.toBe('healthy');expect(firstReport.complete).toBe(false);expect(firstReport.unknown_sections).toEqual(['slow_a', 'slow_b']);@@ -98,22 +98,22 @@ for (const kind of testBackends()) {await runDoctorRegistry(ctxFor(engine, 'standard'), entries);expect(standardRuns).toBe(1);- expect(await recorded()).toEqual(['fast_a', 'ops_a', 'slow_a']);+ expect(await recorded()).toEqual(['ops_a', 'quick_a', 'slow_a']);- const second = await runDoctorRegistry(ctxFor(engine, 'fast'), entries);+ const second = await runDoctorRegistry(ctxFor(engine, 'quick'), entries);expect(standardRuns).toBe(1);const served = byName(second, 'slow_a')!;expect(served.status).toBe('fail');- expect(served.message).toMatch(/^Last known, under a minute ago \(not run by the fast tier\): two pages broke/);+ expect(served.message).toMatch(/^Last known, under a minute ago \(not run by the quick tier\): two pages broke/);expect(served.details?.last_known).toMatchObject({ reason: 'not_in_tier' });expect(byName(second, 'doctor_last_known')).toBeUndefined();- const secondReport = computeDoctorReport(second, { run: { tier: 'fast', startedAt: Date.now(), budgetMs: FAST_BUDGET_MS_DEFAULT } });+ const secondReport = computeDoctorReport(second, { run: { tier: 'quick', startedAt: Date.now(), budgetMs: QUICK_BUDGET_MS_DEFAULT } });expect(secondReport.status).toBe('unhealthy');expect(secondReport.complete).toBe(false);expect(secondReport.last_known_sections).toEqual(['slow_a']);await engine.executeRaw(`UPDATE op_checkpoints SET completed_keys = jsonb_set(completed_keys, '{0,measured_at}', '"2020-01-01T00:00:00.000Z"') WHERE op = $1`, [LAST_KNOWN_OP]);- const stale = await runDoctorRegistry(ctxFor(engine, 'fast'), entries);+ const stale = await runDoctorRegistry(ctxFor(engine, 'quick'), entries);expect(byName(stale, 'slow_a')).toBeUndefined();expect(byName(stale, 'doctor_last_known')!.message).toContain('their last results are too old');}, 60_000);@@ -138,7 +138,7 @@ for (const kind of testBackends()) {await runDoctorRegistry(ctxFor(engine, 'standard', { sourceIds: ['default'] }), entries);await runDoctorRegistry(ctxFor(engine, 'standard', { orphanRatioSourceId: 'default' }), entries);expect(await recorded()).toEqual([]);- const scoped = await runDoctorRegistry(ctxFor(engine, 'fast', { sourceIds: ['default'] }), entries);+ const scoped = await runDoctorRegistry(ctxFor(engine, 'quick', { sourceIds: ['default'] }), entries);expect(byName(scoped, 'doctor_last_known')).toBeUndefined();}, 60_000);@@ -157,11 +157,11 @@ for (const kind of testBackends()) {}, 180_000);if (kind === 'postgres') {- test('a fast run queues one background refresh per hour for the checks it could not report', async () => {+ test('a quick run queues one background refresh per hour for the checks it could not report', async () => {await clear();await engine.executeRaw('DELETE FROM minion_jobs WHERE name = $1', [REFRESH_JOB]);- const first = await runDoctorRegistry(ctxFor(engine, 'fast'), entries);- await runDoctorRegistry(ctxFor(engine, 'fast'), entries);+ const first = await runDoctorRegistry(ctxFor(engine, 'quick'), entries);+ await runDoctorRegistry(ctxFor(engine, 'quick'), entries);const jobs = await engine.executeRaw<{ id: number }>('SELECT id FROM minion_jobs WHERE name = $1', [REFRESH_JOB]);expect(jobs).toHaveLength(1);expect(byName(first, 'doctor_last_known')!.details?.refresh_job).toBe(Number(jobs[0]!.id));diff --git a/test/e2e/doctor-fast-tier-7142-postgres.test.ts b/test/e2e/doctor-fast-tier-7142-postgres.test.tsdeleted file mode 100644index 0f9fcc4f9e..0000000000--- a/test/e2e/doctor-fast-tier-7142-postgres.test.ts+++ /dev/null@@ -1,3 +0,0 @@-import { registerPostgresTests } from '../helpers/test-backends.ts';--await registerPostgresTests(() => import('../doctor-fast-tier-7142.test.ts'));diff --git a/test/e2e/doctor-quick-tier-7142-postgres.test.ts b/test/e2e/doctor-quick-tier-7142-postgres.test.tsnew file mode 100644index 0000000000..601db69b88--- /dev/null+++ b/test/e2e/doctor-quick-tier-7142-postgres.test.ts@@ -0,0 +1,3 @@+import { registerPostgresTests } from '../helpers/test-backends.ts';++await registerPostgresTests(() => import('../doctor-quick-tier-7142.test.ts'));