* test(#2295): failing-first coverage for per-lane resolved-model recording * feat(#2295): record the resolved model per reviewer lane * docs(#2295): document the recorded reviewer model and its provenance * fix(#2295): refuse control characters in a recorded model value * test(#2295): correct watermark assertions for the widened mark shape * fix(#2295): anchor the role-manipulation injection pattern at a word boundary * feat(#2295): record the applied reasoning effort in the model value * chore(#2295): backfill changeset pr number * chore(#2295): restore em-dash in changeset body --------- Co-authored-by: sim <sim@local>
This commit is contained in:
@@ -79,6 +79,27 @@ export interface SpawnPlan {
|
||||
binary: string;
|
||||
/** Fully resolved argv — model, effort and prompt already folded in, in leg order. */
|
||||
argv: string[];
|
||||
/**
|
||||
* The configured model that was ACTUALLY APPLIED to this invocation, or `null` (#2295).
|
||||
*
|
||||
* Not merely "what `review.models.<slug>` says". A lane can declare a `modelConfigKey` and no
|
||||
* `modelArg` — a shape a third-party overlay body can reach — and then the configured value
|
||||
* never enters argv and the CLI reviews under its own default. Recording the config value in
|
||||
* that case would attribute the review to a model that never ran, which is the inverse of the
|
||||
* failure #2295 exists to end. So this mirrors the argv expansion: set only when `{{model}}`
|
||||
* really expanded to something.
|
||||
*/
|
||||
model: string | null;
|
||||
/**
|
||||
* The reasoning effort GSD ACTUALLY APPLIED to this invocation, or `null` (#2295).
|
||||
*
|
||||
* Shares the same applied-not-merely-configured rule `model` above documents. A lane whose
|
||||
* `effortChannel` is not `argv` receives no effort argument at all — the placeholder's
|
||||
* expansion is structurally empty for that lane — and recording an effort level in that case
|
||||
* would attribute the review to a setting that never reached the tool. So this is set only
|
||||
* when the effort argv really expanded into this invocation's argv.
|
||||
*/
|
||||
effort: string | null;
|
||||
/** Prompt delivered on stdin, or `null` for `argv`/`argv-file-ref`/`none` lanes. */
|
||||
stdin: string | null;
|
||||
/**
|
||||
@@ -161,6 +182,14 @@ export interface ResolveInput {
|
||||
repoRoot: string;
|
||||
/** Effort argv for lanes whose `effortChannel` is `argv`; empty when the host declares none. */
|
||||
effortArgs?: readonly string[];
|
||||
/**
|
||||
* The bare reasoning-effort level (`'low'`) GSD resolved for this lane's host, or `undefined`
|
||||
* (#2295). The per-host ARGV RENDERING of this same level arrives separately in `effortArgs` —
|
||||
* `'low'` renders as `--effort low` for one host and `-c model_reasoning_effort=low` for
|
||||
* another, and the runner needs the bare level (for the recorded model suffix) independently
|
||||
* of whichever rendering actually reached argv.
|
||||
*/
|
||||
effortValue?: string;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ *
|
||||
@@ -180,8 +209,11 @@ export interface ResolveInput {
|
||||
*
|
||||
* A non-string (number, bool, object, array) is NOT coerced. `String(0)` would put `"0"` into argv
|
||||
* as a model name; a wrong model silently reviewed is worse than no model override.
|
||||
*
|
||||
* Exported and shared with the runner's model-recovery arms (#2295) — "what counts as unset" has
|
||||
* ONE source, so the plan resolver and the runner's recovered-model normalization cannot disagree.
|
||||
*/
|
||||
function configString(raw: unknown): string | null {
|
||||
export function configString(raw: unknown): string | null {
|
||||
if (typeof raw !== 'string') return null;
|
||||
const trimmed = raw.trim();
|
||||
if (trimmed === '' || trimmed === 'null' || trimmed === 'undefined') return null;
|
||||
@@ -510,6 +542,8 @@ export function resolveLanePlan(input: ResolveInput): ResolveResult {
|
||||
slug,
|
||||
binary,
|
||||
argv,
|
||||
model: modelExpansion.length > 0 ? model : null,
|
||||
effort: effortExpansion.length > 0 ? (configString(input.effortValue) ?? null) : null,
|
||||
stdin,
|
||||
promptPath,
|
||||
outputTarget,
|
||||
|
||||
Reference in New Issue
Block a user