Repository navigation
Description
Motivation
Users are reporting an Opus 5 regression in code/docs output: overthinking, verbose jargon-heavy prose, overcomplex implementations (see the widely-upvoted r/ClaudeAI thread on stopping Opus 5 from writing documentation). The community consensus fix is phase splitting: plan with a stronger model, delegate implementation to Sonnet. Sequant already has the phase boundaries (spec/exec/qa) where that split is natural — it just doesn't expose the knob.
Today ClaudeCodeDriver.executePhase() passes no model and no effort to the Agent SDK query() call, so every phase inherits the CLI default. The SDK supports both at the session level:
Options.model— "Claude model to use. Defaults to the CLI default model."Options.effort—low | medium | high | xhigh | max(defaulthigh), "works with adaptive thinking to guide thinking depth."
Because upstream claude-code#43869 makes subagents inherit the parent session's model (subagent model: frontmatter is silently ignored — see #632), setting the phase session model also governs the sequant-implementer/qa-checker subagents that phase spawns. One knob controls the whole phase tree.
Design
Settings — a per-phase map under run, absent-by-default (zero behavior change until opted in):
"run": {
"phases": {
"spec": { "model": "fable" },
"exec": { "model": "sonnet", "effort": "medium" },
"qa": { "effort": "high" }
}
}CLI overrides on sequant run (and ready), highest precedence:
--models <spec>— either a bare value applied to all phases (--models sonnet) or a comma list ofphase=modelpairs (--models spec=fable,exec=sonnet)--efforts <spec>— same grammar (--efforts exec=medium)
Wiring (standard flag trace: bin/cli.ts → RunOptions → ExecutionConfig → phase-executor → driver):
AgentExecutionConfiggains optionalmodel?: stringandeffort?: string.ClaudeCodeDriverforwards them toquery()options when present; omits them otherwise.- Non-claude drivers ignore both fields (Aider keeps its own
settings.model). ⚠️ Both ExecutionConfig producers must be wired:config-resolver.ts:buildExecutionConfigandready-gate.ts:buildPhaseConfig— they drifted before (fix(cli): bare parseInt on run --timeout lets a malformed value abort every phase instantly (sibling of #818) #833).
Validation: pass model aliases/IDs through to the SDK without hard validation (model IDs churn; the SDK errors clearly on a bad one). Effort values validate against the closed enum low|medium|high|xhigh|max at settings-parse time.
Metrics: record the resolved model and effort per phase in run metrics (closed-enum/alias strings only — consistent with the privacy contract in metrics-schema.ts). This is the foundation for measuring whether phase splitting affects quality (#437 follow-up; replay bench tracked separately).
Acceptance Criteria
-
run.phases.<phase>.modelandrun.phases.<phase>.effortare parsed from settings, validated (effort against the closed enum, unknown phase names rejected with a warning), and default to absent -
sequant run --models exec=sonnetand--efforts exec=mediumoverride settings; a bare value (--models sonnet) applies to all phases; malformed specs fail fast with a usage error - With no per-phase config present, the
query()options object contains neithermodelnoreffort(behavior identical to today, verified by a driver unit test) -
ClaudeCodeDriverforwards configuredmodel/effortintoquery()options, verified by a unit test asserting the options object - Both
buildExecutionConfigandready-gate.ts:buildPhaseConfigresolve per-phase model/effort with identical precedence (CLI > settings > absent), each covered by its own test - The Aider driver is unaffected by
run.phasesconfig (test: config present, Aider args unchanged) - Run metrics record the resolved model and effort per phase when set, and omit the fields when inherited
-
--models/--effortsare registered via.option()inbin/cli.tsand survive the RunOptions dead-surface test - README + docs/ document the settings shape, CLI flags, precedence, and the subagent-inheritance note (fix(agents): realign declared model tiers; document upstream routing bug #632 upstream bug means subagents follow the phase model)
Activity
admarble commentedon Aug 8, 2026
Complexity: Complex (9 ACs, ~3 directories:
src/lib/workflow,bin/,docs/)AC Quality Check
All 9 ACs are measurable and verifiable — each names a concrete artifact (settings key, CLI flag,
query()options object, a specific test). No vague/unmeasurable/open-ended patterns. One note: AC-7 ("omit the fields when inherited") and AC-3 ("contains neithermodelnoreffort") assert absence, which needs a mutation-verified test (assert the key is not present, not merely falsy) to avoid a vacuous pass.Scope Assessment
Non-Goals:⚠️ No explicit Non-Goals section. Implied out-of-scope from the body: hard model-ID validation (pass-through to SDK), the replay A/B bench (#916), and evidence-based effort escalation (#915). Recommend confirming these stay out.
Verdict:⚠️ SCOPE_WARNING — AC count trips the red line, but the 9 ACs are facets of one cohesive flag trace (settings → CLI → ExecutionConfig → executor → driver → metrics → docs), not independent features. Splitting would fracture a single wire. Recommend: keep as one issue, enable the quality loop.
Acceptance Criteria
AC-1: Settings parse/validate
run.phases.<phase>.{model,effort}, default absentVerification: Unit Test
Scenario: Given a settings object with
run.phases.exec.effort = "medium"→ When parsed byRunSettingsSchema→ Then it round-trips; an invalid effort ("turbo") is rejected at parse; an unknown phase name emits aSettingsWarning(non-fatal); absentrun.phasesyieldsundefined.Assumptions: Effort validates against closed enum
low|medium|high|xhigh|max. Unknown-phase-name → warning (settings side), distinct from CLI fail-fast.AC-2: CLI
--models/--effortsoverride settings; bare value = all phases; malformed = usage errorVerification: Integration Test (CLI parse) + Unit Test (spec parser)
Scenario: Given
--models exec=sonnet→ exec overridden, others untouched. Given--models sonnet→ applied to all phases. Given--models spec=or--models sonnet,exec=fable(mixed) or--models badphase=x→ process exits with a usage error naming the flag.Assumptions: Fail-fast happens at the Commander
.option()boundary (mirrorsparseWholeNumberfor--auto-wait, #804), so it shows in--helpand never silently no-ops (#305 class).AC-3: No per-phase config →
query()options contain neithermodelnoreffortVerification: Unit Test (driver)
Scenario: Given
AgentExecutionConfigwithmodel/effortunset → WhenClaudeCodeDriver.executePhasebuildsquery({options})→ Then"model" in options === falseand"effort" in options === false.Assumptions: Uses
in/key-presence assertion, not truthiness — this is the mutation-verified absence gate.AC-4:
ClaudeCodeDriverforwards configuredmodel/effortintoquery()optionsVerification: Unit Test (driver)
Scenario: Given config
{model:"sonnet", effort:"medium"}→ Then thequery()options object containsmodel:"sonnet"andeffort:"medium".AC-5:
buildExecutionConfigANDready-gate.ts:buildPhaseConfigresolve per-phase model/effort with identical precedence (CLI > settings > absent)Verification: Unit Test ×2 (one per producer)⚠️ #833 drift hazard — the two producers diverged before. Mitigate with a single shared resolver both call (see Design).
Scenario: Given CLI
exec=sonnet+ settingsexec.model=opus→ both producers resolve exec→sonnet. Given only settings → both resolve to settings. Given neither → both resolve absent.Assumptions:
AC-6: Aider driver unaffected by
run.phasesVerification: Unit Test
Scenario: Given
run.phases.exec.model="sonnet"present → When Aider driver runs → Then its args/settings.modelare byte-identical to the no-config case.AC-7: Run metrics record resolved model/effort per phase when set; omit when inherited
Verification: Unit Test
Scenario: Given exec resolved to
{model:"sonnet"}and qa inherited → Then the metric record carries exec's model (and effort if set) and omits fields for qa.Assumptions: Closed-enum/alias strings only, per the
metrics-schema.tsprivacy contract. See Open Question 2 on metrics vs run-log placement.AC-8:
--models/--effortsregistered via.option()and survive the RunOptions dead-surface testVerification: Integration Test
Scenario: Given the run command → Then both flags parse, appear in
--help, andrun-options-dead-surface.test.tssees a live consumer for each newRunOptionsfield (not inert).AC-9: README + docs/ document settings shape, CLI flags, precedence, and the #632 subagent-inheritance note
Verification: Manual Test (docs content verification)
Scenario: Given the docs → Then the settings shape, both flags, the CLI>settings>absent precedence, and the "subagents follow the phase model (#632/#43869)" note all appear. Verify content coverage in all locations (main README, marketplace README if present, docs/), not file existence.
Rule Touchpoints
This feature is a multi-touchpoint rule — the same "resolve per-phase model/effort" logic must live at every hop, and #833 is the recorded failure of exactly two of them drifting. Touchpoints the implementation must keep in lockstep:
config-resolver.ts:buildExecutionConfigready-gate.ts:buildPhaseConfig(viaready.ts)phase-executor.ts:1258(agentConfig build)drivers/claude-code.ts:121(queryoptions)drivers/aider.tsImplementation Plan
Phase 1: Types & settings (foundation)
settings.ts— addPhasePolicySchema = z.object({ model: z.string().optional(), effort: z.enum(["low","medium","high","xhigh","max"]).optional() }). Addphases?: Record<string, PhasePolicy>toRunSettings+RunSettingsSchema(z.record(...).optional()). Add"phases"toKNOWN_KEYS.run, and emit aSettingsWarningfor any phase key not ingetPhaseNames().agent-driver.ts— add optionalmodel?: stringandeffort?: stringtoAgentExecutionConfig.types.ts— addphasePolicies?: Record<string, { model?: string; effort?: string }>toExecutionConfig, andmodels?: string/efforts?: string(raw specs) toRunOptions.Phase 2: Shared resolver (the #833 firewall)
config-resolver.ts— add exportedparsePhaseSpec(spec, phaseNames)(grammar: bare →{"*": v}, else comma list ofphase=value; throws on malformed / unknown phase) andresolvePhasePolicies(cliModels, cliEfforts, settingsPhases, phaseNames)returning the mergedRecord<phase,{model?,effort?}>with CLI > settings > absent. Both producers call this one function — mirrors howpositiveOrwas extracted to serve both timeout producers (fix(cli): bare parseInt on run --timeout lets a malformed value abort every phase instantly (sibling of #818) #833 doc comment).Phase 3: Wire both producers
config-resolver.ts:buildExecutionConfig— populatephasePoliciesviaresolvePhasePolicies(...).ready.ts+ready-gate.ts— add resolved policies toRunReadyGateOptions;buildPhaseConfigspreads them onto itsExecutionConfig. (Decide: doessequant readyget its own--models/--effortsflags? Body says "run (and ready)" → yes; see Open Question 1.)Phase 4: Apply & forward
phase-executor.ts:1258— look upconfig.phasePolicies?.[phase]and setagentConfig.model/agentConfig.effortonly when present.drivers/claude-code.ts:121— spread...(config.model ? {model: config.model} : {})and...(config.effort ? {effort: config.effort} : {})intoquery()options.Phase 5: CLI + metrics + docs
bin/cli.ts— register--models <spec>and--efforts <spec>with a custom fail-fast parser (validate grammar + phase names + effort enum, model IDs pass through).metrics-schema.ts— add optional per-phase{model?, effort?}toMetricRunSchema(enum/alias strings only); populate from resolvedphasePoliciesatcreateMetricRun. Omit when inherited.README.md+docs/— settings shape, flags, precedence, fix(agents): realign declared model tiers; document upstream routing bug #632 note.Phase 6: Tests (testgen-seeded)
Design Review
config-resolver.ts(already the 4-layer merge home); a single shared resolver called by both producers. Per-phase application inphase-executor.ts(it alone knows which phase is running). SDK forwarding isolated toclaude-code.ts(owns the SDK import).Record<phase,{model?,effort?}>onExecutionConfig+ two optional driver fields. Rejected: resolving inside the driver (driver doesn't know settings/CLI); resolving inbuildExecutionConfigper-phase-into-flat-fields (loses the phase dimension). Rejected hard model-ID validation per the issue (IDs churn; SDK errors clearly).positiveOr(fix(cli): bare parseInt on run --timeout lets a malformed value abort every phase instantly (sibling of #818) #833) — extract one resolver to serve bothphaseTimeoutproducers — applied here to model/effort. Follows--auto-wait's fail-fast.option()parser (feat(run): --auto-wait — continue a rate-limited run when the window resets instead of halting #804) for the CLI grammar.ExecutionConfigdrives all phases of an issue; the phase is only known atexecutePhase. "Did you wire both producers?" — yes, AC-5 gates it with a test each, and they share one resolver so they cannot drift.Feature Quality Planning
Standard checks pass. Notable items:
"model" in options), and be mutation-verified (add a straymodel, confirm the test fails) per the repo's gate-test rule.Derived ACs
Open Questions
sequant readyget its own--models/--effortsflags? — The body says "onsequant run(andready)". Recommendation: yes, add them to thereadycommand too, feeding the same shared resolver. Impact if skipped: AC-5's ready-side test can still pass via settings-only, but the "(and ready)" CLI promise goes unmet.metrics-schema.tsvs run-logPhaseLogSchema? — AC-7 + body say "run metrics" and namemetrics-schema.ts. Recommendation: add per-phase fields toMetricRunSchema(literal reading). Note: run-logPhaseLogSchemawould be the natural home for the replay bench (bench: replay outcome-distribution smoke for roster/policy changes (descoped from A/B ranking — phase-0) #916) and is per-phase already — worth mirroring there as a cheap follow-up, but only metrics is required here.Recommended Workflow
Phases: spec → testgen → exec → qa
Quality Loop: enabled
Reasoning: ACs are Unit/Integration-heavy on a wiring change with a known drift trap (#833) → testgen seeds the absence/parity/inertness stubs before exec; quality loop justified by the 9-AC breadth and SCOPE_WARNING. No UI → no
testphase. Not security-sensitive → nosecurity-review.Label Review
Current:
enhancement,cliRecommended: add
complex(9 ACs, multi-touchpoint wiring)Reason: Signals the quality loop and the Complex output tier; matches the cross-cutting flag trace.
Quality Loop: Will auto-enable under SCOPE_WARNING.
→
gh issue edit 914 --add-label complex--- DRAFT GITHUB ISSUE COMMENT (PLAN) ---
This comment is the plan of record for #914.
admarble commentedon Aug 8, 2026
#914 — feat(run): per-phase model and effort configuration for the claude-code driver
Open · enhancement, cli
────────────────────────────────────────────────────────────────
→ PROCEED — Foundation knob; clear ACs, wiring path known
Commands:
sequant run 914 -Q --phases testgen,exec,qa # after in-flight spec
spec → testgen → exec → qa · 9 ACs
Flags:
-Q multi-file wiring across bin/cli.ts, config-resolver, ready-gate, driver, metrics
--phases testgen,exec,qa spec already running for this issue; testgen from unit-test ACs
────────────────────────────────────────────────────────────────
⚠ Locked by an in-flight spec-only run at assessment time — wait for it before exec
⚠ #915 layers on this issue's effort resolver; land this first (or chain 914 → 915)
────────────────────────────────────────────────────────────────
admarble commentedon Aug 8, 2026
Test Stubs Generated (/testgen)
Generated from the spec's 9 ACs. All new files were run against
vitestto confirm they fail for the right reason (missing symbols / unimplemented behavior — verified:TypeError: X is not a functionor an assertion onundefined), not a syntax error.src/lib/settings.phase-policy.test.tssrc/lib/workflow/config-resolver.phase-policy.test.ts(parsePhaseSpec)src/lib/cli-flags.phase-policy.test.ts(parsePhaseSpecFlag)it.each×3)src/lib/workflow/drivers/claude-code.phase-policy.test.tsconfig-resolver.phase-policy.test.ts(resolvePhasePolicies + producer 1) +ready-gate.phase-policy.test.ts(producer 2)src/lib/workflow/drivers/aider.phase-policy.test.tssrc/lib/workflow/metrics-schema.phase-policy.test.ts#914 AC-8describe block tosrc/lib/workflow/run-options-dead-surface.test.ts(mirrors the existingreadyGatelive-surface guard)Naming/shape choices made as stub proposals (not locked contracts) — /exec may rename during implementation:
parsePhaseSpec(spec, phaseNames)andresolvePhasePolicies(cliModels, cliEfforts, settingsPhases, phaseNames)exported fromconfig-resolver.ts, called by both producers (the fix(cli): bare parseInt on run --timeout lets a malformed value abort every phase instantly (sibling of #818) #833 firewall).ExecutionConfig.phasePolicies: Record<phase, {model?, effort?}>.cli-flags.ts:parsePhaseSpecFlag(flag, phaseNames)wrapsparsePhaseSpec, converts toInvalidArgumentErrorat the CLI boundary.MetricRun.phasePoliciesmirrors the same shape (Open Question 2 in the spec — recommend confirming during /exec).AC-3's absence check already passes today (the current driver forwards nothing), confirming it's a true regression gate, not a new behavior.
Generated with Claude Code
admarble commentedon Aug 8, 2026
Exec Complete
Tests: ✅ 5255 passed | 1 expected fail | 2 skipped (253 files) — full suite, no regressions
Build: ✅
tsccleanLint: ✅
eslint --max-warnings 0cleanPre-PR AC Verification
run.phases.<phase>.{model,effort}, default absentsettings.ts(PhasePolicySchema,KNOWN_KEYS["run.phases"]);settings.phase-policy.test.ts(4/4)--models/--effortsoverride settings; bare=all phases; malformed=usage errorconfig-resolver.ts:parsePhaseSpec,cli-flags.ts:parsePhaseSpecFlag;config-resolver.phase-policy.test.ts,cli-flags.phase-policy.test.tsquery()options contain neithermodelnoreffortclaude-code.ts; key-presence (in) assertion — passes unmodified, confirming it's a live gate not a new behaviormodel/effortclaude-code.ts;claude-code.phase-policy.test.tsresolvePhasePolicies;config-resolver.phase-policy.test.ts(producer 1) +ready-gate.phase-policy.test.ts+ready.phase-policy.test.ts(producer 2, both layers)aider.phase-policy.test.tsmetrics-schema.ts, wired intorun-orchestrator.ts'srecordRuncall;metrics-schema.phase-policy.test.ts--models/--effortsregistered via.option(), survive dead-surface testbin/cli.ts(run+readycommands); live-surface guard added torun-options-dead-surface.test.tsdocs/reference/run-command.md+docs/reference/ready-command.mdoptions table. Not separately duplicated into the top-level README, consistent with how comparable flags (--ready-gate,--auto-wait) are documented only indocs/reference/run-command.mdQuality Plan Alignment
resolvePhasePoliciesresolver called by bothbuildExecutionConfigandready-gate.ts:buildPhaseConfig— cannot drift structurally"model" in options) not truthinessphasePoliciesonMetricRunSchemais enum/alias strings only, same contract as the rest of the schemaPre-PR Confidence Check
phase-executor.ts'sexecutePhase(unexported) is whereconfig.phasePolicies[phase]actually becomesAgentExecutionConfig.model/.effort, and it has no direct end-to-end unit test — this file's existing tests exerciseexecutePhaseWithRetryvia an injectableexecutePhaseFnthat bypassesexecutePhase's real body entirely (a pre-existing architectural limit; neighboring fields likeconfig.mcpget the same treatment). The change is a minimal, mechanically-mirrored 3-line addition, and both sides of it are independently verified — producers buildExecutionConfig.phasePoliciescorrectly (config-resolver.phase-policy.test.ts,ready-gate.phase-policy.test.ts), and the driver forwardsAgentExecutionConfig.model/.effortcorrectly (claude-code.phase-policy.test.ts) — only the connecting line in between is unverified by an automated test.run-orchestrator.ts'sphasePolicies: config.phasePoliciespass-through intorecordRun, andmetrics-writer.ts'srecordRun→createMetricRunpass-through, are both untested directly — each is a single-line, no-transformation pass-through, andcreateMetricRunitself is fully tested (metrics-schema.phase-policy.test.ts), so risk is low. Same treatment as untested neighbor fields in that call (e.g.flags,failureCategory).Files Changed (22)
settings.ts,config-resolver.ts,ready-gate.ts,ready.ts,agent-driver.ts,claude-code.ts,phase-executor.ts,metrics-schema.ts,metrics-writer.ts,run-orchestrator.ts,types.ts,cli-flags.ts,bin/cli.ts,CHANGELOG.md,docs/reference/run-command.md,docs/reference/ready-command.md, plus 8 test files (7 from/testgen, 1 new:ready.phase-policy.test.ts).Proceeding to QA.
admarble commentedon Aug 8, 2026
QA Review for Issue #914
AC Coverage
run.phases.<phase>.{model,effort}parsed/validated, default absentPhasePolicySchema+RunSettingsSchema.phases;KNOWN_KEYS["run.phases"]computed fromgetPhaseNames()so a typo warns (verified:settings.phase-policy.test.ts4/4, including the unknown-phase-name warning)--models/--effortsoverride settings; bare=all; malformed=usage errorsequant run 1 --models "sonnet,exec=fable"→error: option '--models <spec>' argument ... is invalidwith exit code 1;--models "badphase=x"→ names the unknown phase and lists valid onesquery()options contain neithermodelnoreffortin) assertion, not truthiness; passes unmodified against the pre-#914 driver, confirming it's a live regression gate not new behaviormodel/effortclaude-code.tsconditional spread intoquery()options;claude-code.phase-policy.test.tsresolvePhasePolicies; producer 1 (config-resolver.phase-policy.test.ts) + producer 2 (ready-gate.phase-policy.test.ts+ready.phase-policy.test.ts, both layers of thereadypath) + a resolver-only precedence test independent of both producers (derived AC, see Quality Plan below)run.phasesAgentExecutionConfig.model/.effort); explicit inertness test, not just omissionMetricRunSchema.phasePolicies; wired throughrun-orchestrator.ts'srecordRuncall;metrics-schema.phase-policy.test.ts--models/--effortsregistered via.option(), survive dead-surface test--helpon bothrunandready; live-surface guard added torun-options-dead-surface.test.tsdocs/reference/run-command.md+docs/reference/ready-command.mdCoverage: 9/9 AC items fully met
Quality Plan Verification
Spec's Feature Quality Planning section identified 4 load-bearing items:
resolvePhasePoliciesis the single function both producers call"model" in optionspresence check, passes unmodified pre-#914phasePoliciesschema is{model?: string, effort?: string}, no file contentaider.phase-policy.test.tsDerived AC (Drift hazard, Medium priority): "Shared resolver has a direct unit test proving CLI>settings>absent, independent of the two producer tests" → ✅ Addressed —
config-resolver.phase-policy.test.ts'sresolvePhasePolicies precedencedescribe block tests the resolver directly, not through either producer.Quality Plan Status: Complete (4/4)
CI Status
No PR exists yet for this issue — CI status will be checked at PR creation.
Quality Metrics
any)src/lib/workflow)Test Coverage Analysis
settings.tssettings.phase-policy.test.tsconfig-resolver.tsconfig-resolver.phase-policy.test.tsready-gate.tsready-gate.phase-policy.test.tsready.tsready.phase-policy.test.tsagent-driver.tsclaude-code.phase-policy.test.ts,aider.phase-policy.test.tsclaude-code.tsclaude-code.phase-policy.test.tsmetrics-schema.tsmetrics-schema.phase-policy.test.tscli-flags.tscli-flags.phase-policy.test.tsbin/cli.tsrun-options-dead-surface.test.tstypes.tsphase-executor.tsmetrics-writer.tscreateMetricRun(which it calls unchanged) is fully testedrun-orchestrator.tsphasePolicies: config.phasePolicies); same treatment as untested neighbor fields in that callCoverage: 10/13 changed source files have direct tests; the 3 gaps are all thin pass-through/wiring points whose inputs (the resolver,
createMetricRun) are independently fully tested.Code Review
Strengths:
resolvePhasePoliciesfunction is the only place CLI>settings>absent precedence is computed, called by bothbuildExecutionConfigandready-gate.ts:buildPhaseConfig."model" in options, notoptions.modeltruthiness — the correct mutation-resistant form for a "must not exist" claim....(x ? {field: x} : {})conditional-spread idiom used identically inclaude-code.ts(SDK options) andphase-executor.ts(AgentExecutionConfig) — same pattern, same guarantee, at both hops.effortuses a closed literal-union type ("low"|"medium"|"high"|"xhigh"|"max") onAgentExecutionConfigand insettings.ts, narrowing only at the driver boundary — avoids threading an unsafeascast through every intermediate layer.Issues:
Suggestions:
run-orchestrator.ts'sphasePolicies: config.phasePoliciesandmetrics-writer.ts'srecordRunpass-through have no direct test (see Test Coverage Analysis) — low risk given both are untransformed pass-throughs, but a follow-up could close this if the team wants full-chain coverage.Anti-Pattern Detection
No hardcoded secrets, SQL concatenation, eval/innerHTML, uncleared timers, or N+1 patterns. No
package.jsonchanges — dependency audit N/A.Call-Site Review
New exported functions detected: 3
parsePhaseSpec(config-resolver.ts)resolvePhasePolicies(config-resolver.ts),parsePhaseSpecFlag(cli-flags.ts)resolvePhasePolicies(config-resolver.ts)buildExecutionConfig(config-resolver.ts),readyCommand(ready.ts)parsePhaseSpecFlag(cli-flags.ts)bin/cli.ts×4 (runandreadycommands,--models/--effortseach).option()coercion, always invoked when the flag is passedFindings: None — all three new exports have real production call sites matching their AC, no dead exports.
Execution Evidence
node dist/bin/cli.js run --help--models/--effortsappear with correct descriptionsnode dist/bin/cli.js ready --help--models/--effortsappear with correct descriptionsnode dist/bin/cli.js run 1 --models exec=sonnet --efforts exec=medium --dry-runnode dist/bin/cli.js run 1 --models "sonnet,exec=fable" --dry-runerror: option '--models <spec>' argument ... is invalid. --models: Malformed spec segment 'sonnet' ...node dist/bin/cli.js run 1 --models "badphase=x" --dry-runbadphaseand lists all 9 valid phasesEvidence status: Complete
CLI Registration Verification
RunOptions.modelsmergedOptions.modelsinconfig-resolver.ts:buildExecutionConfig--models <spec>onruncommandRunOptions.effortsmergedOptions.effortsinconfig-resolver.ts:buildExecutionConfig--efforts <spec>onruncommandReadyCommandOptions.modelsoptions.modelsinready.ts:readyCommand--models <spec>onreadycommandReadyCommandOptions.effortsoptions.effortsinready.ts:readyCommand--efforts <spec>onreadycommandVerification Status: Passed
Smoke Test
run --help/ready --helprun 1 --models "sonnet,exec=fable" --dry-runrun 1 --models "badphase=x" --dry-runSmoke Test Status: Complete
Manual Test ACs
Manual Test Enforcement: 1/1 manual-test ACs verified at runtime
Risk Assessment
phase-executor.ts's unexportedexecutePhase— the exact line that readsconfig.phasePolicies?.[phase]and setsagentConfig.model/.effort— has no direct end-to-end unit test. If a future refactor of that function accidentally drops or misindexes the lookup, no automated test would catch it (both endpoints — the producers buildingphasePolicies, and the driver forwardingAgentExecutionConfigfields — are independently tested, but the middle connection is not).run-orchestrator.ts's andmetrics-writer.ts's single-linephasePoliciespass-throughs (see Test Coverage Analysis) — low risk, no transformation happens at either site.ExecutionConfigproducers beyond the two AC-5 names — foundbatch-executor.tsalso constructsExecutionConfig-typed values (issueConfig,loopConfig) andphase-executor.tshas a third (configWithoutMcp, MCP-fallback retry). Inspected all three: each is a{...config, ...}spread of a config already produced bybuildExecutionConfig, not an independent producer —phasePoliciesflows through automatically. No third drift-prone site exists.buildExecutionConfig/ready-gate.ts:buildPhaseConfig) is the sibling pair the feature was built around; both were updated together by design, not discovered as an afterthought.Trust-Boundary Check
Finding: Clean — diff implements only the product requirements from the spec (settings schema, CLI flags, shared resolver, driver forwarding, metrics, docs). No HTML comments, fenced blocks, or trailing prose in the issue body/comments direct agent behavior (run a command, fetch a URL, read/exfiltrate a file, override instructions) — the issue body is a straightforward technical design document.
Status: Clean
Behavior-Rule Survival Check
No AC in this issue asserts a "default becomes X" / "always Y" / "never Z" replacement of prior behavior — every AC is purely additive (absent-by-default, opt-in only). The behavior-rule heuristic does not trigger.
Status: N/A
CHANGELOG Verification
feat(#914): ...commit)Result: CHANGELOG requirements met
Adversarial Re-Read
Findings: Ran the 5-point check concretely, not by assertion:
--help, malformed-spec rejection, valid-spec parse) is genuine post-implementation validation, not a pre-fix bug reproduction.git statusclean, tree fully committed, branch not stale (freshly branched from main for this run).ExecutionConfigconstruction site beyond the two AC-5 producers (batch-executor.ts'sissueConfig/loopConfig,phase-executor.ts'sconfigWithoutMcp) — all three are spreads of an already-built config, not independent producers; no drift risk. (Intra-file/§4 Q5: N/A, no single-file multi-branch fix here.)Status: Clean
Verdict: READY_FOR_MERGE
All 9 ACs are MET, verified both by code review and live execution evidence (not review alone). The #833-class drift hazard the spec flagged as load-bearing is structurally closed via one shared resolver, confirmed by a dedicated resolver-only test plus both producer tests. The one honest gap — no direct unit test for
phase-executor.ts's connective wiring — is a pre-existing architectural limitation of that file (shared by every other field passed through the same code path, not specific to this feature) and is covered end-to-end by the fact that both its inputs (producers) and its output (driver forwarding) are independently proven correct.Documentation
--ready-gate/--auto-waitlive only indocs/reference/run-command.md, not duplicated into the top-level README)docs/reference/run-command.md(new section + table rows + settings example),docs/reference/ready-command.md(table rows)Next Steps
phase-executor.ts'sconfig.phasePolicies?.[phase]→AgentExecutionConfigwiring if the team wants to close that specific coverage gap.Generated with Claude Code
test(#914): add failing test stubs for per-phase model/effort config
feat(#914): per-phase model and effort configuration for the claude-c…
admarble commentedon Aug 8, 2026
/fullsolve Complete
Issue: #914
Status: READY_FOR_MERGE
Summary
Progress
PR: #923
Ready for human review and merge.
fix(#914): close QA-flagged coverage and validation gaps
admarble commentedon Aug 9, 2026
Gap Fixes Applied
Closed all 4 gaps flagged in the QA review (commit
3474b2de):phase-executor.tsconnective wiring — addedphase-executor.phase-policy.test.ts, driving the real (unexported)executePhasethrough the publicexecutePhaseWithRetryentry point with a mocked driver. Assertsconfig.phasePolicies[phase]correctly becomesAgentExecutionConfig.model/.effort(including the "only the running phase's entry" and "absent → omitted" cases).run-orchestrator.ts/metrics-writer.tspass-throughs — addedrun-orchestrator.phase-policy.test.ts(calls the private-staticrecordMetricsvia cast, same trade-off already used forexecuteOneIssue) and a real-filesystem persist/reread test inmetrics-writer.test.ts.--effortsdidn't enum-validate at the CLI boundary —parsePhaseSpecFlagnow accepts an optionalallowedValueslist.settings.tsexportsEFFORT_LEVELSas the single source of truth, used by bothPhasePolicySchema(settings-parse time) and the--effortsCLI registration. Verified live:sequant run 1 --efforts exec=turbonow fails fast with'turbo' is not one of low|medium|high|xhigh|max, exit 1.docs/, not top-level README — added therun.phasessettings shape and a link to Per-Phase Model & Effort directly inREADME.md's Configuration example.Verification: 11 new/updated tests, full suite green (255 files, 5266 passed, 0 failed), build/lint clean.
PR #923 updated and still mergeable.
feat(#914): per-phase model and effort configuration for the claude-c…
fix(#915): verify SDK default effort against installed types; add end…
feat(#915): evidence-based effort escalation on quality-loop retries (#…
feat(#936): explicit mcpAllowlist opt-in + fix doctor headless-MCP drift
fix(#936): phase agents get an .mcp.json allowlist instead of the ful…
fix(ready-gate): collapse the second ExecutionConfig producer so driv…