Cairn implements the WikiSkill loop: an agent runs tasks, a curator distils what happened into a knowledge wiki, a second curator proposes one skill change, and the change survives only if it measurably improves the next run.
Each iteration runs a training split, folds the transcripts into a living wiki, proposes exactly one skill change, and gates it against a held-out validation score. Skills that don't earn their keep are rolled back. The wiki never is.
Run the train split on the deploy model via OpenCode V2. Score every transcript with a deterministic verifier. Redact and write condensed traces to raw/iter-NNN/.
Reads the condensed traces and patches wiki/ with new patterns and observations. The only role that ever touches the wiki.
Reads wiki/patterns/ and writes exactly one skill diff into skills/. If the diff touches more than one skill folder it is rejected unscored.
Run the validation split. Accept only if the new score strictly beats the best so far. On accept, commit. On reject, git restore skills/ — but commit the wiki anyway.
Write one entry to wiki/skill-impact.md either way. Reload the full skill text into the next iteration's inference agent and go again.
skills/ feeds back into rollouts —
the inference agent is sandboxed away from the wiki. The best score starts at the
empty-skill baseline; a first proposal that ties it is a rejection.
A Rust daemon owns the loop, vault, and credentials. A Tauri cockpit relays through it without ever touching a secret. OpenCode V2 executes every rollout in an isolated sandbox.
Every skill must beat the best-so-far validation score on the exact model it will run on. A tie is a rejection. The gate is a deterministic verifier — no LLM, no judgment.
The baseline is the empty-skill validation score. A proposal is accepted only if its
validation score is strictly higher than the best-so-far. On reject,
git restore skills/ runs immediately — but the wiki update is committed
regardless.
Every active SKILL.md is concatenated into the inference agent's prompt
before each iteration's rollouts — byte-identical across all of them so prompt caching
absorbs the cost. The native skill tool is denied; selection is never a
variable in a measurement.
The vault is an Obsidian folder and a git repo at once. Every accepted change is a commit you can inspect or revert from the cockpit. The wiki is meant to be read by a person; the skills are what the agent executes.
Pattern notes, skill PURPOSE files, and impact logs are plain Markdown with [[wikilinks]]. Open any note in Obsidian; use the graph view to see which patterns motivated which skills.
The daemon commits on accept and git restore skills/ on reject. Revert from the cockpit's Gate view — or from the terminal — if a later iteration regresses.
A small OpenCode plugin posts finished coding sessions to the daemon. The nightly maintainer folds them into the wiki; the weekly proposer checks whether they suggest a skill change.
The rollout Seatbelt profile denies reads of the vault path entirely. The inference agent cannot read the wiki — the paper shows it degrades skill quality if it can.
Rollouts run on the deploy model — the one you code with daily. Skills evolved on a different model hurt rather than help. Curators stay on Claude; counting and gating stay in Rust.
| Role | Model | Endpoint | Why |
|---|---|---|---|
| Inference | DeepSeek V4 Pro | Fireworks | Skills must be gated on the model that will run them |
| Exploratory | DeepSeek V4 Flash | Fireworks | ≈ 1/12th cost; re-gate on Pro before adoption |
| Wiki Maintainer | Claude Sonnet 5 | Bedrock runtime | Long traces in, structured patch edits out |
| Skill Proposer | Claude Opus 5 | Bedrock runtime | One high-leverage change per iteration |
| Decision layer | Jev 1.13 | TypeSafe API | Cheap typed judgments; never gates, writes, or counts |
macOS only. Everything runs on one machine: a Rust daemon, a vault, and OpenCode V2. See docs/setup.md for the full guide.
cargo build --release cargo test --workspace # 172 tests, no network cd apps/cockpit/src-tauri && cargo build
npm install -g @opencode/cli opencode2 --version # must be 2.0.x
The daemon checks the version at startup and refuses anything outside the pinned minor.
wikiskilld init --vault ~/Vaults/WikiSkill
Keep the vault outside ~/Documents, ~/Desktop, and iCloud Drive — sync clients race daemon writes.
wikiskilld credential set wikiskill-fireworks wikiskilld credential set wikiskill-jev # optional
# Use inference-profile ids on Bedrock: # global.anthropic.claude-sonnet-5 # Use dated ids on Fireworks: # accounts/fireworks/models/deepseek-v4-pro-0813
# 60 tasks from your own work # eval/train.jsonl — 30 tasks # eval/val.jsonl — 15 tasks # eval/test.jsonl — 15 tasks
A flaky verifier turns the gate into noise. Every number in the cockpit is downstream of this.
wikiskilld baseline
This is the bar a first proposal has to beat. Without it, any acceptance threshold is arbitrary.
wikiskilld run # foreground wikiskilld serve # daemon + API wikiskilld install-agent # launchd