fix(#4255): resolve reviewer-lane effort from the lane, not from gsd-plan-checker (#4275)

`review-lane plan` resolved every cross-AI reviewer lane's reasoning effort by
spawning `query resolve-execution gsd-plan-checker --host <slug>`. The agent id
was a hardcoded literal, so `--host` chose only the argv RENDERING while the
LEVEL always came from the installed plan-checker's frontmatter — `low` under
every shipped model profile. Every prompt-fed lane therefore ran at a fast
structural verifier's effort, and because the rendered argument is a CLI config
override it silently beat the effort the operator had configured for that CLI.
At `low` a large source-grounded prompt makes a model end its turn with no final
message, so the lane came back empty and its stub read as a crash.

Effort is a property of the review, so the lane declares it. Two new fields on
ReviewerLane — `effortConfigKey` (`review.effort.<slug>`) and `defaultEffort` —
carried through each capability manifest and the generated registry, set on the
three lanes with an argv effort channel and null on the other nine. A new pure
`resolveLaneEffort()` resolves config key -> lane default -> nothing, where
"nothing" emits no effort argument at all and the reviewer CLI's own
configuration decides; `inherit` selects that path explicitly and an
unrecognized level falls back to the lane default rather than being forwarded to
a CLI that would reject it. The host's negotiated effortSurface still gates the
rendering, so ADR-1239/#2481's trust boundary holds on this path too. Resolving
in-process also removes up to twelve subprocess spawns per review.

The empty-output stub now names the effort the lane ran at and distinguishes a
clean exit from a timeout kill, a non-zero exit, and a process that never ran —
`status` is null for both a timeout and a signal, so those were indistinguishable
before. The hint is hedged: a clean empty exit is most often a model stopping
short, but it is also consistent with a CLI writing its output elsewhere.

Also: the capability validator now knows both fields, rejects a malformed key or
an out-of-vocabulary default, and rejects a default declared without a config
key (a level the operator could never override). An existing end-to-end row in
tests/effort-surface-axis.test.cjs asserted the old coupling; it now configures
the lane's own key and pins the decoupling in the same real spawn, with the
agent execution tier set to a level that must not appear.

Emitted-Drift-Ack-Growth: review.md — the effort/model resolution-order table this fix adds. The workflow is where an operator looks to find out which knob set a lane's model and effort; leaving the new key undocumented there is the same invisibility that made the plan-checker coupling survive this long.

Emitted-Drift-Ack-Growth: review.md — the effort/model resolution-order table this fix adds. The workflow is where an operator looks to find out which knob set a lane's model and effort, so leaving the new key undocumented there is the same invisibility that let the plan-checker coupling survive.

Claude-Session: https://claude.ai/code/session_01CRMEuzNMWn3gs5uUW2ghcF

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Tom Boucher <trekkie@nomorestars.com>
This commit is contained in:
Behruz Nassre Esfahani
2026-09-05 02:25:44 -07:00
committed by GitHub
parent 925a363879
commit 5ad9a36f35
26 changed files with 759 additions and 61 deletions

View File

@@ -265,6 +265,70 @@ export function normalizeHost(raw: string): string {
* negative values are deliberately treated as unset too — a timeout has no legitimate zero or
* negative value, so no second sentinel (unlike the prompt-budget keys, which use -1) is needed.
*/
/**
* The reasoning effort a reviewer lane runs at, and its host-rendered argv (#4255).
*
* `argv` is spliced into `{{effort}}`; `value` is the bare level the runner folds into the
* recorded model designation (`gpt-5.6-sol (reasoning=high)`, #2295). Both are empty/null when
* this lane emits no effort argument, which is a real and correct outcome — see `resolveLaneEffort`.
*/
export interface LaneEffort {
argv: readonly string[];
value: string | null;
/** Where `value` came from, for diagnostics: the config key, the lane default, or nothing. */
source: 'config' | 'lane-default' | 'none';
}
/** Levels GSD's effort axis accepts (#3533). `inherit` selects the no-argument path. */
const EFFORT_LEVELS: ReadonlySet<string> = new Set([
'minimal', 'low', 'medium', 'high', 'xhigh', 'max', 'inherit',
]);
/**
* Resolve one lane's reasoning effort from REVIEW configuration (#4255).
*
* Resolution order, highest first:
* 1. `lane.effortConfigKey` — the per-lane review effort the operator set
* 2. `lane.defaultEffort` — the lane's declared review default (`high` for prompt-fed,
* source-grounded lanes)
* 3. nothing — no effort argument is emitted and the reviewer CLI's own configuration decides
*
* A configured `'inherit'` selects (3) explicitly. An unrecognized level is REFUSED rather than
* passed to the host: it falls back to the lane default, because forwarding a typo would render an
* argument the CLI rejects and kill the lane outright.
*
* What this function deliberately does NOT do is consult any agent's execution settings. Before
* #4255 the level came from `gsd-plan-checker`'s installed frontmatter through a hardcoded agent
* id, so every lane ran at a fast structural verifier's `low` — and, because the rendered argument
* is a CLI config override, it silently beat the effort the operator had configured for that CLI
* itself. A value inherited from an unrelated agent is worse than no value at all, which is why
* (3) emits nothing rather than falling back to some other agent's number.
*
* `renderArgv` is injected (the host table and the ADR-2481 surface negotiation live in
* `model-catalog` / `commands`, above this module's layer) so this stays a pure function of its
* inputs and the golden lane table can assert it without a spawn.
*/
export function resolveLaneEffort(
lane: ReviewerLane,
configGet: (key: string) => unknown,
renderArgv: (host: string, level: string) => { argv: readonly string[]; value: string | null },
): LaneEffort {
const none: LaneEffort = { argv: [], value: null, source: 'none' };
if (!lane || typeof lane !== 'object') return none;
const configured = lane.effortConfigKey ? configString(configGet(lane.effortConfigKey)) : null;
const valid = configured !== null && EFFORT_LEVELS.has(configured) ? configured : null;
const level = valid ?? configString(lane.defaultEffort);
if (level === null || level === 'inherit') return none;
const rendered = renderArgv(lane.slug, level);
const argv = (rendered.argv ?? []).filter((a): a is string => typeof a === 'string' && a !== '');
if (argv.length === 0) return none;
return {
argv,
value: configString(rendered.value) ?? level,
source: valid !== null ? 'config' : 'lane-default',
};
}
export function resolveTimeoutMs(
timeoutConfigKey: string | null | undefined,
floorMs: number,