Skip to content

feat(run): adopt cheaper per-phase model/effort defaults from #916 benchmark results — testgen, docs, assess candidates #944

Open

Description

@admarble

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

Acceptance Criteria

Human decisions required

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

  1. admarble commented on Aug 24, 2026

    @admarble
    ContributorAuthor

    Spec Plan (2026-08-24)

    Complexity: Standard (5 ACs, 3 directories)

    ⛔ Gate status — hard-blocked on #916

    Dependencies

    Dep State Note
    #916 OPEN, parked May close not-needed if passive dogfood signal answers the question — see Open Q1
    #914 Merged (PR #923) resolvePhasePolicies precedence: CLI > settings.run.phases > absent
    #915 Merged resolveEscalatedEffort; effortEscalation defaults to false — see Open Q2

    Acceptance Criteria

    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):

    1. When bench: replay outcome-distribution smoke for roster/policy changes (descoped from A/B ranking — phase-0) #916 reports (bench or passive-metrics resolution), link results here with per-phase deltas (AC-1). Human decides the "no quality regression" bar per phase.

    Phase 1 — defaults mechanism:
    2. Add BUILT_IN_PHASE_DEFAULTS: Record<string, PhasePolicy> constant in src/lib/settings.ts containing 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 (not DEFAULT_SETTINGS.run.phases) means both ExecutionConfig producers (buildExecutionConfig and ready-gate.ts) get it by construction (#833 class), and it dodges the settings-merge trap where a user's partial run.phases key 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.ts and ready-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)

    AC Touchpoint Snippet
    AC-3 src/lib/settings.ts:224, :442 "Absent by default — zero behavior change until opted in" — becomes false; must be rewritten
    AC-3 src/lib/workflow/config-resolver.ts:311 resolvePhasePolicies precedence docstring — new layer must be named here
    AC-3 README.md:21, :315 + docs/reference/run-command.md "Absent by default: nothing changes unless configured" — stale once defaults ship

    Design Review

    1. Where does this logic belong? The defaults constant in settings.ts (per issue), applied in resolvePhasePolicies — the single shared resolver both dispatch paths use.
    2. Simplest correct approach? One constant + one merge layer. Rejected: seeding DEFAULT_SETTINGS.run.phases (merge-depth ambiguity makes AC-3 fragile); per-phase env vars (new surface, violates Non-Goals).
    3. Existing pattern? feat(run): per-phase model and effort configuration for the claude-code driver #914's layered precedence in resolvePhasePolicies — this adds a layer to an existing ladder, no new mechanism.
    4. Senior-reviewer challenge? "Your safety net is off by default." The issue's premise — "feat(loop): evidence-based effort escalation on quality-loop retries #915's retry escalation stays as the safety net" — doesn't hold today: effortEscalation: false in DEFAULT_SETTINGS. See Open Q2; this needs an explicit decision before AC-2 merges.

    Open Questions

    1. Does passive-metrics evidence satisfy AC-1 if bench: replay outcome-distribution smoke for roster/policy changes (descoped from A/B ranking — phase-0) #916 closes not-needed? — Recommendation: yes; the bar is "per-phase quality deltas stated," whatever the instrument. Impact if wrong: this issue waits on a controlled bench that may never be built.
    2. effortEscalation is off by default — the claimed safety net is inert for default installs. — Recommendation: flip effortEscalation default to true in 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.
    3. Opt-out mechanism. Overriding upward works via run.phases, but "restore session default / no override at all" has no expressible value today. — Recommendation: accept explicit model: null / effort: null in PhasePolicySchema meaning "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.

  2. added
    planned
    enhancement
    backlog
    on Aug 24, 2026
  3. admarble commented on Aug 30, 2026

    @admarble
    ContributorAuthor

    #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:

    1. AC-1's evidence shape must change. Diff-size ratio — the metric the A/B ranking design centered on — does not separate model tiers above its own noise floor at feasible N. "Per-phase quality deltas" from diff-ratio ranking will not exist. What the instrument can deliver is outcome-distribution smoke: verdict mix, wall time, guard-failure rate, file-set discipline — which did separate arms cleanly overnight at cheap-tier cost.
    2. Phase-0 varied the exec arm only — it validates the instrument, not this issue's candidates. testgen/docs/assess were never measured, and they have a simpler evaluation shape than exec: mechanical outputs with direct checks (stubs parse/compile, docs coverage assertions hold, assess renders the dashboard format). A candidate-phase measurement can likely be cheaper than the replay bench — run the candidate phase at two tiers on a handful of real issues and diff the mechanical outputs directly, plus the smoke instrument's outcome distribution.
    3. Verdict-based deltas need discharge. The phase-0 data reconfirmed the trust hole: undischarged NEEDS_VERIFICATION verdicts concentrated 5/7-vs-0/9 by arm under a same-family judge. Any "no verdict-affecting delta" bar (the Human-decision item) must count discharged outcomes (ACs actually executed, per NEEDS_VERIFICATION maps to ready_for_merge, blocking QA re-runs; MCP sequant_run ignores force #972's awaiting_verification flow), not raw verdict strings.
    4. The safety architecture here is unchanged and is doing the real work: feat(loop): evidence-based effort escalation on quality-loop retries #915 escalation-on-retry as the net, exec/qa hard-excluded, phase-level only. Those survive the descope untouched.

    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).

  4. admarble commented on Sep 6, 2026

    @admarble
    ContributorAuthor

    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.phases policy 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.tokensUsed is 0 on 365/365 recorded runs (#986). #986 is now the practical blocker for this issue, more than #916's remaining scope.

  5. admarble commented on Oct 6, 2026

    @admarble
    ContributorAuthor

    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 alias sonnet (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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    backlogenhancementplanned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions