Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
fix(onboard): manual-only skip fixes verify with read-only commands (#6248)
time-attackde2f48cc033d
diff --git a/INSTALL_FOR_AGENTS.md b/INSTALL_FOR_AGENTS.mdindex 1253d9cf77..960e79318f 100644--- a/INSTALL_FOR_AGENTS.md+++ b/INSTALL_FOR_AGENTS.md@@ -630,7 +630,7 @@ gbrain onboard --check --jsonThe JSON envelope (`schema_version: 1`) carries `recommendations[]` with`apply_policy` per item: `auto_apply` (safe to run unattended),`prompt_required` (needs explicit user consent), or `manual_only`-(the schema-pack upgrade or the paid takes bootstrap; the user runs it).+(pack upgrade, paid takes bootstrap: the user runs it).**After every `gbrain upgrade`:**```bash@@ -644,11 +644,10 @@ step regardless.```bashgbrain onboard --auto --max-usd 5```-Refuses without `--max-usd N`. Never runs a `manual_only` item: the-result lists each under `manual_only_skipped` with the command for the-user to run (`fix.next` is `tell_user_to_run`). The-autopilot daemon also consults onboard recommendations on its tick — no-explicit agent action needed for the autonomous path.+Refuses without `--max-usd N`. Never runs `manual_only` items; it+lists them in `manual_only_skipped`. The autopilot daemon also consults+onboard recommendations on its tick — no explicit agent action needed+for the autonomous path.**Remote / federated brain installs (MCP):**The `run_onboard` MCP op (admin scope) lets thin-client agents probediff --git a/src/core/error-registry.ts b/src/core/error-registry.tsindex 2d44c7d2c7..675e298036 100644--- a/src/core/error-registry.ts+++ b/src/core/error-registry.ts@@ -222,7 +222,7 @@ export const CODES = {lock_busy: { class: 'retryable', summary: "Another process holds the lock this command needs." },maintenance_lock_busy: { class: 'retryable', summary: "A source-scoped dream cycle skipped its brain-wide phases because another cycle (usually autopilot maintenance) holds the shared gbrain-cycle lease; its source phases still ran.", why: 'Brain-wide phases (synthesize, patterns, embed, purge and the other mixed or global phases) must not run twice at once, so a cycle that cannot take gbrain-cycle runs only the phases its own source lease covers.', docs: 'docs/guides/cron-schedule.md#dream-beside-autopilot', suggestion: 'Nothing is lost: the holder runs those phases itself. To run one now, wait until the lease is released, then re-run `gbrain dream --phase <phase>` (LLM-backed phases spend; ask the user first).', fix: { argv: ['gbrain', 'status', '--section', 'locks', '--json'], consent: [], actor: 'agent', why: 'Shows who holds gbrain-cycle and when its lease expires, read-only.', requires_exclusive: false } },managed_pull_skipped: { class: 'retryable', summary: "The managed pull was skipped." },- manual_only_skipped: { class: 'consent', summary: "An automatic remediation run (`gbrain onboard --auto`, `doctor --remediate`, MCP `run_onboard`, autopilot) did not submit a manual-only step: the schema-pack upgrade (`unify-types`) or the paid takes bootstrap (`extract-takes-from-pages`).", why: "A pack upgrade retypes pages and switches the brain's schema pack, and the takes bootstrap pays a model per page; both are the user's one-time decision, so only the user submits them. A job of that kind an earlier run already queued is listed in `queued_jobs` and still runs unless cancelled.", actor: 'user', suggestion: 'Show the user the step and its `fix.command` (`gbrain jobs submit <job> --follow`, with `--params` when the step has them); the user runs it after reviewing `gbrain onboard --check`. Cancel a listed queued job with `gbrain jobs cancel <id>` if the user does not want it.', fix: { argv: ['gbrain', 'onboard', '--check', '--json'], consent: [], actor: 'agent', requires_exclusive: false, why: 'Lists the plan with each step\'s apply policy; manual-only steps are labeled manual_only.' } },+ manual_only_skipped: { class: 'consent', summary: "An automatic remediation run (`gbrain onboard --auto`, `doctor --remediate`, MCP `run_onboard`, autopilot) did not submit a manual-only step: the schema-pack upgrade (`unify-types`) or the paid takes bootstrap (`extract-takes-from-pages`).", why: "A pack upgrade retypes pages and switches the brain's schema pack, and the takes bootstrap pays a model per page; both are the user's one-time decision, so only the user submits them. A job of that kind an earlier run already queued is listed in `queued_jobs` and still runs unless cancelled.", actor: 'user', suggestion: 'Show the user the step and its `fix.command` (`gbrain jobs submit <job> --follow`, with `--params` when the step has them); the user runs it after reviewing `gbrain onboard --check`. Cancel a listed queued job with `gbrain jobs cancel <id>` if the user does not want it.', fix: { argv: ['gbrain', 'jobs', 'list', '--status', 'waiting'], consent: [], actor: 'agent', requires_exclusive: false, why: 'Lists queued jobs, including any manual-only job an earlier run queued.' } },membership_inactive: { class: 'caller', summary: "The shared-skills enrollment epoch was left or superseded.", docs: 'docs/guides/shared-brain-skills.md#membership-inactive-after-a-re-enrollment' },membership_not_found: { class: 'caller', summary: "This principal has no shared-skills membership with that installation id.", docs: 'docs/guides/shared-brain-skills.md#troubleshoot-leave-and-recover' },method_not_allowed: { class: 'caller', summary: "The HTTP method is not allowed on this endpoint." },diff --git a/src/core/remediation/manual-only.ts b/src/core/remediation/manual-only.tsindex 0930b9a40a..90699c498f 100644--- a/src/core/remediation/manual-only.ts+++ b/src/core/remediation/manual-only.ts@@ -34,7 +34,7 @@ export function manualOnlyFix(step: Pick<RemediationStep, 'job' | 'params' | 'esactor: 'user',why: `${step.job} is manual-only: automatic runs never submit it, so it runs only when the user submits it${paid ? `; it calls the model provider and costs money${cost}` : ''}.`,user_message: `The ${step.job} step was not run automatically. Review it (gbrain onboard --check), then run the command yourself if you want it.`,- verify: { argv: ['gbrain', 'onboard', '--check', '--json'] },+ verify: { argv: ['gbrain', 'doctor', '--only', 'brain_score', '--json'] },requires_exclusive: false,};}diff --git a/test/remediation-manual-only.test.ts b/test/remediation-manual-only.test.tsindex 3d52eb8f73..b2d3725a9f 100644--- a/test/remediation-manual-only.test.ts+++ b/test/remediation-manual-only.test.ts@@ -111,7 +111,7 @@ describe('runRemediation never submits a manual-only step', () => {code: 'manual_only_skipped', id: 'onboard.pack_upgrade_example', job: 'unify-types', params: { target_pack: 'example-pack', apply: true },fix: {argv: ['gbrain', 'jobs', 'submit', 'unify-types', '--params', '{"target_pack":"example-pack","apply":true}', '--follow'],- consent: [], actor: 'user', next: 'tell_user_to_run', verify: { argv: ['gbrain', 'onboard', '--check', '--json'] },+ consent: [], actor: 'user', next: 'tell_user_to_run', verify: { argv: ['gbrain', 'doctor', '--only', 'brain_score', '--json'] },},});expect(takes).toMatchObject({