Skip to content

chore(#689): ready-gate backtest driver script - #691

Merged
admarble merged 2 commits into
mainfrom
feature/689-ready-backtest-driver
Jun 1, 2026
Merged

admarble merged 2 commits into
mainfrom
feature/689-ready-backtest-driver

Conversation

@admarble

@admarble admarble commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds the repeatable backtest driver for the sequant ready Layer-2 measurement — the tooling half of #689 (which tracks #683's deferred AC-7). Makes the eventual offline run a single command instead of a hand-rolled per-case ritual.

scripts/analytics/ready-backtest.ts:

Three methodology decisions, made explicit (not hidden)

  1. Skill version — --current-skills (default ON) overlays current main skill dirs onto the old product code, so the measurement answers "does today's gate catch this old bug," not "did the old skill."
  2. Pre-fix SHA — confidence-flagged. The (#N) grep is the feat(state): prevent concurrent sequant sessions from targeting the same issue #625-class false-positive zone, so non-scoped/multi-match derivations are marked LOW-CONFIDENCE and require a manual sha override before they're trusted. Dry-run currently flags arch: extract RunOrchestrator — decouple execution engine from CLI wiring #503, fix(checkpoint): scope chain-mode checkpoint to feature paths, don't sweep dirty tree #528, feat(state): prevent concurrent sequant sessions from targeting the same issue #625, chore: raise Node engine floor to >=22.12 (drop EOL Node 20), unblock commander 15 #677.
  3. Scoring — heuristic HIT/MISS; the committed recall number is a human read of the captured JSON.

Safety / scope

🤖 Generated with Claude Code

admarble added 2 commits May 31, 2026 22:33
Adds scripts/analytics/ready-backtest.ts — the repeatable plumbing for the
Layer-2 backtest (#683 AC-7). Reads the 12-case real-bug corpus + clean
control, auto-derives each pre-fix SHA (parent of the `(#N)` squash-merge),
sets up an issue-number-named worktree so `sequant ready` can discover it,
runs both policies, captures JSON to .sequant/backtest/, and emits a
recall/noise table.

Makes the three methodology decisions explicit rather than hiding them:
- --current-skills (default ON) overlays current main skills onto old code,
  so the measurement tests TODAY's gate against the old bug.
- pre-fix SHA derivation is confidence-flagged; low-confidence matches
  (#503/#528/#625/#677 currently) require a manual `sha` override before
  their results are trusted — surfaces the #625-class git-grep false positive
  rather than silently mis-deriving.
- HIT/MISS is heuristic; the committed recall number is a human read of the
  captured JSON.

Default is --dry-run (no live passes). Does NOT close #689 — the offline
--run and the Layer-3 dogfood remain operator work.

Entire-Checkpoint: 1c9e97b44e21
Extract the pure SHA-confidence classifier (classifyShaConfidence) out of the
git-calling resolvePreFixSha and export score, so both are unit-testable
without live git/ready (matches the scripts/analytics/*.test.ts convention).
Guard main() behind the standard isMain check so importing the module in tests
doesn't execute the CLI.

11 cases: high/low confidence (incl. the #625-class "mentions (#N) but not
scoped" false positive, multi-match ambiguity, wrong-issue scope, override
short-circuit, no-match) + HIT/MISS/? scoring. Dry-run behavior unchanged.

Entire-Checkpoint: 22a45d560d30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Promote sequant ready from experimental: Layer-2 backtest + Layer-3 shadow dogfood, meet promotion gate (#683 follow-up)

1 participant