Repository navigation
Description
SCOPE UPDATE (2026-08-30, phase-0 gate decision — see the phase-0 results comment):
The measurement below ran (18 runs, haiku-vs-sonnet exec arms, 3 replayed issues). Diff-size ratio — this design's primary overcomplexity proxy — does not separate model tiers above its own noise floor at feasible N. Verdict distribution, wall time, guard-failure rate, and file-set Jaccard do separate cleanly at cheap-tier overnight cost.
This issue's scope therefore shrinks from A/B policy ranking to an outcome-distribution SMOKE instrument for roster/policy changes: same replay harness, scoring = verdict mix (discharge-verified where NEEDS_VERIFICATION), wall time, guard failures, file Jaccard — no diff-ratio ranking, no LLM judge. #944 (the consumer) is re-scoped accordingly on its thread; roster updates stay human-triaged. Phase-0 artifacts are the baseline dataset (retained locally; table in the results comment). Original design kept below for record.
Depends on #914. Deferred by design: build only if passive dogfood metrics from #914 leave the quality question ambiguous. Successor to the closed #437 (data-driven workflow optimization) for the specific claim "phase model/effort splitting reduces overcomplexity without hurting correctness."
Motivation
Once #914 ships, "does medium-effort/Sonnet exec hurt or help?" should be answered with data, not vibes. Naively re-running a live issue before/after the knob is methodologically broken:
- Single runs per arm are noise — agentic run variance requires ~3 runs per arm per issue before a difference means anything.
- Re-running the same live issue contaminates arm B: sequant posts spec/QA comments on the issue and the spec parser reads them, so the second arm sees the first arm's plan.
- Model-side drift over time confounds sequential comparison — arms must run interleaved in the same time window.
The cheap insight that makes a bench viable: for past merged issues, the human-approved diff is free ground truth. Overthinking manifests as bigger diffs, extra abstraction, more files touched — all mechanically measurable against the reference PR. No LLM judge in v1 (structured LLM review biases positive on clean-looking code, and an LLM judging overcomplexity is circular).
Design (weekend-sized script, not an eval platform)
- Corpus: 5–10 past merged sequant issues with clean reference PRs, replayed in a fixture fork (issue bodies copied, no comment history), base commit pinned per issue.
- Arms: A = current defaults (inherit), B = a candidate policy (e.g.
exec=sonnet,effort=medium), configured via feat(run): per-phase model and effort configuration for the claude-code driver #914's flags. 3 runs per arm per issue, arms interleaved. - Scoring per run, all mechanical:
- diff-size ratio vs. the merged reference PR (primary overcomplexity proxy)
- file-set overlap with the reference (Jaccard over touched paths)
- first-pass QA verdict + loop iteration count (already computed by sequant)
- tokens and wall time per phase (already in run metrics)
- Output: one comparison table per policy pair; outliers flagged for human review.
- Operational constraints (from prior incidents):
- The bench driver is a plain script/cron — never a backgrounded
sequant runinside a Claude session (bg-pty watchdog kills the tree at ~106s, Nested phase claude that hangs after its turn is killed at ~106s, taking down the parent sequant run #856). - Worktree isolation per run; worktree reuse force-destroys stale trees between runs, so arms must not share worktrees.
- Copy any needed
.sequant/evidence out immediately (gitignored + rotates at 100 files).
- The bench driver is a plain script/cron — never a backgrounded
Acceptance Criteria
- A documented corpus manifest lists the replayed issues with their pinned base commits and reference PR numbers
- The bench script runs N configurable repetitions per arm per issue against the fixture fork, interleaving arms, and never posts to the real repository
- Each run's diff-size ratio and file-set overlap vs. the reference PR are computed and persisted alongside the run's existing metrics
- First-pass QA verdict, loop iterations, tokens, and wall time are extracted from run metrics per run
- The script emits a per-policy comparison table (mean ± spread per metric per arm) suitable for pasting into an issue or README
- Runs that fail for infrastructure reasons (rate limit, timeout) are excluded from scoring and reported separately, not silently dropped
- README section or docs/ page explains the methodology, its limits (small N, one repo), and the no-LLM-judge rationale
Activity
admarble commentedon Aug 8, 2026
Complexity: Standard (7 ACs, ~3 directories)
AC Quality Check
All 7 ACs are measurable and scenario-shaped — good quality. Two minor notes (warnings only, non-blocking):
Scope Assessment
Non-Goals: The body implicitly bounds scope well ("weekend-sized script, not an eval platform"; "No LLM judge in v1"). No explicit⚠️ Consider adding one: no LLM judge, no eval platform/UI, no CI gating, single-repo corpus only.
## Non-Goalsheading.scripts/analytics/,src/lib/workflow/,docs/)Verdict:⚠️ SCOPE_WARNING — auto-enables the quality loop. Cohesive single deliverable; no split recommended.
Acceptance Criteria
AC-1: Documented corpus manifest (issues + pinned base commits + reference PR numbers)
Verification: Unit Test
Scenario: Given the committed manifest → When a loader parses it → Then every entry has
{issue, baseCommit (full SHA), referencePR}, eachbaseCommitresolves in-repo (git cat-file -e), and 5–10 entries are present.Assumptions: Reference PRs are single-PR, human-approved, no revert follow-ups (record the selection rationale per entry).
AC-2: Bench runs N configurable reps per arm per issue against a fixture fork, interleaving arms, never posts to the real repo
Verification: Integration Test
Scenario: Given a fixture fork + manifest +
--reps N→ When the bench runs → Then execution order is A,B,A,B… (interleaved, not A,A,A then B,B,B), exactlyNruns occur per arm per issue, and nogh issue comment/ PR / label write targets the realadmarble/sequantrepo (assert via a stubbed platform client / dry-run guard that fails the test if any real-repo write is attempted).Assumptions: #914's flags expose per-phase model/effort so arm B is configurable; a fixture fork with issue bodies copied (no comment history) is available.
AC-3: Per-run diff-size ratio + file-set overlap (Jaccard) vs the reference PR, persisted with existing metrics
Verification: Unit Test
Scenario: Given a run diff and a reference-PR diff → When scored → Then
diffSizeRatio = run_changed_lines / reference_changed_linesandjaccard = |A∩B| / |A∪B|over touched paths are computed and written alongside the run's existing metrics record.Assumptions: Reference-PR diff is fetchable (via
gh pr diff <PR>orgit diff base...merge); "changed lines" definition (added+deleted vs added-only) is fixed and documented.AC-4: Extract first-pass QA verdict, loop iterations, tokens, wall time per run
Verification: Unit Test
Scenario: Given a run's structured log fixture → When extracted → Then first-pass
verdict(fromrun-log-schema.tsphase recordverdict),qaIterations,tokensUsed, and per-rundurationare pulled from existing run metrics/logs — no new instrumentation, just extraction.Assumptions: These already exist —
metrics-schema.tscarriesqaIterations/tokensUsed/duration;run-log-schema.tsphase records carryverdict. "First-pass" = the verdict of the firstqaphase record before any loop iteration.AC-5: Per-policy comparison table (mean ± spread per metric per arm), paste-ready
Verification: Unit Test
Scenario: Given the scored runs for a policy pair → When the formatter runs → Then it emits a Markdown table with one row per metric and
mean ± <stddev|IQR>per arm, valid to paste into an issue/README.Assumptions: Spread statistic chosen and documented (recommend stddev). Table format is LLM-friendly (labeled headers, no box-drawing).
AC-6: Infra-failed runs (rate limit / timeout) excluded from scoring and reported separately, not silently dropped
Verification: Unit Test
Scenario: Given a run set containing rate-limit/timeout failures → When scoring → Then those runs are excluded from mean/spread AND listed in a distinct "Excluded (infrastructure)" section with reason + count; total runs = scored + excluded (no silent loss).
Assumptions: Infra failures are classifiable via
failureCategory(error-classifier.tsERROR_CATEGORIES) — reuse it, don't invent a parallel taxonomy.AC-7: README/docs page explaining methodology, limits (small N, one repo), and no-LLM-judge rationale
Verification: Manual Test (docs content coverage)
Scenario: Given the docs page → When reviewed → Then it covers: replay methodology, why ~3 reps/arm, why interleaving, why merged-PR ground truth, small-N + single-repo limits, and the no-LLM-judge rationale.
Assumptions: Content-coverage check (not file-existence) — verify each required topic is present.
Implementation Plan
Phase 1: Scoring & extraction primitives (pure, testable first)
diffSizeRatio(runDiff, refDiff)andjaccard(pathsA, pathsB)— new module undersrc/lib/workflow/(e.g.bench-scoring.ts) so they get unit coverage independent of the driver.metrics.json+ structured run logs (run-log-schema.ts) and returns{firstPassVerdict, qaIterations, tokensUsed, duration}per run. Reuse existing schemas — no new instrumentation.error-classifier.tsERROR_CATEGORIESto partition runs intoscoredvsexcluded(reason).Phase 2: Corpus manifest
scripts/analytics/replay-bench-corpus.jsonor.jsonc) with 5–10 merged issues:{issue, baseCommit, referencePR, rationale}. Add a loader/validator (zod) that resolves eachbaseCommitin-repo. Pattern precedent:scripts/analytics/ready-backtest.tsBacktestCase.Phase 3: Bench driver
scripts/analytics/replay-bench.ts(CLI, JSON/Markdown out): loads manifest, builds arms (A=inherit defaults, B=candidate policy via feat(run): per-phase model and effort configuration for the claude-code driver #914 flags), runs--reps Nper arm per issue interleaved, one isolated worktree per run (reuseworktree-isolation.ts; arms must NOT share a worktree — reuse force-destroys stale trees, chore(types): reuseWorktrees is a declared-but-unconsumed RunOptions field #810). Targets a fixture fork, with a hard dry-run guard that refuses any write to the real repo (AC-2).sequant runinside a Claude session (bg-pty watchdog group-SIGKILLs the tree at ~106s, Nested phase claude that hangs after its turn is killed at ~106s, taking down the parent sequant run #856)..sequant/evidence out of the worktree immediately after each run (gitignored + rotates at 100 files).Phase 4: Reporting + docs
mean ± stddevper metric per arm) plus a separate "Excluded (infrastructure)" section (AC-5, AC-6). Write the methodology docs page (AC-7).Parallelizable: Phase 1 (three independent pure modules) and Phase 2 (manifest) can proceed concurrently; Phase 3 depends on both; Phase 4 depends on Phase 3.
Design Review
src/lib/workflow/(unit-tested, reused). The orchestration driver →scripts/analytics/replay-bench.ts, matching the existinganalyze-runs.ts/ready-backtest.ts/gap-signal.tsfamily. Keep I/O and worktree orchestration out of the pure modules.worktree-isolation.tsfor per-run isolation,metrics-schema.ts+run-log-schema.tsfor metric extraction,error-classifier.tsfor infra-failure partitioning,ready-backtest.tsfor the arm/worktree/scoring skeleton. New code is only: scoring math, the manifest, the interleaving driver, the table formatter, docs. Rejected: a standalone eval platform / DB / LLM judge (explicit non-goals).scripts/analytics/ready-backtest.ts— worktree setup per case, policy arms,score()— is the direct template.run-log-schema.tsverdict; extraction only.Feature Quality Planning
All standard checks pass. Notable items:
ghcan rate-limit; cache reference diffs locally per manifest entry.Derived ACs (if any)
Open Questions
--repsoverridable. Impact: too few → noise dominates; too many → cost.Recommended Workflow
Phases: spec → testgen → exec → qa
⚠️ Do not dispatch
Quality Loop: enabled (SCOPE_WARNING auto-enables it; safety-critical AC-2 warrants it)
Reasoning: ACs are dominated by Unit/Integration verification (scoring math, extraction, interleaving/no-write guard) → testgen stubs first. No UI → no
testphase. Not security-sensitive in the auth/payments sense → nosecurity-review(though AC-2's "never write to real repo" is treated as a hard test gate)./execuntil the #914 dependency + deferral gate clear (Open Question 1).Label Review
Current:
enhancement,backlogRecommended: add
planned; keepbackloguntil the #914 gate clears; considerblockedto make the dependency explicitReason: Planning complete, but real work is gated on #914 (open) and the deferral condition.
Quality Loop: Will auto-enable (SCOPE_WARNING).
→
gh issue edit 916 --add-label planned--- DRAFT GITHUB ISSUE COMMENT (PLAN) ---
Plan (Standard, 7 ACs) — BLOCKED on #914 + deferral gate
Build only once #914 is merged AND its passive dogfood metrics leave "does medium-effort/Sonnet exec help or hurt?" ambiguous. Otherwise close as not-needed.
--reps Nper arm per issue against a fixture fork, interleaved, with a hard guard that never writes to the real repo — Integration Test (safety-critical)error-classifiercategories — Unit TestApproach: Reuse existing infra —
worktree-isolation.ts(per-run isolation; arms must not share worktrees),metrics-schema.ts/run-log-schema.ts(extraction, no new instrumentation),error-classifier.ts(infra partition). Template:scripts/analytics/ready-backtest.ts. New code = scoring math + manifest + interleaving driver (scripts/analytics/replay-bench.ts) + table formatter + docs.Operational guardrails: plain script/cron, never a backgrounded
sequant runin a Claude session (#856); copy.sequant/evidence out immediately (rotates at 100 files); local fixture recommended so real-repo writes are impossible by construction.Workflow: spec → testgen → exec → qa, quality loop on. Do not start exec until the #914 gate clears.
admarble commentedon Aug 8, 2026
#916 — bench: replay benchmark — A/B phase model/effort policies against merged reference PRs
Open · enhancement, backlog
────────────────────────────────────────────────────────────────
→ PARK — Deferred by design — build only if #914 dogfood metrics leave the quality question ambiguous
Resume after: #914 ships and passive dogfood metrics leave the overcomplexity question ambiguous
────────────────────────────────────────────────────────────────
⚠ An in-flight spec-only run includes this issue — the spec output is fine to keep, but exec stays parked per the issue's own deferral
────────────────────────────────────────────────────────────────
admarble commentedon Aug 9, 2026
#916 — bench: replay benchmark — A/B phase model/effort policies against merged reference PRs
OPEN · enhancement, planned, backlog
────────────────────────────────────────────────────────────────
Supersedes prior assess from 2026-08-08 (PARK)
→ PARK — Deferred by design — build only if #914 dogfood metrics leave the quality question ambiguous
Resume after: #914 dogfood metrics leave the overcomplexity question ambiguous (no data yet — #914 just merged)
────────────────────────────────────────────────────────────────
admarble commentedon Aug 13, 2026
Spec addendum (2026-08-13) — re-check of the 2026-08-08 plan; the plan itself is unchanged and still authoritative.
Gate status update:
--models exec=sonnet --efforts exec=medium(plus--escalate-effortfrom feat(loop): evidence-based effort escalation on quality-loop retries #915 as an optional third policy dimension)./execuntil this gate is evaluated. If the passive data answers the question cleanly, close this issue as not-needed.Plan freshness check (all references verified on main @ 2026-08-13):
src/lib/worktree-isolation.ts,src/lib/workflow/metrics-schema.ts(extended by #914 with phase-policy fields — extraction in AC-4 gets richer for free),src/lib/workflow/run-log-schema.ts,src/lib/workflow/error-classifier.ts, and templatescripts/analytics/ready-backtest.tsall exist unchanged in role.Marker correction: the 2026-08-08 spec comment omitted the machine-readable phase marker, so
sequant runwould fall back to fragile prose parsing and could silently drop thetestgenphase (#921/#925). Supplying it here:Phases: testgen → exec → qa
Quality Loop: enabled (SCOPE_WARNING)
admarble commentedon Aug 13, 2026
Status update (2026-08-13) — deferral gate re-characterized, not cleared.
While reviewing model-cost options this week, I re-checked #914's passive dogfood data across every dogfood project on this machine (this repo, ad-motion, matcha-maps, job-scout, workout, sequant-landing, portfolio-2025, pm-projects, sequant-demo-video). Findings:
phasePolicies: null,model: "opus"). Zero runs have exercised--models/--effortsin practice.Action taken: as of today, this repo's
.sequant/settings.jsonopts into per-phase policy (spec=fable,exec=sonnet@medium,qa=sonnet,testgen=sonnet), so realphasePoliciesruns will start accumulating in.sequant/metrics.jsongoing forward. A release bump is also planned shortly, which will put--models/--effortsin front of the broader install base — the fastest path to real signal, not just this one repo.Revised recommendation: stay parked. Re-check after roughly 10–15 non-default runs have accumulated (locally and/or post-release across other projects). At that point:
No change to the plan itself (still valid — see the 2026-08-08 comment). This only updates the gate-status read.
admarble commentedon Aug 28, 2026
Proposed phase 0: prove discriminating power before any consumer is wired to this benchmark
Two consumers are now queued behind this instrument — #944 (adopt cheaper defaults from its results) and the roster-evolution loop sketched in #975 (new model release → replay → role-map update). Before either is designed against it, the benchmark should pass the same test this repo has applied to gates before: can it distinguish the things it claims to rank, above its own noise floor, at a cost that permits routine re-runs? The prior here is the spec-citation-grounding gate, measured at ~0.31% true-positive against an 8:1 noise ratio and rejected (#922/#928) — a benchmark that can't separate haiku from sonnet on real reference PRs would be the same class of instrument, with more machinery attached.
Minimal measurement
Decision gate
One design nudge from the same spike set: record the resolved concrete model ID per run (available from the SDK result's
modelUsagekeys, per #975's AC-4), not the alias —sonnetre-resolves across releases, and benchmark rows keyed only by alias become incomparable over exactly the time horizon this benchmark exists to serve.admarble commentedon Aug 29, 2026
Phase-0 run plan: discriminating-power measurement (prepared 2026-08-29)
Concrete instantiation of the phase-0 proposal above. Nothing has been run — this is the corpus, protocol, and cost cap for a go/no-go decision.
Corpus manifest (4 issues, all merged with executable ACs)
b8fedc40bde2f81f85ef93f4npm test -- ac-parserb0bb088ded98npm test -- ac-parser+ verbatim fixture76fc911e73f6Excluded: #909/PR #918 (no AC checkboxes — prose ACs fail the executability bar this measurement depends on).
Protocol
sequant runin a Claude session (Nested phase claude that hangs after its turn is killed at ~106s, taking down the parent sequant run #856); worktree per run, no reuse across arms..sequant/immediately — 100-file rotation): first-pass verdict, loop iterations, AC pass rate from the orchestrator actually executing each AC's named test, diff-size ratio vs the reference PR, file-set Jaccard vs reference, wall time, tokens, and the resolved concrete model ID frommodelUsage(not the alias).Cost cap (stated up front, per the proposal)
Wave-1 reference: a full spec/exec/qa pipeline on this repo ran 14–26 min wall. Estimate 24 runs at concurrency 3 ≈ 3–4 h wall, token cost ballpark $60–150 (haiku arm materially cheaper). Hard caps: abort the measurement if projected spend exceeds $150 or if ≥3 runs fail for infrastructure reasons (rate limit, timeout, worktree env) before completing a full cell — an instrument this noisy at collection time already answers the routine-rerun-viability question negatively.
Decision gate (unchanged from the proposal)
Between-model gap exceeds within-model spread at acceptable cost → #944/#975-evolution get designed against the bench and these numbers become its baseline. No separation (or prohibitive cost) → adoption loop descoped explicitly; roster updates stay human-triaged; #916 shrinks to gross-regression smoke. Either outcome is recorded as a result.
admarble commentedon Aug 30, 2026
Phase-0 results: discriminating-power measurement (run overnight 2026-08-29→30)
18/18 runs completed (3 sources × haiku|sonnet exec arms × 3 reps, interleaved, sequential, ~4.9h wall; spec+qa pinned to sonnet in both arms; fixture forks,
--no-pr; abort cap never fired). Per-cell results, mean±sd over scoreable runs:(A− = AC_MET_BUT_NOT_A_PLUS, NV = NEEDS_VERIFICATION. The 2 infra failures are both sonnet "exec left files uncommitted, made no commits" — the #534/#879 guard.)
What separates above noise — and what doesn't
Separates clearly:
Does NOT separate: diff-size ratio — the primary overcomplexity proxy the bench was designed around. Every cell pair overlaps within 1 sd (0.62±0.18 vs 0.69±0.35; 0.49±0.10 vs 0.46±0.06; 1.21 vs 1.38). At N=3 on small issues, diff-ratio is noise.
Confounds that block reading this as a model ranking
metrics.json(which now carriesresolvedModelpost-feat(config): model roles — semantic indirection between phase policy/ladders and concrete model strings #975) lived in the deleted run clones; only.sequant/logswere collected, which carry no model IDs. Cells are keyed by alias only — the exact failure mode the recording nudge exists to prevent. A future rerun must collectmetrics.jsonper run.Gate decision (per the decision gate above)
Partial separation → the adoption loop is NOT justified as designed, and this issue's scope should shrink to what the data supports:
Raw per-run artifacts retained at
~/Projects/sequant-bench/results/(branch diffs, run logs, stdout); these numbers are the baseline if the smoke-scope bench proceeds.[-]bench: replay benchmark — A/B phase model/effort policies against merged reference PRs[/-][+]bench: replay outcome-distribution smoke for roster/policy changes (descoped from A/B ranking — phase-0)[/+]