Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
chore(purge): tool areas and privacy-sweep classification for purge ops
garrytan2fcfea7fbab4
diff --git a/docs/TOOL_CATALOG.md b/docs/TOOL_CATALOG.mdindex 03ddbe0902..12ecfac8ff 100644--- a/docs/TOOL_CATALOG.md+++ b/docs/TOOL_CATALOG.md@@ -62,6 +62,12 @@ Every non-localOnly operation on the MCP surface: 143 tools across 24 areas. **S| `extract_entities` | Extract entity names (people, companies) from text and create/update their brain stub pages. | write | | || `extraction_pending` | List unverified auto-extracted entity stubs awaiting owner review (the quarantine lane from extract_entities). | read | | |+## facts++| Tool | Description | Scope | Starter | Gate |+|---|---|---|---|---|+| `purge_fact` | Owner-only, trusted local CLI on the brain host (`gbrain forget <id> --purge`). | admin | | |+## identity| Tool | Description | Scope | Starter | Gate |@@ -156,14 +162,6 @@ Every non-localOnly operation on the MCP surface: 143 tools across 24 areas. **S| `ontology_get` | Life Chronicle: the current resolved per-entity ontology (dimension → value) at `asof` (default now), with provenance + confidence + validity. | read | | || `ontology_propose` | Life Chronicle: record one ontology observation (entity has dimension=value), sourced + confidence-weighted + bi-temporal. | write | | |-## other--| Tool | Description | Scope | Starter | Gate |-|---|---|---|---|---|-| `list_page_purges` | Owner-only (`gbrain pages purges list`). | admin | | |-| `purge_fact` | Owner-only, trusted local CLI on the brain host (`gbrain forget <id> --purge`). | admin | | |-| `unpurge_page` | Owner-only (`gbrain pages unpurge <slug>`). | admin | | |-## pages| Tool | Description | Scope | Starter | Gate |@@ -178,6 +176,7 @@ Every non-localOnly operation on the MCP surface: 143 tools across 24 areas. **S| `get_raw_data` | Retrieve raw data for a page. | read | | || `get_versions` | Page version history, newest snapshot first. | read | | || `get_write_request` | Read your write's receipt by request_id (after write_pending or a lost reply). | write | yes | |+| `list_page_purges` | Owner-only (`gbrain pages purges list`). | admin | | || `list_pages` | List pages with filters. | read | yes | || `list_write_requests` | List your write receipts in one source, newest first. | write | yes | || `put_page` | Complete content REPLACES the whole page: read get_page include_content:true; send its revision as expected_revision. | write | yes | |@@ -186,6 +185,7 @@ Every non-localOnly operation on the MCP surface: 143 tools across 24 areas. **S| `resolve_slugs` | Fuzzy-match a partial slug or title to page slugs. | read | yes | || `restore_page` | Restore a soft-deleted page (clear deleted_at) and re-create its markdown file on disk (the counterpart to delete_page removing it; the result write_through field reports the outcome). | write | | || `revert_version` | Restore a page to an earlier version from its history (a new revision; history is kept). | write | | |+| `unpurge_page` | Owner-only (`gbrain pages unpurge <slug>`). | admin | | |## schemadiff --git a/src/core/ops/purge.ts b/src/core/ops/purge.tsindex 7b7393d639..9a3677e380 100644--- a/src/core/ops/purge.ts+++ b/src/core/ops/purge.ts@@ -33,6 +33,7 @@ const purge_fact: Operation = {const { submitPurgeFactMutation } = await import('../facts/purge.ts');return submitPurgeFactMutation(ctx, p);},+ area: 'facts',cliHints: { name: 'purge-fact', hidden: true },};@@ -52,6 +53,7 @@ const list_page_purges: Operation = {const { listPagePurges } = await import('../persistence/page-purge.ts');return listPagePurges(ctx, p);},+ area: 'pages',cliHints: { name: 'list-page-purges', hidden: true },};@@ -71,6 +73,7 @@ const unpurge_page: Operation = {const { unpurgePage } = await import('../persistence/page-purge.ts');return unpurgePage(ctx, p);},+ area: 'pages',cliHints: { name: 'unpurge-page', hidden: true },};diff --git a/test/remote-privacy-sweep.test.ts b/test/remote-privacy-sweep.test.tsindex 880570714c..e08314e6f1 100644--- a/test/remote-privacy-sweep.test.ts+++ b/test/remote-privacy-sweep.test.ts@@ -336,6 +336,9 @@ const EXPECTED_OUTCOME: Record<string, Outcome> = {// mutating ops (fresh-slug targets; envelope-echo checks only)remember: 'ok',forget: 'error',+ purge_fact: 'error',+ list_page_purges: 'error',+ unpurge_page: 'error',// rate_answer with no answer_id is a validation error; a real answer id only// ever names pages that answer returned to the same client.rate_answer: 'error',