mirror of
https://github.com/garrytan/gbrain.git
synced 2026-07-27 22:15:33 +00:00
* feat(eval): cycle-default — single source of truth for TTY/non-TTY cycle count (#1784) * fix(jobs): decouple 'jobs watch' format (--json) from loop (--follow); non-TTY prints one human snapshot (#1784) * fix(reindex): human cost-refusal unless --json; spend guardrail unchanged (#1784) * fix(eval): annotate non-interactive cycle/budget defaults; runner core TTY-agnostic (#1784) * chore: bump version and changelog (v0.42.15.0) Decouple CLI primary output from process.stdout.isTTY (#1784): human by default, JSON only with --json; jobs watch non-TTY one-shots; eval banners annotate non-interactive defaults; reindex-code refusal is human unless --json. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * docs: CLAUDE.md Key Files notes for v0.42.15.0 isTTY-output decoupling (#1784) Annotate jobs.ts (jobs watch format/loop split + resolveWatchMode + the new cycle-default.ts), reindex-code.ts (human cost-refusal), and eval-cross-modal.ts (cycle/budget banner annotations). Regenerate llms-full.txt. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
38 lines
1.4 KiB
TypeScript
38 lines
1.4 KiB
TypeScript
/**
|
|
* v0.42.11.0 (#1784) — suspected-contradictions budget-default detection.
|
|
*
|
|
* The TTY-derived budget default ($5 TTY / $1 non-TTY) is overwritten in-place,
|
|
* so the banner needs an explicit `budgetUsdExplicit` flag to know whether to
|
|
* annotate the value as the silent non-interactive default. These run non-TTY
|
|
* (bun test pipes stdout), so the default resolves to $1.
|
|
*/
|
|
import { describe, test, expect } from 'bun:test';
|
|
import { parseFlags } from '../src/commands/eval-suspected-contradictions.ts';
|
|
|
|
describe('parseFlags budgetUsdExplicit', () => {
|
|
test('no --budget-usd → non-TTY default $1, not flagged explicit', () => {
|
|
const f = parseFlags([]);
|
|
expect(f.budgetUsd).toBe(1); // bun test is non-TTY
|
|
expect(f.budgetUsdExplicit).toBe(false);
|
|
});
|
|
|
|
test('--budget-usd 3 → value 3, flagged explicit', () => {
|
|
const f = parseFlags(['--budget-usd', '3']);
|
|
expect(f.budgetUsd).toBe(3);
|
|
expect(f.budgetUsdExplicit).toBe(true);
|
|
});
|
|
|
|
test('explicit value equal to the default still counts as explicit', () => {
|
|
const f = parseFlags(['--budget-usd', '1']);
|
|
expect(f.budgetUsd).toBe(1);
|
|
expect(f.budgetUsdExplicit).toBe(true);
|
|
});
|
|
|
|
test('subcommand positional does not break flag parsing', () => {
|
|
const f = parseFlags(['run', '--budget-usd', '2']);
|
|
expect(f.sub).toBe('run');
|
|
expect(f.budgetUsd).toBe(2);
|
|
expect(f.budgetUsdExplicit).toBe(true);
|
|
});
|
|
});
|