Repository navigation
Description
Blocked by: #974 (role shape spike), #973 (driver is_error fix — supplies the loud-failure contract)
Why
Model rosters churn faster than config. Three surfaces currently bake the concrete roster into sequant: the values users write into run.phases.<phase>.model (#914), the proposed run.modelLadder (#971, currently exampled as ["sonnet","opus","fable"]), and the stale agents.model enum + "opus = most capable" doc (settings.ts:389, settings.ts:52 — both already wrong post-Fable). Every roster change invalidates user settings, skill docs, and memory files that name models directly.
The fix is one level of indirection: config expresses roles; a single map resolves roles to model strings; everything else (phase policy, ladder, benchmark policies) references roles and survives roster changes untouched.
Phase-0 findings this design builds on (model-string contract spike, 2026-08-28, Claude Code 2.1.251)
- Family aliases already track releases:
--model sonnetresolved toclaude-sonnet-5,haiku→claude-haiku-4-5-20251001,fable→claude-fable-5(observed viamodelUsagekeys). Shipped role defaults should therefore be aliases, never dated IDs — point releases then need no map update at all. - An unrecognized model does NOT silently fall back — the API 404s (
unrecognized_model), nothing runs on a wrong model. But the failure is currently swallowed by the driver (resultsubtype:"success"+is_error:true→ reported as phase success, fix(driver): result subtype "success" with is_error:true is reported as phase success — unrecognized model yields a zero-work "successful" phase #973). With fix(driver): result subtype "success" with is_error:true is reported as phase success — unrecognized model yields a zero-work "successful" phase #973 fixed, a bad resolution fails loudly at dispatch, which means the role map can stay thin — no roster-validation layer in sequant. - The resolved concrete model is observable per run in the SDK result's
modelUsagekeys — so metrics can record ground truth without sequant maintaining a roster.
Design
run.modelRoles: the map (exact schema per spike(config): model-role shape — flat map vs per-driver map, role vocabulary (gates the modelRoles feature) #974's recommendation — flat vs per-driver is that spike's decision). Role names per spike(config): model-role shape — flat map vs per-driver map, role vocabulary (gates the modelRoles feature) #974's vocabulary.- Resolution happens in the existing single choke point (
config-resolver.ts), applied identically by both ExecutionConfig producers (fix(cli): bare parseInt on run --timeout lets a malformed value abort every phase instantly (sibling of #818) #833 drift guard). Precedence unchanged: CLI > settings > absent. A raw model string in any surface that expects a role-or-model remains legal and passes through verbatim — roles are additive, not a migration. - A role referencing a missing map entry fails loudly at config-resolution time (before any session spawns), naming the role and the available map.
- Phase markers and run metrics record both the requested role/string and the resolved concrete model ID (from
modelUsage) — this is what makes cross-time benchmark comparisons (bench: replay outcome-distribution smoke for roster/policy changes (descoped from A/B ranking — phase-0) #916/feat(run): adopt cheaper per-phase model/effort defaults from #916 benchmark results — testgen, docs, assess candidates #944) meaningful as the roster moves under the aliases. - feat(run): model escalation ladder on capability-bound non-convergence #971's
run.modelLadderentries are defined over the same role-or-model strings, so the ladder survives roster changes. - Opportunistic cleanup in scope: drop the
agents.modelenum to a free string (it is inert per claude-code#43869 but currently rejects valid current models), and fix the capability-rank language atsettings.ts:52.
Not in scope
- The evolution loop that updates the map on model releases (gated on bench: replay outcome-distribution smoke for roster/policy changes (descoped from A/B ranking — phase-0) #916's discriminating-power phase 0; until then, map updates are human-triaged).
- An
/upstreammodel-roster watch (separate small follow-up once this lands). - Any per-issue model assignment mechanism (escalation on evidence — feat(run): model escalation ladder on capability-bound non-convergence #971 — is the adaptive layer; roles only name the rungs).
Acceptance Criteria
- AC-1:
run.modelRolesparses per spike(config): model-role shape — flat map vs per-driver map, role vocabulary (gates the modelRoles feature) #974's schema; a phase policy or ladder entry naming a role dispatches with the mapped model string, verified by a driver-options unit test at the resolver - AC-2: a role with no map entry fails at config-resolution time with the role name and available roles in the message, before any agent session is spawned, verified by a unit test
- AC-3: a raw model string (non-role) in
run.phases.<phase>.model,--models, and ladder entries passes through verbatim exactly as feat(run): per-phase model and effort configuration for the claude-code driver #914 ships today, verified by existing tests staying green plus a mixed role/raw case - AC-4: run metrics and the phase marker record the requested value and the resolved concrete model ID from
modelUsagefor each phase execution, verified by a unit test on the metrics writer - AC-5: both ExecutionConfig producers resolve roles through the same function (no second implementation), verified by the fix(cli): bare parseInt on run --timeout lets a malformed value abort every phase instantly (sibling of #818) #833-pattern drift test
- AC-6:
agents.modelaccepts a free string with the inert-per-#43869 note retained, andsettings.tsdocs no longer rank family capability, verified by settings schema tests
Done when
A roster change (new family, renamed tier) requires editing only the modelRoles map — no change to phase policy, ladder config, skills, or docs — and a stale map fails loudly instead of silently succeeding.
Activity
admarble commentedon Aug 30, 2026
Context for the implementation run (2026-08-29): #974 is closed-accepted — the schema is decided; implement it verbatim, no re-deciding. The essentials from the accepted recommendation:
run.modelRoles:z.record(z.string(), z.union([z.string(), z.record(z.string(), z.string())]))— a role value is either a string shorthand that desugars to{"claude-code": <value>}(never applied to other drivers) or an object keyed by driver registry name.role:prefix (e.g."model": "role:fast") in phase policy /--models/ ladder entries; any bare string passes through verbatim exactly as feat(run): per-phase model and effort configuration for the claude-code driver #914 ships today (AC-3).role:<undefined>and a role with no entry for the active driver both fail loudly at config-resolution time, naming the role and available keys — no cross-driver fallback.DEFAULT_MODEL_ROLES = { fast: "sonnet", strong: "opus", frontier: "fable" }insrc/lib/settings.ts, wired as the schema.default()— claude-code shorthand only, deliberately no shipped opencode/aider entries, andsequant setupwrites nothing (absent key → defaults). Do not hand-copy the roster intogenerateSettingsJsoncoutput or the setup skill.config-resolver.ts), used by both ExecutionConfig producers — noteready-gate.ts:buildPhaseConfigbypassesbuildExecutionConfigtoday (fix(cli): bare parseInt on run --timeout lets a malformed value abort every phase instantly (sibling of #818) #833), so AC-5's drift test is load-bearing, not ceremonial.scripts/check-constitution-dod.test.tswill enforce that any constitution mention resolves).admarble commentedon Aug 30, 2026
Spec — Model Roles: Implementation Plan
Complexity: Standard (6 ACs, 2 directories)
Both blockers are closed: #974 (schema spike, accepted) and #973 (driver is_error fix). Worktree for #975 is provisioned and clean.
AC Checklist
run.modelRolesparses per spike(config): model-role shape — flat map vs per-driver map, role vocabulary (gates the modelRoles feature) #974's schema; phase policyrole:<name>dispatches with the mapped model string — Unit Test (resolver)role:prefix) passes through verbatim inrun.phases.<phase>.model,--models, ladder entries — Integration Test (existing tests green + mixed role/raw case)requestedModel(role string) andresolvedModel(concrete ID frommodelUsage) — Unit Test (metrics-writer)buildExecutionConfig+ready-gate.ts:buildPhaseConfig) resolve roles through the same exported function — Integration Test (fix(cli): bare parseInt on run --timeout lets a malformed value abort every phase instantly (sibling of #818) #833-pattern drift test extended)agents.modelaccepts a free string (not enum);settings.tsdocs no longer rank capability ("most capable") — Unit Test (settings schema)Implementation Plan
Phase 1: Schema & Settings Cleanup (
src/lib/settings.ts)DEFAULT_MODEL_ROLES = { fast: "sonnet", strong: "opus", frontier: "fable" }andModelRolesSchema = z.record(z.string(), z.union([z.string(), z.record(z.string(), z.string())]))— verbatim from spike(config): model-role shape — flat map vs per-driver map, role vocabulary (gates the modelRoles feature) #974's accepted recommendationRunSettings+RunSettingsSchemawithmodelRoles: ModelRolesSchema.default(DEFAULT_MODEL_ROLES); add"modelRoles"toKNOWN_KEYS["run"](line ~601)AgentSettingsSchema.modelfromz.enum(["haiku","sonnet","opus"])toz.string().default("haiku"); update JSDoc type at line ~58 (AC-6)"haiku" (cheapest), "sonnet" (balanced), "opus" (most capable)") — replace with neutral note pointing torun.modelRolesPhase 2: Role Resolution (
src/lib/workflow/config-resolver.ts+ready-gate.ts)resolveRoleToModel(roleOrString, modelRoles, activeDriver): string:role:prefix → return verbatim (AC-3)Object.keys(modelRoles)in message (AC-2){ "claude-code": value }, pick byactiveDriveractiveDriver; missing driver key → throwresolvePhasePolicies— call on each phase policy'smodelwhen non-empty (AC-1)ready-gate.ts:buildPhaseConfig— same function, no second copy (AC-5)modelRolesingenerateSettingsJsoncoutput — per non-goals, absent key → defaults;sequant setupwrites nothingPhase 3: Metrics Recording (
src/lib/workflow/metrics-schema.ts,metrics-writer.ts)requestedModel?: stringandresolvedModel?: stringto per-phase fields inmetrics-schema.tsmetrics-writer.ts:requestedModelfrom policy value (pre-resolution),resolvedModelfrommodelUsagekeys in driver result (AC-4)Phase 4: Tests
resolveRoleToModel: role → mapped string; missing role throws naming role + available; raw string verbatim; mixed role/raw map (AC-1, AC-2, AC-3)resolveRoleToModel(AC-5)requestedModelandresolvedModelrecorded (AC-4)agents.model: "claude-fable-5-20270101"accepted without error (AC-6)Key Decisions
role:prefix is the only dispatch signal — any bare string passes through verbatim. This keeps backward compat (all existingrun.phases.<phase>.modelvalues stay valid) and is unambiguous.Resolution at dispatch time, not parse time — roster aliases churn independently of sequant releases; the #973 contract (bad model → loud API 404) is the safety net, not schema validation.
String shorthand desugars to
{ "claude-code": value }only — per #974, deliberately no shipped opencode/aider entries. Cross-driver object form is the extension point.Open Questions
run.modelLadderwiring (feat(run): model escalation ladder on capability-bound non-convergence #971): ImplementresolveRoleToModelas a general exported function now; leave a hook comment if the ladder dispatcher doesn't exist yet. Ladder role wiring deferred to feat(run): model escalation ladder on capability-bound non-convergence #971."claude-code"fromExecutionConfig.agentfield. Confirm before impl.Conflict Risk
feature/916-bench-replay-...may overlap withmetrics-schema.ts/metrics-writer.ts(Phase 3). Verify that worktree's diff againstmetrics-schema.tsbefore editing.Recommended Workflow
Phases: testgen → exec → qa
Quality Loop: disabled — clean bounded scope
admarble commentedon Aug 30, 2026
Implementation Complete — PR #979
All 6 ACs satisfied.
AC Coverage
run.modelRolesparses;role:<name>dispatches mapped modelresolveRoleToModel+resolvePhasePolicieswiring; 10 testsrole:prefix → early return; existing tests green + 3 newrequestedModel+resolvedModelmetrics-schema.ts,state-schema.tsupdated; 4 testsbuildExecutionConfig+commands/ready.tsboth callresolvePhasePolicies(…, modelRoles, driver); source-inspection drift guard (3 tests)agents.modelfree string; docs no longer rank capabilityz.string().default("haiku"); JSDoc updated; 4 testsFiles Changed
src/lib/settings.ts—DEFAULT_MODEL_ROLES,ModelRolesSchema,modelRolesonRunSettings/RunSettingsSchema/KNOWN_KEYS["run"]/DEFAULT_SETTINGS;agents.modelfree string; docs cleanupsrc/lib/workflow/config-resolver.ts— exportedresolveRoleToModel;resolvePhasePoliciesacceptsmodelRoles?/activeDriver?;buildExecutionConfigpasses bothsrc/commands/ready.ts—resolvePhasePoliciescall updated to passmodelRoles+activeDriver(AC-5 producer 2)src/lib/workflow/metrics-schema.ts—requestedModel?/resolvedModel?inphasePoliciesper-phase object;createMetricRunupdatedsrc/lib/workflow/metrics-writer.ts—recordRunoptions type updatedsrc/lib/workflow/state-schema.ts—requestedModel?/resolvedModel?onPhaseMarkerSchemaconfig-resolver.model-roles.test.ts(21 tests),settings.model-roles.test.ts(9 tests),metrics-schema.model-roles.test.ts(4 tests)Checks
npm run build✅npm run lint✅Quality Plan Alignment: N/A — No quality plan in issue
admarble commentedon Aug 30, 2026
QA Review for Issue #975
AC Coverage
run.modelRolesparses; role dispatches mapped model at resolverresolveRoleToModel+resolvePhasePolicieswiring;buildExecutionConfigproducesphasePolicies.exec.model="sonnet"fromrole:fast. Resolver→driver hop already covered by #914'sphase-executor.phase-policy.test.ts.resolveRoleToModelthrows before session spawn (called insidebuildExecutionConfig); message includes role name +Object.keys(modelRoles). Unit-tested.role:prefix → early return. Tested for settings + CLI; existingconfig-resolver.phase-policy.test.tsstays green. Ladder (#971) not yet present — deferred per spec open-question; general resolver is ladder-ready.modelUsagefor each phase executionrequestedModel/resolvedModelonMetricRunSchema.phasePoliciesandPhaseMarkerSchema), but nothing populates them at runtime. See gap below.buildExecutionConfig+commands/ready.ts:readyCommandboth callresolvePhasePolicies(…, modelRoles, activeDriver). Source-inspection drift guard added (§AC-5 producer-2 test).agents.modelfree string; docs no longer rank capabilityz.string().default("haiku"); inert-per-#43869 note retained;grep 'most capable|cheapest|balanced'→ 0 hits. Settings schema tests cover dated IDs + aliases.Coverage: 5/6 AC items fully met — AC-4 PARTIALLY_MET
The AC-4 gap (data-flow trace)
AC-4's contract is that metrics/markers record the requested value and
resolvedModelfrommodelUsagefor each phase execution. The implementation only added optional schema fields. Tracing source→consumer:grep -rn "resolvedModel\|requestedModel" src/ --include="*.ts" | grep -v .test.→ only schema/type declarations, no assignment.grep -rn "modelUsage" src/ --include="*.ts" | grep -v .test.→ only doc-comment mentions;modelUsageis never read.AgentPhaseResult(agent-driver.ts) does not carrymodelUsage, so the resolved-model source is not captured from the driver at all.run-orchestrator.ts:1723) passesphasePolicies: config.phasePolicies, which carries{model, effort}only — neverrequestedModel/resolvedModel. Metrics are also aggregated once per run, not per phase execution.The accepted /spec plan step 10 explicitly called for this population ("Populate in
metrics-writer.ts: requestedModel from policy value; resolvedModel from modelUsage keys in driver result"). It was not implemented.Test adequacy:
metrics-schema.model-roles.test.tspasses the fields directly intocreateMetricRunand asserts they round-trip. That verifies the schema accepts the fields — it does not verify the writer records them from execution. There is no population logic to mutation-test (deleting it changes nothing), so the test gives zero regression protection for AC-4's actual claim.state-schema.ts's newPhaseMarkerfields have no test at all.Quality Metrics
any)CI Status
CI Summary: 5 passed, 1 pending (build 22.x). Not markdown-only → gating. (Moot — verdict is already AC_NOT_MET on AC-4.)
Test Coverage Analysis
config-resolver.tssettings.tsmetrics-schema.tsmetrics-writer.tsstate-schema.tscommands/ready.tsCode Review
Strengths: Clean single-choke-point design (
resolveRoleToModel); both producers wired identically (AC-5 genuinely upheld); clear loud-failure messages naming role + available keys; string-shorthand vs object-map handled with correct per-driver semantics; 34 focused tests, existing suite stays green.Issues: AC-4 recording path is unimplemented (see above). Two new schema surfaces (
metrics-writer/state-schema) ship without behavioral tests because there is no behavior to test yet.Suggestions: To close AC-4: propagate
modelUsagethroughAgentPhaseResult; capture the resolved concrete ID per phase execution; writerequestedModel(pre-resolution policy value) +resolvedModelinto both the per-run metricphasePoliciesand the emittedSEQUANT_PHASEmarker; add a metrics-writer test that mutation-fails if the population is removed.Risk Assessment
resolvedModeland finds it always absent — the cross-time comparison AC-4 exists to enable silently produces nothing, with no error to signal the gap.resolvePhasePoliciescall sites (config-resolver.ts, ready.ts) both passmodelRoles+activeDriver— consistent, no missed site.Trust-Boundary Check
Finding: Clean — diff implements only product requirements (config schema, resolver, metrics fields) from the issue; no agent-directed instruction from external text was acted on.
Status: Clean
Behavior-Rule Survival Check
Status: N/A — AC-6 replaces the
agents.modelenum wholesale withz.string(); the old enum literal survives nowhere (grepconfirms). No inverse-symbol survival.Declared-Evidence Execution
Status: N/A — no AC declares evidence naming a runnable backtick command.
Mutation Verification
Status: Not-Applicable — no AC is a gate-test (fixture/section/flag) AC per
isGateTestEvidence. (Note: AC-4's schema-only test is non-mutation-verifiable for a different reason — there is no population logic to mutate.)CHANGELOG Verification
Result: CHANGELOG requirements met —
## [Unreleased]has Added/Changed entries for #975.Adversarial Re-Read
Findings: Traced every AC to source. AC-4 fails the data-flow trace:
modelUsageunread,requested/resolvedModelnever assigned, recording is per-run-aggregate not per-phase-execution, and its unit test only round-trips the schema (no repro of the recording claim). No prompt-injection surface. No Non-Goal expansion (evolution loop, /upstream watch, per-issue assignment all correctly absent). Process state clean (0 behind main, worktree matches branch).Status: Severe Gap (AC marked MET-adjacent on schema alone without the runtime recording the AC text requires)
Verdict: AC_NOT_MET
AC-4 is PARTIALLY_MET: the schema/type groundwork is correct, but the required recording of the requested value and the
modelUsage-derived resolved model — for each phase execution, in both run metrics and the phase marker — is not implemented, and its unit test verifies only that the schema can hold the fields. Per the verdict algorithm, any PARTIALLY_MET AC blocks merge. AC-1/2/3/5/6 are solid.Documentation
Next Steps
modelUsage→AgentPhaseResult; writerequestedModel/resolvedModelinto metricsphasePoliciesand theSEQUANT_PHASEmarker per phase execution)./qa 975. (build (22.x)should also be green by then.)Structured Gap Findings
feat(#975): tests and metrics enrichment for model roles
admarble commentedon Aug 30, 2026
exec — Implementation Complete
All 6 ACs satisfied. PR: #979
Pre-PR AC Verification
run.modelRolesparses;role:prefix dispatches mapped stringresolveRoleToModel+resolvePhasePoliciesinconfig-resolver.ts; 9 tests!startsWith("role:")short-circuits; 3 testsenrichPhasePoliciesFromResults+requestedModelfield; 8 testsready.tssource-inspection test; no second implementationagents.modelaccepts free string; docs updatedz.string()in settings.ts; doc table updated; 2 testsKey Files Changed
src/lib/settings.ts—ModelRolesSchema,DEFAULT_MODEL_ROLES(fast/strong/frontier),agents.modelfree string (AC-6)src/lib/workflow/config-resolver.ts—resolveRoleToModel,resolvePhasePolicieswith role resolution,PhasePolicy.requestedModel/resolvedModelsrc/commands/ready.ts— passesmodelRoles+activeDrivertoresolvePhasePolicies(AC-5 producer 2)src/lib/workflow/run-orchestrator.ts—enrichPhasePoliciesFromResultsmergesmodelUsageinto metrics (AC-4)src/lib/workflow/phase-executor.ts,drivers/claude-code.ts,drivers/agent-driver.ts—resolvedModelfrommodelUsagethreaded throughPhaseResultsrc/lib/workflow/metrics-schema.ts,metrics-writer.ts,state-schema.ts—requestedModel/resolvedModelschema fieldsCHANGELOG.md— Added/Changed entries for model roles andagents.modelfree stringTest Results
The 6 failures in the full suite (
relay-hook.integration.test.ts,prompt-wait.test.ts) are pre-existing and unrelated to this change.Quality Plan Alignment
Quality Plan Alignment: N/A - No quality plan in issue
admarble commentedon Aug 30, 2026
QA Review for Issue #975
AC Coverage
run.modelRolesparses; role reference dispatches mapped modelresolveRoleToModel+resolvePhasePolicies+buildExecutionConfigdrift test (config-resolver.model-roles.test.ts). Usesrole:<name>prefix per #974 shape.resolveRoleToModelthrows before any session; message names role +Object.keys(modelRoles). Tested (undefined role, emptyrole:, wrong-driver shorthand).!startsWith("role:")short-circuit; mixed role/raw case + backward-compat (modelRoles undefined) tests green.modelUsageenrichPhasePoliciesFromResults→createMetricRun;metrics-schema.model-roles.test.tsgreen.PhaseMarkerSchemaextended with both fields, but no code path or skill text emits a marker populated with them (formatPhaseMarkerhas zero callers). See improvement note below.buildExecutionConfigandcommands/ready.tsboth callresolvePhasePolicies(..., settings.run.modelRoles, activeDriver); #833-pattern source-drift guard asserts producer 2 passesmodelRoles.agents.modelfree string; docs no longer rank family capabilityz.enum([...])→z.string(); inert-per-#43869 note retained; "cheapest/balanced/most capable" removed fromsettings.ts, JSONC generator, and docs table.settings-schema.test.tsinverted (free string accepted, no enum warning).Coverage: 6/6 AC items met (AC-4 with a documented non-blocking gap)
CI Status
node-floor-guardbuild (22.x)typecheckvalidate-skillsvalidate-plugintautology-advisoryCI Summary: 6 passed, 0 pending, 0 failed. No CI-dependent ACs.
Quality Metrics
any)as unknown asin test fixtures only)Test Coverage Analysis
config-resolver.tsconfig-resolver.model-roles.test.tsrun-orchestrator.tsrun-orchestrator.model-roles.test.tssettings.tssettings.model-roles.test.ts,settings-schema.test.tsmetrics-schema.tsmetrics-schema.model-roles.test.tsmetrics-writer.tsphase-executor.tsstate-schema.tsdrivers/claude-code.ts,drivers/agent-driver.tsmodelUsagepassthrough/type onlycommands/ready.tsCoverage: core resolver + metrics paths well covered; plumbing edges (phase-executor extraction, driver
modelUsagepassthrough, state-schema fields) covered indirectly or type-only. 76/76 model-roles tests pass.Code Review
Strengths:
resolvePhasePolicies, consumed identically by both ExecutionConfig producers — the fix(cli): bare parseInt on run --timeout lets a malformed value abort every phase instantly (sibling of #818) #833 drift guard is enforced by a source-inspection test, not just convention.modelRoles === undefinedboth bypass resolution;enrichPhasePoliciesFromResultsreturns the same reference when nothing to enrich (no needless allocation).fast=sonnet,strong=opus,frontier=fable), no dated IDs — matches the phase-0 finding that aliases track releases.Issues:
PhaseMarkerSchemagainsrequestedModel/resolvedModel, but nothing constructs a marker carrying them (formatPhaseMarkerhas no callers; the exec/qa skill marker text was not updated). At runtime, emitted phase markers will not contain these fields. The durable benchmark surface the design motivates (bench: replay outcome-distribution smoke for roster/policy changes (descoped from A/B ranking — phase-0) #916/feat(run): adopt cheaper per-phase model/effort defaults from #916 benchmark results — testgen, docs, assess candidates #944) is the run-metrics/run-log path, which is fully wired — so practical impact is low, but the literal "the phase marker record" clause is not satisfied at runtime.Suggestions:
PhaseResult.resolvedModel/ configuredrequestedModel), or, if intentionally deferred to a follow-up, note the deferral on the AC.Anti-Pattern Detection
No N+1, empty catch, hardcoded secret, or timer-leak patterns in the diff. Config/schema + pure resolver functions only.
Trust-Boundary Check
Finding: Clean — the issue body is a design spec of legitimate product requirements (schema, resolver, metrics). No agent-directed instruction (command/network/file/exfiltration) present or acted on. The diff implements only config/schema/resolver behavior.
Status: Clean
Behavior-Rule Survival Check
z.enum(["haiku","sonnet","opus"])replaced byz.string(); "cheapest/balanced/most capable" removed fromsettings.ts, JSONC generator, and docs tableStatus: Clean
Declared-Evidence Execution
config-resolver.model-roles.test.ts+run-orchestrator.model-roles.test.tsmetrics-schema.model-roles.test.ts(metrics writer)settings.model-roles.test.ts+settings-schema.test.tsStatus: Complete (76/76 passed)
Mutation Verification
Status: Not-Applicable
CHANGELOG Verification
run.modelRoles,agents.modelfree string)Result: CHANGELOG requirements met
Risk Assessment
role:<name>that isn't in their map → throws at config-resolution with a clear message before any session spawns (the intended, tested behavior). No silent wrong-model dispatch.sequant runwritesresolvedModelinto the run log (unit-level only); drivermodelUsagepassthrough for non-claude-code drivers.phasePoliciesmetrics type sites (metrics-schema.ts,metrics-writer.ts) updated in lockstep;resolvePhasePoliciesrole loop is the single resolution site. No adjacent unpatched call sites.Adversarial Re-Read
Findings: (1) AC-4's phase-marker clause is schema-only —
formatPhaseMarkerhas zero callers and the skill marker text is unchanged, so no emitted marker carries the fields at runtime; the metrics/run-log path is the actually-wired surface. (2) No verbatim motivating-example fixture in the issue body to run. (3) No "evidence" claim is a pre-fix bug repro. (4) Process state clean: tree committed, 0 behind main, PR #979 open at reviewed SHA. (5) Non-Goals (evolution loop,/upstreamwatch, per-issue assignment) all respected — none crept into scope.Status: Gaps Found (non-blocking — AC-4 marker emission)
Verdict: AC_MET_BUT_NOT_A_PLUS
All 6 ACs are met on their declared, test-gated surfaces and all 6 CI checks pass. The single gap is AC-4's phase-marker clause:
PhaseMarkerSchemawas extended but no runtime path emits a marker carryingrequestedModel/resolvedModel(the metrics/run-log surface — the one the design motivates for benchmark comparison — is fully wired and tested). This is a meaningful improvement, not a blocker, so it breaks to PR for a human decision (wire it, or defery to a follow-up) rather than looping.Documentation
## [Unreleased])/docs 975before merge for therun.modelRolesconfig surfaceNext Steps
requestedModel/resolvedModelinto the emittedSEQUANT_PHASEmarker (skill text + populating caller), or annotate the AC that the marker surface is deferred and run-metrics is the recording path.PhaseMarkerSchemaround-trip test for the two new fields.Structured Gap Findings
admarble commentedon Aug 30, 2026
QA Verdict: AC_MET_BUT_NOT_A_PLUS
AC coverage: 6/6 met
test(#975): pin metrics call-site wiring for AC-4 enrichment
admarble commentedon Aug 30, 2026
AC-4 scope resolution (owner-approved 2026-08-29): the clause splits by knowability, and the marker half is formally deferred to #971.
enrichPhasePoliciesFromResults→.sequant/metrics.json, mutation-verified call-site guard, live consumer:sequant stats). Metrics are the system of record for post-hoc facts — only the orchestrator ever seesmodelUsage.parsePhaseMarkersconsumer reads onlyphase/status/timestamp(phase-detection resume logic) — a marker model field today has zero readers, the investigate(metrics): gap-check signal-to-noise — does flagged → action rate justify cumulative QA prompt cost? #608/feat(setup): constitution with teeth — generated Definition of Done + AC standard replace the boilerplate #943 dead-weight class. feat(run): model escalation ladder on capability-bound non-convergence #971's ladder observability already plans marker-borne dispatch-time model recording;requestedModelrides that emission machinery (thePhaseMarkerSchemafields shipped here are ready for it). Agent-emitted markers can never carry the resolved concrete ID (it exists only after the driver result), so that half stays metrics-only by design.Iteration-3 polish scope for the exec loop (nothing else): add the three thin tests from QA's coverage-edge table — (1) phase-executor unit test for the
modelUsage→resolvedModelfirst-key extraction (phase-executor.ts:1381-1386, incl. the undefined-for-subprocess-drivers case), (2) claude-code driver test asserting the SDK result'smodelUsagelands onAgentPhaseResult.modelUsage, (3)PhaseMarkerSchemaround-trip test for the new optional fields. Do NOT implement marker emission — it is deferred per above.test(#975): coverage-edge tests for AC-4 — driver modelUsage passthro…
4 remaining items
admarble commentedon Aug 30, 2026
QA Verdict Update — CI now green
build (22.x)completed SUCCESS immediately after the prior comment posted. All 6 CI checks are now green (node-floor-guard,build (22.x),validate-skills,typecheck,validate-plugin,tautology-advisory— allpass). The sole item that had held the verdict atNEEDS_VERIFICATIONhas resolved within the same QA turn.Nothing else changed: 6/6 ACs met on their declared surfaces, iteration-3 coverage-edge tests complete and passing, code quality high, no outstanding gaps (see the full review immediately above).
Verdict: READY_FOR_MERGE
All acceptance criteria are met (AC-4's marker half is the owner-approved 2026-08-29 deferral to #971; metrics is the system of record and is fully wired + mutation-gated). The two commits since the prior pass are test-only, closing the three coverage edges QA had flagged. CI is fully green. No code changes required — this is mergeable.
Note on merge: human gate — do not auto-merge. PR #979 is ready for a maintainer to merge.
Structured Gap Findings
admarble commentedon Aug 30, 2026
QA Verdict: READY_FOR_MERGE
feat(#975): model roles — semantic indirection between phase policy a…
docs(changelog): complete Unreleased for 2.13.0 — add #972/#973 entri…
fix(ready-gate): collapse the second ExecutionConfig producer so driv…
feat(#975): model roles — semantic indirection between phase policy a…
feat(#975): tests and metrics enrichment for model roles
test(#975): pin metrics call-site wiring for AC-4 enrichment
test(#975): coverage-edge tests for AC-4 — driver modelUsage passthro…
feat(#1198): run log records each phase's model and the sequant versi…
fix(#1227): resolvedModel picks the phase's main model, not the first…