Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

fix(purge): concrete forget --dry-run refusal fix text; KEY_FILES index back under its 10 KB cap

garrytan7f30a8d5ab38
diff --git a/docs/architecture/KEY_FILES.md b/docs/architecture/KEY_FILES.md
index a44dfee14d..1d52d0a34d 100644
--- a/docs/architecture/KEY_FILES.md
+++ b/docs/architecture/KEY_FILES.md
@@ -44,8 +44,8 @@ boundary and add its link here rather than raising the cap.
| [Core Minions (2/2)](key-files/core-minions-2.md) | `src/core/minions/run-child.ts` through `src/core/minions/worker.ts` |
| [Core Persistence](key-files/core-persistence.md) | `src/core/persistence/` write journal, coordinator, effects, canonical projections and managed sync |
| [Core Persistence (continued)](key-files/core-persistence-continued.md) | `worktree-refresh*.ts`, `persistence/connector-*.ts`, `src/core/connectors/item-holds*.ts`, checkpoint validation, no-op kernel, accepted-pending receipts, verb types/errors, database-write, attribution, purge-deleted and loop-fact retirement |
-| [Core Persistence (engine graduation)](key-files/core-persistence-graduation.md) | `engine-graduation*.ts`, `graduation-*.ts`, `src/commands/migrate-graduation.ts`, the graduation doctor finding |
-| [Managed sync and persistence stalls (key files cluster)](key-files/persistence-stalls.md) | `claim-phase.ts`, `pre-activation-release.ts`, `sync-concurrent-write.ts`, `worktree-manifest.ts`, `src/core/hardened-git.ts` |
+| [Core Persistence (engine graduation)](key-files/core-persistence-graduation.md) | `engine-graduation*.ts`, `graduation-*.ts`, `src/commands/migrate-graduation.ts`, its doctor finding |
+| [Managed sync and persistence stalls](key-files/persistence-stalls.md) | `claim-phase.ts`, `pre-activation-release.ts`, `sync-concurrent-write.ts`, `worktree-manifest.ts`, `src/core/hardened-git.ts` |
| [Core Search (1/2)](key-files/core-search-1.md) | `src/core/search/` through `src/core/search/rerank.ts` |
| [Core Search (2/2)](key-files/core-search-2.md) | `src/core/search/return-policy.ts` through `src/core/search/vector-pool.ts`, the relational arm and multi-hop chain modules, `hub-dampening.ts` |
| [Core Services (1/3)](key-files/core-services-1.md) | `src/core/advisor/{types,run,render,recommended-set,history,apply,collect-*}.ts` through `src/core/connectors/` |
@@ -65,11 +65,11 @@ boundary and add its link here rather than raising the cap.
| [Mcp](key-files/mcp.md) | `src/mcp/dispatch.ts` through `src/mcp/validate-params.ts` |
| [Providers](key-files/providers.md) | `src/core/anthropic-pricing.ts` through `src/core/transcription.ts` |
| [Runtime](key-files/runtime.md) | `src/core/abort-check.ts` through `src/core/zombie-reap.ts` |
-| [Security](key-files/security.md) | `src/core/destructive-guard.ts` through `src/core/write-gate-scan.ts` |
+| [Security](key-files/security.md) | `src/core/destructive-guard.ts` through `src/core/write-gate-scan.ts`; [purge](key-files/memory-purge.md) |
| [Shared brain skills](key-files/shared-skills.md) | Canonical catalog, enrollment, migration, publication and harness integration |
| [Skills](key-files/skills.md) | `src/core/audit-skill-brain-first.ts` through `src/core/skills-integrity.ts` |
| [Tooling And Tests](key-files/tooling-and-tests.md) | `.github/workflows/test.yml` through `test/remote-privacy-sweep.test.ts` |
-| [CI Health And Test Guards](key-files/ci-health-and-test-guards.md) | `.github/workflows/nightly-watch.yml` through `scripts/check-image-decoders-embedded.sh`, plus the contributor audit and the fix-wave gate |
+| [CI Health And Test Guards](key-files/ci-health-and-test-guards.md) | `.github/workflows/nightly-watch.yml` through `scripts/check-image-decoders-embedded.sh`, plus contributor audit, fix-wave gate |
| [BrainBench — in a sibling repo](key-files/brainbench.md) | Cross-file subsystem contract |
| [Hindsight calibration (key files cluster)](key-files/hindsight.md) | Cross-file subsystem contract |
| [Schema packs: mutation surface (key files cluster)](key-files/schema-mutation.md) | Cross-file subsystem contract |
@@ -81,7 +81,6 @@ boundary and add its link here rather than raising the cap.
| [Workspace push and backup coverage (key files cluster)](key-files/workspace-push-and-backup.md) | Workspace push, hook push backstops, backup verdicts |
| [Ambient capture consent gate (key files cluster)](key-files/ambient-capture.md) | `memory.auto_writeback` capture lanes |
| [Quarantine (cluster)](key-files/quarantine.md) | Gate-marker strip; quarantined pages in facts, reads, writes |
-| [Memory purge (cluster)](key-files/memory-purge.md) | `forget --purge`, purge ledgers and overlay, page purge tombstones, deletion inventory, purged intents |
## BrainBench — in a sibling repo
diff --git a/src/commands/forget-purge.ts b/src/commands/forget-purge.ts
index 0fdb86cc63..883e48c7db 100644
--- a/src/commands/forget-purge.ts
+++ b/src/commands/forget-purge.ts
@@ -104,11 +104,11 @@ export async function runForgetPurge(engine: BrainEngine | (() => Promise<BrainE
const out = (value: Record<string, unknown>, human: string) => process.stdout.write(json ? `${JSON.stringify(value, null, 2)}\n` : human);
try {
if (args.includes('--help') || args.includes('-h')) { process.stdout.write(USAGE); return; }
+ const idArg = args.find(a => /^\d+$/.test(a));
if (!args.includes('--purge')) {
throw opError('invalid_params', '--dry-run previews a purge only; a plain forget has no dry run, so nothing was forgotten.',
- 'Add --purge to preview a purge (gbrain forget <id> --purge --dry-run), or drop --dry-run to forget the fact.');
+ idArg ? `Run gbrain forget ${idArg} --purge --dry-run to preview a purge, or gbrain forget ${idArg} to forget the fact.` : 'Run gbrain forget --help for the forget and purge forms.');
}
- const idArg = args.find(a => /^\d+$/.test(a));
const cfg = loadConfig();
if (isThinClient(cfg)) throw purgeHostOnly(idArg);
const requestId = parseWriteRequestId(flagValue(args, '--request-id'));