Garry's Opinionated OpenClaw/Hermes Agent Brain
Upgrade to v0.60.102.0: malformed facts and takes fences repair themselves
Since v0.60.98.0 a facts or takes fence gbrain cannot import is held
instead of blocking a sync, and since v0.60.99.0 a fence with one exact
meaning is rewritten in the same write. This release repairs the rest: the
maintenance run's new fence_repair phase repairs held files and stored pages
by itself, and gbrain repair fences previews and applies the same repair on
demand. No schema migration.
The repairs need no extra consent, but they rewrite the user's files: tell the user what the first maintenance run will change (step 2) before it runs, and leave spend decisions to them (step 3).
Finish the upgrade.
gbrain upgraderuns it. To be sure, on the brain host:gbrain apply-migrations --yes --no-autopilot-installNo schema migration and no rows are rewritten by the upgrade itself. Restart every
gbrain serve, autopilot and worker so the maintenance run picks up thefence_repairphase.Tell the user what the first maintenance run rewrites. The first maintenance run after the upgrade repairs every malformed fence it finds across each source (held files, stored pages and checkout files not yet synced), rewriting those files and committing each one (a legacy source's files are backed up and left for the user to commit). Show the user the count and the plan first:
gbrain doctor --only fence_integrity # malformed fences per source, by the tier that fixes them gbrain repair fences --source <id> # preview: read-only, no model callIf the user wants to review before anything is rewritten, pause the automatic repair first:
gbrain config set fences.repair.enabled falseThen apply what they approve with the preview's printed
gbrain repair fences --source <id> --apply --expect <hash>(select files with--only/--skip, stored pages with--slug), and resume withgbrain config set fences.repair.enabled true. Syncs and writes keep rewriting fixable fences inline either way;gbrain config set fences.normalize falsemakes them hold such a fence instead.Spend and what leaves the machine. Most repairs are free rules. A fence only a rewrite can realign goes to the repair model: only the fence header and the rows it must realign are sent, never valid rows and never the rest of the page, and the model answers HOLD instead of guessing when a row has two readings. With
models.fence_repairunset, the repair model is the first model the fence-repair eval measured as accurate enough whose provider key the brain has:openai:gpt-6.1-sol(OpenAI key), elseanthropic:claude-opus-5-5(Anthropic key). With neither key, model repair stays off and those fences wait asno_measured_model; which model to trust is the user's call (gbrain config set models.fence_repair <provider:model>; a model set there always runs). Spend is capped at $0.30 per page (fences.repair.max_usd_per_page) and $1.00 per UTC day (fences.repair.max_usd_per_day) across every process, through a durable ledger; each call reserves its worst case (the prompt plus the full output ceiling, with room for a reasoning model to think) and settles what it really cost. A repair model gbrain has no price for still runs under these default caps, metered at an estimated ceiling (the highest chat rate gbrain knows); under a cap the user set it waits until its price is registered withgbrain pricing set. Every proposed rewrite passes the validation gates before it is written. To keep fence rows away from the model:gbrain config set fences.repair.llm falseThe free tiers keep running. Raising a cap or turning model repair back on is the user's call.
Tell the user what stays held.
gbrain sources status <id> # each fence hold: reason, fence, section, rows, next attemptA hold whose reason is
manualis something gbrain never guesses (a stray end marker, an unknown takes kind, a weight out of range, extra cells that removing empty cells cannot line up, a sentence in the factskindcolumn: often a claim cut in two by an unescaped|). Show the user the location, edit only that fence in the file, commit, thengbrain sync --source <id> --no-pull. A hold waiting on the daily cap (budget_exhausted) resumes after 00:00 UTC. Each reason's fix:docs/guides/write-refusals.md#invalid_fence; the format:docs/guides/fence-format.md.Inspect or undo a repair.
- Managed sources: each repaired file is committed with the subject
gbrain: repair fence in <path> (<classes>).git log --grep 'repair fence in'lists them,git show <commit>shows the change, andgit revert <commit>undoes it (for one file of a commit that lists several,git checkout <commit>^ -- <path>and commit). - Database-only pages:
gbrain history <slug>shows every version, including the one before the repair, andgbrain revert <slug> <version_id>restores it. A managed brain refuses a version whose fence it cannot import; then read the old rows from the history and write them again withrememberortakes_add. - Legacy (unmanaged) sources: the original file is backed up under
~/.gbrain/backups/(the repair output names the path); copy it back and sync.
Turning the settings off stops future repairs and does not undo past ones. A restored malformed fence is held again on the next sync and repaired again by the next maintenance run, so pause first (
gbrain config set fences.repair.enabled false) if the user wants to keep the original.- Managed sources: each repaired file is committed with the subject
Which steps need the user.
- Nothing to approve for the repairs themselves: the maintenance run and
gbrain repair fences --applyneed no extra consent. - Tell the user before the first maintenance run (step 2); pausing is their choice.
- Raising a cap (
fences.repair.max_usd_per_day,fences.repair.max_usd_per_page), turning model repair back on (fences.repair.llm true), choosing a repair model (models.fence_repair), registering a model price, the content of everymanualedit, and undoing a repair are the user's calls. - Relay the one-time
behavior_changesnotice when gbrain prints it (gbrain doctor --only behavior_changesshows it again).
- Nothing to approve for the repairs themselves: the maintenance run and
Verify:
gbrain doctor --only fence_integrity,git_held_files --json gbrain sources status --jsonfence_integrityisokwhen no malformed fence is left; it never reportsokwhile a scan is partial.