Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript
3.2 KB
Raw Blame

Upgrade to v0.60.100.0: doctor counts the broken facts and takes tables left

gbrain doctor has a new fence_integrity check. Per source, it counts every malformed facts or takes table still waiting, once each: a file managed sync held (invalid_fence), a stored page an older release imported with a broken table, and a checkout file not yet synced. It splits them by the tier that would fix them: deterministic (gbrain repairs it the next time the file syncs or the page is written), resolver (a holder name to resolve), llm (a table only a rewrite can realign) and manual (an edit only a person can decide). It also shows the oldest hold, the tables repaired in the last 7 days with their top writers, and the model-repair caps with today's spend.

  1. Finish the upgrade. gbrain upgrade runs it; no schema migration is added. Restart every gbrain serve, autopilot and worker.

  2. Run the check.

    gbrain doctor --only fence_integrity --json
    

    Each run scans stored pages and source checkouts for up to 10 seconds (GBRAIN_DOCTOR_FENCE_TIMEOUT_MS) and resumes where the last run stopped. A partial result means the scan has not finished: run the same command again until details.partial is false. Do not report a partial result as healthy.

  3. Act on what it lists. details.sources[] gives each source's counts by bucket and tier, and details.sources[].sample the first tables (slug, path, tier, reasons; never a cell value). The check's fix is the next step:

    • Held files: gbrain sources status <id> names the file, table, section, rows and reason. Read the page (gbrain get --source <id> -- <slug>), edit only that table in the file, commit, then gbrain sync --source <id> --no-pull.
    • Stored pages: read the page with gbrain get --source <id> -- <slug> and write it again with put_page. gbrain repairs a fixable table in that write and reports fences_normalized; a table it cannot repair refuses invalid_fence with fence_issues naming every row and column to fix.
    • Unsynced files: gbrain sync --source <id> --no-pull. A fixable table is repaired and committed; any other is held, then fixed as above. Write facts with remember and takes with takes_add: their rows never need repair.
  4. Tell the user about a noisy writer. When a source had 20 or more tables repaired in 7 days, the check warns and names the top writers (a receipt principal such as oauth_client, or a top directory for sync). Something keeps writing broken tables; tell the user so it can be fixed at the source.

  5. Know the new settings. fences.repair.max_usd_per_page (default 0.05) and fences.repair.max_usd_per_day (default 1.00) cap model repair of tables, per page and per UTC day across every gbrain process. 0 turns model spend off. Nothing spends under them in this release. Raising them is the user's call:

    gbrain config set fences.repair.max_usd_per_day <usd>
    
  6. Verify:

    gbrain doctor --only fence_integrity --json
    

    status: "ok" means nothing is waiting, every source's scan is complete, and no source is at the repair-trend threshold.