Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
train T: the opt-in autopilot install suggestion never pages doctor --alert
garrytan21009c577c1a
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 4ca2ab032d..e211344226 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -40,7 +40,7 @@ gbrain publishes a release for nearly every merged change, more than a hundred a### For operators- Install commands still name `latest-stable`; every install surface goes through `src/core/install-ref.ts` (checked by `bun run check:install-ref`) and moves to `stable` after a release with this change has been promoted.-- The page class (`PAGE_CHECK_LEVELS`): connection, migrations, write failures and stalls, build skew, managed sync stopped, maintenance stalled, corrupt JSONB rows, RLS exposure, the paid-loop breaker, `dream_write_deferred` and `embedding_restamp_stalled`. Every doctor report carries `alert`; `health_score`, `brain_checks_score`, `category_scores` and `status` are unchanged. Cron recipe and exit codes: `docs/guides/troubleshooting.md`.+- The page class (`PAGE_CHECK_LEVELS`): connection, migrations, write failures and stalls, build skew, managed sync stopped, maintenance stalled, corrupt JSONB rows, RLS exposure, the paid-loop breaker, `dream_write_deferred` and `embedding_restamp_stalled`; the opt-in autopilot install suggestion that `minions_migration` shows after an upgrade never pages. Every doctor report carries `alert`; `health_score`, `brain_checks_score`, `category_scores` and `status` are unchanged. Cron recipe and exit codes: `docs/guides/troubleshooting.md`.- New switches, on by default: `dream.write_deferral.enabled` and `embed.restamp.enabled`; `false` restores the old behavior. Every heal writes a row to the `heal.audit` config record (last 200 rows, 30 days). Nothing heals on upgrade, and repo-less brains get the same behavior.- The upgrade matrix runs nightly against the newest release, opens one `upgrade-break` issue on a red run and closes it on a green one; `gh workflow run upgrade-matrix.yml -f candidate=<tag>` runs it on demand, and pull requests touching migrations, the schema or the updater run a subset. Upgrading a v0.59.2.0 brain now passes the preservation check (#7814), so the matrix carries no known exceptions. Details: `docs/ci-upgrade-matrix.md`.- INSTALL_FOR_AGENTS.md has one **Opt-ins** list (keys and embeddings, autopilot, dream schedule, connectors, auto-upgrade, release channel), and `gbrain setup <harness>` prints one line pointing to it. The default keyless install starts no daemon, writes no service, connects nothing and keeps self-upgrade in `notify` mode, now locked by `test/boring-default.test.ts`.diff --git a/docs/guides/troubleshooting.md b/docs/guides/troubleshooting.mdindex ce2c7d5f20..71e0830c64 100644--- a/docs/guides/troubleshooting.md+++ b/docs/guides/troubleshooting.md@@ -758,7 +758,7 @@ other check, skill checks included, never pages:| Condition | Check | Pages on ||---|---|---|| database unreachable | `connection` | fail |-| migrations pending or wedged | `schema_version`, `minions_migration` | warn |+| migrations pending or wedged (not the opt-in autopilot install suggestion) | `schema_version`, `minions_migration` | warn || tables the applied migrations created hold user data and are missing | `schema_missing_tables` | fail || writes failing | `persistence_terminal_failures` | warn || writes wedged | `persistence_write_stall` | warn |diff --git a/llms-full.txt b/llms-full.txtindex a635aa94d0..7c82b401ae 100644--- a/llms-full.txt+++ b/llms-full.txt@@ -10698,7 +10698,7 @@ other check, skill checks included, never pages:| Condition | Check | Pages on ||---|---|---|| database unreachable | `connection` | fail |-| migrations pending or wedged | `schema_version`, `minions_migration` | warn |+| migrations pending or wedged (not the opt-in autopilot install suggestion) | `schema_version`, `minions_migration` | warn || tables the applied migrations created hold user data and are missing | `schema_missing_tables` | fail || writes failing | `persistence_terminal_failures` | warn || writes wedged | `persistence_write_stall` | warn |diff --git a/src/commands/doctor/alert.ts b/src/commands/doctor/alert.tsindex fd2cbf0120..6a06539eb5 100644--- a/src/commands/doctor/alert.ts+++ b/src/commands/doctor/alert.ts@@ -103,8 +103,9 @@ function unknownReason(c: Check): AlertUnknownReason | null {return null;}+/** An advisory warning (details.advisory, e.g. the opt-in autopilot install suggestion) never pages; a failure always does. */function pages(c: Check): boolean {- return c.status === 'fail' || (c.status === 'warn' && PAGE_CHECK_LEVELS.get(c.name) === 'warn');+ return c.status === 'fail' || (c.status === 'warn' && PAGE_CHECK_LEVELS.get(c.name) === 'warn' && c.details?.advisory !== true);}function isRendered(fix: Check['fix']): fix is RenderedAction {diff --git a/src/commands/doctor/checks/autopilot-install-pending.ts b/src/commands/doctor/checks/autopilot-install-pending.tsindex 5e992b78e2..a4edbb7bcc 100644--- a/src/commands/doctor/checks/autopilot-install-pending.ts+++ b/src/commands/doctor/checks/autopilot-install-pending.ts@@ -21,6 +21,6 @@ export function autopilotInstallPendingCheck(): Check | null {fix: agentFix(todo.install_argv,'Installs the background maintenance daemon (sync, extract, embed) for this brain repo under the host supervisor; a persistent install, so ask the user first.','minions_migration', { consent: ['persistent_install'], ...(inputs ? { inputs } : {}) }),- details: { pending_host_work: todo },+ details: { pending_host_work: todo, advisory: true },};}diff --git a/test/doctor-alert-w4.test.ts b/test/doctor-alert-w4.test.tsindex 3f5d1d28d1..79836a3bc6 100644--- a/test/doctor-alert-w4.test.ts+++ b/test/doctor-alert-w4.test.ts@@ -49,6 +49,29 @@ describe('alert verdict per page-class check', () => {});}+ test('the opt-in autopilot install suggestion (an advisory minions_migration warning) does not page', async () => {+ const { autopilotInstallPendingCheck } = await import('../src/commands/doctor/checks/autopilot-install-pending.ts');+ const { mkdtempSync, mkdirSync, writeFileSync, rmSync } = await import('node:fs');+ const { tmpdir } = await import('node:os');+ const home = mkdtempSync(join(tmpdir(), 'alert-advisory-'));+ const prev = process.env.GBRAIN_HOME;+ process.env.GBRAIN_HOME = home;+ try {+ mkdirSync(join(home, '.gbrain', 'migrations'), { recursive: true });+ writeFileSync(join(home, '.gbrain', 'migrations', 'pending-host-work.jsonl'), JSON.stringify({ type: 'autopilot-install-needs-repo', status: 'pending', detected_at: '2026-10-31T00:00:00.000Z', repo: '/tmp/brain-example', install_argv: ['gbrain', 'autopilot', '--install', '--yes', '--repo', '/tmp/brain-example'], recommendation: 'opt-in' }) + '\n');+ const suggestion = autopilotInstallPendingCheck();+ expect(suggestion?.name).toBe('minions_migration');+ expect(suggestion?.status).toBe('warn');+ const checks = [...healthy(), suggestion!];+ expect(computeDoctorReport(checks, { alertRan: ALL }).alert!.level).toBe('none');+ const pending = [...checks, { name: 'minions_migration', status: 'warn' as const, message: '1 host migration(s) not run yet' }];+ expect(computeDoctorReport(pending, { alertRan: ALL }).alert!.level).toBe('act');+ } finally {+ if (prev === undefined) delete process.env.GBRAIN_HOME; else process.env.GBRAIN_HOME = prev;+ rmSync(home, { recursive: true, force: true });+ }+ });+test('a stable details.code is the item code, and details.docs its docs', () => {const checks = healthy().map((c) => c.name === 'global_maintenance_stalled'? { ...c, status: 'fail' as const, details: { code: 'global_maintenance_stalled', docs: 'docs/guides/troubleshooting.md#global-maintenance-stalled' } } : c);