Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
Merge remote-tracking branch 'origin/master' into capy/deprecate-skillopts-iterative
garrytan9111c45dd47d
diff --cc CHANGELOG.mdindex d85ab1461b,57da3ef4b1..1224ce5bdd--- a/CHANGELOG.md+++ b/CHANGELOG.md@@@ -10,17 -10,39 +10,50 @@@ credits are retained; no result has beeidentifiers and attribution are available in the pre-removal Git revision`6040075c6cb95be5881cc2e1b76ef7d71f4e5d29` (retained on 2026-09-23).+## [Unreleased]++**SkillOpt's iterative loop is deprecated and will be removed on or after 2026-12-03.** The loop tied a single rewrite on gbrain-evals' benchmarks at about 1.8 times the cost, and every edit it kept came from its first step, so it is being retired. `gbrain skillopt --loop`, a `--resume` of a run the loop started, `run_skillopt` with `optimizer_mode: "reflect"` and a queued `skillopt` job in loop mode now print the `skillopt_loop_deprecated` coaching notice once (over MCP, once per session) and otherwise run exactly as before. Nothing replaces the loop: edit the skill directly, or run the default one-shot rewrite, which stays. Nothing is removed and no default changes in this release.++### Itemized changes++- `src/core/skillopt/loop-deprecation.ts` (new): the notice text, the removal date and the one emitter, called by `gbrain skillopt` (after it resolves the mode, so a resumed loop run counts), the `run_skillopt` op (`ctx.emitNotice`, so MCP and `gbrain call` render it) and the `skillopt` job handler. `skillopt_loop_deprecated` is a new coaching code in `NOTICE_CODES`.+- `gbrain skillopt --help`, the `run_skillopt` description and its `optimizer_mode` parameter, docs/guides/skillopt.md, the tutorial and the `skill-optimizer` skill mark the loop deprecated.+- Ship policy: `.gstack/ship-policy.json` declares `stamp_placeholders: ["TBD"]` (and `min_gstack_version` 1.94.16.0, the first gstack that reads it), so a branch's own `since: 'TBD'` BEHAVIOR_CHANGES row that the slot restamp fills reads as a stamp instead of a change after /ship's review.+- `test/skillopt/loop-deprecation.serial.test.ts`: each entry point that runs the loop emits the notice exactly once and still runs it; the one-shot default, a one-shot job and the cycle phase emit none.++ ## [0.60.568.0] - 2026-11-03++ **A brain opened from settings keeps its files in its own store.** On an engine opened from settings, every file operation (`file_upload`, `file_url`, page purge and the new `file_verify`) uses the engine's own `settings.storage`: a local path, or s3 with its endpoint and keys, and an optional one-segment key `prefix` so brains sharing a bucket each keep their own keys. The process storage config is never used there. `file_verify` lists which rows still have their object or re-hashes one. A brain the CLI or a server opens is unchanged, and there `file_verify` refuses `embedded_engine_required`; it is never an MCP tool. `file_register`, which lets a host record bytes it stored itself, ships separately. Contributed by @bradgessler (#8457).++ ### Itemized changes++ - `src/core/storage/s3.ts`: `file_url` on an s3 store with an endpoint builds the URL from the endpoint the SDK resolves, instead of throwing.+ - A store that does not answer `file_verify` or `file_url` is the new `store_unavailable` code, never a file reported missing.+ - On an engine opened from settings, `delete_page` purge deletes a page's files from `settings.storage` too. A file it can't find there, or a store that doesn't answer, is reported in `blobs_remaining`, never as deleted; files an embedded engine's `file_upload` wrote before this release live in the process store, so delete those remaining paths by hand. Rows an embedded engine's `file_upload` wrote before this release point at the process store, so `file_url` and `file_verify` look for them in `settings.storage`.+ - `openEngine` refuses `engine_settings_invalid` for a `storage` setting missing a value its backend needs (so no backend falls back to a default path or environment credentials), an unknown field, a backend other than local or s3, or a prefix that is not one segment; an s3 store must name its endpoint, so no AWS_* variable or ~/.aws file picks it; `embeddedSettings()` reads back `hasSecret` instead of the secret.+ - `src/core/storage/local.ts` and `s3.ts` stream an object's size and SHA-256 (`hashObject`); other backends hash one download.+ - `test/embedded-file-store.test.ts`: real PGLite engines and a real local store; the unreachable store is a closed local port.++ ## [0.60.567.0] - 2026-11-03++ **/ship now carries its unit, serial, slow and E2E lanes from a passed full-ci run instead of running them again.** `.gstack/pregate.json` declares `ship_lanes_from` (gstack 1.94+): `bun run test`, `bun run test:serial`, `bun run test:slow` and `bun run test:e2e` carry from the Test (`full-suite`) and E2E (`e2e-full-suite`) runs at the exact, clean tree, and print `LANE: <label> carried run=<id>/<attempt>`. A dirty tree, a newer red or running run, or a run whose `tree.json` misses a file the lane runs still runs the lane locally. Each lane's file list comes from `scripts/pregate-remote-gate.sh --list` on the full gate, so a tree that changes the CI reuse files never carries its own runs.++ ### Itemized changes++ - `.gstack/pregate.json`: `ship_lanes_from` maps the four lane commands to the `test` and `e2e` run profiles. The E2E lane names both, because test.yml's reconciliation job runs two `test/e2e/` files. `bun run verify` and `bun run typecheck` still run locally: `tree.json` records test files only.+ - `.gstack/ship-policy.json`: `min_gstack_version` is 1.94.4.0. A gstack below 1.94.0.0 rejects `ship_lanes_from` as an unknown key.+ - `docs/ci-event-parity.md#ship-lanes` lists the exact lane commands and the carry conditions; AGENTS.md and CONTRIBUTING.md point /ship at it. `test/scripts/pregate-remote-gate.test.ts` keeps the table and the config in step.+ - Nightly shard weights refreshed (2026-11-03).++ ## [0.60.566.0] - 2026-11-03++ **Two installs at once no longer drop each other's instruction-ledger entry, and a Codex skills opt-out reaches the file Codex used before.** Every install lane reads the brain-first ledger (`~/.gbrain/agent-instructions.json`) or the skill-loading ledger, edits the instruction file and rewrites the ledger. Two installs at once (say `setup claude-code` and `setup codex`) could each read the ledger before the other wrote it, and one entry was lost; a later opt-out then left that block, and its Claude Code allow rule, in place. Each install now holds one shared lock for the whole step, and the second waits for the first. Separately, Codex loads `AGENTS.override.md` when it is non-empty and `AGENTS.md` otherwise, so an explicit skills opt-out made after the override appeared left the index in `AGENTS.md`, where it came back once the override was removed.++ ### Itemized changes++ - The brain-first and skill-loading ledgers share one lock (`~/.gbrain/agent-instructions.lock`), held across each install step: the ledger read, the file edit, the Claude Code permission edit and the ledger write (#8484). An install that waited reads the recorded choice again under the lock, so an opt-out the other install just recorded stays in force. An install that cannot take it within 10 seconds, or cannot create it, changes nothing and reports why (the skills outcome's reason is `ledger_locked`). A dry run takes no lock.+ - `gbrain setup codex --skill-loading off`, `--no-instructions` and `GBRAIN_SKILL_LOADING=off` also strip a spring index gbrain recorded in the other global instruction file of the same `CODEX_HOME` (`AGENTS.md` or `AGENTS.override.md`), and report it as a second skills line in the plain output (`paired` in `--json`), in `--dry-run` too (#8485). A plain re-run strips it only when brain-first instructions are declined on record for that Codex home, and no other Codex home, OpenClaw workspace or Claude profile is touched.+## [0.60.565.0] - 2026-11-03**The per-file index describes how pages stored in segments are written and held.** The key-files entries for `write-through.ts` and `sync-entry-fault.ts` contradicted v0.60.560.0: the first said every page is rendered whole and `content` always holds the bytes written, and the second said a page-body fault at the freeze stops the run. They now describe the streamed write of a segmented page (measured at its snapshot's revision, checked against the scan cap before `source_path` binds, `inlineOnly` and `segmented_page`) and the `page_write_failed` hold that names `page_body_segmented` or `page_body_rows_unreadable`. The entries for full sync, `sync status`, the derived write-through and export also name `reexport_failures`, `last_error.request_id: null`, the `freeze_page_body_*` routing, the derived writer's `segmented_page` skip and the export's revision pin. Docs only.diff --cc CONTRIBUTING.mdindex ea14fc7e47,5211dba08d..cef9a3db1b--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@@ -732,11 -735,8 +735,12 @@@ gstack reads both from master, so a bra- `.gstack/ship-policy.json`: the stamp rule (the release stamp files andversion patterns) and the migration numbering `gstack-pregate regate` and`gstack-tree-receipt` use to decide whether a restamped head is the same tree- that passed the gate, plus `min_gstack_version` (1.94.4.0; 1.94.0.0 is the first gstack that- reads `ship_lanes_from`; an older one refuses with an upgrade fix).+ that passed the gate, plus `min_gstack_version` (1.94.16.0, the first gstack- that reads `stamp_placeholders`; an older one refuses with an upgrade fix).++ that reads `stamp_placeholders`; 1.94.0.0 is the first that reads++ `ship_lanes_from`; an older one refuses with an upgrade fix).+ `stamp_placeholders: ["TBD"]` lets a branch's own `since: 'TBD'` row become+ `since: '<version>'` at the slot and still count as a stamp, so /ship's+ finish step does not read the restamp as a change made after review.### How a contributor PR landsdiff --cc scripts/serial-weights.jsonindex bf4e4ba592,fd540e27d7..5bfe6cdf1c--- a/scripts/serial-weights.json+++ b/scripts/serial-weights.json@@@ -398,11 -399,10 +399,11 @@@"test/shared-skills-inventory-park.serial.test.ts": 28,"test/shared-skills-migration-cli.serial.test.ts": 29,"test/shared-skills-optimizer.serial.test.ts": 25,- "test/shared-skills-restore.serial.test.ts": 27,- "test/skillopt/cycle-phase-caps.serial.test.ts": 4,+ "test/shared-skills-restore.serial.test.ts": 33,+ "test/skillopt/cycle-phase-caps.serial.test.ts": 3,+ "test/skillopt/loop-deprecation.serial.test.ts": 3,"test/skillopt/models-four-paths.serial.test.ts": 4,- "test/skillopt/models-plan.serial.test.ts": 3,+ "test/skillopt/models-plan.serial.test.ts": 2,"test/skillopt/run-skillopt-op.serial.test.ts": 3,"test/sources-push-cli.serial.test.ts": 7,"test/spawn-seam-batch1-4992.serial.test.ts": 0,diff --cc test/fixtures/goldens/cli/tools-json.jsonindex b309b57906,25383b2eac..cb4ee5109b--- a/test/fixtures/goldens/cli/tools-json.json+++ b/test/fixtures/goldens/cli/tools-json.json@@@ -2,8 -2,8 +2,8 @@@"golden": {"exitCode": 0,"stderr": "",- "stdoutBytes": 268935,- "stdoutSha256": "c93966124678ecbf3623a199aeebea8b5eac5e8d990bd4c9622531affc20a7bc",- "stdoutBytes": 269760,- "stdoutSha256": "dd3dc10529f90a617d4ddfde2eaffd90fe3892a5d23ffe0f6457aa9557e5babb",++ "stdoutBytes": 269897,++ "stdoutSha256": "39204fde48293f94039ada247d1125d6da50aa1adff8cbdf6dd434b5c9bc6959","toolNames": ["remember","entity",