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

@@ -233,6 +233,8 @@ const capabilities = {
"requiresBinaries": [],
"promptBudgetKey": "review.max_prompt_tokens_per_reviewer.antigravity",
"modelConfigKey": "review.models.agy",
"effortConfigKey": null,
"defaultEffort": null,
"handler": "antigravity"
},
"config": {
@@ -650,6 +652,8 @@ const capabilities = {
"requiresBinaries": [],
"promptBudgetKey": "review.max_prompt_tokens_per_reviewer.claude",
"modelConfigKey": "review.models.claude",
"effortConfigKey": "review.effort.claude",
"defaultEffort": "high",
"handler": null
},
"config": {
@@ -667,6 +671,11 @@ const capabilities = {
"type": "number",
"default": -1,
"description": "Outer wall-clock timeout override (seconds) for the Claude reviewer lane. Unset is -1, a sentinel: 0 or a negative number is also treated as unset (a timeout has no legitimate zero/negative value), so no second sentinel is needed. Falls back to the lane's built-in timeoutFloorMs when unset."
},
"review.effort.claude": {
"type": "string",
"default": "",
"description": "Reasoning effort for the Claude reviewer lane: minimal, low, medium, high, xhigh, max, or inherit. Unset falls back to the lane's declared review default (high); inherit emits no effort argument so the CLI's own configuration decides. An unrecognized value falls back to the lane default rather than being forwarded."
}
}
},
@@ -1093,6 +1102,8 @@ const capabilities = {
"requiresBinaries": [],
"promptBudgetKey": "review.max_prompt_tokens_per_reviewer.coderabbit",
"modelConfigKey": null,
"effortConfigKey": null,
"defaultEffort": null,
"handler": null
},
"config": {
@@ -1252,6 +1263,8 @@ const capabilities = {
"requiresBinaries": [],
"promptBudgetKey": "review.max_prompt_tokens_per_reviewer.codex",
"modelConfigKey": "review.models.codex",
"effortConfigKey": "review.effort.codex",
"defaultEffort": "high",
"handler": null
},
"config": {
@@ -1269,6 +1282,11 @@ const capabilities = {
"type": "number",
"default": -1,
"description": "Outer wall-clock timeout override (seconds) for the Codex reviewer lane. Unset is -1, a sentinel: 0 or a negative number is also treated as unset (a timeout has no legitimate zero/negative value), so no second sentinel is needed. Falls back to the lane's built-in timeoutFloorMs when unset."
},
"review.effort.codex": {
"type": "string",
"default": "",
"description": "Reasoning effort for the Codex reviewer lane: minimal, low, medium, high, xhigh, max, or inherit. Unset falls back to the lane's declared review default (high); inherit emits no effort argument so the CLI's own configuration decides. An unrecognized value falls back to the lane default rather than being forwarded."
}
}
},
@@ -1524,6 +1542,8 @@ const capabilities = {
"requiresBinaries": [],
"promptBudgetKey": "review.max_prompt_tokens_per_reviewer.cursor",
"modelConfigKey": "review.models.cursor",
"effortConfigKey": null,
"defaultEffort": null,
"handler": null
},
"config": {
@@ -1805,6 +1825,8 @@ const capabilities = {
"requiresBinaries": [],
"promptBudgetKey": "review.max_prompt_tokens_per_reviewer.gemini",
"modelConfigKey": "review.models.gemini",
"effortConfigKey": null,
"defaultEffort": null,
"handler": null
},
"config": {
@@ -2409,6 +2431,8 @@ const capabilities = {
"requiresBinaries": [],
"promptBudgetKey": "review.max_prompt_tokens_per_reviewer.kimi-code",
"modelConfigKey": "review.models.kimi-code",
"effortConfigKey": null,
"defaultEffort": null,
"handler": null
},
"config": {
@@ -2521,6 +2545,8 @@ const capabilities = {
"requiresBinaries": [],
"promptBudgetKey": "review.max_prompt_tokens_per_reviewer.llama_cpp",
"modelConfigKey": "review.models.llama_cpp",
"effortConfigKey": null,
"defaultEffort": null,
"handler": "openai-compatible"
},
"config": {
@@ -2585,6 +2611,8 @@ const capabilities = {
"requiresBinaries": [],
"promptBudgetKey": "review.max_prompt_tokens_per_reviewer.lm_studio",
"modelConfigKey": "review.models.lm_studio",
"effortConfigKey": null,
"defaultEffort": null,
"handler": "openai-compatible"
},
"config": {
@@ -2873,6 +2901,8 @@ const capabilities = {
"requiresBinaries": [],
"promptBudgetKey": "review.max_prompt_tokens_per_reviewer.ollama",
"modelConfigKey": "review.models.ollama",
"effortConfigKey": null,
"defaultEffort": null,
"handler": "openai-compatible"
},
"config": {
@@ -3066,6 +3096,8 @@ const capabilities = {
"requiresBinaries": [],
"promptBudgetKey": "review.max_prompt_tokens_per_reviewer.opencode",
"modelConfigKey": "review.models.opencode",
"effortConfigKey": "review.effort.opencode",
"defaultEffort": "high",
"handler": "opencode"
},
"config": {
@@ -3083,6 +3115,11 @@ const capabilities = {
"type": "number",
"default": -1,
"description": "Outer wall-clock timeout override (seconds) for the OpenCode reviewer lane. Unset is -1, a sentinel: 0 or a negative number is also treated as unset (a timeout has no legitimate zero/negative value), so no second sentinel is needed. Falls back to the lane's built-in timeoutFloorMs when unset."
},
"review.effort.opencode": {
"type": "string",
"default": "",
"description": "Reasoning effort for the OpenCode reviewer lane: minimal, low, medium, high, xhigh, max, or inherit. Unset falls back to the lane's declared review default (high); inherit emits no effort argument so the CLI's own configuration decides. An unrecognized value falls back to the lane default rather than being forwarded."
}
}
},
@@ -3425,6 +3462,8 @@ const capabilities = {
"requiresBinaries": [],
"promptBudgetKey": "review.max_prompt_tokens_per_reviewer.qwen",
"modelConfigKey": null,
"effortConfigKey": null,
"defaultEffort": null,
"handler": null
},
"config": {
@@ -4869,6 +4908,7 @@ const configKeys = {
"review.models.claude": "claude",
"review.max_prompt_tokens_per_reviewer.claude": "claude",
"review.timeouts.claude": "claude",
"review.effort.claude": "claude",
"claude_orchestration.enabled": "claude-orchestration",
"claude_orchestration.execution_backend": "claude-orchestration",
"claude_orchestration.min_agent_sdk_version": "claude-orchestration",
@@ -4879,6 +4919,7 @@ const configKeys = {
"review.models.codex": "codex",
"review.max_prompt_tokens_per_reviewer.codex": "codex",
"review.timeouts.codex": "codex",
"review.effort.codex": "codex",
"review.models.cursor": "cursor",
"review.max_prompt_tokens_per_reviewer.cursor": "cursor",
"workflow.drift_threshold": "drift",
@@ -4928,6 +4969,7 @@ const configKeys = {
"review.models.opencode": "opencode",
"review.max_prompt_tokens_per_reviewer.opencode": "opencode",
"review.timeouts.opencode": "opencode",
"review.effort.opencode": "opencode",
"workflow.pattern_mapper": "pattern-mapper",
"profile-pipeline.enabled": "profile-pipeline",
"review.max_prompt_tokens_per_reviewer.qwen": "qwen",
@@ -5007,6 +5049,12 @@ const configSchema = {
"default": -1,
"description": "Outer wall-clock timeout override (seconds) for the Claude reviewer lane. Unset is -1, a sentinel: 0 or a negative number is also treated as unset (a timeout has no legitimate zero/negative value), so no second sentinel is needed. Falls back to the lane's built-in timeoutFloorMs when unset."
},
"review.effort.claude": {
"owner": "claude",
"type": "string",
"default": "",
"description": "Reasoning effort for the Claude reviewer lane: minimal, low, medium, high, xhigh, max, or inherit. Unset falls back to the lane's declared review default (high); inherit emits no effort argument so the CLI's own configuration decides. An unrecognized value falls back to the lane default rather than being forwarded."
},
"claude_orchestration.enabled": {
"owner": "claude-orchestration",
"type": "boolean",
@@ -5081,6 +5129,12 @@ const configSchema = {
"default": -1,
"description": "Outer wall-clock timeout override (seconds) for the Codex reviewer lane. Unset is -1, a sentinel: 0 or a negative number is also treated as unset (a timeout has no legitimate zero/negative value), so no second sentinel is needed. Falls back to the lane's built-in timeoutFloorMs when unset."
},
"review.effort.codex": {
"owner": "codex",
"type": "string",
"default": "",
"description": "Reasoning effort for the Codex reviewer lane: minimal, low, medium, high, xhigh, max, or inherit. Unset falls back to the lane's declared review default (high); inherit emits no effort argument so the CLI's own configuration decides. An unrecognized value falls back to the lane default rather than being forwarded."
},
"review.models.cursor": {
"owner": "cursor",
"type": "string",
@@ -5391,6 +5445,12 @@ const configSchema = {
"default": -1,
"description": "Outer wall-clock timeout override (seconds) for the OpenCode reviewer lane. Unset is -1, a sentinel: 0 or a negative number is also treated as unset (a timeout has no legitimate zero/negative value), so no second sentinel is needed. Falls back to the lane's built-in timeoutFloorMs when unset."
},
"review.effort.opencode": {
"owner": "opencode",
"type": "string",
"default": "",
"description": "Reasoning effort for the OpenCode reviewer lane: minimal, low, medium, high, xhigh, max, or inherit. Unset falls back to the lane's declared review default (high); inherit emits no effort argument so the CLI's own configuration decides. An unrecognized value falls back to the lane default rather than being forwarded."
},
"workflow.pattern_mapper": {
"owner": "pattern-mapper",
"type": "boolean",
@@ -5638,6 +5698,8 @@ const runtimes = {
"requiresBinaries": [],
"promptBudgetKey": "review.max_prompt_tokens_per_reviewer.antigravity",
"modelConfigKey": "review.models.agy",
"effortConfigKey": null,
"defaultEffort": null,
"handler": "antigravity"
},
"config": {
@@ -5926,6 +5988,8 @@ const runtimes = {
"requiresBinaries": [],
"promptBudgetKey": "review.max_prompt_tokens_per_reviewer.claude",
"modelConfigKey": "review.models.claude",
"effortConfigKey": "review.effort.claude",
"defaultEffort": "high",
"handler": null
},
"config": {
@@ -5943,6 +6007,11 @@ const runtimes = {
"type": "number",
"default": -1,
"description": "Outer wall-clock timeout override (seconds) for the Claude reviewer lane. Unset is -1, a sentinel: 0 or a negative number is also treated as unset (a timeout has no legitimate zero/negative value), so no second sentinel is needed. Falls back to the lane's built-in timeoutFloorMs when unset."
},
"review.effort.claude": {
"type": "string",
"default": "",
"description": "Reasoning effort for the Claude reviewer lane: minimal, low, medium, high, xhigh, max, or inherit. Unset falls back to the lane's declared review default (high); inherit emits no effort argument so the CLI's own configuration decides. An unrecognized value falls back to the lane default rather than being forwarded."
}
}
},
@@ -6306,6 +6375,8 @@ const runtimes = {
"requiresBinaries": [],
"promptBudgetKey": "review.max_prompt_tokens_per_reviewer.codex",
"modelConfigKey": "review.models.codex",
"effortConfigKey": "review.effort.codex",
"defaultEffort": "high",
"handler": null
},
"config": {
@@ -6323,6 +6394,11 @@ const runtimes = {
"type": "number",
"default": -1,
"description": "Outer wall-clock timeout override (seconds) for the Codex reviewer lane. Unset is -1, a sentinel: 0 or a negative number is also treated as unset (a timeout has no legitimate zero/negative value), so no second sentinel is needed. Falls back to the lane's built-in timeoutFloorMs when unset."
},
"review.effort.codex": {
"type": "string",
"default": "",
"description": "Reasoning effort for the Codex reviewer lane: minimal, low, medium, high, xhigh, max, or inherit. Unset falls back to the lane's declared review default (high); inherit emits no effort argument so the CLI's own configuration decides. An unrecognized value falls back to the lane default rather than being forwarded."
}
}
},
@@ -6578,6 +6654,8 @@ const runtimes = {
"requiresBinaries": [],
"promptBudgetKey": "review.max_prompt_tokens_per_reviewer.cursor",
"modelConfigKey": "review.models.cursor",
"effortConfigKey": null,
"defaultEffort": null,
"handler": null
},
"config": {
@@ -7084,6 +7162,8 @@ const runtimes = {
"requiresBinaries": [],
"promptBudgetKey": "review.max_prompt_tokens_per_reviewer.kimi-code",
"modelConfigKey": "review.models.kimi-code",
"effortConfigKey": null,
"defaultEffort": null,
"handler": null
},
"config": {
@@ -7272,6 +7352,8 @@ const runtimes = {
"requiresBinaries": [],
"promptBudgetKey": "review.max_prompt_tokens_per_reviewer.opencode",
"modelConfigKey": "review.models.opencode",
"effortConfigKey": "review.effort.opencode",
"defaultEffort": "high",
"handler": "opencode"
},
"config": {
@@ -7289,6 +7371,11 @@ const runtimes = {
"type": "number",
"default": -1,
"description": "Outer wall-clock timeout override (seconds) for the OpenCode reviewer lane. Unset is -1, a sentinel: 0 or a negative number is also treated as unset (a timeout has no legitimate zero/negative value), so no second sentinel is needed. Falls back to the lane's built-in timeoutFloorMs when unset."
},
"review.effort.opencode": {
"type": "string",
"default": "",
"description": "Reasoning effort for the OpenCode reviewer lane: minimal, low, medium, high, xhigh, max, or inherit. Unset falls back to the lane's declared review default (high); inherit emits no effort argument so the CLI's own configuration decides. An unrecognized value falls back to the lane default rather than being forwarded."
}
}
},
@@ -7500,6 +7587,8 @@ const runtimes = {
"requiresBinaries": [],
"promptBudgetKey": "review.max_prompt_tokens_per_reviewer.qwen",
"modelConfigKey": null,
"effortConfigKey": null,
"defaultEffort": null,
"handler": null
},
"config": {

View File

@@ -1849,9 +1849,26 @@ const KNOWN_REVIEWER_FIELDS = new Set([
// `timeoutConfigKey` added by #3274, same optional/backward-compatible shape as
// `modelConfigKey` above: a manifest authored before this field existed must keep validating.
'timeoutConfigKey',
// `effortConfigKey` / `defaultEffort` added by #4255, same optional/backward-compatible shape
// as the two above. Lane effort used to be resolved by querying the `gsd-plan-checker` AGENT
// through a hardcoded id, so every prompt-fed lane ran at that verifier's frontmatter effort;
// it is a property of the review, so the lane declares it. A manifest authored before these
// fields existed must keep validating — absent is read as "this lane declares no review
// effort", which emits no effort argument at all.
'effortConfigKey',
'defaultEffort',
'handler',
]);
/**
* The effort levels a lane may declare as its review default (#4255, #3533 vocabulary).
*
* `inherit` is deliberately NOT a member. It is a legitimate CONFIGURED value — it selects "emit
* no argument, the CLI's own configuration decides" — but as a DECLARED default it would be a
* second spelling of `null` and split one behaviour across two shapes.
*/
const REVIEWER_EFFORT_LEVELS = new Set(['minimal', 'low', 'medium', 'high', 'xhigh', 'max']);
/**
* The closed `runtime.hostBehaviors` vocabulary (ADR-1016, closed via #2801).
*
@@ -2407,6 +2424,39 @@ function validateReviewerBodyFields(cap) {
);
}
// OPTIONAL, mirroring the two keys above (#4255). Absent/null means "this lane declares no
// review effort", which is the shape that emits no effort argument at all — the correct state
// for the nine lanes with no effort channel to feed. An empty string is neither.
if (r.effortConfigKey !== undefined && r.effortConfigKey !== null &&
(typeof r.effortConfigKey !== 'string' || r.effortConfigKey.length === 0)) {
errors.push(
ctx + ' reviewer.effortConfigKey must be a dotted config key or null ' +
'(got: ' + describeValue(r.effortConfigKey) + ')',
);
}
// A declared default must be a level the effort axis knows, or the lane would render an
// argument the reviewer CLI rejects and kill itself on every run. Closed vocabulary, checked
// here rather than at resolution time so a malformed manifest fails at the trust boundary.
if (r.defaultEffort !== undefined && r.defaultEffort !== null
&& !(typeof r.defaultEffort === 'string' && REVIEWER_EFFORT_LEVELS.has(r.defaultEffort))) {
errors.push(
ctx + ' reviewer.defaultEffort must be one of ' +
Array.from(REVIEWER_EFFORT_LEVELS).join('/') + ' or null ' +
'(got: ' + describeValue(r.defaultEffort) + ')',
);
}
// A default with nothing to configure it through is a value the operator cannot change — the
// shape #4255 exists to end. Declared together or not at all.
if ((r.defaultEffort !== undefined && r.defaultEffort !== null)
&& (r.effortConfigKey === undefined || r.effortConfigKey === null)) {
errors.push(
ctx + ' reviewer.defaultEffort is declared without an effortConfigKey, so the level ' +
'could never be overridden',
);
}
// `null` is the declared "no per-lane budget"; an empty string is not.
if (r.promptBudgetKey !== null && (typeof r.promptBudgetKey !== 'string' || r.promptBudgetKey.length === 0)) {
errors.push(