Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/commands/calibration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export async function getLatestProfile(
engine: BrainEngine,
opts: { holder: string; sourceId?: string; sourceIds?: string[] },
): Promise<CalibrationProfileRow | null> {
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
Expand Down
6 changes: 6 additions & 0 deletions test/calibration-cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' });
Expand Down
1 change: 1 addition & 0 deletions test/cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down