Run improvement campaign

From s-smits/anabasis · View interactive version

Run improvement campaign is an AI agent skill from the GitHub repository s-smits/anabasis. Use when managing ongoing improvement cycles (the Super Loop), forking fresh runs, working toward a release, running a pass or audit, interpreting a promotion, diagnosing a non-promoting campaign, or planning the next run. Tracks milestones and pre-registered predictions, backtracks predictions afte

How to use this skill

Skill file

Run improvement campaign (the Super Loop)

Three nested cycles:

Only a fresh campaign opened from a prompt at a single commit is valid climb evidence (AGENTS.md §10, item 9).

What to do when

| Trigger | Read first | Next action |

| --- | --- | --- |

| Starting, resuming or waking | wri2p2.ts due, cycle.md | Check measures drift and hook continuity; act on the live decision/trigger or oldest pending step (wri2p2.ts next <dir>) |

| Promotion (1st–5th) | runs view <name>, starter-reads.ts, wri.ts read, predictions-<run>.md (plus paired sibling) | Execute the per-promotion gate below: backtrack every row of predictions-<run>.md at current log event count; check written-after transfer; decide pause-and-act now vs continue to N+1 (up to 5 max) |

| Starter read, non-step or ending | runs view <name>, starter-reads.ts | Resolve outcomes-<run>.md at current log event count (convert pending → unreached when stopped); once paused or ended, run wri2p2.ts open |

| Runner slot frees up | runs active, runs usage, runs loadwatch --once, run-queue.md | Step 5: dry-run, write sharp predictions-<run>.md (early vs multi-epoch), launch via runs fresh |

| Lanes or synthesis finish | wri2p2.ts next <dir>, wri2p2.ts ledger <dir> | Execute WRI2P2 step 3 (adversarial vet, recurrence check, cross-domain, plan) |

| Code fix ready | stack-pr/scripts/stack.ts, repository-practice/scripts/preflight.ts | Step 4: /simplify, model-free system-path-simulation, land --sanitize, then step 5 |

| Spend with no milestone progress | runs pulse <name>, wri.ts read --log <log> | Diagnose via "Milestones and the walk" below |

| Step open 2 days or double-claimed | Elapsed hours in due; cycle.md | Claim step, log deviation or assign one owner in cycle.md |

| jobstat pauses at ≥2 promotions (or pauses/stops with 1) without outside read | Prior prediction, score.ts table, compare.ts levels | Follow references/outside.md (runs bench, outside-reads.md); never let owed reads pile up |

| Handover or timer audit | timers.ts <transcripts>, active until.ts hooks | Verify promotion hooks are armed in cycle.md, retire dead timers, report the five points |

The release cycle

Operator authorisation (e.g. "work towards 0.6.4") covers the cycle's runs, scheduled pauses and stack patches; landing, tagging, stopping live runs mid-flight and new cycles require fresh operator authorisation (AGENTS.md §3, §11). Log grants, per-promotion decisions and open choices in cycle.md.

iteration: predict (early + multi-epoch) → fork at top → backtrack at each promo (1–5 max, or non-promo trigger) → pause --after reported → WRI2P2 → adversarial vet + recurrence check → cross-domain → plan (repair or remove) → one stacked PR → simplify & simulate → predict → fork
release:   proof run at top (2 promos, unchanged) → 3 reviewers → consolidate → land & tag on operator's word → fork at release

Cycle files

Live in .ana/wri/<YYYY-MM-DD>-cycle-<release>/ on the central archive host, never under data/:

| id | PR | labels | lanes | group | claim, as a count | falsified by |

Keep ledgers sharp (~8–15 load-bearing rows, not snowballed archives): cover every PR since the previous fork, each component contract/boundary under test, explicit keep-or-revert bars for newly added components, and supply/climb/honesty rows. Mark whether each claim settles early-epoch (by promo 1: draft audit, grounding, portability, supply floor) or multi-epoch (promos 2–5: written-after confirmation, post-promotion Examiner targeting, practice boundary, sustained climb). group: first | again | off-run | outside.

Per-promotion decision gate (1 to 5 promotions)

Every promotion (harness.promoted, 1st through 5th) triggers a sequential prediction-backtracking triage surfaced by wri2p2.ts due (step: decide for promotions 1–4; step: pause at ceiling 5), runs pulse and promotion hooks (until.ts <run> --at harness.promoted:next). Driving investigations from promotions replaces arbitrary 90-minute clock checks — a single solve sweep can exceed 90 minutes, causing clock checks to fire repeatedly mid-sweep with no new evidence — and avoids auto-piloting to a fixed count of 2 when evidence is already settled at 1 or still incomplete at 2–4.

  1. Backtrack every prediction first: read runs view <name>, starter-reads.ts, wri.ts read, wri.ts backtrack --log <log> (comparing against older same-domain releases with version-gap attention decay), key readers (readings, scores, portability, seats, draft-audit, history), wri2p2.ts due's measures drift line, and any paired ablation sibling; backtrack each row of predictions-<run>.md into outcomes-<run>.md with Log events at resolution: <n>.
  2. Check transfer health (written-after + validity + freshness) before continuing:
  1. Decide pause-and-act now vs continue to promotion N+1 (ceiling 5):
  1. Non-promotion triggers (when a run stays at 0 promotions): 12 elapsed hours since opening, a scored comparison with 0 untied tasks, or a natural ending after ≥1 comparison.
  2. Always pause cleanly: pause via runs pause <name> --after reported --yes (under nohup; add --eval on jobstat from promotion 2 onwards), never directly at harness.promoted, so the owed starter confirmation (heldBy) tallies before investigation opens. Wait until the run rests, then re-resolve outcomes-<run>.md at the final event count.
  3. Paired and ablation runs: evaluate both arms together at each promotion gate, and open them as equals (wri2p2.ts open <runA>,<runB>) so synthesis attributes causal deltas across mechanisms rather than anecdotes.

Iteration (WRI2P2)

bun .claude/skills/run-improvement-campaign/scripts/wri2p2.ts [due] [<part> ...] [--days 2]
bun .claude/skills/run-improvement-campaign/scripts/wri2p2.ts open <name>[,<name>] [--out <dir>]
bun .claude/skills/run-improvement-campaign/scripts/wri2p2.ts next <dir>
  1. Rest & resolve: after pausing at the decision gate (or non-promotion trigger), wait until the active comparison/starter read finishes and resolve outcomes-<run>.md at the stopped log's event count (leaving zero non-outside pending rows).
  2. Investigate: run wri2p2.ts open <name>[,<peer>] (open snapshots internally; opening a live unpaused run is a deviation requiring operator direction logged in deviations.md). Follow wri2p2.ts next <dir> through instruct → lanes --agents 4 (importance-ranked 20-lane catalogue: Lane 1 blind reach/soundness, Lane 2 longitudinal version backtracking, Lane 3 reward hacking) → lane reports → wri.ts record → isolated (auto-skipped when overview.md fires no isolated-lane trigger) → collect → synthesis.
  1. Adversarial vet, recurrence escalation, cross-domain check & plan:
  1. Implement, simplify & simulate: fold refinements into your own owning PR when touching the same compartment (stack-pr), otherwise land the plan as one stacked PR at the stack top (avoid fragmenting into micro-PRs; consolidate by mechanism before release). Run /simplify, verify behavioural patches model-free via system-path-simulation (before/after archive replays, scripted rehearsals or wall probes on identical logs/seeds — never model-seated simulations), prove the full stack with bun run land -- <top> --sanitize, and record Pull request: #N in plan.md.
  2. Predict & fork: skip forking if the PR changes zero files in CODE_TREES (log in deviations.md as | launch | ... |). Otherwise dry-run runs fresh --as forkedPR<N> to lock the exact run name, write a crisp predictions-<run>.md (carrying non-opposed unheld parent ids in ## Carried, tagging early vs multi-epoch rows, and setting keep/revert bars for new components), launch only ready: yes entries, and immediately arm until.ts <run> --at harness.promoted:next.

next gates: open → instruct → lanes → reports → record → isolated → synthesise → per-run predictions/outcomes/carry/outside → vet → across → plan → implement → launch → forks → done. Override any gate except done via | <step>[:<run>] | <reason> | in deviations.md.

Running, consolidating & proving a release

Resume & the five points

bun run runs status
bun run runs pulse
bun run runs view <name>
bun run runs source <name>
bun .claude/skills/stack-pr/scripts/stack.ts
bun tools/wri/wri.ts read --log <worktree>/.ana/d2/<name>/log.jsonl

Report Supply + the four factors (AGENTS.md §1) at pass open and close:

| # | Point | Source | Bar |

| --- | --- | --- | --- |

| 1 | Climb | runs status, runs view, close.ts "Promotions" | AGENTS.md factor 1 |

| 2 | Honesty | Report noise; close.ts "The chance of a false promotion" | A/A controls & cumulative risk |

| 3 | Supply | --dry-run, runs view, task.gate | comparisonFloor(level) frontier tasks |

| 4 | Verdicts | tools/d2/settle.ts | AGENTS.md factor 3 |

| 5 | Economy | close.ts "Work and spend", promotionsWorth, worthLine | ≤3 attempts/epoch after setup |

The outside aim: Harness² on JobBench

At least one live slot stays on jobstat. Evaluate every jobstat run's newest promoted reference on JobBench's eight-task subset beside a fresh paired Starter—automatically on pause from promotion 2 onwards, or after lane 8 (skipping if soundness ≤2 or bloat) when pausing or stopping with 1 promotion. Roll owed reads promptly so transfer feedback stays current rather than piling up a multi-run backlog. Nothing from JobBench ever enters seats, prompts, checks or queries, and external scores never gate promotions. See references/outside.md for partitions, outside-reads.md columns, runs bench execution and spread actions.

Milestones and the walk

| Milestone | Log event | Check |

| --- | --- | --- |

| M0 opened | Receipt, campaign.opened | runs source: clean single commit, fresh opening |

| M1 exam | exam.drafted, referee.draft, checker.read, contract.frozen | Faults by kind, draft-audit findings, doNothing, admitted |

| M2 supply | First task.gate | Held vs refused by reason, objective gap, dry run |

| M3 first reading | First comparison.reported | valid.informative.old, untied vs tied, scored.detectable, A/A, load |

| M4 step | reading: step vs reference | Margins, retained tally, A/A |

| M5 promotion | harness.promoted | Reading, untied count, A/A, cumulative risk; wri.ts climb; per-promotion gate |

| M6 next epoch | First Examiner & comparison post-M5 | Drafts held vs refused, frontier & retained sizes, written-after starter confirmation |

| M7 ending | campaign.ended | Ending kind, closing report, final prediction outcomes |

On stalls (spend without milestone progress; exclude rule-15 limit waits), walk from the active milestone and stop at the first failing link (matches WRI lane 16):

| # | Link | Point | Fails as | Owner |

| --- | --- | --- | --- | --- |

| 1 | supply | 3 | tasks/short rows, refused drafts (< comparisonFloor) | src/examiner/prompt.ts, heard (record.ts), propose_tasks (write.ts), supplyRun/tasksToAskFor (decide.ts), comparisonFloor (admission.ts) |

| 2 | instrument | 4 | exam ending, checker faults, tasks set aside, audit ceremony | planOf (opening.ts), readChecker (acceptance.ts), reviewDraft (src/referee/draft-audit.ts), check author |

| 3 | room | 1 | no-room, zero valid.informative.old | Link 1; roomOf (reports.ts) |

| 4 | session | 1 | Unchanged build.finished, idle sessions, practice all passing | src/builder/prompt.ts, tools/d2/campaign-actions.ts, idleOf (campaign-terms.ts) |

| 5 | size | 2 | Excess ties, near miss, high scored.detectable | --target for next run; link 1 |

| 6 | host | 2 | HOST LOADED, LOAD MOVED, long campaign.waited | Concurrent campaigns/host |

| 7 | promotion | 2 | no-step near alpha, retained loss, A/A step | Links 1 & 5; readsStep (compare.ts) |

| 8 | next epoch | 1 | Refused drafts, thin frontier after promotion | make (harness-builder.ts), ROWS (decide.ts) |

Event hooks and timers

Never run recurring clock-polling loops (1h, 90m, 2h/4h/6h/8h) — a single solve sweep can outlast 90 minutes, so clock polls fire repeatedly mid-sweep with no new evidence. Drive the loop strictly from promotion events (until.ts <name> --at harness.promoted:next, stepping 1 → 2 → 3 → 4 → 5), runs alerts, runs pulse or subagent completions. On each promotion wake, execute the per-promotion backtracking gate above: either arm runs pause <name> --after reported --yes and wait for rest to open WRI2P2, or record the unresolved prediction ids in cycle.md + <cycle>/deviations.md and immediately re-arm until.ts <name> --at harness.promoted:next (up to 5 promotions maximum). On every handover or session resume, verify that every live run's promotion hook is still armed and listed in cycle.md. Reserve one-shot timers strictly for non-event deadlines such as the 12h non-promoting ceiling or a single handover (references/timers.md; audit via timers.ts). On non-promotion wakes: check date -u, wri2p2.ts due and cycle.md (if idle, print one line and touch no files); execute one authorised step; chain a 10m one-shot only if actionable steps remain, else wait on the next event; log a cycle.md row only on state change.

Related skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.