Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
test: ingest verbs carry curated help (ingest-show second example, ingest-undo parses --yes); doctor goldens count 173 tables
garrytanaa417a492445
diff --git a/src/cli/help/ingest-show.ts b/src/cli/help/ingest-show.tsindex fe8531e92d..22af5d9fba 100644--- a/src/cli/help/ingest-show.ts+++ b/src/cli/help/ingest-show.ts@@ -7,5 +7,5 @@ export const help: CliHelpSpec = {flags: [{ name: '--json', type: 'boolean', desc: 'Print the report as JSON.' },],- examples: ['gbrain ingest-show <attempt_id> --json'],+ examples: ['gbrain ingest-show <attempt_id>', 'gbrain ingest-show <attempt_id> --json'],};diff --git a/test/cli-help-curated.test.ts b/test/cli-help-curated.test.tsindex b0e5342dc2..41ec5d223d 100644--- a/test/cli-help-curated.test.ts+++ b/test/cli-help-curated.test.ts@@ -2,7 +2,7 @@* Agent contract v1 D3/D4 (CLI-only half): curated help specs, their renderer* and the typed flag-value validator built from them.*- * Protects: the 8 ops-critical commands carry a curated spec whose flags the+ * Protects: the 8 ops-critical commands and the 3 ingest verbs carry a curated spec whose flags the* acceptance registry accepts (so help never advertises a flag the CLI then* rejects), `--yes` is listed wherever the handler parses it, the rendered* help shows type/values/consent, `curatedFlagError` turns a NaN number or an@@ -23,15 +23,17 @@ import { curatedFlagError } from '../src/cli/help/validate.ts';import { unknownFlagError } from '../src/cli/cli-error.ts';const OPS_CRITICAL = ['apply-migrations', 'autopilot', 'diag', 'doctor', 'import', 'onboard', 'serve', 'status'];-/** Handlers that parse `--yes` (doctor --remediate, apply-migrations parseArgs). */-const PARSES_YES = ['apply-migrations', 'doctor'];+/** GBRA-215: ingest and its show/undo verbs carry curated help too (pasted-document ingest, consent and preview flags). */+const CURATED = [...OPS_CRITICAL, 'ingest', 'ingest-show', 'ingest-undo'].sort();+/** Handlers that parse `--yes` (doctor --remediate, apply-migrations parseArgs, ingest-undo apply). */+const PARSES_YES = ['apply-migrations', 'doctor', 'ingest-undo'];describe('curated help specs (D3)', () => {- test('exactly the ops-critical commands carry a curated help module', () => {- expect(CLI_COMMANDS.filter(r => r.help).map(r => r.name).sort()).toEqual(OPS_CRITICAL);+ test('exactly the ops-critical commands and the ingest verbs carry a curated help module', () => {+ expect(CLI_COMMANDS.filter(r => r.help).map(r => r.name).sort()).toEqual(CURATED);});- for (const command of OPS_CRITICAL) {+ for (const command of CURATED) {test(`${command}: every curated flag is accepted by the generated registry and well-typed`, async () => {const spec = (await loadCuratedHelp(command))!;const accepted = new Set(CLI_FLAG_REGISTRY[command] ?? []);diff --git a/test/fixtures/goldens/doctor/content-pglite-human.json b/test/fixtures/goldens/doctor/content-pglite-human.jsonindex e54acdd89f..cbef61278c 100644--- a/test/fixtures/goldens/doctor/content-pglite-human.json+++ b/test/fixtures/goldens/doctor/content-pglite-human.json@@ -91,7 +91,7 @@" [OK] function_search_path: Every gbrain function that pins a search_path ends it with pg_temp"," [OK] schema_version: Version <latest> (latest: <latest>)"," [OK] schema_columns: 1388 column(s) verified against live schema",- " [OK] schema_missing_tables: All 172 table(s) the applied migrations create exist.",+ " [OK] schema_missing_tables: All 173 table(s) the applied migrations create exist."," [OK] rls_event_trigger: Skipped (PGLite — no event trigger support)"," [INFO] embeddings: Not applicable: embeddings are disabled on this brain (keyword search keeps working)."," [INFO] embedding_provider: Not probed: embeddings are disabled on this brain by choice (keyword search keeps working).",diff --git a/test/fixtures/goldens/doctor/content-pglite-json.json b/test/fixtures/goldens/doctor/content-pglite-json.jsonindex 7e433be648..b2ed9f16e0 100644--- a/test/fixtures/goldens/doctor/content-pglite-json.json+++ b/test/fixtures/goldens/doctor/content-pglite-json.json@@ -1155,7 +1155,7 @@{"category": "meta","elapsed_ms": "<volatile>",- "message": "All 172 table(s) the applied migrations create exist.",+ "message": "All 173 table(s) the applied migrations create exist.","name": "schema_missing_tables","status": "ok"},diff --git a/test/fixtures/goldens/doctor/hot-checks-pglite-json.json b/test/fixtures/goldens/doctor/hot-checks-pglite-json.jsonindex 675345e6fe..d9f46d88ff 100644--- a/test/fixtures/goldens/doctor/hot-checks-pglite-json.json+++ b/test/fixtures/goldens/doctor/hot-checks-pglite-json.json@@ -1226,7 +1226,7 @@{"category": "meta","elapsed_ms": "<volatile>",- "message": "All 172 table(s) the applied migrations create exist.",+ "message": "All 173 table(s) the applied migrations create exist.","name": "schema_missing_tables","status": "ok"},@@ -6198,7 +6198,7 @@{"category": "meta","elapsed_ms": "<volatile>",- "message": "All 172 table(s) the applied migrations create exist.",+ "message": "All 173 table(s) the applied migrations create exist.","name": "schema_missing_tables","status": "ok"},diff --git a/test/fixtures/goldens/doctor/json-pglite-degraded.json b/test/fixtures/goldens/doctor/json-pglite-degraded.jsonindex ea9b23d1d3..b8c6ee4322 100644--- a/test/fixtures/goldens/doctor/json-pglite-degraded.json+++ b/test/fixtures/goldens/doctor/json-pglite-degraded.json@@ -1068,7 +1068,7 @@{"category": "meta","elapsed_ms": "<volatile>",- "message": "All 172 table(s) the applied migrations create exist.",+ "message": "All 173 table(s) the applied migrations create exist.","name": "schema_missing_tables","status": "ok"},diff --git a/test/fixtures/goldens/doctor/json-pglite-fresh.json b/test/fixtures/goldens/doctor/json-pglite-fresh.jsonindex 31d76b7fcf..519f982c1b 100644--- a/test/fixtures/goldens/doctor/json-pglite-fresh.json+++ b/test/fixtures/goldens/doctor/json-pglite-fresh.json@@ -1115,7 +1115,7 @@{"category": "meta","elapsed_ms": "<volatile>",- "message": "All 172 table(s) the applied migrations create exist.",+ "message": "All 173 table(s) the applied migrations create exist.","name": "schema_missing_tables","status": "ok"},