Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

feat(cli): gbrain pricing set|list|unset, merge-safe and trusted-local only

garrytanfec4875a8d1c
diff --git a/scripts/module-size-limits.tsv b/scripts/module-size-limits.tsv
index 7277fa774e..de68b15f7c 100644
--- a/scripts/module-size-limits.tsv
+++ b/scripts/module-size-limits.tsv
@@ -3,7 +3,7 @@
# Raising a ceiling is a conscious, reviewer-visible act. Lower ceilings in
# the same commit as any peel (the guard fails on >50 lines of stale slack).
# Columns: path max_lines policy note
-src/cli.ts 3202 ratchet +2 fix wave 5 (#5401): projections drain help line and thin-client hint; +2 (#5137) key-shadow warning seam, logic in ai/key-warnings.ts; +2 System One v1: decide help line + thin-client refusal hint; refactor wave 1 split target (W4 cli); ceiling rationale: docs/architecture/key-files/entrypoints-and-docs.md entry for src/cli.ts; evidence delivery: thin-client return_unit version-skew warning (+3; logic in search/evidence-delivery.ts); put stdin recovery (#5700): stdin hint in the --content requires-a-value error and stdin usage/required text in printOpHelp (+7); logic in persistence/deactivation.ts); +36 #5827: link-command help examples, local --source vs --source-id/--all-sources conflict check, ambient-binding return from applyThinClientSourceScope (logic in cli/source-scope.ts); +4 #5433: list_pages TSV cell escaping in formatResult
+src/cli.ts 3204 ratchet +2 #lane-h pricing: help line + thin-client refusal hint for `gbrain pricing`; +2 fix wave 5 (#5401): projections drain help line and thin-client hint; +2 (#5137) key-shadow warning seam, logic in ai/key-warnings.ts; +2 System One v1: decide help line + thin-client refusal hint; refactor wave 1 split target (W4 cli); ceiling rationale: docs/architecture/key-files/entrypoints-and-docs.md entry for src/cli.ts; evidence delivery: thin-client return_unit version-skew warning (+3; logic in search/evidence-delivery.ts); put stdin recovery (#5700): stdin hint in the --content requires-a-value error and stdin usage/required text in printOpHelp (+7); logic in persistence/deactivation.ts); +36 #5827: link-command help examples, local --source vs --source-id/--all-sources conflict check, ambient-binding return from applyThinClientSourceScope (logic in cli/source-scope.ts); +4 #5433: list_pages TSV cell escaping in formatResult
src/commands/autopilot.ts 1639 ratchet refactor wave 1 split target (W4 autopilot, cut line); ceiling rationale: docs/architecture/key-files/commands-1.md entry for src/commands/autopilot.ts; +2 fix wave 5: nosemgrep justifications on the per-brain job launchctl/systemctl calls (#5195); +2 #5813: boot reconcile names attempted and running versions in log + audit; +2 #5855: Bun floor gate before the swap and the swap-refusal hold (logic in core/bun-floor.ts)
src/commands/doctor.ts 653 ratchet refactor wave 1 split target (W4 doctor); ceiling rationale: docs/architecture/key-files/commands-2.md entry for src/commands/doctor.ts
src/commands/embed.ts 2190 ratchet lowered v0.46.26.0: embedBatchWithBackoff + retry cluster peeled to core/embed-retry.ts (core/commands layering fix); grown wave-g (#4530): per-model input-limit wiring; wave-k #3622 reimpl: --stale zero-progress failure quarantine; +29 #4668 (#4530): oversize-heal call sites in both --stale drains — kept low by peeling the healed-row remap to core/embed-oversize-heal.ts (shared with embed-stale.ts); +35 #4647 (refs #4599): per-tick timeout+abort on the single-flight lock heartbeat refresh (interval deliberately NOT unref'd); +122 refs #4599: stall-watchdog race around the drain + shared idempotent flushAndRelease + CLI stall exit mapping (watchdog machinery itself lives in core/embed-stall.ts); +12: adversarial-review hardening (healed_splits progress key + heal-tick comment); #5105: guarded derived projection preparation and read seals; #5105: conditional embedding installer wiring; archived eligibility: active-only dispatch with honest stranded-work reporting; explicit archived admission: live-source snapshots and honest refused-installation failures; +2 fw3: embed --stale --images dispatch (sweep lives in core/embed-stale-images.ts); +5 #5289: dry run reports restamp-only chunks apart from chunks to embed (count lives in core/embedding-invalidation.ts); +6 #4616: keep a partially refused batch in embedPageTexts and name the recovery command in failure samples (guard lives in core/ai/embedding-guard.ts); +5 #5226: embed summary counts distinct pages; +3 #5804: null projection snapshot counted as a failure with one batch summary in embed --stale
diff --git a/src/cli.ts b/src/cli.ts
index 36693b5721..94384bdf4c 100755
--- a/src/cli.ts
+++ b/src/cli.ts
@@ -1895,6 +1895,7 @@ const THIN_CLIENT_REFUSE_HINTS: Record<string, string> = {
'code-callers': '`code-callers` has no MCP op yet. Run on the host.',
'code-callees': '`code-callees` has no MCP op yet. Run on the host.',
// scratch-DB audit additions
+ pricing: "pricing registers model prices in the host brain's config and is trusted-local only (a remote caller could void a cost cap). Ask the brain's operator to run `gbrain pricing set <model> ...` on the host.",
config: "config reads/writes the host brain's config plane. Edit the host's .gbrain/config.json (file-plane keys) or run on the host with GBRAIN_HOME set. self_upgrade.* keys are machine-local and work here.",
jobs: '`jobs list`, `jobs get <id>`, and `jobs stats` are thin-client routable; this subcommand runs against the host queue. Use the submit_job / list_jobs / get_job / get_job_stats MCP tools from your agent, or run on the host with GBRAIN_HOME set.',
// Gap-closure wave [OV6]: routable subcommands are intercepted before this
@@ -3100,6 +3101,7 @@ ADMIN
features [--json] [--auto-fix] Scan usage + recommend unused features
autopilot [--repo] [--interval N] Self-maintaining brain daemon
config [show|get|set] <key> [val] Brain config
+ pricing [set|list|unset] <model> Register model prices for cost caps (host only)
protocol [conformance|stats] MEMORY_VERBS v1: schemas, conformance
certification, local usage stats + TTHW
storage status [--repo <path>] Storage tier status and health
diff --git a/src/cli/command-table.ts b/src/cli/command-table.ts
index 0ea48a343e..fcc627fecf 100644
--- a/src/cli/command-table.ts
+++ b/src/cli/command-table.ts
@@ -214,6 +214,9 @@ export const CLI_COMMANDS: readonly CliCommandRecord[] = [ // Pre-connect: disp
// deliberately NOT here — it gets a partial dispatch (list/get route over MCP engine-free, the
// rest refuse) in the main dispatch before connectEngine().
{ name: 'config', phase: 'post-connect', thinClient: 'refuse', selfHelp: true, load: () => import('./commands/config.ts') },
+ // thin client: pricing writes the host brain's `pricing.overrides`. Registration is trusted-local
+ // only: a remote caller could declare $0 and void a cost cap, so it is never an operation either.
+ { name: 'pricing', phase: 'post-connect', thinClient: 'refuse', selfHelp: true, load: () => import('./commands/pricing.ts') },
{ name: 'migrate', phase: 'post-connect', thinClient: 'refuse', selfHelp: true, load: () => import('./commands/migrate.ts') },
{ name: 'retrieval-upgrade', phase: 'post-connect', thinClient: 'refuse', selfHelp: true, load: () => import('./commands/retrieval-upgrade.ts') },
// selfHelp: #3686 (the #578 residue): eval / storage / reindex each ship real usage — eval's
diff --git a/src/cli/commands/pricing.ts b/src/cli/commands/pricing.ts
new file mode 100644
index 0000000000..703687af3d
--- /dev/null
+++ b/src/cli/commands/pricing.ts
@@ -0,0 +1,11 @@
+/**
+ * `gbrain pricing`: post-connect dispatch, run by handleCliOnly with the
+ * engine connectEngine() opened. The record lives in src/cli/command-table.ts;
+ * the behavior lives in src/commands/pricing.ts.
+ */
+import type { BrainEngine } from '../../core/engine.ts';
+
+export async function run(engine: BrainEngine, args: string[]): Promise<void> {
+ const { runPricing } = await import('../../commands/pricing.ts');
+ await runPricing(engine, args);
+}
diff --git a/src/commands/pricing.ts b/src/commands/pricing.ts
new file mode 100644
index 0000000000..c09de8e9f5
--- /dev/null
+++ b/src/commands/pricing.ts
@@ -0,0 +1,244 @@
+/**
+ * `gbrain pricing` — register a model's per-token price in `pricing.overrides`.
+ *
+ * gbrain pricing set <model> --input <usd/1M> --output <usd/1M> [--source <url>]
+ * gbrain pricing set <model> --rate <usd/1M> [--source <url>] (embeddings, rerankers)
+ * gbrain pricing list [--json]
+ * gbrain pricing unset <model>
+ *
+ * Each write reads the stored JSON, changes one entry and writes it back, so
+ * other models' overrides survive (`config set pricing.overrides` replaces
+ * the whole value). A cost cap the user set refuses an unpriced model with
+ * `no_pricing`; the refusal tells the agent to look the rate up and run
+ * `pricing set` (src/core/budget/no-pricing.ts).
+ *
+ * Trust boundary: this is a CLI-only command, never an operation, so no MCP
+ * caller can reach it — a remote agent could otherwise declare $0 and void a
+ * cap. The command table refuses it on thin clients for the same reason.
+ *
+ * Entries keep the existing schema: `{input, output}` for chat, `pricePerMTok`
+ * for a single rate (input and output). `source` and `set_at` sit beside the
+ * rates for provenance; parsePricingOverrides ignores them.
+ */
+
+import type { BrainEngine } from '../core/engine.ts';
+import { parsePricingOverrides } from '../core/budget/budget-tracker.ts';
+import { setCliExitVerdict } from '../core/cli-force-exit.ts';
+
+const KEY = 'pricing.overrides';
+
+const HELP = `gbrain pricing — register model prices for cost caps
+
+USAGE
+ gbrain pricing set <model> --input <usd-per-1M> --output <usd-per-1M> [--source <url>]
+ gbrain pricing set <model> --rate <usd-per-1M> [--source <url>]
+ gbrain pricing list [--json]
+ gbrain pricing unset <model>
+
+Chat models take --input and --output (USD per 1M input / output tokens).
+Embedding and reranker models take one --rate (USD per 1M tokens).
+--source records where the rate came from, usually the provider's pricing page.
+
+Prices merge into the pricing.overrides config: other entries are kept.
+They win over gbrain's shipped price tables. A $0 rate is accepted with a
+warning: every call to that model then counts as free against all cost caps.
+
+This command runs only on the brain host's local CLI. Agents connected over
+MCP cannot register prices; they ask the operator to run the command.
+See docs/operations/spend-controls.md#registering-a-model-price.
+`;
+
+export interface PricingEntry {
+ input?: number;
+ output?: number;
+ pricePerMTok?: number;
+ source?: string;
+ set_at?: string;
+}
+
+type RawOverrides = Record<string, unknown>;
+
+/** Parse the stored value. Refuses (throws) instead of clobbering an unreadable value. */
+export function readRawOverrides(raw: string | null): RawOverrides {
+ if (raw == null || raw.trim() === '') return {};
+ let value: unknown;
+ try {
+ value = JSON.parse(raw);
+ } catch {
+ throw new Error(`${KEY} is not valid JSON, so it was left unchanged. Inspect it with: gbrain config get ${KEY}`);
+ }
+ if (typeof value !== 'object' || value === null || Array.isArray(value)) {
+ throw new Error(`${KEY} is not a JSON object, so it was left unchanged. Inspect it with: gbrain config get ${KEY}`);
+ }
+ return value as RawOverrides;
+}
+
+const normalize = (model: string) => model.trim().toLowerCase();
+
+function withoutModel(overrides: RawOverrides, model: string): { rest: RawOverrides; removed: string[] } {
+ const rest: RawOverrides = {};
+ const removed: string[] = [];
+ for (const [k, v] of Object.entries(overrides)) {
+ if (normalize(k) === normalize(model)) removed.push(k);
+ else rest[k] = v;
+ }
+ return { rest, removed };
+}
+
+/** Returns the rate or an error message. Non-negative finite numbers only. */
+function parseRate(flag: string, value: string | undefined): number | string {
+ if (value === undefined || value.trim() === '' || value.startsWith('--')) return `${flag} needs a value in USD per 1M tokens.`;
+ const n = Number(value);
+ if (!Number.isFinite(n) || n < 0) return `${flag} must be a non-negative number of USD per 1M tokens (got "${value}").`;
+ return n;
+}
+
+export interface PricingSetRequest {
+ model: string;
+ input?: number;
+ output?: number;
+ rate?: number;
+ source?: string;
+}
+
+/** Merge one model's price into the stored overrides. Pure. */
+export function mergePricing(overrides: RawOverrides, req: PricingSetRequest, now: Date): { next: RawOverrides; entry: PricingEntry; replaced: boolean } {
+ const { rest, removed } = withoutModel(overrides, req.model);
+ const entry: PricingEntry = req.rate !== undefined
+ ? { pricePerMTok: req.rate }
+ : { input: req.input, output: req.output };
+ if (req.source) entry.source = req.source;
+ entry.set_at = now.toISOString();
+ return { next: { ...rest, [normalize(req.model)]: entry }, entry, replaced: removed.length > 0 };
+}
+
+function flagValue(args: string[], flag: string): string | undefined {
+ const i = args.indexOf(flag);
+ if (i === -1) return undefined;
+ return args[i + 1] ?? '';
+}
+
+function fail(message: string): void {
+ console.error(`gbrain pricing: ${message}`);
+ setCliExitVerdict(1);
+}
+
+function describeEntry(value: unknown): { input: number; output: number } | null {
+ const parsed = parsePricingOverrides({ probe: value });
+ return parsed?.probe ?? null;
+}
+
+async function runSet(engine: BrainEngine, args: string[]): Promise<void> {
+ const model = args[0];
+ if (!model || model.startsWith('--')) return fail('missing <model>. Usage: gbrain pricing set <model> --input <usd-per-1M> --output <usd-per-1M>');
+ const has = (flag: string) => args.includes(flag);
+ const req: PricingSetRequest = { model: model.trim() };
+ if (has('--rate')) {
+ if (has('--input') || has('--output')) return fail('use either --rate, or --input with --output, not both.');
+ const rate = parseRate('--rate', flagValue(args, '--rate'));
+ if (typeof rate === 'string') return fail(rate);
+ req.rate = rate;
+ } else if (has('--input') || has('--output')) {
+ if (!has('--input') || !has('--output')) return fail('chat prices need both --input and --output (use --rate for a single per-token rate).');
+ const input = parseRate('--input', flagValue(args, '--input'));
+ if (typeof input === 'string') return fail(input);
+ const output = parseRate('--output', flagValue(args, '--output'));
+ if (typeof output === 'string') return fail(output);
+ req.input = input;
+ req.output = output;
+ } else {
+ return fail('give the price: --input <usd-per-1M> --output <usd-per-1M> for chat models, or --rate <usd-per-1M> for embeddings.');
+ }
+ if (has('--source')) {
+ const source = flagValue(args, '--source')?.trim();
+ if (!source || source.startsWith('--')) return fail('--source needs a value (the pricing page URL).');
+ req.source = source;
+ }
+
+ let current: RawOverrides;
+ try {
+ current = readRawOverrides(await engine.getConfig(KEY));
+ } catch (err) {
+ return fail((err as Error).message);
+ }
+ const { next, entry, replaced } = mergePricing(current, req, new Date());
+ await engine.setConfig(KEY, JSON.stringify(next));
+
+ const rates = req.rate !== undefined
+ ? `$${req.rate} per 1M tokens`
+ : `$${req.input} per 1M input tokens, $${req.output} per 1M output tokens`;
+ if (args.includes('--json')) {
+ console.log(JSON.stringify({ model: normalize(req.model), ...entry, replaced }, null, 2));
+ } else {
+ console.log(`${replaced ? 'Updated' : 'Registered'} ${normalize(req.model)}: ${rates}${req.source ? ` (source: ${req.source})` : ''}.`);
+ console.log('Cost caps now price this model at that rate. Retry the command that was refused.');
+ }
+ if (req.rate === 0 || (req.input === 0 && req.output === 0)) {
+ console.error(`gbrain pricing: warning: ${normalize(req.model)} is registered at $0, so its calls count as free against every cost cap. Use $0 only for local or flat-rate routes.`);
+ }
+}
+
+async function runList(engine: BrainEngine, args: string[]): Promise<void> {
+ let current: RawOverrides;
+ try {
+ current = readRawOverrides(await engine.getConfig(KEY));
+ } catch (err) {
+ return fail((err as Error).message);
+ }
+ const rows = Object.entries(current).map(([model, value]) => {
+ const priced = describeEntry(value);
+ const meta = value && typeof value === 'object' ? value as PricingEntry : {};
+ return {
+ model,
+ input: priced?.input ?? null,
+ output: priced?.output ?? null,
+ valid: priced !== null,
+ source: meta.source ?? null,
+ set_at: meta.set_at ?? null,
+ };
+ });
+ if (args.includes('--json')) {
+ console.log(JSON.stringify({ overrides: rows }, null, 2));
+ return;
+ }
+ if (rows.length === 0) {
+ console.log('No registered prices. Add one with: gbrain pricing set <model> --input <usd-per-1M> --output <usd-per-1M>');
+ return;
+ }
+ console.log('Registered prices (USD per 1M tokens; these win over the shipped tables):');
+ for (const r of rows) {
+ const rate = r.valid ? `input $${r.input}, output $${r.output}` : 'invalid entry, ignored by cost caps';
+ const extra = [r.source && `source ${r.source}`, r.set_at && `set ${r.set_at}`].filter(Boolean).join('; ');
+ console.log(` ${r.model}: ${rate}${extra ? ` (${extra})` : ''}`);
+ }
+}
+
+async function runUnset(engine: BrainEngine, args: string[]): Promise<void> {
+ const model = args[0];
+ if (!model || model.startsWith('--')) return fail('missing <model>. Usage: gbrain pricing unset <model>');
+ let current: RawOverrides;
+ try {
+ current = readRawOverrides(await engine.getConfig(KEY));
+ } catch (err) {
+ return fail((err as Error).message);
+ }
+ const { rest, removed } = withoutModel(current, model);
+ if (removed.length === 0) {
+ console.log(`No registered price for ${normalize(model)}; nothing changed.`);
+ return;
+ }
+ await engine.setConfig(KEY, JSON.stringify(rest));
+ console.log(`Removed the registered price for ${normalize(model)}. Under a cost cap it is unpriced again unless gbrain ships a rate for it.`);
+}
+
+export async function runPricing(engine: BrainEngine, args: string[]): Promise<void> {
+ const [sub, ...rest] = args;
+ if (!sub || sub === '--help' || sub === '-h' || args.includes('--help') || args.includes('-h')) {
+ console.log(HELP);
+ return;
+ }
+ if (sub === 'set') return runSet(engine, rest);
+ if (sub === 'list') return runList(engine, rest);
+ if (sub === 'unset') return runUnset(engine, rest);
+ fail(`unknown subcommand "${sub}". Run gbrain pricing --help.`);
+}
diff --git a/src/core/cli-flag-registry.generated.ts b/src/core/cli-flag-registry.generated.ts
index e3420730be..f8add9ae4e 100644
--- a/src/core/cli-flag-registry.generated.ts
+++ b/src/core/cli-flag-registry.generated.ts
@@ -19,7 +19,7 @@ export const CLI_FLAG_REGISTRY: Record<string, readonly string[]> = {
'anomalies': ['--brain', '--help', '--json', '--lookback-days', '--mcp-only', '--sigma', '--since', '--source'],
'apply-migrations': ['--acknowledge-no-backup', '--apply', '--backup-confirmed', '--brain', '--break-lock', '--confirm-quiesced', '--content-root', '--dry-run', '--export-db-only', '--export-source', '--force', '--force-all', '--force-orchestrator', '--force-retry', '--force-schema', '--help', '--host-dir', '--json', '--list', '--locks', '--migrate-only', '--migration', '--mode', '--no-autopilot-install', '--non-interactive', '--require-db', '--skip-verify', '--source', '--yes'],
'auth': ['--admin-intent', '--allowed-operations', '--before', '--bound-brain', '--bound-max-concurrent', '--bound-slug-prefixes', '--bound-source', '--bound-tools', '--brain', '--budget-usd-per-day', '--cleanup-dead-local-locks', '--confirm-quiesced', '--days', '--delegated-namespace', '--delegated-slug-prefixes', '--enable-dcr-insecure', '--expected-epoch', '--expected-state', '--federated-read', '--fix', '--force', '--grant-types', '--help', '--id', '--if-version', '--json', '--limit', '--manifest', '--max-concurrent', '--no-pull', '--path', '--probe', '--profile', '--redirect-uri', '--repair', '--replace', '--request-id', '--retry-failed', '--scopes', '--self-transfer', '--shared-skills', '--slug-prefixes', '--source', '--source-ids', '--surface', '--takes-holders', '--token', '--token-endpoint-auth-method', '--token-ttl', '--usage', '--yes'],
- 'autopilot': ['--batch', '--brain', '--check', '--dimensions', '--dir', '--drain', '--embedding-dimensions', '--embedding-model', '--explain', '--ff-only', '--force', '--force-retry', '--from-pages', '--help', '--inject-bootstrap', '--inline', '--install', '--interval', '--json', '--markdown', '--max-rss', '--max-usd', '--migrate-only', '--no-autopilot-install', '--no-bun-floor-check', '--no-inject', '--no-worker', '--non-interactive', '--now', '--once', '--output', '--params', '--path', '--pause', '--phase', '--reason', '--refresh-cache', '--remediation-plan', '--repo', '--resume', '--source', '--stale', '--status', '--swap-only', '--target', '--uninstall', '--user', '--verify', '--version', '--yes'],
+ 'autopilot': ['--batch', '--brain', '--check', '--dimensions', '--dir', '--drain', '--embedding-dimensions', '--embedding-model', '--explain', '--ff-only', '--force', '--force-retry', '--from-pages', '--help', '--inject-bootstrap', '--inline', '--install', '--interval', '--json', '--markdown', '--max-rss', '--max-usd', '--migrate-only', '--no-autopilot-install', '--no-bun-floor-check', '--no-inject', '--no-worker', '--non-interactive', '--now', '--once', '--output', '--params', '--path', '--pause', '--phase', '--rate', '--reason', '--refresh-cache', '--remediation-plan', '--repo', '--resume', '--source', '--stale', '--status', '--swap-only', '--target', '--uninstall', '--user', '--verify', '--version', '--yes'],
'backfill': ['--batch-size', '--brain', '--concurrency', '--dry-run', '--fresh', '--help', '--json', '--keep-index', '--list', '--max-errors', '--max-rows', '--resume', '--source'],
'backup': ['--background', '--brain', '--confirm-authority-reviewed', '--confirm-backup-compatible', '--confirm-quiesced', '--dir', '--explain', '--follow', '--full', '--help', '--into', '--json', '--mode', '--output', '--path', '--progress-interval', '--progress-json', '--quiet', '--restore-only', '--source', '--timeout'],
'bench': ['--baseline', '--brain', '--force', '--from', '--help', '--json', '--label', '--limit', '--source', '--threshold-jaccard', '--threshold-latency-multiplier', '--threshold-top1', '--to', '--tool'],
@@ -46,16 +46,16 @@ export const CLI_FLAG_REGISTRY: Record<string, readonly string[]> = {
'creds': ['--allow-create-db', '--allow-docker', '--brain', '--chat-model', '--content-root', '--db-only', '--embedding-dimensions', '--embedding-model', '--entity', '--expansion-model', '--force', '--git', '--grant-types', '--help', '--http', '--ids', '--issuer-url', '--json', '--key', '--local-postgres', '--mcp-only', '--mcp-url', '--migrate-only', '--model', '--no-embedding', '--no-git', '--non-interactive', '--oauth-client-id', '--oauth-client-secret', '--out', '--passphrase-env', '--path', '--pglite', '--prefer-postgres', '--provenance', '--provider', '--schema-pack', '--scopes', '--skip-embed-check', '--source', '--status', '--supabase', '--surface', '--to', '--url', '--version'],
'db-repair': ['--apply', '--apply-rewrites', '--brain', '--break-lock', '--db-url', '--dry-run', '--filter', '--force', '--force-retry', '--format', '--help', '--json', '--locks', '--name', '--path', '--prefer-postgres', '--remediate', '--restart', '--skip-verify', '--source', '--supabase', '--undo-last-rewrite', '--url', '--version', '--yes'],
'decide': ['--all', '--all-from', '--brain', '--call-site', '--dataset', '--dry-run', '--egress', '--embedding-dimensions', '--embedding-model', '--from', '--help', '--input', '--json', '--limit', '--min', '--out', '--provider', '--query', '--recommended', '--shadow', '--since', '--slot', '--source', '--status', '--suite', '--target', '--threshold', '--what-if-threshold', '--yes'],
- 'doctor': ['--abbrev-ref', '--abort', '--admin-intent', '--all', '--all-from', '--allow-old-serve', '--allow-shell-jobs', '--allow-unverified-remote', '--apply', '--apply-rewrites', '--auto', '--auto-fix', '--background', '--brain', '--branch', '--break-lock', '--by-mention', '--cached', '--call-site', '--check', '--concurrency', '--confidence', '--confirm', '--content-audit', '--count', '--dataset', '--db-url', '--delete-brain', '--detach', '--diff-filter', '--dim', '--dir', '--drain', '--dry-run', '--egress', '--embedding-dimensions', '--embedding-model', '--env', '--exclude', '--exclude-standard', '--exit-code', '--expect', '--expected-epoch', '--expected-state', '--explain', '--fast', '--federated-read', '--file', '--fix', '--follow', '--force', '--force-rechunk', '--force-retry', '--force-schema', '--format', '--fresh', '--from', '--from-pages', '--full', '--gbrain-bin', '--get', '--get-url', '--git-dir', '--git-path', '--harness', '--help', '--home', '--http', '--id', '--ignore-env-override', '--include-ambiguous', '--include-flagged', '--include-gitignored', '--include-hidden', '--include-pseudo', '--include-repairs', '--index-audit', '--init', '--input', '--install', '--is-ancestor', '--is-inside-work-tree', '--job-isolation', '--jq', '--json', '--lang', '--limit', '--link-source', '--link-type', '--local', '--locks', '--log-noop', '--manifest', '--markdown', '--max-cost', '--max-cost-usd', '--max-jobs', '--max-rss', '--max-usd', '--mcp-only', '--migrate-only', '--min', '--mode', '--multimodal', '--name', '--name-only', '--nice', '--no-autopilot-install', '--no-capture', '--no-cron', '--no-embed', '--no-embedding', '--no-extract', '--no-hooks', '--no-migrate', '--no-pull', '--no-schema-pack', '--no-tags', '--no-verify', '--no-write-fetch-head', '--older-than', '--once', '--others', '--out', '--overwrite', '--parallel', '--params', '--pat-file', '--path', '--pglite', '--phase', '--pid-file', '--porcelain', '--port', '--prefer-postgres', '--preset', '--preview', '--probe-pglite', '--progress-interval', '--progress-json', '--project', '--provider', '--prune-orphans', '--pure', '--push', '--push-only', '--query', '--queue', '--quiet', '--reauth', '--rebase', '--recommended', '--refresh', '--regenerate', '--reissue', '--remediate', '--remediation-plan', '--remove', '--repo', '--request-id', '--reranker', '--reset', '--reset-checkpoint', '--restore-only', '--resume', '--retry-failed', '--review-lower', '--scope', '--scopes', '--select', '--self-transfer', '--session', '--set', '--shadow', '--short', '--show-current', '--show-token', '--show-toplevel', '--since', '--skills', '--skills-dir', '--skip-bare-tweet', '--skip-failed', '--skip-urls', '--skip-verify', '--slot', '--slugs', '--source', '--source-id', '--src-subpath', '--stale', '--status', '--strategy', '--strict', '--suite', '--supabase', '--surface', '--symbol-kind', '--target', '--target-score', '--threshold', '--timeout', '--to', '--token', '--token-name', '--token-ttl', '--top-k', '--type', '--unsafe-bypass-dream-guard', '--unset-all', '--untracked-files', '--url', '--user', '--vectors', '--verbose', '--verify', '--version', '--what-if-threshold', '--window', '--workers', '--working-tree', '--yes'],
- 'dream': ['--audit-rejects', '--brain', '--cancel-unmatched', '--date', '--dir', '--drain', '--dry-run', '--eval-run', '--force', '--force-retry', '--from', '--help', '--input', '--install', '--json', '--limit', '--list', '--max-usd', '--once', '--path', '--phase', '--pull', '--reconcile-queue', '--since', '--source', '--source-id', '--threshold', '--to', '--unsafe-bypass-dream-guard', '--window', '--yes'],
+ 'doctor': ['--abbrev-ref', '--abort', '--admin-intent', '--all', '--all-from', '--allow-old-serve', '--allow-shell-jobs', '--allow-unverified-remote', '--apply', '--apply-rewrites', '--auto', '--auto-fix', '--background', '--brain', '--branch', '--break-lock', '--by-mention', '--cached', '--call-site', '--check', '--concurrency', '--confidence', '--confirm', '--content-audit', '--count', '--dataset', '--db-url', '--delete-brain', '--detach', '--diff-filter', '--dim', '--dir', '--drain', '--dry-run', '--egress', '--embedding-dimensions', '--embedding-model', '--env', '--exclude', '--exclude-standard', '--exit-code', '--expect', '--expected-epoch', '--expected-state', '--explain', '--fast', '--federated-read', '--file', '--fix', '--follow', '--force', '--force-rechunk', '--force-retry', '--force-schema', '--format', '--fresh', '--from', '--from-pages', '--full', '--gbrain-bin', '--get', '--get-url', '--git-dir', '--git-path', '--harness', '--help', '--home', '--http', '--id', '--ignore-env-override', '--include-ambiguous', '--include-flagged', '--include-gitignored', '--include-hidden', '--include-pseudo', '--include-repairs', '--index-audit', '--init', '--input', '--install', '--is-ancestor', '--is-inside-work-tree', '--job-isolation', '--jq', '--json', '--lang', '--limit', '--link-source', '--link-type', '--local', '--locks', '--log-noop', '--manifest', '--markdown', '--max-cost', '--max-cost-usd', '--max-jobs', '--max-rss', '--max-usd', '--mcp-only', '--migrate-only', '--min', '--mode', '--multimodal', '--name', '--name-only', '--nice', '--no-autopilot-install', '--no-capture', '--no-cron', '--no-embed', '--no-embedding', '--no-extract', '--no-hooks', '--no-migrate', '--no-pull', '--no-schema-pack', '--no-tags', '--no-verify', '--no-write-fetch-head', '--older-than', '--once', '--others', '--out', '--overwrite', '--parallel', '--params', '--pat-file', '--path', '--pglite', '--phase', '--pid-file', '--porcelain', '--port', '--prefer-postgres', '--preset', '--preview', '--probe-pglite', '--progress-interval', '--progress-json', '--project', '--provider', '--prune-orphans', '--pure', '--push', '--push-only', '--query', '--queue', '--quiet', '--rate', '--reauth', '--rebase', '--recommended', '--refresh', '--regenerate', '--reissue', '--remediate', '--remediation-plan', '--remove', '--repo', '--request-id', '--reranker', '--reset', '--reset-checkpoint', '--restore-only', '--resume', '--retry-failed', '--review-lower', '--scope', '--scopes', '--select', '--self-transfer', '--session', '--set', '--shadow', '--short', '--show-current', '--show-token', '--show-toplevel', '--since', '--skills', '--skills-dir', '--skip-bare-tweet', '--skip-failed', '--skip-urls', '--skip-verify', '--slot', '--slugs', '--source', '--source-id', '--src-subpath', '--stale', '--status', '--strategy', '--strict', '--suite', '--supabase', '--surface', '--symbol-kind', '--target', '--target-score', '--threshold', '--timeout', '--to', '--token', '--token-name', '--token-ttl', '--top-k', '--type', '--unsafe-bypass-dream-guard', '--unset-all', '--untracked-files', '--url', '--user', '--vectors', '--verbose', '--verify', '--version', '--what-if-threshold', '--window', '--workers', '--working-tree', '--yes'],
+ 'dream': ['--audit-rejects', '--brain', '--cancel-unmatched', '--date', '--dir', '--drain', '--dry-run', '--eval-run', '--force', '--force-retry', '--from', '--help', '--input', '--install', '--json', '--limit', '--list', '--max-usd', '--once', '--path', '--phase', '--pull', '--rate', '--reconcile-queue', '--since', '--source', '--source-id', '--threshold', '--to', '--unsafe-bypass-dream-guard', '--window', '--yes'],
'edges-backfill': ['--all-sources', '--brain', '--concurrency', '--help', '--json', '--max-chunks', '--source', '--workers'],
'embed': ['--all', '--background', '--batch-size', '--brain', '--break-lock', '--budget-ms', '--catch-up', '--db-url', '--dim', '--dry-run', '--embedding-dimensions', '--embedding-model', '--explain', '--facts', '--follow', '--force', '--help', '--images', '--include-null-signature', '--json', '--max-cost-usd', '--max-facts', '--no-embed', '--no-embedding', '--pace', '--pace-max-concurrency', '--path', '--pglite', '--priority', '--progress-interval', '--progress-json', '--quiet', '--show-toplevel', '--slugs', '--source', '--stale', '--status', '--supabase', '--timeout', '--to', '--yes'],
'engine': ['--apply-rewrites', '--brain', '--break-lock', '--db-url', '--help', '--json', '--path', '--prefer-postgres', '--probe', '--source', '--supabase', '--url', '--yes'],
- 'enrich': ['--access', '--asof', '--background', '--bound-slug-prefixes', '--brain', '--concurrency', '--confirm-destructive', '--date', '--days', '--dry-run', '--embedding-dimensions', '--embedding-model', '--entities', '--explain', '--federated-read', '--file', '--follow', '--force', '--full', '--help', '--http', '--image', '--json', '--kind', '--limit', '--max-cost', '--max-cost-usd', '--max-runtime', '--max-usd', '--min-context', '--mode', '--model', '--multimodal', '--once', '--order', '--page', '--path', '--progress-interval', '--progress-json', '--quiet', '--reenrich-after', '--resume', '--session', '--since', '--slug', '--slugs', '--source', '--source-id', '--stats', '--status', '--surface', '--thin', '--thin-threshold', '--timeout', '--trusted-extraction', '--types', '--url', '--workers', '--yes'],
+ 'enrich': ['--access', '--asof', '--background', '--bound-slug-prefixes', '--brain', '--concurrency', '--confirm-destructive', '--date', '--days', '--dry-run', '--embedding-dimensions', '--embedding-model', '--entities', '--explain', '--federated-read', '--file', '--follow', '--force', '--full', '--help', '--http', '--image', '--input', '--json', '--kind', '--limit', '--max-cost', '--max-cost-usd', '--max-runtime', '--max-usd', '--min-context', '--mode', '--model', '--multimodal', '--once', '--order', '--output', '--page', '--path', '--progress-interval', '--progress-json', '--quiet', '--rate', '--reenrich-after', '--resume', '--session', '--since', '--slug', '--slugs', '--source', '--source-id', '--stats', '--status', '--surface', '--thin', '--thin-threshold', '--timeout', '--trusted-extraction', '--types', '--url', '--workers', '--yes'],
'eval': ['--ab-relational', '--against', '--allow-incomplete-judgments', '--allow-mixed-run-config', '--allow-regression', '--asof', '--autocut', '--background', '--baseline', '--batch', '--brain', '--budget-usd', '--budget-usd-answer', '--budget-usd-retrieval', '--by-type', '--by-type-floor', '--by-type-floor-metric', '--candidate', '--capture-pool', '--committed-baseline', '--compare', '--compare-limit', '--concurrent', '--config-a', '--config-b', '--corpus', '--cycles', '--days', '--decide', '--decide-calibration', '--decide-dataset', '--decide-force-on', '--decide-provider', '--decide-threshold', '--dedup-cosine', '--dedup-max-per-page', '--dedup-type-ratio', '--dimensions', '--distance-min', '--draws', '--embed-cache', '--embedder', '--embedding-dimensions', '--embedding-model', '--eval-pool-depth', '--expand', '--expansion', '--expansion-replay', '--expansion-variant-budget', '--explain', '--fixtures', '--follow', '--force-rechunk', '--format', '--from-capture', '--from-db', '--gold', '--grounding-min', '--harness', '--help', '--include-abstention', '--include-holdout', '--input', '--json', '--judge', '--judge-concurrency', '--judge-model', '--justification', '--k', '--keyword-only', '--limit', '--llm', '--max-pair-chars', '--max-tokens', '--max-usd', '--mcp-only', '--md', '--metric', '--min-recall', '--mode', '--model', '--models', '--modes', '--name-only', '--no-cache', '--no-embed-cache', '--no-expand', '--no-llm', '--no-trajectory', '--older-than', '--out', '--output', '--output-dir', '--parallel', '--parity-baseline', '--pglite', '--progress-interval', '--progress-json', '--qrels', '--queries-file', '--query', '--question-ids', '--questions', '--quiet', '--reader-max-tokens', '--reader-mode', '--receipt-dir', '--record', '--refresh-cache', '--reranker', '--resume-from', '--retrieval-only', '--rrf-k', '--rubric-version', '--runs', '--sample', '--sampling', '--save', '--search-pin', '--seed', '--severity', '--short', '--show-toplevel', '--since', '--skip-replay', '--slot', '--slot-a-model', '--slot-b-model', '--slot-c-model', '--slug', '--slug-prefix', '--source', '--stale', '--status', '--strategy', '--suite', '--suites', '--supabase', '--task', '--threshold', '--threshold-expected-top1', '--threshold-first-relevant-hit', '--threshold-jaccard', '--threshold-latency-multiplier', '--threshold-recall-at-k', '--threshold-top1', '--timeout', '--tool', '--top-k', '--top-regressions', '--until', '--update-baseline', '--usefulness-min', '--vectors', '--verbose', '--verify', '--with-code-intel', '--yes'],
'export': ['--background', '--brain', '--dir', '--explain', '--fix', '--follow', '--help', '--json', '--progress-interval', '--progress-json', '--quiet', '--repo', '--restore-only', '--slug-prefix', '--source', '--timeout', '--type'],
'extract': ['--admin-intent', '--after-slug', '--apply-preview', '--background', '--backup-verified', '--brain', '--break-lock', '--by-mention', '--catch-up', '--checkpoint', '--concurrency', '--confirm', '--db-url', '--dir', '--dry-run', '--expected-epoch', '--expected-state', '--explain', '--follow', '--from-meetings', '--help', '--include-frontmatter', '--infer-dates', '--json', '--kind', '--limit', '--manifest', '--ner', '--pack', '--path', '--progress-interval', '--progress-json', '--prune-orphans', '--quiet', '--rebuild', '--repair-attendance', '--self-transfer', '--since', '--source', '--source-id', '--stale', '--timeout', '--type', '--verbose', '--workers', '--yes'],
- 'extract-conversation-facts': ['--admin-intent', '--background', '--brain', '--concurrency', '--confirm-destructive', '--dim', '--dry-run', '--embedding-dimensions', '--embedding-model', '--expected-epoch', '--expected-state', '--explain', '--follow', '--force', '--help', '--json', '--limit', '--manifest', '--max-cost', '--max-cost-usd', '--max-runtime', '--no-embedding', '--override-disabled', '--path', '--pglite', '--progress-interval', '--progress-json', '--quiet', '--segment-limit', '--self-transfer', '--since', '--sleep', '--slug', '--source', '--source-id', '--stale', '--status', '--supabase', '--timeout', '--to', '--types', '--url', '--workers', '--yes'],
+ 'extract-conversation-facts': ['--admin-intent', '--background', '--brain', '--concurrency', '--confirm-destructive', '--dim', '--dry-run', '--embedding-dimensions', '--embedding-model', '--expected-epoch', '--expected-state', '--explain', '--follow', '--force', '--help', '--input', '--json', '--limit', '--manifest', '--max-cost', '--max-cost-usd', '--max-runtime', '--no-embedding', '--output', '--override-disabled', '--path', '--pglite', '--progress-interval', '--progress-json', '--quiet', '--rate', '--segment-limit', '--self-transfer', '--since', '--sleep', '--slug', '--source', '--source-id', '--stale', '--status', '--supabase', '--timeout', '--to', '--types', '--url', '--workers', '--yes'],
'facts': ['--admin-intent', '--after-id', '--brain', '--dry-run', '--entity', '--examples', '--expected-state', '--help', '--include-private', '--json', '--limit', '--max-cost-usd', '--max-usd', '--no-conflict-queue', '--no-llm', '--path', '--retry-model', '--since', '--source'],
'features': ['--all', '--auto', '--auto-fix', '--background', '--batch-size', '--brain', '--by-mention', '--catch-up', '--concurrency', '--dir', '--explain', '--facts', '--from-meetings', '--help', '--images', '--include-frontmatter', '--include-null-signature', '--infer-dates', '--json', '--kind', '--ner', '--overwrite', '--pace', '--pace-max-concurrency', '--pack', '--path', '--priority', '--prune-orphans', '--rebuild', '--refresh', '--repo', '--since', '--slugs', '--source', '--source-id', '--stale', '--target', '--type', '--verbose', '--workers'],
'files': ['--background', '--brain', '--dry-run', '--explain', '--follow', '--help', '--json', '--no-pointer', '--page', '--progress-interval', '--progress-json', '--quiet', '--retry-failed', '--source', '--timeout', '--type', '--yes'],
@@ -70,14 +70,14 @@ export const CLI_FLAG_REGISTRY: Record<string, readonly string[]> = {
'init': ['--all', '--allow-create-db', '--allow-docker', '--brain', '--break-lock', '--chat-model', '--check', '--content-root', '--db-only', '--dim', '--embedding-dimensions', '--embedding-model', '--entity', '--expansion-model', '--force', '--git', '--grant-types', '--help', '--http', '--issuer-url', '--json', '--key', '--local-postgres', '--mcp-only', '--mcp-url', '--migrate-only', '--model', '--no-embedding', '--no-expand', '--no-git', '--non-interactive', '--oauth-client-id', '--oauth-client-secret', '--path', '--pglite', '--prefer-postgres', '--probe', '--provenance', '--quiet', '--schema-pack', '--scopes', '--show-toplevel', '--skip-embed-check', '--source', '--stale', '--status', '--supabase', '--surface', '--to', '--touchpoint', '--url', '--version', '--yes'],
'integrations': ['--auto', '--brain', '--dry-run', '--help', '--json', '--overwrite', '--refresh', '--source', '--target'],
'integrity': ['--auto', '--backend', '--background', '--brain', '--confidence', '--cost', '--dry-run', '--explain', '--follow', '--fresh', '--help', '--json', '--limit', '--progress-interval', '--progress-json', '--quiet', '--review-lower', '--skip-bare-tweet', '--skip-urls', '--source', '--supabase', '--timeout', '--type', '--url'],
- 'jobs': ['--abbrev-ref', '--access', '--aliases', '--all', '--allow-empty', '--allow-shell-jobs', '--asof', '--auto', '--background', '--backoff-delay', '--backoff-jitter', '--backoff-type', '--batch-size', '--bound-slug-prefixes', '--brain', '--break-lock', '--by-mention', '--cached', '--catch-up', '--cli-path', '--cluster-errors', '--concurrency', '--confidence', '--confirm-destructive', '--cost-estimate', '--date', '--days', '--delay', '--detach', '--diff-filter', '--dir', '--drain', '--dry-run', '--embedding-dimensions', '--embedding-model', '--empty', '--entities', '--exclude', '--exclude-standard', '--expect', '--explain', '--facts', '--federated-read', '--file', '--filters', '--fix', '--follow', '--force', '--force-break-lock', '--force-retry', '--format', '--fresh', '--from-meetings', '--full', '--full-history', '--hard-deadline', '--health-interval', '--help', '--http', '--idempotency-key', '--ids', '--image', '--images', '--include-frontmatter', '--include-gitignored', '--include-hidden', '--include-null-signature', '--infer-dates', '--inject-bootstrap', '--inline', '--install', '--interval', '--is-ancestor', '--is-shallow-repository', '--job-id', '--job-isolation', '--json', '--kind', '--limit', '--lock-duration-ms', '--log-noop', '--markdown', '--max-age', '--max-attempts', '--max-cost-usd', '--max-crashes', '--max-rss', '--max-sources', '--max-stalled', '--max-usd', '--max-waiting', '--mcp-only', '--min-context', '--missing-path', '--mode', '--model', '--multimodal', '--name-only', '--ner', '--nice', '--no-auto-embed', '--no-delegate', '--no-embed', '--no-extract', '--no-gpg-sign', '--no-hard-deadline', '--no-inject', '--no-pull', '--no-renames', '--no-schema-pack', '--no-verify', '--no-worker', '--now', '--older-than', '--once', '--order', '--others', '--override-disabled', '--pace', '--pace-max-concurrency', '--pack', '--page', '--parallel', '--params', '--path', '--pause', '--phase', '--pid-file', '--priority', '--prune-orphans', '--queue', '--quiet', '--reason', '--rebuild', '--redact-secrets', '--reenrich-after', '--refresh-ms', '--repo', '--reset-checkpoint', '--resume', '--retry-failed', '--review-lower', '--segment-limit', '--select', '--serial', '--session', '--show-toplevel', '--sigkill-rescue', '--since', '--skip-bare-tweet', '--skip-failed', '--skip-urls', '--sleep', '--slug', '--slugs', '--source', '--source-id', '--src-subpath', '--stale', '--stats', '--status', '--strategy', '--surface', '--swap-only', '--target', '--thin', '--thin-threshold', '--timeout', '--timeout-ms', '--trusted-extraction', '--type', '--types', '--uninstall', '--url', '--user', '--vectors', '--verbose', '--verify', '--watch', '--wedge-rescue', '--workers', '--working-tree', '--yes'],
+ 'jobs': ['--abbrev-ref', '--access', '--aliases', '--all', '--allow-empty', '--allow-shell-jobs', '--asof', '--auto', '--background', '--backoff-delay', '--backoff-jitter', '--backoff-type', '--batch-size', '--bound-slug-prefixes', '--brain', '--break-lock', '--by-mention', '--cached', '--catch-up', '--cli-path', '--cluster-errors', '--concurrency', '--confidence', '--confirm-destructive', '--cost-estimate', '--date', '--days', '--delay', '--detach', '--diff-filter', '--dir', '--drain', '--dry-run', '--embedding-dimensions', '--embedding-model', '--empty', '--entities', '--exclude', '--exclude-standard', '--expect', '--explain', '--facts', '--federated-read', '--file', '--filters', '--fix', '--follow', '--force', '--force-break-lock', '--force-retry', '--format', '--fresh', '--from-meetings', '--full', '--full-history', '--hard-deadline', '--health-interval', '--help', '--http', '--idempotency-key', '--ids', '--image', '--images', '--include-frontmatter', '--include-gitignored', '--include-hidden', '--include-null-signature', '--infer-dates', '--inject-bootstrap', '--inline', '--input', '--install', '--interval', '--is-ancestor', '--is-shallow-repository', '--job-id', '--job-isolation', '--json', '--kind', '--limit', '--lock-duration-ms', '--log-noop', '--markdown', '--max-age', '--max-attempts', '--max-cost-usd', '--max-crashes', '--max-rss', '--max-sources', '--max-stalled', '--max-usd', '--max-waiting', '--mcp-only', '--min-context', '--missing-path', '--mode', '--model', '--multimodal', '--name-only', '--ner', '--nice', '--no-auto-embed', '--no-delegate', '--no-embed', '--no-extract', '--no-gpg-sign', '--no-hard-deadline', '--no-inject', '--no-pull', '--no-renames', '--no-schema-pack', '--no-verify', '--no-worker', '--now', '--older-than', '--once', '--order', '--others', '--output', '--override-disabled', '--pace', '--pace-max-concurrency', '--pack', '--page', '--parallel', '--params', '--path', '--pause', '--phase', '--pid-file', '--priority', '--prune-orphans', '--queue', '--quiet', '--reason', '--rebuild', '--redact-secrets', '--reenrich-after', '--refresh-ms', '--repo', '--reset-checkpoint', '--resume', '--retry-failed', '--review-lower', '--segment-limit', '--select', '--serial', '--session', '--show-toplevel', '--sigkill-rescue', '--since', '--skip-bare-tweet', '--skip-failed', '--skip-urls', '--sleep', '--slug', '--slugs', '--source', '--source-id', '--src-subpath', '--stale', '--stats', '--status', '--strategy', '--surface', '--swap-only', '--target', '--thin', '--thin-threshold', '--timeout', '--timeout-ms', '--trusted-extraction', '--type', '--types', '--uninstall', '--url', '--user', '--vectors', '--verbose', '--verify', '--watch', '--wedge-rescue', '--workers', '--working-tree', '--yes'],
'lint': ['--abbrev-ref', '--abort', '--all', '--background', '--brain', '--branch', '--cached', '--dry-run', '--exclude', '--exit-code', '--explain', '--file', '--fix', '--follow', '--get', '--get-url', '--git-dir', '--git-path', '--help', '--is-ancestor', '--is-inside-work-tree', '--json', '--local', '--name-only', '--no-cron', '--no-tags', '--no-verify', '--no-write-fetch-head', '--pat-file', '--path', '--progress-interval', '--progress-json', '--push', '--push-only', '--quiet', '--rebase', '--short', '--show-toplevel', '--source', '--timeout', '--unset-all'],
'loops': ['--all', '--as-of', '--brain', '--help', '--json', '--note', '--source', '--stale-ok', '--status', '--top', '--type'],
'lsd': ['--brain', '--force-resume', '--help', '--json', '--judge-model', '--limit', '--list-runs', '--max-cost', '--max-far-set', '--max-ideas-per-judge-call', '--no-save', '--resume', '--save', '--source', '--strict-budget', '--yes'],
'maintain': ['--all', '--apply', '--background', '--brain', '--break-lock', '--by-mention', '--catch-up', '--concurrency', '--content-audit', '--count', '--detach', '--dim', '--dir', '--drain', '--dry-run', '--expect', '--explain', '--fast', '--fix', '--follow', '--force', '--force-retry', '--force-schema', '--from-meetings', '--full', '--harness', '--help', '--http', '--include-ambiguous', '--include-flagged', '--include-frontmatter', '--include-gitignored', '--include-repairs', '--index-audit', '--infer-dates', '--install', '--json', '--kind', '--lang', '--link-source', '--link-type', '--locks', '--markdown', '--max-cost', '--max-cost-usd', '--max-jobs', '--max-rss', '--max-usd', '--migrate-only', '--multimodal', '--ner', '--no-autopilot-install', '--no-embed', '--no-pull', '--older-than', '--pack', '--parallel', '--params', '--path', '--pglite', '--phase', '--pid-file', '--porcelain', '--preview', '--probe-pglite', '--prune-orphans', '--query', '--queue', '--reauth', '--rebuild', '--regenerate', '--remediate', '--remediation-plan', '--remove', '--request-id', '--reset', '--resume', '--retry-failed', '--safe', '--scope', '--scopes', '--show-current', '--since', '--skills-dir', '--skip-failed', '--slot', '--slugs', '--source', '--source-id', '--stale', '--status', '--supabase', '--symbol-kind', '--target', '--target-score', '--to', '--top-k', '--type', '--url', '--verbose', '--version', '--window', '--workers', '--yes'],
'mcp': ['--admin-token-file', '--agent', '--arg', '--bearer-token-env-var', '--bound-brain', '--bound-max-concurrent', '--bound-slug-prefixes', '--bound-source', '--bound-tools', '--brain', '--budget-usd-per-day', '--client', '--credentials-file', '--credentials-out', '--delegate', '--delegated-namespace', '--delegated-slug-prefixes', '--dry-run', '--enable-dcr', '--federated-read', '--flow', '--force', '--funnel', '--harness', '--header', '--help', '--if-version', '--install', '--issuer-url', '--json', '--limit', '--mcp-only', '--mcp-url', '--no-install', '--no-service', '--no-tailscale', '--oauth-client-id', '--oauth-client-secret', '--oauth-request', '--port', '--profile', '--queue', '--redirect-uri', '--remove', '--resume', '--root', '--scope', '--scopes', '--skills', '--source', '--status', '--surface', '--timeout-ms', '--token', '--token-endpoint-auth-method', '--token-ttl', '--url', '--yes'],
'migrate': ['--all', '--apply', '--background', '--batch-size', '--brain', '--catch-up', '--dim', '--dry-run', '--embedding-dimensions', '--embedding-model', '--explain', '--facts', '--follow', '--force', '--force-retry', '--help', '--ignore-env-override', '--images', '--include-null-signature', '--json', '--locks', '--max-cost-usd', '--no-embed', '--non-interactive', '--pace', '--pace-max-concurrency', '--path', '--priority', '--progress-interval', '--progress-json', '--quiet', '--reranker', '--retarget', '--skip-verify', '--slugs', '--source', '--stale', '--status', '--timeout', '--to', '--url', '--yes'],
- 'models': ['--brain', '--embedding-dimensions', '--embedding-model', '--help', '--json', '--skip', '--source', '--status'],
+ 'models': ['--brain', '--embedding-dimensions', '--embedding-model', '--help', '--json', '--rate', '--skip', '--source', '--status'],
'mounts': ['--alias', '--brain', '--database-path', '--database-url', '--db-path', '--db-url', '--engine', '--help', '--id', '--json', '--mcp-url', '--path', '--skills-dir', '--source'],
'notability-eval': ['--brain', '--embedding-dimensions', '--embedding-model', '--help', '--in', '--json', '--out', '--repo', '--skip-llm', '--source', '--status', '--target-high', '--target-low', '--target-medium'],
'onboard': ['--access', '--asof', '--auto', '--bound-slug-prefixes', '--brain', '--check', '--date', '--days', '--entities', '--explain', '--federated-read', '--file', '--from-pages', '--full', '--help', '--history', '--http', '--image', '--json', '--kind', '--limit', '--max-usd', '--mode', '--multimodal', '--once', '--page', '--params', '--path', '--remediate', '--remediation-plan', '--resume', '--session', '--since', '--slug', '--slugs', '--source', '--stats', '--surface', '--target-score', '--trusted-extraction', '--types', '--url', '--yes'],
@@ -85,6 +85,7 @@ export const CLI_FLAG_REGISTRY: Record<string, readonly string[]> = {
'pages': ['--brain', '--dry-run', '--help', '--json', '--older-than', '--source'],
'pglite-repair': ['--brain', '--break-lock', '--dry-run', '--help', '--json', '--path', '--source', '--vectors', '--yes'],
'post-upgrade': ['--acknowledge-no-backup', '--admin-intent', '--all', '--apply', '--apply-clean-hunks', '--backup-confirmed', '--brain', '--check', '--concurrency', '--confirm-quiesced', '--content-root', '--cost-estimate', '--embedding-dimensions', '--embedding-model', '--expected-epoch', '--expected-state', '--export-db-only', '--export-source', '--ff-only', '--force', '--force-all', '--force-orchestrator', '--force-retry', '--force-schema', '--format', '--help', '--host-dir', '--inject-bootstrap', '--inline', '--install', '--interval', '--json', '--limit', '--list', '--manifest', '--markdown', '--max-rss', '--migrate-only', '--migration', '--mode', '--multimodal', '--name-only', '--no-autopilot-install', '--no-bun-floor-check', '--no-embed', '--no-inject', '--no-worker', '--non-interactive', '--now', '--once', '--path', '--pause', '--quiet', '--reason', '--remediation-plan', '--repo', '--require-db', '--resume', '--self-transfer', '--skills-dir', '--skip-verify', '--source', '--stale', '--status', '--swap-only', '--target', '--uninstall', '--user', '--vectors', '--verify', '--version', '--workers', '--yes'],
+ 'pricing': ['--brain', '--help', '--input', '--json', '--max-cost', '--max-runtime', '--output', '--rate', '--source'],
'projections': ['--brain', '--enable-dcr', '--help', '--http', '--install', '--json', '--limit', '--now', '--port', '--public-url', '--remove', '--source', '--status', '--surface', '--user'],
'protocol': ['--access', '--asof', '--bound-slug-prefixes', '--brain', '--date', '--days', '--entities', '--federated-read', '--file', '--full', '--help', '--http', '--image', '--json', '--kind', '--limit', '--mode', '--multimodal', '--once', '--page', '--path', '--session', '--since', '--slug', '--slugs', '--source', '--stats', '--surface', '--synthesize', '--target', '--token', '--trusted-extraction', '--types', '--url', '--yes'],
'providers': ['--brain', '--embedding-dimensions', '--embedding-model', '--help', '--json', '--model', '--source', '--status', '--touchpoint'],
diff --git a/test/cli-dispatch-phase.test.ts b/test/cli-dispatch-phase.test.ts
index 15907aaa44..2a6e5666b5 100644
--- a/test/cli-dispatch-phase.test.ts
+++ b/test/cli-dispatch-phase.test.ts
@@ -89,7 +89,7 @@ describe('CLI dispatch shape (master AST)', () => {
const shape = await expectNormalizerStable(extractCliDispatch, astNormalizer);
expect(shape.sets.CLI_ONLY).toEqual([...CLI_ONLY].sort());
expect(shape.sets.THIN_CLIENT_REFUSED_COMMANDS).toEqual([...THIN_CLIENT_REFUSED_COMMANDS].sort());
- expect(shape.switchCases.length).toBe(62);
+ expect(shape.switchCases.length).toBe(63);
expect(Object.keys(shape.commands).length).toBeGreaterThanOrEqual(shape.sets.CLI_ONLY.length);
});
diff --git a/test/cli-thin-client-refusal-matrix.test.ts b/test/cli-thin-client-refusal-matrix.test.ts
index 9a23100f38..f641dc3d40 100644
--- a/test/cli-thin-client-refusal-matrix.test.ts
+++ b/test/cli-thin-client-refusal-matrix.test.ts
@@ -12,7 +12,7 @@
* against a remote brain), routes a host-bound subcommand, changes a hint or
* exit code, or moves a check across the connectEngine terminator.
* Why new: test/cli-dispatch-thin-client.test.ts asserts refusal for a
- * hand-picked subset by substring; nothing pins all 62 cases or the full
+ * hand-picked subset by substring; nothing pins all 63 cases or the full
* text. Seam: none.
*
* Nothing leaves the machine: issuer and MCP URLs point at 127.0.0.1:1
@@ -104,8 +104,8 @@ describe('A16b thin-client refusal matrix', () => {
routing = await run(ROUTING_ROWS);
}, 300_000);
- test('the matrix covers all 62 handleCliOnly cases', () => {
- expect(CASES.length).toBe(62);
+ test('the matrix covers all 63 handleCliOnly cases', () => {
+ expect(CASES.length).toBe(63);
});
test('every handleCliOnly case, run bare on a thin client, matches the golden', () => {
diff --git a/test/fixtures/goldens/cli/dispatch-phase.json b/test/fixtures/goldens/cli/dispatch-phase.json
index df1dc2aa2b..0833878509 100644
--- a/test/fixtures/goldens/cli/dispatch-phase.json
+++ b/test/fixtures/goldens/cli/dispatch-phase.json
@@ -1127,6 +1127,13 @@
"thinClient": "none",
"thinClientRoutedSubcommands": []
},
+ "pricing": {
+ "hasSwitchCase": true,
+ "phase": "post-connect",
+ "preConnectRules": [],
+ "thinClient": "refuse",
+ "thinClientRoutedSubcommands": []
+ },
"projections": {
"hasSwitchCase": false,
"phase": "pre-connect-own-engine",
diff --git a/test/fixtures/goldens/cli/help-and-errors.json b/test/fixtures/goldens/cli/help-and-errors.json
index d1b4e1e786..6ad26dbd7d 100644
--- a/test/fixtures/goldens/cli/help-and-errors.json
+++ b/test/fixtures/goldens/cli/help-and-errors.json
@@ -179,6 +179,7 @@
" features [--json] [--auto-fix] Scan usage + recommend unused features",
" autopilot [--repo] [--interval N] Self-maintaining brain daemon",
" config [show|get|set] <key> [val] Brain config",
+ " pricing [set|list|unset] <model> Register model prices for cost caps (host only)",
" protocol [conformance|stats] MEMORY_VERBS v1: schemas, conformance",
" certification, local usage stats + TTHW",
" storage status [--repo <path>] Storage tier status and health",
@@ -386,6 +387,7 @@
" features [--json] [--auto-fix] Scan usage + recommend unused features",
" autopilot [--repo] [--interval N] Self-maintaining brain daemon",
" config [show|get|set] <key> [val] Brain config",
+ " pricing [set|list|unset] <model> Register model prices for cost caps (host only)",
" protocol [conformance|stats] MEMORY_VERBS v1: schemas, conformance",
" certification, local usage stats + TTHW",
" storage status [--repo <path>] Storage tier status and health",
@@ -593,6 +595,7 @@
" features [--json] [--auto-fix] Scan usage + recommend unused features",
" autopilot [--repo] [--interval N] Self-maintaining brain daemon",
" config [show|get|set] <key> [val] Brain config",
+ " pricing [set|list|unset] <model> Register model prices for cost caps (host only)",
" protocol [conformance|stats] MEMORY_VERBS v1: schemas, conformance",
" certification, local usage stats + TTHW",
" storage status [--repo <path>] Storage tier status and health",
diff --git a/test/fixtures/goldens/cli/literal-imports.json b/test/fixtures/goldens/cli/literal-imports.json
index a39f6437f5..12ad2b1202 100644
--- a/test/fixtures/goldens/cli/literal-imports.json
+++ b/test/fixtures/goldens/cli/literal-imports.json
@@ -117,6 +117,9 @@
"pages": [
"./commands/pages.ts"
],
+ "pricing": [
+ "./commands/pricing.ts"
+ ],
"quarantine": [
"./commands/quarantine.ts"
],
diff --git a/test/fixtures/goldens/cli/membership-sets.json b/test/fixtures/goldens/cli/membership-sets.json
index fd8dc635aa..6e35142e50 100644
--- a/test/fixtures/goldens/cli/membership-sets.json
+++ b/test/fixtures/goldens/cli/membership-sets.json
@@ -154,6 +154,7 @@
"pages",
"pglite-repair",
"post-upgrade",
+ "pricing",
"projections",
"protocol",
"providers",
@@ -239,6 +240,7 @@
"pages",
"pglite-repair",
"post-upgrade",
+ "pricing",
"projections",
"protocol",
"reindex",
@@ -308,6 +310,7 @@
"migrate",
"orphans",
"pages",
+ "pricing",
"projections",
"repair",
"repair-jsonb",
@@ -346,6 +349,7 @@
"migrate",
"orphans",
"pages",
+ "pricing",
"projections",
"quarantine",
"repair",
diff --git a/test/fixtures/goldens/cli/thin-client-cases.json b/test/fixtures/goldens/cli/thin-client-cases.json
index e4c57752e8..465706a76e 100644
--- a/test/fixtures/goldens/cli/thin-client-cases.json
+++ b/test/fixtures/goldens/cli/thin-client-cases.json
@@ -107,6 +107,15 @@
],
"stdout": []
},
+ {
+ "argv": "pricing",
+ "exitCode": 1,
+ "stderr": [
+ "`gbrain pricing` is not routable. pricing registers model prices in the host brain's config and is trusted-local only (a remote caller could void a cost cap). Ask the brain's operator to run `gbrain pricing set <model> ...` on the host.",
+ "(thin-client of http://127.0.0.1:1/mcp)"
+ ],
+ "stdout": []
+ },
{
"argv": "migrate",
"exitCode": 1,