Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

regen tool catalog, manifest and goldens; bench privacy scan without dynamic regexps

garrytan23b4303bfe5a
diff --git a/docs/TOOL_CATALOG.md b/docs/TOOL_CATALOG.md
index f999fc141d..9e69e62d91 100644
--- a/docs/TOOL_CATALOG.md
+++ b/docs/TOOL_CATALOG.md
@@ -226,7 +226,7 @@ Every non-localOnly operation on the MCP surface: 157 tools across 25 areas. **S
|---|---|---|---|---|
| `assemble_evidence` | Deliver whole evidence for an ordered list of search hits (each {source_id, slug, chunk_id} from a prior search/query result): the same windows, sections or pages `query` returns with return_unit, packed into token_budget. | read | | |
| `cache_stats` | Semantic query-cache introspection: resolved knobs (enabled, similarity threshold, TTL) plus row counts and total hits. | admin | | |
-| `query` | Hybrid search for concept/landscape questions and people/companies/projects by topic; expand adds multi-query expansion (expansion recovers synonyms). | read | yes | |
+| `query` | Hybrid search for questions and people/companies/projects by topic; ranks like `search` plus fact rows and a confidence grade. | read | yes | |
| `rate_answer` | Rate how useful an answer's retrieved evidence was, so this brain ranks better next time (zero LLM calls). | write | | |
| `search` | Cheap hybrid search, no LLM expansion, top 20: exact tokens, names, field values. | read | yes | |
| `search_by_image` | Image-as-query retrieval. | read | | |
diff --git a/scripts/bench/ranking-shapes/generate.ts b/scripts/bench/ranking-shapes/generate.ts
index 4408a762ac..d4078117ba 100644
--- a/scripts/bench/ranking-shapes/generate.ts
+++ b/scripts/bench/ranking-shapes/generate.ts
@@ -717,11 +717,13 @@ const scrub = (t: string) => scrubBase(t).replace(realFirstAll, m => inventedFor
for (const p of pages) { p.title = scrub(p.title); p.body = scrub(p.body); p.fm = JSON.parse(scrub(JSON.stringify(p.fm))); }
for (const r of rows) r.question = scrub(r.question);
-const denyRe = REAL_DENY.map(w => ({ w, re: new RegExp('(^|[^a-z0-9])' + w.replace(/[.*+?^$()|[\]\\{}]/g, '\\$&') + '([^a-z0-9]|$)', 'i') }));
+const words = (s: string) => ' ' + s.toLowerCase().replace(/[^a-z0-9&]+/g, ' ').trim() + ' ';
+const denyWords = REAL_DENY.map(w => ({ w, padded: words(w) }));
function privacyFindings(): string[] {
const out: string[] = [];
const check = (where: string, text: string) => {
- for (const { w, re } of denyRe) if (re.test(text)) out.push(where + ': "' + w + '"');
+ const padded = words(text);
+ for (const { w, padded: needle } of denyWords) if (padded.includes(needle)) out.push(where + ': "' + w + '"');
const m = text.match(realFirstRe);
if (m) out.push(where + ': common real name "' + m[2] + '"');
};
diff --git a/src/core/operation-manifest.generated.ts b/src/core/operation-manifest.generated.ts
index b0aa76284b..8ded82659a 100644
--- a/src/core/operation-manifest.generated.ts
+++ b/src/core/operation-manifest.generated.ts
@@ -1344,7 +1344,7 @@ export const OPERATION_MANIFEST: OperationMeta[] = [
"name": "query",
"idempotent": true,
"outputRedaction": "retrieval",
- "description": "Hybrid search for concept/landscape questions and people/companies/projects by topic; expand adds multi-query expansion (expansion recovers synonyms). Still top-K; return_unit: sections or conversations. Lists: list_pages. Exact tokens: `search` is cheaper (no LLM call). Personal: get_recent_salience, find_anomalies; transcripts: `gbrain transcripts recent`. Do NOT assume 'crazy' means impressive (often difficult or emotionally charged). Needs an embedding key (else keyword-only); expansion needs a chat key. Fact rows: use follow_up. fields: \"full\" adds diagnostics.",
+ "description": "Hybrid search for questions and people/companies/projects by topic; ranks like `search` plus fact rows and a confidence grade. expand: one LLM call, rarely helps. Still top-K; return_unit: sections or conversations. Lists: list_pages. Exact tokens: `search` is cheaper. Personal: get_recent_salience, find_anomalies; transcripts: `gbrain transcripts recent`. Do NOT assume 'crazy' means impressive (often difficult or emotionally charged). Needs an embedding key (else keyword-only); expansion needs a chat key. Fact rows: use follow_up. fields: \"full\" adds diagnostics.",
"params": {
"query": {
"type": "string",
@@ -1399,7 +1399,7 @@ export const OPERATION_MANIFEST: OperationMeta[] = [
},
"expand": {
"type": "boolean",
- "description": "Default off; search.expansion overrides."
+ "description": "Default off; one LLM call, rarely helps."
},
"detail": {
"type": "string",
diff --git a/test/fixtures/goldens/cli/help-and-errors.json b/test/fixtures/goldens/cli/help-and-errors.json
index 5ffff0a2f5..2c7c1a9e70 100644
--- a/test/fixtures/goldens/cli/help-and-errors.json
+++ b/test/fixtures/goldens/cli/help-and-errors.json
@@ -718,7 +718,7 @@
"stdout": [
"Usage: gbrain query <query> [options]",
"",
- "Hybrid search for concept/landscape questions and people/companies/projects by topic; expand adds multi-query expansion (expansion recovers synonyms). Still top-K; return_unit: sections or conversations. Lists: list_pages. Exact tokens: `search` is cheaper (no LLM call). Personal: get_recent_salience, find_anomalies; transcripts: `gbrain transcripts recent`. Do NOT assume 'crazy' means impressive (often difficult or emotionally charged). Needs an embedding key (else keyword-only); expansion needs a chat key. Fact rows: use follow_up. fields: \"full\" adds diagnostics.",
+ "Hybrid search for questions and people/companies/projects by topic; ranks like `search` plus fact rows and a confidence grade. expand: one LLM call, rarely helps. Still top-K; return_unit: sections or conversations. Lists: list_pages. Exact tokens: `search` is cheaper. Personal: get_recent_salience, find_anomalies; transcripts: `gbrain transcripts recent`. Do NOT assume 'crazy' means impressive (often difficult or emotionally charged). Needs an embedding key (else keyword-only); expansion needs a chat key. Fact rows: use follow_up. fields: \"full\" adds diagnostics.",
"",
"Options:",
" <query> Question or topic (required unless image).",
@@ -731,7 +731,7 @@
" --return-unit Default auto: whole conversations.",
" --return-window Window radius 1-3.",
" --token-budget Evidence token cap.",
- " --expand Default off; search.expansion overrides.",
+ " --expand Default off; one LLM call, rarely helps.",
" --detail low (compiled truth), medium (default) or high (all chunks).",
" --fields lean (remote default) or full.",
" --mode Local callers only.",
diff --git a/test/fixtures/goldens/exports/types.json b/test/fixtures/goldens/exports/types.json
index d8ce424a9e..ab6fa6a2ba 100644
--- a/test/fixtures/goldens/exports/types.json
+++ b/test/fixtures/goldens/exports/types.json
@@ -7239,7 +7239,7 @@
"kind": "variable",
"name": "AUTO_BLOCK_CHAR_CAP",
"signature": [
- "12000"
+ "8000"
]
},
{