Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript
3.6 KB
Raw Blame

Upgrade to v0.60.47.0: one broken file never blocks a sync

A file gbrain cannot import without guessing (broken YAML frontmatter, a frontmatter slug: naming another page, a file over the size limit, content the operator's sanity gate rejects) is now held: the rest of the source syncs and the file stays visible until it is fixed. Files gbrain can read exactly after quoting an unquoted value now import. A source such a file blocked before this release recovers by itself.

Repairs rewrite the user's files. Never run gbrain repair frontmatter --apply or gbrain frontmatter install-hook without the user's agreement, and never apply an --include-ambiguous interpretation the user has not seen.

  1. Finish the upgrade. gbrain upgrade runs it. To be sure, on the brain host:

    gbrain apply-migrations --yes --no-autopilot-install
    

    One schema migration adds an index for hold lookups; no rows are rewritten. Restart every gbrain serve, autopilot and worker.

  2. Unblock a source a file blocked. gbrain post-upgrade prints a frontmatter_holds: line naming each blocked source. The next scheduled or manual sync recovers a blocked source automatically; to do it now run:

    gbrain sync --source <id> --no-pull
    

    The blocked request is converted in place (converted_from_failed): the broken file is held and everything else imports. No --retry-failed and no ledger edits.

  3. Tell the user what is held, then preview the fix.

    gbrain sources status <id>                       # each hold: code, line, key, next command
    gbrain repair frontmatter --source <id>          # safe pass; writes nothing
    gbrain repair frontmatter --source <id> --include-ambiguous --diff   # interpretations, per file
    

    Show the user the diffs. After they agree, run the printed --apply --expect <hash> --yes command (select files with --only / --skip). Holds with ambiguous_identity_key or ambiguous_protected_key (for example a broken visibility: line) are never guessed: show the user the line and let them decide. Walkthrough with real output: docs/guides/repair.md#held-files.

  4. Refresh an old pre-commit hook. If doctor frontmatter_hook warns or post-upgrade says an older hook is installed, the hook checks working-tree files instead of what is staged. The user installed it, so refreshing it carries their decision forward; mention it, then run:

    gbrain frontmatter install-hook --force
    
  5. Know the behavior changes.

    • gbrain frontmatter validate --fix re-validates after fixing and exits 1 when errors remain (it used to exit 0). It also quotes YAML gbrain reads by quoting.
    • A file whose protected key (visibility, derived_from, ...) was swallowed into another value, rewritten by the old quoting pass, or sits in an unclosed frontmatter fence is now held (ambiguous_protected_key) instead of importing with a guessed value.
    • Content refusals during sync no longer block; teams that want the old fail-closed behavior run gbrain config set sync.holds fail.
    • A page whose newer file is held is read-only for put_page until the file is repaired. Do not retry the refused write.
  6. Verify:

    gbrain doctor --only git_held_files,frontmatter_repairable,frontmatter_hook --json
    gbrain sources status --json
    

    git_held_files and frontmatter_repairable list each source with the exact gbrain repair frontmatter --source <id> preview; they clear when the files are fixed.