Garry's Opinionated OpenClaw/Hermes Agent Brain
Key files — per-file index (gbrain repo)
Read a file's entry before editing it. This page routes to bounded subsystem references; do not load the whole directory.
Find a path's entry:
rg -n -F 'src/core/ops/pages.ts' docs/architecture/key-files/
Ranges use each entry's first path. Search when a path crosses subsystems.
Edit the subsystem entry, not this page, when behavior changes.
Keep entries current-state: history belongs in CHANGELOG and Git.
Where a new storage method, migration, doctor check, command, route or sync
phase goes: CONTRIBUTING.md.
A branch from before refactor wave 1 follows the generated
porting guide (JSON map).
scripts/check-key-files-current-state.sh guards each subsystem against
history, duplicate entries and size growth. A full page links its next page
from its last line; never raise the cap.
| Subsystem | Entry range / scope |
|---|---|
| Page identity and writer administration | Opaque result IDs, current grants, state-bound ownership changes |
| Canonical reconciliation | Exact-page repair, retained originals, derived generations, sync discovery and the origin rule; rows behind the checkpoint |
| Company-brain ingestion | Inspection, admission, receipts, derived relationships and schema; operator guide |
| Agent operator contract | agent-output.ts, error registry + docs, notice ledger, isCallable, --json guard, contract scanner |
| Commands (1/6) | agent-logs.ts to db-repair.ts |
| Commands (2/6) | doctor.ts, doctor/; alert |
| Commands (2/6, continued) | More doctor/checks/*, dream-retriage.ts to embed.ts; tiers and budgets |
| Commands (3/6) | src/commands/engine-status.ts to extract-conversation-facts.ts |
| Commands (3/6, continued) | src/commands/extract.ts through frontmatter-install-hook.ts |
| Commands (4/6) | src/commands/frontmatter.ts through pages-status.ts |
| Commands (4/6, continued) | persistence-admin.ts to reindex-search-vector.ts, init-mode-picker.ts, core/embedding-migration-cli.ts |
| Commands (5/6) | repair.ts to skillpack.ts; continued |
| Commands (6/6) | sync.ts to whoknows.ts |
| Core Ai | src/core/ai/ gateway, embedding, dims, errors, fallbacks |
| Core Ai (continued) | src/core/ai/providers/*, recipes/*, voyage-gateway.ts |
| Core Decide | src/core/ai/decide/*, src/core/search/decide-stage.ts, gbrain decide, decide_health (System One) |
| Core Questions | Pinned questions: src/core/questions/*, gbrain questions, standing_questions |
| Core Cycle | src/core/cycle/anomaly.ts through phase-table.ts: atoms, facts, drains, probes, phase scope |
| Core Cycle (continued) | synthesis postprocess |
| Core Cycle (patterns) | patterns, drift, synthesis |
| Core Minions (1/2) | src/core/minions/ through src/core/minions/protected-names.ts |
| Core Minions (2/2) | minions/queue.ts to worker.ts; Wakeshift |
| Core Persistence | src/core/persistence/ journal, coordinator, effects, managed sync |
| Core Persistence (continued) | connectors, holds, receipts; Git writer; fence repair |
| Persistence capacity | write caps, true-up; history, as_of |
| Core Persistence (seams) | checkpoint-validation, fault-points, native-file-target, admission-retry, unbound-source |
| Core Persistence (managed facts) | facts-maintenance.ts, facts-prepare.ts, derived-facts.ts, same-page-shadow.ts |
| Core Persistence (engine graduation) | engine-graduation*.ts, graduation-*.ts, commands/migrate-graduation.ts |
| Managed sync and persistence stalls | preparation budgets, claim-phase.ts, consumer.ts, group-publish.ts, diagnostics.ts, worktree-manifest.ts |
| Managed sync bookkeeping | sync-failures.ts, managed-sync-orphans.ts, sync-checkpoint-replaced.ts |
| Core Search (1/2) | src/core/search/ to search/read-policy-sql.ts; access |
| Core Search (2/2) | search/rerank.ts to search/vector-pool.ts, relational, multi-hop, hub-dampening.ts, crag.ts; CJK, evidence |
| Core Services (1/3) | src/core/advisor/*.ts through src/core/connectors/ |
| Core Services (1/3, continued) | src/core/context/ through src/core/context/ipc-path.ts |
| Core Services (2/3) | src/core/conversation-parser/ through src/core/ops/sources.ts, except src/core/persistence/ |
| Core Services (2/3, continued) | page-state/, page-{body,window}/, progressive-batch/ |
| Commit notifier | src/core/notifier/ |
| Core Services (3/3) | src/core/think/index.ts through src/core/verbs/usage-log.ts |
| Core Utilities (1/2) | archive-crawler-config.ts through remediation-checkpoint.ts; cycle.ts |
| Core Utilities (2/2) | src/core/repair/ through src/core/utils.ts |
| Engines (1/2) | src/core/connection-manager.ts through pglite-repair.ts |
| Engines (2/2) | src/core/pglite-resetwal.ts through worker-pool.ts |
| Entrypoints And Docs | .agents/gbrain-launcher through templates/ |
| Evaluation | evals/brainbench/ through src/eval/shared/judge-runner.ts |
| Files And Sync (1/2) | src/core/audit-week-file.ts through src/core/sync-embed-backfill.ts |
| Files And Sync (2/2) | src/core/sync-failure-ledger.ts through src/core/write-through.ts |
| Graph And Facts | check-resolvable.ts to trajectory-format.ts; recall |
| Entity recall | mentions/*, extract mentions --explain, v206 |
| Mcp | src/mcp/dispatch.ts through src/mcp/validate-params.ts |
| Providers | src/core/anthropic-pricing.ts through src/core/transcription.ts |
| Runtime | src/core/abort-check.ts through src/core/zombie-reap.ts |
| Security | src/core/destructive-guard.ts through src/core/write-gate-scan.ts; purge |
| Shared brain skills | Canonical catalog, enrollment, migration, publication and harness integration |
| Skills | src/core/audit-skill-brain-first.ts through src/core/skills-integrity.ts |
| Tooling And Tests | .github/workflows/test.yml through test/remote-privacy-sweep.test.ts |
| CI Health And Test Guards | nightly-watch.yml through check-image-decoders-embedded.sh, contributor audit, fix-wave gate |
| BrainBench (sibling repo) | Cross-file contract |
| Hindsight calibration | Cross-file contract |
| Schema packs: mutation surface | Cross-file contract |
| Agent bootstrap cluster (paste-in install) | Cross-file contract |
| Agent Bootstrap (continued) | Remaining entries |
| Google connector + open-loop engine | Cross-file contract; more, API |
| Open loops | detect, extract, store |
| Always-loaded core memory | Core tier, write-path guard and lock order, delivery lanes, pressure notice |
| Workspace push and backup coverage | Workspace push, hook push backstops, backup verdicts, git writer |
| Secret and sensitivity scanning | secret-scan*.ts: detection, allowlist, scan counters |
| Ambient capture consent gate | memory.auto_writeback capture lanes |
| Belief ledger | src/core/belief/, gbrain beliefs, doctor coverage |
| Quarantine | Gate-marker strip; quarantined pages in facts, reads, writes |