Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

fix: adversarial review fixes (no date in run_skillopt first sentence, notice just before the run, guide wording)

garrytan2a2231dcff4b
diff --git a/docs/TOOL_CATALOG.md b/docs/TOOL_CATALOG.md
index 88910c6894..f66f94c48b 100644
--- a/docs/TOOL_CATALOG.md
+++ b/docs/TOOL_CATALOG.md
@@ -20,7 +20,7 @@ Every non-localOnly operation on the MCP surface: 164 tools across 25 areas. **S
| `quarantine_list` | List quarantined (hidden) and optionally content-flagged pages by scanning page frontmatter, newest-updated first. | admin | | |
| `run_doctor` | Run brain health checks and return a structured DoctorReport (thin-client doctor surface). | admin | | |
| `run_onboard` | Probe brain health + optionally submit onboard remediations. | admin | | |
-| `run_skillopt` | Run SkillOpt against a single skill; its iterative loop (optimizer_mode "reflect") is deprecated and removed on or after 2026-12-03. | admin | | |
+| `run_skillopt` | Run SkillOpt against a single skill; its iterative loop (optimizer_mode "reflect") is deprecated. | admin | | |
## advisor
diff --git a/docs/guides/skillopt.md b/docs/guides/skillopt.md
index 09f2c012c1..4268f79160 100644
--- a/docs/guides/skillopt.md
+++ b/docs/guides/skillopt.md
@@ -12,7 +12,8 @@ May 2026).
> `optimizer_mode: "reflect"`, a `--resume` of a run the loop started and a
> queued `skillopt` job in loop mode are deprecated and will be removed on or
> after 2026-12-03. Each use prints the `skillopt_loop_deprecated` notice once
-> (MCP: once per session) and otherwise runs exactly as before. Nothing
+> (MCP: at most once per session; a queued job: in the worker's log) and
+> otherwise runs exactly as before. Nothing
> replaces the loop: edit the skill directly, or run the default
> [one-shot rewrite](#one-shot-rewrite-the-default), which stays.
@@ -74,15 +75,13 @@ The audit trail lives at `~/.gbrain/audit/skillopt-YYYY-Www.jsonl`
(2026-11-01), the iterative loop and a one-shot rewrite both scored 0.54 on
held-out tasks (paired bootstrap p = 1.00) and the loop cost about 1.8x as
much. Every edit the loop kept came at its first step. `--loop` (MCP and job
-`optimizer_mode: "reflect"`) still runs the iterative loop. This default is
-reversible: it flips back if gbrain-evals' SkillOpt method benchmark shows the
-loop winning. A resume continues in the mode its run started in.
+`optimizer_mode: "reflect"`) still runs the iterative loop until it is removed
+on or after 2026-12-03. A resume continues in the mode its run started in.
## How the loop works (`--loop`, deprecated)
Deprecated: removed on or after 2026-12-03 (see the banner at the top).
-
For each step:
1. **Forward pass.** Run the candidate skill against a batch from `D_train`.
diff --git a/src/core/behavior-change-notice.ts b/src/core/behavior-change-notice.ts
index 7f51f7db55..d97dda51ec 100644
--- a/src/core/behavior-change-notice.ts
+++ b/src/core/behavior-change-notice.ts
@@ -1420,7 +1420,7 @@ export const BEHAVIOR_CHANGES: ReadonlyArray<{ since: string; text: ChangeText;
// GBRA-200 (harness ask 6: stamp degraded replies). `since` is stamped at the merge slot.
{ since: '0.60.563.0', id: 'write_grant_refusal_gbra200', text: 'A `remember` naming a `source_id` outside the connection\'s write grant is still refused `scope_denied` (a page write: `permission_denied`), and the refusal now carries `writable_source_ids`: the sources the connection\'s own grant lets it write, never another source, identical whether the named source exists or not. On `remember` the `fix` repeats the call against that source once the user agrees (`next: ask_user`, naming both sources), so a harness can retry instead of giving up; `forget`, `forget_fact` and page writes carry no fix.' },
{ since: '0.60.563.0', id: 'degraded_stamp_gbra200', text: 'Every degraded or partial read result now carries one stamp naming why with stable codes: an MCP result gets `_meta.degraded: { reasons: [...] }` and one extra text block, `[gbrain degraded: <reasons>] ...`, after the others; a CLI `--json` object gets a `degraded` key, and other CLI output (human text, a bare `--json` array such as search results) gets that line on stderr. It covers search, query, recall, find_experts, context_pack, delta, entity, get_page (`file_held`), think and synthesize, search_exact, open_loops and rank_entities. recall and think no longer drop their page search\'s degraded stages (an embed timeout, a failed arm, the keyword rank bound): recall reports them in `_meta.retrieval.degraded` and its `degraded_recall` notice, think and synthesize as `GATHER_DEGRADED:<stage>` warnings, and a keyword-only search or recall on Postgres reports `keyword_candidates_incomplete` when the rank bound applies. A clean result carries no stamp, and no existing field changed.' },
- { since: '0.60.569.0', id: 'skillopt_loop_deprecated_gst1251', text: 'SkillOpt\'s iterative loop is deprecated and is removed on or after 2026-12-03: `gbrain skillopt` with its loop flag, a resumed run the loop started, `run_skillopt` with `optimizer_mode: "reflect"` and a queued `skillopt` job in loop mode (including one queued before the one-shot default, which carries no mode) each print the `skillopt_loop_deprecated` coaching notice once (MCP: once per session, muteable) and otherwise run exactly as before. The default one-shot rewrite, the cycle phase and every flag and config key are unchanged. Nothing replaces the loop: edit the skill directly, or run the default one-shot rewrite.' },
+ { since: '0.60.569.0', id: 'skillopt_loop_deprecated_gst1251', text: 'SkillOpt\'s iterative loop is deprecated and is removed on or after 2026-12-03: `gbrain skillopt` with its loop flag, a resumed run the loop started, `run_skillopt` with `optimizer_mode: "reflect"` and a a `skillopt` job in loop mode (including one queued before the one-shot default, which carries no mode; its notice goes to the worker\'s stderr) each print the `skillopt_loop_deprecated` coaching notice once (MCP: once per session, muteable) and otherwise run exactly as before. The default one-shot rewrite, the cycle phase and every flag and config key are unchanged. Nothing replaces the loop: edit the skill directly, or run the default one-shot rewrite.' },
];
/** The newest disclosed change's release: the notice id moves only when a release adds rows. */
diff --git a/src/core/operation-manifest.generated.ts b/src/core/operation-manifest.generated.ts
index fd6ca047e3..052ca48fe8 100644
--- a/src/core/operation-manifest.generated.ts
+++ b/src/core/operation-manifest.generated.ts
@@ -6818,7 +6818,7 @@ export const OPERATION_MANIFEST: OperationMeta[] = [
"outputRedaction": {
"exempt": "skill catalog files are installed instructions read verbatim; redaction would corrupt approved revisions"
},
- "description": "Run SkillOpt against a single skill; its iterative loop (optimizer_mode \"reflect\") is deprecated and removed on or after 2026-12-03. Admin scope and remote skill allowlist required. shared_skill stages an exact catalog revision privately and requires explicit skill_editor and put_skill grants; only accepted body changes publish through the original revision CAS. Rate-limited per-skill via DB lock.",
+ "description": "Run SkillOpt against a single skill; its iterative loop (optimizer_mode \"reflect\") is deprecated. Admin scope and remote skill allowlist required. shared_skill stages an exact catalog revision privately and requires explicit skill_editor and put_skill grants; only accepted body changes publish through the original revision CAS. Rate-limited per-skill via DB lock.",
"params": {
"skill_name": {
"type": "string",
diff --git a/src/core/ops/skillopt.ts b/src/core/ops/skillopt.ts
index bf72dc7fc0..6b60ef417c 100644
--- a/src/core/ops/skillopt.ts
+++ b/src/core/ops/skillopt.ts
@@ -132,7 +132,7 @@ const run_skillopt: Operation = {
name: 'run_skillopt',
idempotent: true,
outputRedaction: { exempt: 'skill catalog files are installed instructions read verbatim; redaction would corrupt approved revisions' },
- description: 'Run SkillOpt against a single skill; its iterative loop (optimizer_mode "reflect") is deprecated and removed on or after 2026-12-03. Admin scope and remote skill allowlist required. shared_skill stages an exact catalog revision privately and requires explicit skill_editor and put_skill grants; only accepted body changes publish through the original revision CAS. Rate-limited per-skill via DB lock.',
+ description: 'Run SkillOpt against a single skill; its iterative loop (optimizer_mode "reflect") is deprecated. Admin scope and remote skill allowlist required. shared_skill stages an exact catalog revision privately and requires explicit skill_editor and put_skill grants; only accepted body changes publish through the original revision CAS. Rate-limited per-skill via DB lock.',
params: {
skill_name: { type: 'string', required: true, description: 'Kebab-case skill name (resolves to skills/<name>/SKILL.md)' },
benchmark_path: { type: 'string', description: 'Absolute path to benchmark JSONL; defaults to skills/<name>/skillopt-benchmark.jsonl' },
@@ -193,7 +193,6 @@ const run_skillopt: Operation = {
if (optimizerMode !== 'one-shot-rewrite' && optimizerMode !== 'reflect') {
throw invalidParam(ctx, 'run_skillopt', 'optimizer_mode', "run_skillopt: optimizer_mode must be 'one-shot-rewrite' or 'reflect'", { example: 'reflect' });
}
- if (optimizerMode === 'reflect') ctx.emitNotice?.((await import('../skillopt/loop-deprecation.ts')).skillOptLoopDeprecatedNotice());
const { clampRemoteReflectMaxTokens } = await import('../skillopt/output-cap.ts');
let reflectMaxTokens: number | undefined;
try {
@@ -261,6 +260,7 @@ const run_skillopt: Operation = {
confine('benchmark_path', p.benchmark_path as string | undefined);
confine('held_out_path', heldOutPath);
}
+ if (optimizerMode === 'reflect') ctx.emitNotice?.((await import('../skillopt/loop-deprecation.ts')).skillOptLoopDeprecatedNotice());
const result = await runSkillOpt({
engine: ctx.engine,
operationContext: ctx,
diff --git a/test/fixtures/goldens/cli/tools-json.json b/test/fixtures/goldens/cli/tools-json.json
index cb4ee5109b..0903800254 100644
--- a/test/fixtures/goldens/cli/tools-json.json
+++ b/test/fixtures/goldens/cli/tools-json.json
@@ -2,8 +2,8 @@
"golden": {
"exitCode": 0,
"stderr": "",
- "stdoutBytes": 269897,
- "stdoutSha256": "39204fde48293f94039ada247d1125d6da50aa1adff8cbdf6dd434b5c9bc6959",
+ "stdoutBytes": 269862,
+ "stdoutSha256": "572b0651eccad5f6985053264f93a5c88014f50c0e243145dae36e74a73c735c",
"toolNames": [
"remember",
"entity",
@@ -7907,7 +7907,7 @@
"scope": "admin"
},
{
- "description": "Run SkillOpt against a single skill; its iterative loop (optimizer_mode \"reflect\") is deprecated and removed on or after 2026-12-03. Admin scope and remote skill allowlist required. shared_skill stages an exact catalog revision privately and requires explicit skill_editor and put_skill grants; only accepted body changes publish through the original revision CAS. Rate-limited per-skill via DB lock.",
+ "description": "Run SkillOpt against a single skill; its iterative loop (optimizer_mode \"reflect\") is deprecated. Admin scope and remote skill allowlist required. shared_skill stages an exact catalog revision privately and requires explicit skill_editor and put_skill grants; only accepted body changes publish through the original revision CAS. Rate-limited per-skill via DB lock.",
"idempotent": true,
"local_only": false,
"mutating": true,