mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-19 14:44:44 +01:00
Merge main and repair review eval regressions
Preserve the upstream frontier-model defaults while retaining configured Claude Code models for outside reviews. Repair fixed-scope mode selection and empathy coverage counting, restore merged approval gates, and keep static scans out of workspace archives.
This commit is contained in:
commit
7b08fbfe56
147 files changed
+3244
-1707
No files matched your search
+5
-2
@@ -37,7 +37,7 @@ function isObject(value: unknown): value is Record<string, unknown> {
|
||||
}
|
||||
|
||||
/** Keep argument construction separate so wrappers never interpolate a prompt. */
|
||||
export function claudeCodeArgs(options: Pick<ClaudeCodeOptions, 'access' | 'resume'>, command: ClaudeCommand): string[] {
|
||||
export function claudeCodeArgs(options: Pick<ClaudeCodeOptions, 'access' | 'resume'>, command: ClaudeCommand, env: NodeJS.ProcessEnv = process.env): string[] {
|
||||
const args = [
|
||||
...command.argsPrefix, '-p', '--output-format', 'json',
|
||||
'--disable-slash-commands',
|
||||
@@ -58,6 +58,9 @@ export function claudeCodeArgs(options: Pick<ClaudeCodeOptions, 'access' | 'resu
|
||||
+ 'If essential context is missing, identify it explicitly instead of inventing observations.');
|
||||
}
|
||||
if (options.access === 'read-only') args.push('--allowedTools', 'Read,Grep,Glob');
|
||||
// An explicit gstack override wins; otherwise leave native CLI configuration
|
||||
// and ANTHROPIC_MODEL intact instead of replacing the user's selected model.
|
||||
if (env.GSTACK_CLAUDE_MODEL) args.push('--model', env.GSTACK_CLAUDE_MODEL);
|
||||
if (options.resume) args.push('--resume', options.resume);
|
||||
return args;
|
||||
}
|
||||
@@ -133,7 +136,7 @@ export async function runClaudeCode(options: ClaudeCodeOptions): Promise<ClaudeC
|
||||
|
||||
let child: ChildProcess;
|
||||
try {
|
||||
child = spawn(command.command, claudeCodeArgs(options, command), {
|
||||
child = spawn(command.command, claudeCodeArgs(options, command, env), {
|
||||
cwd: options.cwd, env, stdio: ['pipe', 'pipe', 'pipe'],
|
||||
detached: process.platform !== 'win32', windowsHide: true,
|
||||
});
|
||||
|
||||
+9
-9
@@ -12,25 +12,25 @@
|
||||
* per-kind default — last resort
|
||||
*
|
||||
* Kinds and their defaults:
|
||||
* capture — AskUserQuestion SDK capture runs: sonnet (D1a)
|
||||
* capture — AskUserQuestion SDK capture runs: current frontier Claude model
|
||||
* warmup — PTY warm-up ping (cheapest thing that answers): haiku
|
||||
* distill — free-text distillation (cheap, structured): haiku (pinned)
|
||||
* judge — LLM-judge rubric calls: sonnet (D1a pin-on-regressors — the
|
||||
* Haiku A/B regressed the doc-rubric family; see llm-judge.ts)
|
||||
* judge — LLM-judge rubric calls: current frontier Claude model
|
||||
*/
|
||||
|
||||
export const CLAUDE_FRONTIER_EVAL_MODEL = "claude-fable-5-1";
|
||||
|
||||
// `as const satisfies` keeps EvalModelKind the literal union
|
||||
// 'capture' | 'warmup' | 'distill' — a `Record<string, string>` annotation
|
||||
// would widen it to string and let any typo through the type gate.
|
||||
const DEFAULTS = {
|
||||
// D1a (2026-08 test-infra review): capture runs default to Sonnet, matching
|
||||
// session-runner — the old Opus default was an inconsistency between
|
||||
// runners, not a choice; tests needing Opus pass it explicitly or set
|
||||
// GSTACK_EVAL_MODEL_CAPTURE.
|
||||
capture: "claude-sonnet-4-6",
|
||||
// Keep eval capture/judge on the current frontier Claude model by default.
|
||||
// Tests needing a cheaper or historical ruler pass it explicitly or set
|
||||
// GSTACK_EVAL_MODEL_CAPTURE / GSTACK_EVAL_MODEL_JUDGE / GSTACK_EVAL_MODEL.
|
||||
capture: CLAUDE_FRONTIER_EVAL_MODEL,
|
||||
warmup: "claude-haiku-4-5",
|
||||
distill: "claude-haiku-4-5-20251001",
|
||||
judge: "claude-sonnet-4-6",
|
||||
judge: CLAUDE_FRONTIER_EVAL_MODEL,
|
||||
} as const satisfies Record<string, string>;
|
||||
|
||||
export type EvalModelKind = keyof typeof DEFAULTS;
|
||||
|
||||
Reference in new issue
Block a user