autoresearch
Autonomous iteration loop: modify, verify, keep/discard against any metric
Layered regression stability gate: capture baseline behavior on the base ref, diff the candidate, verdict STABLE/UNSTABLE before you push
> /plugin marketplace add uditgoenka/autoresearch > /plugin install autoresearch@autoresearch
How it fires
How this command gets triggered: by you, by Claude, or both.
/regressionContext preview
What this command does when you run it.
Layered regression stability gate: capture baseline behavior on the base ref, diff the candidate, verdict STABLE/UNSTABLE before you push
name: autoresearch:regression description: "Layered regression stability gate: capture baseline behavior on the base ref, diff the candidate, verdict STABLE/UNSTABLE before you push" argument-hint: "[Base: <ref>] [Scope: <glob>] [--select auto|full|affected] [--samples N] [--noise-band %] [--matrix] [--max-runs N] [--baseline-cache] [Baseline: <prebuilt-ref>] [--probe|--no-probe|--probe deep] [--predict --reason --debug --fix --fix-cycles N --evals --evals-interval N --chain]"
EXECUTE IMMEDIATELY.
A regression is a **green→red transition ONLY**. The gate orchestrates the project's OWN test/bench/snapshot/migrate commands (it is a protocol, not a bundled framework), captures baseline behavior in an isolated git worktree, re-runs the candidate, and reports a tiered ship/no-ship verdict.
Extract from $ARGUMENTS:
1. Auto-detect per-dimension verify commands: `package.json` scripts, `Makefile`, `nx`, migrate config, bench/snapshot/size scripts. 2. AskUserQuestion (single batch) to confirm detected commands + base ref + which dimensions to run. 3. **Auto-skip probe** when CI / no-TTY / `--mode autonomous` / complete-config / chained-handoff — log the inferred config instead of asking.
Establish the baseline green-set per dimension, then tag each unit. Match by **test-id first, then path**.
| State | Meaning | Gated? | |---|---|---| | `regression-eligible` | green on baseline | YES — only green→red counts | | `pre-existing` | red→red (already failing) | no — excluded | | `new-coverage` | absent→red (brand-new test) | no — new coverage, ungated | | `flaky` | nondeterministic on baseline | no — routed to flakiness SCORE | | `baseline-unavailable` | dimension never green | no — advisory only |
**Core invariant: red→red, absent→red, and flake→red are NOT regressions.** Run flakiness N× on **both** baseline and candidate; a candidate failure inside the baseline flake-envelope routes to flakiness SCORE, never to a regression. `5/5 green ≠ non-flaky` — detection probability is `1−(1−p)^n` (≈23% at p=5%, n=5); print it.
`git worktree add --detach <full-sha>` (detached SHA — avoids "branch already checked out" when Base==HEAD) → `baseline/<full-sha>/`; `--baseline-cache` reuses by SHA. Then per worktree: `git submodule update --init` + dependency install (lockfile is SHA-pinned so the cache stays sound). Per-dimension **setup tiers**: api-contract = file-diff, no build; functional / integration-e2e / data-migration = full env. On completion or crash: `git worktree remove` + `git worktree prune`. Warn on concurrent index-lock contention. `Baseline: <prebuilt-ref>` bypasses capture.
| Dim | Tier | Compare | Key params | |---|---|---|---| | functional | HARD | baseline green-set vs candidate; new fail = regression | test cmd, globs | | api-contract | HARD | schema/exports diff → breaking? | schema cmd, breaking ruleset | | data-migration | HARD | default: up applies clean + idempotent re-apply + app boots/schema valid; schema/rowcount roundtrip opt-in | migrate cmds, fixture, allowlisted DB | | integration-e2e | HARD | e2e green-set diff | e2e cmd | | flakiness | SCORE | run N× on baseline + candidate, count nondeterministic | runs (def 5), flake-threshold | | performance | SCORE | K **independent-process** samples/side, Mann-Whitney U AND effect beyond `max(noise-band%, k·stdev)`, report median delta | bench cmd, samples=7, noise-band=5%, k=2 | | resource | SCORE | mem/bundle/size delta vs budget | size cmd, budget | | visual-ui | SCORE | containerize render; default `maxDiffPixelRatio` + AA-detection; SSIM = per-page escalation | snapshot cmd, diff-threshold, mask regions |
`--select auto` mapper (`jest --findRelatedTests` fed the changed-file list; `nx affected` project-graph) is **best-effort static-import** — blind to dynamic/runtime/global-setup couplings. The report names the mapper + its blind-spot caveat; a HARD STABLE earned on an affected subset prints "run `--select full` for high-stakes". FULL suite is the correctness default.
Run candidate verify vs baseline metric → comp
Turn Claude Code, OpenCode, or OpenAI Codex into a relentless improvement engine. Based on Karpathy's autoresearch — constraint + mechanical metric + autonomous iteration = compounding gains.
Repo: uditgoenka/autoresearch
Autonomous iteration loop: modify, verify, keep/discard against any metric
Analyze iteration results: trends, plateaus, regressions, recommendations
Scout codebase and auto-generate docs — or a navigable wiki knowledge base — with validation-fix loop