Skip to content

Assemble the harness

Every piece you’re about to see, you already built or sketched. This lesson doesn’t teach anything new - it walks a proposed stash .pi/ directory the way you’d walk a new teammate through it on their first day, so the nine separate lessons collapse into one mental picture. Several entries are illustrative designs rather than files this course has fully implemented; use the linked lesson to decide what still needs code.

Here’s what a well-worked stash checkout looks like after a real week with Pi:

stash/
├─ .pi/
│ ├─ APPEND_SYSTEM.md # stash's conventions, written once (module 3)
│ ├─ settings.json # project config - routing, tool defaults (module 4)
│ ├─ damage-control-rules.yaml # the DB/.env guardrail, in plain YAML (module 6)
│ ├─ PLAN.md # the current unit of work (module 6)
│ ├─ extensions/
│ │ ├─ stash-tools.ts # /stash command + re-extract URL tool (module 5)
│ │ ├─ damage-control.ts # blocks writes to stash.db and .env (module 6)
│ │ ├─ tilldone.ts # blocks tool calls until one task is in-progress (module 6)
│ │ ├─ plan-injector.ts # keeps PLAN.md in front of the model (module 6)
│ │ └─ statusline.ts # live footer: model, context %, cost
│ ├─ prompts/
│ │ └─ triage-fetch.md # the recurring triage pass, /triage-fetch (module 7)
│ ├─ skills/
│ │ └─ onboard-content-source/
│ │ └─ SKILL.md # "wire up a new content source" procedure (module 7)
│ ├─ themes/
│ │ └─ stash-dark.json # the one purely cosmetic file in here (module 7)
│ └─ agents/
│ ├─ verifier.md # read-only child that checks the builder (module 8)
│ ├─ reextract-chain.yaml # the batch re-extraction chain (module 8)
│ └─ expertise/
│ └─ extraction-lead.md # what the extraction lead learned (module 9)
└─ (the actual stash codebase)

Nothing in that tree is exotic. It’s markdown, YAML, and a handful of small TypeScript files, all readable in one sitting - which is itself the point Pi has been making since module 2: a harness you can read in one sitting is a harness you actually trust.

The rules and the routing - what the agent knows before it does anything

Section titled “The rules and the routing - what the agent knows before it does anything”

APPEND_SYSTEM.md is the first thing loaded, and it’s where stash’s facts live once and stop needing repetition: the readability extractor’s known failure modes, the fetch worker’s rate-limit rules, how feed dates get normalized, which tags are reserved. Module 3 is where this file was born; here it’s just present, doing the same job it always did.

settings.json is where the routing from module 4 lives - cheap model for bulk re-extraction jobs, a stronger model for anything touching the search index or the fetch worker’s retry logic. If a local model is in the mix for throwaway grunt work, its practical context ceiling is a known, accepted limit here, not a surprise discovered mid-task.

The extensions - the features Pi didn’t ship, built on purpose

Section titled “The extensions - the features Pi didn’t ship, built on purpose”

stash-tools.ts is the first extension you wrote - the /stash command and the re-extract tool, still the most-used thing in the directory because it turned a repeated chore into one keystroke.

damage-control.ts and tilldone.ts are module 6’s pair: the first is a design for blocking any tool call that touches stash.db or .env outside an explicit allow-rule; the second is a design for blocking every tool except its own until exactly one task is in-progress, with task state rebuilt from session history rather than a side file that could drift out of sync. The linked lesson shows the load-bearing checks and the state model; you still need to turn them into complete extensions and test them before treating this tree as production-ready.

statusline.ts is the quiet one: a footer that always shows model, context percentage, and running cost, so “how much of the window is left” and “what is this costing me” are ambient information instead of a command you have to remember to run.

The skill and the verify loop - the no-code layer and the check that doesn’t trust you

Section titled “The skill and the verify loop - the no-code layer and the check that doesn’t trust you”

skills/onboard-content-source/SKILL.md is module 7’s packaged procedure for wiring up a new content source into stash - no code, just the steps, shared with anyone who installs it the same way you did. prompts/triage-fetch.md and themes/stash-dark.json are the same module’s smaller wins: a recurring triage pass you invoke as /triage-fetch instead of retyping, and the one file in this tree that exists purely because you have to look at the thing all day.

agents/verifier.md is module 8’s reviewer - a persona file, not an extension, because the only lever it gives you is the file. The course describes how a runner could spawn a second, read-only Pi process against the builder’s session log, have it decompose the work into falsifiable claims about data integrity, and report back. agents/reextract-chain.yaml is a driver design sketch from the same module, not a file Pi consumes by itself; wire it to the child-runner primitive before relying on it.

The team - for when one context genuinely isn’t enough

Section titled “The team - for when one context genuinely isn’t enough”

agents/expertise/extraction-lead.md is what’s left on disk from module 9’s migration team. The personas themselves are cheap - frontmatter and a paragraph, spun up only when a job is big enough that a single agent juggling everything would be the actual bottleneck. What’s worth keeping between runs is the expertise file: what the extraction lead worked out about which of stash’s saved sites break the new extractor, so the next lead doesn’t start from nothing.

None of these pieces talk to each other through anything magic - a settings file, some markdown, and TypeScript designs that hook into the same handful of lifecycle events. That’s the proposed harness. It isn’t bigger than the sum of nine lessons; it’s the same nine pieces, finally sitting in one directory where you can see which parts are runnable and which parts still need implementation.

Next: judge, honestly, when this setup is worth reaching for.