Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript
22.3 KB
Raw Blame
{
  "golden": [
    {
      "argv": "engine status",
      "exitCode": 0,
      "stderr": [],
      "stderrFirstLine": null,
      "stdout": [
        "Brain:   host",
        "Engine:  postgres",
        "Source:  config-file",
        "URL:     postgresql://***@127.0.0.1:1/none",
        "Pooler:  supabase=false prepare=undefined pool=10"
      ],
      "stdoutFirstLine": "Brain:   host",
      "url": "config"
    },
    {
      "argv": "engine status --json",
      "exitCode": 0,
      "stderr": [],
      "stderrFirstLine": null,
      "stdout": [
        "{",
        "  \"schema_version\": 1,",
        "  \"brain_id\": \"host\",",
        "  \"effective_engine\": \"postgres\",",
        "  \"config_file_engine\": \"postgres\",",
        "  \"db_url_source\": \"config-file\",",
        "  \"database_url\": \"postgresql://***@127.0.0.1:1/none\",",
        "  \"database_path\": null,",
        "  \"thin_client\": false,",
        "  \"env\": {",
        "    \"shadowed\": false,",
        "    \"gbrain_database_url\": null,",
        "    \"database_url\": null",
        "  },",
        "  \"pooler\": {",
        "    \"supabase_pooler\": false,",
        "    \"direct_url_derivable\": false,",
        "    \"session_pooler_derivable\": false,",
        "    \"direct_pool_disabled\": false,",
        "    \"pool_size\": 10,",
        "    \"direct_pool_size\": null",
        "  }",
        "}"
      ],
      "stdoutFirstLine": "{",
      "url": "config"
    },
    {
      "argv": "engine status --probe",
      "exitCode": 1,
      "stderr": [],
      "stderrFirstLine": null,
      "stdout": [
        "Brain:   host",
        "Engine:  postgres",
        "Source:  config-file",
        "URL:     postgresql://***@127.0.0.1:1/none",
        "Pooler:  supabase=false prepare=undefined pool=10",
        "Probe:   FAIL conn_refused — Connection refused: nothing accepted the connection at the configured host and port. Check that the database server is running and that the URL names the right host and port."
      ],
      "stdoutFirstLine": "Brain:   host",
      "url": "config"
    },
    {
      "argv": "engine status --probe --json",
      "exitCode": 1,
      "stderr": [],
      "stderrFirstLine": null,
      "stdout": [
        "{",
        "  \"schema_version\": 1,",
        "  \"brain_id\": \"host\",",
        "  \"effective_engine\": \"postgres\",",
        "  \"config_file_engine\": \"postgres\",",
        "  \"db_url_source\": \"config-file\",",
        "  \"database_url\": \"postgresql://***@127.0.0.1:1/none\",",
        "  \"database_path\": null,",
        "  \"thin_client\": false,",
        "  \"env\": {",
        "    \"shadowed\": false,",
        "    \"gbrain_database_url\": null,",
        "    \"database_url\": null",
        "  },",
        "  \"pooler\": {",
        "    \"supabase_pooler\": false,",
        "    \"direct_url_derivable\": false,",
        "    \"session_pooler_derivable\": false,",
        "    \"direct_pool_disabled\": false,",
        "    \"pool_size\": 10,",
        "    \"direct_pool_size\": null",
        "  },",
        "  \"probe\": {",
        "    \"ok\": false,",
        "    \"diagnosis\": {",
        "      \"reason\": \"conn_refused\",",
        "      \"transient\": true,",
        "      \"message\": \"connect ECONNREFUSED  <REDACTED:ipv4>:1\",",
        "      \"remediation\": \"Connection refused: nothing accepted the connection at the configured host and port. Check that the database server is running and that the URL names the right host and port.\",",
        "      \"brainId\": \"host\"",
        "    }",
        "  }",
        "}"
      ],
      "stdoutFirstLine": "{",
      "url": "config"
    },
    {
      "argv": "engine status",
      "exitCode": 0,
      "stderr": [],
      "stderrFirstLine": null,
      "stdout": [
        "Brain:   host",
        "Engine:  postgres",
        "Source:  env:DATABASE_URL",
        "URL:     postgresql://***@127.0.0.1:1/none",
        "Pooler:  supabase=false prepare=undefined pool=10"
      ],
      "stdoutFirstLine": "Brain:   host",
      "url": "env"
    },
    {
      "argv": "db-repair",
      "exitCode": 1,
      "stderr": [],
      "stderrFirstLine": null,
      "stdout": [
        "GBRAIN_DB_ACCESS conn_refused",
        "reason: conn_refused (auto tier)  connect ECONNREFUSED  <REDACTED:ipv4>:1",
        "plan: bounded reconnect; if the server is down, start it and re-run",
        "Connection refused: nothing accepted the connection at the configured host and port. Check that the database server is running and that the URL names the right host and port.",
        "Apply: gbrain db-repair --yes"
      ],
      "stdoutFirstLine": "GBRAIN_DB_ACCESS conn_refused",
      "url": "config"
    },
    {
      "argv": "db-repair --json",
      "exitCode": 1,
      "stderr": [],
      "stderrFirstLine": null,
      "stdout": [
        "{\"schema_version\":1,\"brain_id\":\"host\",\"reason\":\"conn_refused\",\"tier\":\"auto\",\"marker\":\"GBRAIN_DB_ACCESS conn_refused\",\"diagnosis\":{\"reason\":\"conn_refused\",\"transient\":true,\"message\":\"connect ECONNREFUSED  <REDACTED:ipv4>:1\",\"remediation\":\"Connection refused: nothing accepted the connection at the configured host and port. Check that the database server is running and that the URL names the right host and port.\",\"brainId\":\"host\"},\"plan\":[\"bounded reconnect; if the server is down, start it and re-run\"],\"applied\":[],\"fixed\":false,\"remaining\":{\"reason\":\"conn_refused\",\"transient\":true,\"message\":\"connect ECONNREFUSED  <REDACTED:ipv4>:1\",\"remediation\":\"Connection refused: nothing accepted the connection at the configured host and port. Check that the database server is running and that the URL names the right host and port.\",\"brainId\":\"host\"},\"error\":\"database_error\",\"code\":\"database_error\",\"message\":\"connect ECONNREFUSED  <REDACTED:ipv4>:1\",\"suggestion\":\"Apply the plan: gbrain db-repair --yes --brain host\",\"docs\":\"https://github.com/garrytan/gbrain/blob/master/docs/guides/error-codes.md#database_error\",\"why\":\"Connection refused: nothing accepted the connection at the configured host and port. Check that the database server is running and that the URL names the right host and port.\",\"fix\":{\"argv\":[\"gbrain\",\"db-repair\",\"--yes\",\"--brain\",\"host\"],\"command\":\"gbrain db-repair --yes --brain host\",\"consent\":[],\"actor\":\"agent\",\"next\":\"run\",\"why\":\"Applies the auto tier the plan names (bounded retries, pending migrations, CREATE EXTENSION vector, starting gbrain's own docker container).\",\"requires_exclusive\":false},\"docs_cmd\":[\"gbrain\",\"errors\",\"database_error\"],\"class\":\"server\",\"retryable\":false,\"contract_version\":1}"
      ],
      "stdoutFirstLine": "{\"schema_version\":1,\"brain_id\":\"host\",\"reason\":\"conn_refused\",\"tier\":\"auto\",\"marker\":\"GBRAIN_DB_ACCESS conn_refused\",\"diagnosis\":{\"reason\":\"conn_refused\",\"transient\":true,\"message\":\"connect ECONNREFUSED  <REDACTED:ipv4>:1\",\"remediation\":\"Connection refused: nothing accepted the connection at the configured host and port. Check that the database server is running and that the URL names the right host and port.\",\"brainId\":\"host\"},\"plan\":[\"bounded reconnect; if the server is down, start it and re-run\"],\"applied\":[],\"fixed\":false,\"remaining\":{\"reason\":\"conn_refused\",\"transient\":true,\"message\":\"connect ECONNREFUSED  <REDACTED:ipv4>:1\",\"remediation\":\"Connection refused: nothing accepted the connection at the configured host and port. Check that the database server is running and that the URL names the right host and port.\",\"brainId\":\"host\"},\"error\":\"database_error\",\"code\":\"database_error\",\"message\":\"connect ECONNREFUSED  <REDACTED:ipv4>:1\",\"suggestion\":\"Apply the plan: gbrain db-repair --yes --brain host\",\"docs\":\"https://github.com/garrytan/gbrain/blob/master/docs/guides/error-codes.md#database_error\",\"why\":\"Connection refused: nothing accepted the connection at the configured host and port. Check that the database server is running and that the URL names the right host and port.\",\"fix\":{\"argv\":[\"gbrain\",\"db-repair\",\"--yes\",\"--brain\",\"host\"],\"command\":\"gbrain db-repair --yes --brain host\",\"consent\":[],\"actor\":\"agent\",\"next\":\"run\",\"why\":\"Applies the auto tier the plan names (bounded retries, pending migrations, CREATE EXTENSION vector, starting gbrain's own docker container).\",\"requires_exclusive\":false},\"docs_cmd\":[\"gbrain\",\"errors\",\"database_error\"],\"class\":\"server\",\"retryable\":false,\"contract_version\":1}",
      "url": "config"
    },
    {
      "argv": "db-repair",
      "exitCode": 1,
      "stderr": [],
      "stderrFirstLine": null,
      "stdout": [
        "GBRAIN_DB_ACCESS conn_refused",
        "reason: conn_refused (auto tier)  connect ECONNREFUSED  <REDACTED:ipv4>:1",
        "plan: bounded reconnect; if the server is down, start it and re-run",
        "Connection refused: nothing accepted the connection at the configured host and port. Check that the database server is running and that the URL names the right host and port.",
        "Apply: gbrain db-repair --yes"
      ],
      "stdoutFirstLine": "GBRAIN_DB_ACCESS conn_refused",
      "url": "env"
    },
    {
      "argv": "pglite-repair",
      "exitCode": 1,
      "stderr": [
        "Error (not_pglite): gbrain pglite-repair is for PGLite brains (current engine: postgres). Pass --path <dir> to repair a specific data dir."
      ],
      "stderrFirstLine": "Error (not_pglite): gbrain pglite-repair is for PGLite brains (current engine: postgres). Pass --path <dir> to repair a specific data dir.",
      "stdout": [],
      "stdoutFirstLine": null,
      "url": "config"
    },
    {
      "argv": "bootstrap",
      "exitCode": 0,
      "stderr": [],
      "stderrFirstLine": null,
      "stdout": [
        "gbrain bootstrap — paste-in agent install (Claude Code / Codex / opencode)",
        "",
        "Usage: gbrain bootstrap <subcommand> [flags]",
        "",
        "Subcommands (run `gbrain bootstrap status` first — it is the resume entrypoint):",
        "  status [--json]                 Phase list + next action + support blob. The CLI's",
        "                                  phase list is the source of truth the runbook defers to.",
        "  interview --init                Create state/interview.json.",
        "            --set KEY \"value\"     Record one answer verbatim (never invent answers).",
        "            --skip KEY            Decline an optional question.",
        "            --status              Gate: exits nonzero until required answers exist.",
        "            --show                Read-back payload (all answers + confirm hash).",
        "            --confirm <hash>      Record the human's confirmation of the read-back.",
        "  render [--force] [--only F] [--minimal] [--host openclaw|generic|auto]",
        "                                  Render identity files from the confirmed answers.",
        "                                  Never clobbers; --force backs up first. OpenClaw: SCHEDULES.md.",
        "  contract [--repair]             Audit the same-turn GBrain write-back contract.",
        "                                  --repair appends it additively and backs up AGENTS.md.",
        "  hooks [--harness claude-code|codex|opencode] [--repair] [--no-hooks] [--gbrain-bin <path>]",
        "        [--seat <label> | --no-seat]",
        "                                  Register MCP (+ per-turn hooks on Claude Code,",
        "                                  ON by default; --no-hooks opts out, GBRAIN_HOOKS=0",
        "                                  disables at runtime). opencode registrations are",
        "                                  written directly into its JSONC config (user-global",
        "                                  by default; MCP_SCOPE=project is an explicit opt-in",
        "                                  with a sharing warning). --seat credits captured",
        "                                  sessions to this agent seat (kept on re-install;",
        "                                  --no-seat clears it; --seat off records none).",
        "  repo                            Create the dedicated PRIVATE GitHub repo (or adopt",
        "                                  an EMPTY private repo you created under your own",
        "                                  account), verify the privacy bit via the API, push.",
        "  verify [--json]                 The whole install contract (round-trip, graph floor,",
        "                                  magic moment, scans, hooks smoke). Exit 0 or not done.",
        "  attach [--harness H]            Machine two: adopt a cloned agent workspace.",
        "  harness [--harness claude-code|codex|opencode|all] [--url U | --port N] [--source ID]",
        "          [--token-name NAME | --token TOK] [--name MCPNAME] [--project DIR]...",
        "          [--no-hooks] [--no-capture] [--force] [--status] [--remove [--dry-run]] [--refresh-skills] [--yes] [--json]",
        "          [--seat <label> | --no-seat]",
        "                                  Wire framework-spawned Claude Code / Codex / opencode",
        "                                  sessions to a RUNNING `gbrain serve --http` on this box",
        "                                  (#4043): scoped bearer token, user-scope MCP + headless",
        "                                  pre-approval, lifecycle hooks (user scope, or per --project",
        "                                  dir), codex config block, opencode config entry. No",
        "                                  agent.json needed. Idempotent; --remove tears it down (--dry-run previews).",
        "                                  --source ID: the source the hooks + token bind to",
        "                                  (default: sources.default, else the sole populated",
        "                                  non-default source, else default).",
        "                                  --refresh-skills: re-join shared skills under the",
        "                                  recorded credential so the router adopts the current",
        "                                  enrollment epoch (no token rotation).",
        "                                  (--local is an accepted no-op alias.)",
        "  cloud-setup-script              Print the paste-ready cloud environment setup",
        "                                  script (installs the gbrain binary into the",
        "                                  environment snapshot; npm-based — bun fetching",
        "                                  is proxy-incompatible in cloud sandboxes).",
        "  uninstall [--delete-brain] [--home <dir>] [--yes]",
        "                                  Receipt-keyed removal. The repo stays yours.",
        "",
        "Global flags: --workspace <dir> (default: cwd; refuses if the resolved",
        "             path is your home directory — status/uninstall are exempt so",
        "             an existing $HOME install can still be inspected and removed),",
        "             --help.",
        "Env: GBRAIN_BOOTSTRAP_ABORT_AFTER=<phase> (test seam — abort after that phase's work).",
        ""
      ],
      "stdoutFirstLine": "gbrain bootstrap — paste-in agent install (Claude Code / Codex / opencode)",
      "url": "config"
    },
    {
      "argv": "hook",
      "exitCode": 1,
      "stderr": [
        "Usage: gbrain hook <event>",
        "",
        "Events (wired into .claude/settings.local.json by gbrain bootstrap):",
        "  session-start   print the greeting digest (MEMORY.md sections, push status,",
        "                  hook health) to stdout",
        "  user-prompt     read hook JSON on stdin, request per-turn context from a",
        "                  running 'gbrain serve' over IPC, print additionalContext JSON",
        "                  (--harness <claude-code|codex|opencode> sets the feedback-loop",
        "                  channel; default claude-code, unknown values fall back to the default)",
        "  stop            bank the writeback backstop and spawn the workspace push",
        "  session-end     ingest the session transcript into the dream corpus",
        "                  (secret-scanned), prune old corpus files, push the workspace",
        "  compact         (PreCompact) bank the window's standing entities into the",
        "                  session cursor so the post-compaction session-start serves",
        "                  a warm context pack; emits nothing",
        "",
        "Env: GBRAIN_HOOKS=0 disables all events (immediate exit 0).",
        "     GBRAIN_SESSION_AGENT=<label>|off|owner names who wrote the session's user",
        "     turns (an agent's are never saved as yours; off saves nothing).",
        "All events fail open: errors exit 0 with empty stdout and a heartbeat entry at",
        "<gbrain home>/integrations/hooks/heartbeat.jsonl."
      ],
      "stderrFirstLine": "Usage: gbrain hook <event>",
      "stdout": [],
      "stdoutFirstLine": null,
      "url": "config"
    },
    {
      "argv": "hook session-start",
      "exitCode": 0,
      "stderr": [],
      "stderrFirstLine": null,
      "stdout": [],
      "stdoutFirstLine": null,
      "url": "config"
    },
    {
      "argv": "backup",
      "exitCode": 0,
      "stderr": [],
      "stderrFirstLine": null,
      "stdout": [
        "gbrain backup <status|check|create|restore> [--json]",
        "",
        "  status   Configured repos and recently verified remote commits. Git alone",
        "           is not a full database backup. Uses the",
        "           cached verdict, including warnings, while remote evidence is fresh.",
        "  check    Force a bounded remote-ref sweep, prioritizing pending/older refs.",
        "           Remote evidence expires after one hour; offline is not verified.",
        "  create --output ABS   Snapshot local PGLite and installer-managed files.",
        "                        Pause file writers. Archive contains sensitive full DB state.",
        "  restore ARCHIVE --into ABS",
        "                        Restore into a NEW absent root; preserve the old brain.",
        "                        Default --mode new-brain resets shared identity and authority.",
        "                        --mode recovery preserves brain identity only with",
        "                        --confirm-quiesced --confirm-backup-compatible",
        "                        --confirm-authority-reviewed. Old service exclusion is",
        "                        operator-enforced, not verified by these attestations.",
        "                        Both modes revoke archived authority and disable publication.",
        "                        Quarantine unfinished jobs; never start automation.",
        "                        Replays purges made after the archive from the original",
        "                        brain's .gbrain/purge-events.jsonl, or the copy named by",
        "                        --purge-mirror ABS when that root is gone.",
        "",
        "  --json   Structured verdict (includes the recovery field).",
        "",
        "Exit codes: 0 ok / 1 warn / 2 usage error. Off switches: GBRAIN_BACKUP_CHECK=0 or",
        "`gbrain config set backup.check_enabled false`. Interval:",
        "`gbrain config set backup.check_interval_days <n>` (default 30, min 1;",
        "env GBRAIN_BACKUP_CHECK_DAYS wins over config)."
      ],
      "stdoutFirstLine": "gbrain backup <status|check|create|restore> [--json]",
      "url": "config"
    },
    {
      "argv": "config set database_url postgresql://[email protected]:2/none",
      "exitCode": 0,
      "stderr": [],
      "stderrFirstLine": null,
      "stdout": [
        "Set database_url = postgresql://***@127.0.0.1:2/none (file plane: ~/.gbrain/config.json; engine inferred: postgres)"
      ],
      "stdoutFirstLine": "Set database_url = postgresql://***@127.0.0.1:2/none (file plane: ~/.gbrain/config.json; engine inferred: postgres)",
      "url": "config"
    },
    {
      "argv": "status",
      "exitCode": 1,
      "stderr": [
        "[gbrain] reading the brain status snapshot; large brains can take minutes. Progress prints here every <dur>; the result prints on stdout when it is ready.",
        "GBRAIN_DB_ACCESS conn_refused",
        "Error [database_error]: Cannot connect to database: connect ECONNREFUSED  <REDACTED:ipv4>:1. Fix: Check the database URL; `gbrain engine status --probe` names where it comes from (environment variable or the config file under GBRAIN_HOME)",
        "Connection refused: nothing accepted the connection at the configured host and port. Check that the database server is running and that the URL names the right host and port. Run: gbrain db-repair"
      ],
      "stderrFirstLine": "[gbrain] reading the brain status snapshot; large brains can take minutes. Progress prints here every <dur>; the result prints on stdout when it is ready.",
      "stdout": [],
      "stdoutFirstLine": null,
      "url": "config"
    },
    {
      "argv": "backup status",
      "exitCode": 1,
      "stderr": [
        "GBRAIN_DB_ACCESS conn_refused",
        "Error [database_error]: Cannot connect to database: connect ECONNREFUSED  <REDACTED:ipv4>:1. Fix: Check the database URL; `gbrain engine status --probe` names where it comes from (environment variable or the config file under GBRAIN_HOME)",
        "Connection refused: nothing accepted the connection at the configured host and port. Check that the database server is running and that the URL names the right host and port. Run: gbrain db-repair"
      ],
      "stderrFirstLine": "GBRAIN_DB_ACCESS conn_refused",
      "stdout": [],
      "stdoutFirstLine": null,
      "url": "config"
    },
    {
      "argv": "config get database_url",
      "exitCode": 1,
      "stderr": [
        "GBRAIN_DB_ACCESS conn_refused",
        "Error [database_error]: Cannot connect to database: connect ECONNREFUSED  <REDACTED:ipv4>:1. Fix: Check the database URL; `gbrain engine status --probe` names where it comes from (environment variable or the config file under GBRAIN_HOME)",
        "Connection refused: nothing accepted the connection at the configured host and port. Check that the database server is running and that the URL names the right host and port. Run: gbrain db-repair"
      ],
      "stderrFirstLine": "GBRAIN_DB_ACCESS conn_refused",
      "stdout": [],
      "stdoutFirstLine": null,
      "url": "config"
    }
  ],
  "normalizer": "cli-db-down-v1"
}