Repository navigation
Description
Blocked by #1027 (W2 gate 08 — records the post-#982 cost baseline this issue measures against; PLAN D9)
Blocked by #916
Motivation
The mechanism for per-phase model/effort configuration shipped in #914, and #915 added evidence-based effort escalation on quality-loop retries. What doesn't exist is the downward direction: default policies that start lower-cost phases on cheaper tiers. Every phase currently runs at the session default regardless of task shape, so mechanical phases (test-stub generation, docs rendering, status assessment) pay frontier-tier cost for work that plausibly doesn't need it.
This is deliberately not decidable today: adopting cheaper defaults without measurement would be an unmeasured behavior change of exactly the class the citation-grounding work rejected (#922/#928 — measure first, then gate). #916's replay benchmark is the instrument: A/B phase model/effort policies against merged reference PRs. This issue is the consumer of its results — filed now so the decision has a tracked home and the benchmark has a named customer, per the no-advisory-without-a-consumer rule (#608).
Proposal
When #916 produces results, adopt per-phase model/effort defaults for phases where the benchmark shows no quality regression.
Candidate phases, in expected-safety order: testgen (stub generation from already-written verification criteria; a haiku-tier candidate — #217 explored this before the current architecture), docs, assess (read-and-summarize), then spec/loop only if the benchmark is unambiguous. exec and qa are out of scope for cheap defaults regardless of results — QA quality is the load-bearing trust surface (57% second-look catch rate depends on it; see the 2026-08 gap-strategy review), and a cheap-tier QA saving tokens while missing verdicts would cost more than it saves.
Shape: defaults land in settings.ts phase-config defaults (the #914 surface — no new mechanism, no new flags). #915's retry escalation stays as the safety net: a cheap-tier phase that stalls escalates on retry, so the failure mode of an over-cheap default is a retry, not a silent quality drop.
Constraint: phase-level only. Per-subagent tiering is blocked upstream — claude-code silently ignores subagent model: declarations (#632 / claude-code#43869); do not wire agents.model.
Non-Goals
- No policy adoption before bench: replay outcome-distribution smoke for roster/policy changes (descoped from A/B ranking — phase-0) #916 reports — this issue must not merge on judgment alone.
- No new CLI flags or config surface — feat(run): per-phase model and effort configuration for the claude-code driver #914's existing per-phase config is the whole mechanism.
- No per-subagent model routing (fix(agents): realign declared model tiers; document upstream routing bug #632 upstream bug).
- No cheap defaults for
exec/qaeven if benchmarked favorably — revisit only with a dedicated follow-up and a larger sample.
Acceptance Criteria
- AC-1: bench: replay outcome-distribution smoke for roster/policy changes (descoped from A/B ranking — phase-0) #916 benchmark results for the candidate phases are linked in this issue with the per-phase quality deltas stated. Evidence: comment linking the benchmark report before any code lands.
- AC-2: Phases the benchmark clears get model/effort defaults in
settings.ts, and phases it doesn't are recorded here as measured-and-rejected. Evidence: settings diff + decision table in the PR body citing the benchmark numbers per phase. - AC-3: User-configured per-phase overrides beat the new defaults (no precedence regression vs feat(run): per-phase model and effort configuration for the claude-code driver #914 behavior). Evidence: existing feat(run): per-phase model and effort configuration for the claude-code driver #914 precedence tests green plus one new case overriding a cheap default upward.
- AC-4: feat(loop): evidence-based effort escalation on quality-loop retries #915 escalation applies to cheap-default phases on retry. Evidence: unit test asserting a cheap-tier phase's retry escalates per the feat(loop): evidence-based effort escalation on quality-loop retries #915 path.
- AC-5: Settings docs and README document the default tiers and how to opt out, content-verified in all doc locations. Evidence: content-coverage assertions on main README, marketplace README, and docs/.
Human decisions required
- The acceptance bar for "no quality regression" per phase (suggest: no verdict-affecting deltas across the bench: replay outcome-distribution smoke for roster/policy changes (descoped from A/B ranking — phase-0) #916 reference set; token savings alone never justify a quality delta).
Context
Filed 2026-08-13 from the model-tiering landscape review: #914 (mechanism, shipped), #915 (upward escalation, shipped), #916 (measurement, open — this issue is its consumer), #632 (subagent model routing broken upstream), #217 (pre-architecture haiku exploration). Measure-first framing per #922/#928.
Activity
admarble commentedon Aug 24, 2026
Spec Plan (2026-08-24)
Complexity: Standard (5 ACs, 3 directories)
⛔ Gate status — hard-blocked on #916
phasePoliciesruns accumulate.".sequant/metrics.jsonshows 116 runs, latest 2026-08-08 — nothing since the 2026-08-13 opt-in ofrun.phasesin this repo's settings.Dependencies
resolvePhasePoliciesprecedence: CLI >settings.run.phases> absentresolveEscalatedEffort;effortEscalationdefaults tofalse— see Open Q2Acceptance Criteria
settings.ts; uncleared recorded as measured-and-rejected. — Manual + Unit Test (settings diff, decision table in PR body, unit assertion that only cleared phases carry defaults)config-resolver.phase-policy.test.ts+ready-gate.phase-policy.test.ts: existing green + new case overriding a cheap default upward)resolveEscalatedEffort, steps exactly one tier)README.md,docs/README.md(marketplace),docs/reference/run-command.md; these are gate tests → mutation-verification markers required in PR body per repo policy feat(qa): mutation-verification becomes a parseable §7 gate instead of honor-system prose #939)AC lint: all 5 pass (declared evidence on every AC). Scope:⚠️ SCOPE_WARNING (2 feature clusters: config-mechanism vs measurement-gate) → quality loop auto-enabled.
Implementation Plan
Phase 0 — measurement gate (blocks everything):
Phase 1 — defaults mechanism:
2. Add
BUILT_IN_PHASE_DEFAULTS: Record<string, PhasePolicy>constant insrc/lib/settings.tscontaining only benchmark-cleared phases.3. Merge it as a new lowest layer inside
resolvePhasePolicies()(src/lib/workflow/config-resolver.ts:311) — precedence becomes CLI >settings.run.phases> built-in defaults > absent. Landing it in the shared resolver (notDEFAULT_SETTINGS.run.phases) means both ExecutionConfig producers (buildExecutionConfigandready-gate.ts) get it by construction (#833 class), and it dodges the settings-merge trap where a user's partialrun.phaseskey could clobber or resurrect defaults per-phase depending on merge depth.4. Update now-false docstrings/prose:
settings.ts:224,settings.ts:442("Absent by default — zero behavior change"),README.md:21("nothing changes unless configured").Phase 2 — tests:
5. AC-3: new precedence cases in both
config-resolver.phase-policy.test.tsandready-gate.phase-policy.test.ts(settings override a cheap default upward; CLI beats both).6. AC-4: escalation test — phase with built-in cheap effort, retry escalates one tier from the default base. AC-2: assert non-cleared phases absent from
BUILT_IN_PHASE_DEFAULTS.Phase 3 — docs (AC-5):
7. Document tiers + opt-out in
README.md,docs/README.md,docs/reference/run-command.md(#per-phase-model--effort precedence section); add content-coverage assertions scoped to delimited regions, mutation-verified.Rule Touchpoints (AC-3 triggered:
default,behavior)resolvePhasePoliciesprecedence docstring — new layer must be named hereDesign Review
settings.ts(per issue), applied inresolvePhasePolicies— the single shared resolver both dispatch paths use.DEFAULT_SETTINGS.run.phases(merge-depth ambiguity makes AC-3 fragile); per-phase env vars (new surface, violates Non-Goals).resolvePhasePolicies— this adds a layer to an existing ladder, no new mechanism.effortEscalation: falseinDEFAULT_SETTINGS. See Open Q2; this needs an explicit decision before AC-2 merges.Open Questions
effortEscalationis off by default — the claimed safety net is inert for default installs. — Recommendation: flipeffortEscalationdefault totruein the same PR (fires only on retries; bounded cost), or ship cheap defaults conditioned on escalation being enabled. Impact if wrong: an over-cheap default degrades silently, exactly the failure mode the issue says can't happen.run.phases, but "restore session default / no override at all" has no expressible value today. — Recommendation: accept explicitmodel: null/effort: nullinPhasePolicySchemameaning "suppress built-in default, inherit session default"; a new accepted value on the existing surface, not a new surface. Impact if wrong: AC-5's "how to opt out" documents a workaround instead of an opt-out.Recommended Workflow
Phases: spec → testgen → exec → qa (do not start until AC-1 evidence lands)
Quality Loop: enabled (SCOPE_WARNING auto-enable)
Reasoning: Unit-test-verified ACs (AC-3/AC-4) → testgen; enhancement with 5 ACs; blocked at Phase 0 on #916.
admarble commentedon Aug 30, 2026
#916 phase-0 reported — what it changes here (2026-08-30): the phase-0 discriminating-power measurement descoped the instrument this issue consumes. Implications for #944, precisely:
Suggested path: stay blocked on #916, whose remaining scope is now the smoke instrument; when picked up, rewrite AC-1/AC-2 evidence to (a) direct mechanical-output comparison per candidate phase and (b) smoke outcome distribution — and drop any diff-ratio citation. Roster/default changes stay human-triaged in the meantime (phase-0 gate decision).
admarble commentedon Sep 6, 2026
Motivation reframe (2026-09-06): the pressure behind this issue is now concrete — top-tier model usage is exhausting the weekly plan quota, and 9 of 11 local projects had no
run.phasespolicy at all, so every phase ran at the CLI default model. That changes the acceptance bar: this issue doesn't need to prove "no quality delta" from cheap defaults; it needs "cheaper per converged issue, with #915/#971 as the net." Two consequences: (1) AC-1/AC-2 should measure cost-per-converged-issue alongside the smoke outcome distribution, not quality parity alone; (2) that measurement is impossible today —metrics.tokensUsedis 0 on 365/365 recorded runs (#986). #986 is now the practical blocker for this issue, more than #916's remaining scope.docs(graph): wave 2 plan — sync ownership, fresh-session QA, trust co…
admarble commentedon Oct 6, 2026
Upstream note from the v2.1.284 assessment (#1326): Claude Sonnet 5.5 (
claude-sonnet-5-5) is now the default Sonnet model on the Anthropic API (1M context, $2/$10 per Mtok, $0.20 cache reads). Sequant's ladder uses the aliassonnet(src/lib/settings.ts:106), so the model behind it changed after the #916 bench baselines were recorded. Re-baseline cost and quality on the current alias target before using those numbers to set defaults. v2.1.287 (#1331) also made a saved Fable default follow the newest Fable.