diff --git a/src/cli.ts b/src/cli.ts index 976d2920f..001e3527c 100755 --- a/src/cli.ts +++ b/src/cli.ts @@ -27,7 +27,7 @@ for (const op of operations) { } // CLI-only commands that bypass the operation layer -const CLI_ONLY = new Set(['init', 'upgrade', 'post-upgrade', 'check-update', 'integrations', 'publish', 'check-backlinks', 'lint', 'report', 'import', 'export', 'files', 'embed', 'serve', 'call', 'config', 'doctor', 'migrate', 'eval', 'sync', 'extract', 'features', 'autopilot', 'graph-query', 'jobs', 'agent', 'apply-migrations', 'skillpack-check', 'skillpack', 'resolvers', 'integrity', 'repair-jsonb', 'orphans', 'sources', 'mounts', 'dream', 'check-resolvable', 'routing-eval', 'skillify', 'smoke-test', 'providers', 'storage', 'repos', 'code-def', 'code-refs', 'reindex-code', 'reindex-frontmatter', 'code-callers', 'code-callees', 'frontmatter', 'auth', 'friction', 'claw-test', 'book-mirror', 'takes', 'think', 'salience', 'anomalies', 'transcripts', 'models', 'remote', 'recall', 'forget', 'edges-backfill', 'cache', 'founder']); +const CLI_ONLY = new Set(['init', 'upgrade', 'post-upgrade', 'check-update', 'integrations', 'publish', 'check-backlinks', 'lint', 'report', 'import', 'export', 'files', 'embed', 'serve', 'call', 'config', 'doctor', 'migrate', 'eval', 'sync', 'extract', 'features', 'autopilot', 'graph-query', 'jobs', 'agent', 'apply-migrations', 'skillpack-check', 'skillpack', 'resolvers', 'integrity', 'repair-jsonb', 'orphans', 'sources', 'mounts', 'dream', 'check-resolvable', 'routing-eval', 'skillify', 'smoke-test', 'providers', 'storage', 'repos', 'code-def', 'code-refs', 'reindex-code', 'reindex-frontmatter', 'code-callers', 'code-callees', 'frontmatter', 'auth', 'friction', 'claw-test', 'book-mirror', 'takes', 'think', 'calibration', 'salience', 'anomalies', 'transcripts', 'models', 'remote', 'recall', 'forget', 'edges-backfill', 'cache', 'founder']); // CLI-only commands whose handlers print their own --help text. These are // excluded from the generic short-circuit so detailed per-command and // per-subcommand usage stays reachable. diff --git a/src/commands/calibration.ts b/src/commands/calibration.ts index fcf7ecba0..c4ce9bdc2 100644 --- a/src/commands/calibration.ts +++ b/src/commands/calibration.ts @@ -48,7 +48,7 @@ export async function getLatestProfile( engine: BrainEngine, opts: { holder: string; sourceId?: string; sourceIds?: string[] }, ): Promise { - let sql = `SELECT id, source_id, holder, wave_version, generated_at, published, + let sql = `SELECT id::int AS id, source_id, holder, wave_version, generated_at, published, total_resolved, brier, accuracy, partial_rate, grade_completion, pattern_statements, active_bias_tags, voice_gate_passed, voice_gate_attempts, model_id diff --git a/test/calibration-cli.test.ts b/test/calibration-cli.test.ts index 1ddbd6d5e..f6d637225 100644 --- a/test/calibration-cli.test.ts +++ b/test/calibration-cli.test.ts @@ -145,6 +145,12 @@ describe('getLatestProfile', () => { expect(capturedParams[0]![1]).toEqual(['tenant-a', 'tenant-b']); }); + test('casts BIGSERIAL id to int so CLI JSON output is serializable', async () => { + const { engine, capturedSql } = buildMockEngine({ rows: [] }); + await getLatestProfile(engine, { holder: 'garry', sourceId: 'default' }); + expect(capturedSql[0]).toContain('SELECT id::int AS id'); + }); + test('no source filter when neither sourceId nor sourceIds is passed', async () => { const { engine, capturedSql } = buildMockEngine({ rows: [] }); await getLatestProfile(engine, { holder: 'garry' }); diff --git a/test/cli.test.ts b/test/cli.test.ts index e85da900b..2c338ba98 100644 --- a/test/cli.test.ts +++ b/test/cli.test.ts @@ -34,6 +34,7 @@ describe('CLI structure', () => { expect(cliSource).toContain("'export'"); expect(cliSource).toContain("'embed'"); expect(cliSource).toContain("'files'"); + expect(cliSource).toContain("'calibration'"); }); test('has formatResult function for CLI output', () => {