README Source History Refs Reviews Compare Notes Search Review guide Cut plan drift and add the walking-skeleton entry point (#11) a0363001e8525636918b586e17db65db01e6bfe1
Oliver Jan Krylow <oliver@bugabinga.net > · 18 Jul 2026
SSH signature · not checked
Browse files Compare with HEAD
* Demote the plans to non-normative and cut their drift
The plans had started to contradict the spec they exist to serve — TASK-BREAKDOWN
hardcoded "17 widgets" while SPEC §8.6 now defines an open-ended set — because
they restated architecture and crate responsibilities the spec already owns.
Rather than maintain two copies, each plan now carries the same non-normative
banner research docs use and points at SPEC §2 for anything canonical, keeping
only what is genuinely plan-specific: the build waves and the doc-tooling
inventory.
A README indexes the two and states the coverage honestly — the set is
deliberately lopsided and omits a walking-skeleton plan and per-crate
breakdowns until implementation actually starts. Surface: docs/plans (three
files).
* Draft the walking-skeleton plan as the implementation entry point
The bottom-up crate order defers every integration risk to the final wave. This
plan inverts it: build one turn end-to-end through a scripted StreamFn — loop,
one tool, EngineEvents, TUI render, CBOR persist and reload — so the four
load-bearing seams are proven wired before any layer is built out. It leans on
the prototypes that already validated each seam in isolation (p05/p06/p07/p08),
uses a deterministic fixture so the whole slice is hermetic, and keeps a single
gated smoke test for a live provider.
One end-to-end test is the definition of done. Recorded as docs/plans/
WALKING-SKELETON.md and indexed as the ready-to-start entry point.
---------
Co-authored-by: Claude <noreply@anthropic.com> Changed files (4) Diff layout Auto Unified Split
docs/plans/PLUGIN-DOC-PLAN.md Modified +6 / −5 text lines
1 1 # Smith Plugin SDK Documentation Plan # Smith Plugin SDK Documentation Plan
3 + > Non-normative execution plan. `docs/SPEC.md` is canonical; where this file and4 + > the spec disagree, the spec wins. The normative pieces already live in SPEC —5 + > doc resolution order + `SMITH_DOCS_PATH` (§16), dotted `topic.function`6 + > addressing (§10.2), the system-prompt self-learn bootstrap (§6.8). This file7 + > is the execution plan for file inventories and tooling only.5 11 Smith must be able to extend itself when prompted by humans.Smith must be able to extend itself when prompted by humans.281 287 └── doc_gen.rs -- generate man pages + docs bundle └── doc_gen.rs -- generate man pages + docs bundle284 - > Normative pieces of this plan are now canonical in SPEC: doc resolution285 - > order + `SMITH_DOCS_PATH` (§16), `smith help <topic>.<function>` dotted286 - > addressing (§10.2), system-prompt SDK self-learn bootstrap (§6.8). This287 - > file remains the execution plan for file inventories and tooling.
291 292 - [ ] Create SDK annotation files in `smith-harness/src/lua/sdk/`- [ ] Create SDK annotation files in `smith-harness/src/lua/sdk/`docs/plans/README.md Added new file mode 100644+23 / −0 text lines
3 + Non-normative execution plans — the bridge from `docs/SPEC.md` (what to build)4 + to code (in what order). The spec is canonical; a plan never overrides it.6 + | Plan | Covers | Status |7 + |------|--------|--------|8 + | `WALKING-SKELETON.md` | first vertical slice — one turn end-to-end, proving the four seams | ready to start |9 + | `TASK-BREAKDOWN.md` | crate build order (SM-003→012), wave sequencing | pre-implementation |10 + | `PLUGIN-DOC-PLAN.md` | plugin-SDK doc source, `smith help`, doc tooling/tests | pre-implementation |12 + ## Is this the whole set? 14 + `WALKING-SKELETON` is the entry point for implementation — a thin slice through15 + every layer that proves the StreamFn, EngineEvent, session-codec, and TUI seams16 + connect before any of them is built out. `TASK-BREAKDOWN` is the full crate17 + sequencing that follows once the skeleton is green. One thing is still18 + intentionally *not* written, to avoid speculative planning:20 + - **Per-crate breakdowns.** Each SM-0xx task is crate-sized; it gets decomposed21 + into tested units at the start of its own wave, not now.23 + Prototype evidence that de-risks all of this lives in `../../prototypes/PLAN.md`.docs/plans/TASK-BREAKDOWN.md Modified +40 / −47 text lines
1 1 # Smith Task Breakdown # Smith Task Breakdown 3 + > Non-normative execution plan. `docs/SPEC.md` is canonical; where this file and4 + > the spec disagree, the spec wins. Architecture and crate responsibilities are5 + > defined once in SPEC §2 and CLAUDE.md — this file only sequences the build.6 - smith/ (shared types + StreamFn + AgentTool trait)8 - ├── smith-ai/ (Provider implementations — parallel with smith-core)9 - ├── smith-core/ (Agent loop + session — parallel with smith-ai)10 - └── smith-tui/ (Widgets + layout — parallel with smith-core/ai)7 + Top-level build order for the first implementation pass, at crate granularity.8 + Each task is a whole crate; decomposition into buildable, tested units is9 + deferred to that crate's own wave (see **Granularity**).12 - smith-core + smith-ai + smith-tui14 - smith-harness/ (Wiring: provider → StreamFn → agent, plugins, SDK)16 - smith-cli/ (Binary entry point)19 - **Key design:** The agent loop lives in `smith-core`. It takes a `StreamFn` (from `smith/`),20 - not a concrete provider. `smith-ai` implements providers and creates `StreamFn` instances.21 - `smith-harness` wires them together. This enables `smith-core` and `smith-ai` to build in parallel.11 + ## Task dependency graph 26 14 SM-003 (scaffolding) ── SM-005 (smith/) ──┬── SM-006 (smith-core/) ──┐SM-003 (scaffolding) ── SM-005 (smith/) ──┬── SM-006 (smith-core/) ──┐31 19 SM-012 (testing) SM-012 (testing)22 + The edges are the §2.2 boundary rules: `smith/` is the sole foundation;23 + `smith-core` / `smith-ai` / `smith-tui` build in parallel and never depend on24 + each other; `smith-harness` wires them; `smith-cli` sits on top.37 - Wave 0: SM-003 ( scaffolding — jj repo, workspace, crate skeletons) 38 - Wave 1: SM-005 (sequential — foundation types)39 - Wave 2: SM-006 + SM-007 + SM-008 (parallel)40 - Wave 3: SM-009 (sequential — after wave 2)41 - Wave 4: SM-010 + SM-011 (parallel — after SM-009 )42 - Wave 5: SM-012 (sequential — after wave 4)29 + Wave 0: SM-003 scaffolding — jj repo, Cargo workspace, crate skeletons, xtask 30 + Wave 1: SM-005 smith/ — foundation types (sequential; everything blocks on it)31 + Wave 2: SM-006 + SM-007 + SM-008 core / ai / tui (parallel)32 + Wave 3: SM-009 smith-harness — wiring (after wave 2)33 + Wave 4: SM-010 + SM-011 cli + workspace (parallel)34 + Wave 5: SM-012 integration tests47 - | Task | Crate | Description | Blocked By | Blocks |48 - |------|-------|-------------|------------|--------|49 - | SM-003 | workspace/ | jj repo, Cargo workspace, crate skeletons, xtask | - | SM-005 |50 - | SM-005 | smith/ | Shared types, StreamFn, AgentTool trait, Lua runtime, config | SM-003 | SM-006, 007, 008 |51 - | SM-006 | smith-core/ | Agent loop, session, tools, hooks, events | SM-005 | SM-009 |52 - | SM-007 | smith-ai/ | Provider trait, implementations, auth, OAuth | SM-005 | SM-009 |53 - | SM-008 | smith-tui/ | Widgets, layout, themes, rendering | SM-005 | SM-009 |54 - | SM-009 | smith-harness/ | Wiring, plugins, SDK, smith help | SM-006, 007, 008 | SM-010 |55 - | SM-010 | smith-cli/ | Binary entry point, subcommands | SM-009 | SM-012 |56 - | SM-011 | workspace/ | Cargo workspace, xtask | SM-009 | SM-012 |57 - | SM-012 | testing/ | Integration tests | SM-010, SM-011 | - |39 + | Task | Crate | Blocked by | Blocks |40 + |------|-------|------------|--------|41 + | SM-003 | workspace | — | SM-005 |42 + | SM-005 | smith/ | SM-003 | SM-006/007/008 |43 + | SM-006 | smith-core/ | SM-005 | SM-009 |44 + | SM-007 | smith-ai/ | SM-005 | SM-009 |45 + | SM-008 | smith-tui/ | SM-005 | SM-009 |46 + | SM-009 | smith-harness/ | SM-006/007/008 | SM-010 |47 + | SM-010 | smith-cli/ | SM-009 | SM-012 |48 + | SM-011 | workspace | SM-009 | SM-012 |49 + | SM-012 | testing | SM-010, SM-011 | — |59 - ## Crate Responsibilities51 + What each crate owns and must not own is defined once in SPEC §2.2 — not52 + repeated here, to avoid drift.61 - | Crate | Owns | Does NOT own |62 - |-------|------|-------------|63 - | **smith/** | Shared types, StreamFn type, AgentTool trait, ProviderEvent, ProviderRequest, Lua runtime, config | No business logic, no I/O |64 - | **smith-core/** | Agent loop (takes StreamFn), session, ToolRegistry, hooks, EngineEvent, AgentEvent, compaction, system prompt | No provider implementations, no I/O |65 - | **smith-ai/** | Provider trait + impls, model registry, auth, OAuth, providers.json, provider_to_stream_fn | No agent loop, no session |66 - | **smith-tui/** | 17 widgets, layout primitives, border layout, virtual scroll, themes | No business logic |67 - | **smith-harness/** | Wiring (provider→StreamFn→agent), plugins, SDK, event bridge, built-in plugins, smith help | No new core logic |68 - | **smith-cli/** | CLI subcommands (new, attach, continue, resume, eval, rpc, help) | No business logic |56 + These tasks are crate-sized, not buildable units: "SM-006 smith-core" is an57 + entire agent loop plus session, tools, hooks, and events. Before a crate's wave58 + starts it needs its own breakdown into vertical, tested slices. This file is59 + top-level sequencing only; a pure bottom-up walk of it produces nothing runnable60 + until SM-010, so the first implementation move should be a thin end-to-end slice61 + (walking skeleton) rather than a full horizontal wave — see the plans index.docs/plans/WALKING-SKELETON.md Added new file mode 100644+104 / −0 text lines
1 + # Walking Skeleton — First Vertical Slice 3 + > Non-normative execution plan. `docs/SPEC.md` is canonical; where this file and4 + > the spec disagree, the spec wins. This plan sequences the *first* code, not5 + > the whole product — `TASK-BREAKDOWN.md` holds the full crate build order.9 + `TASK-BREAKDOWN` is bottom-up: `smith/` → core/ai/tui → harness → cli. Built10 + literally, nothing runs end-to-end until the last wave, so the first integration11 + problem surfaces last — the most expensive place to find it. The walking12 + skeleton inverts that: build the **thinnest possible slice through every layer**13 + first, prove the seams connect, then widen. Each layer ships the minimum that14 + lets the next one exist — no more.16 + The slice is one agent turn, end to end, rendered and persisted:19 + input → agent loop → StreamFn → (scripted) ProviderEvents → one tool call20 + → assistant Message → EngineEvents → TUI render → session CBOR → reload23 + ## The seams it proves (the entire point) 25 + The skeleton exists to exercise the four load-bearing boundaries once, together,26 + before any of them is built out:28 + 1. **StreamFn seam** (§5.4) — the agent loop consumes a `StreamFn`, never a29 + concrete provider. Proven in isolation by p07; proven *wired* here.30 + 2. **EngineEvent seam** (§6.3) — the engine emits a UI-agnostic event stream;31 + the TUI is one consumer of it, not coupled to the loop.32 + 3. **Session codec** (§6.6) — a turn round-trips through CBOR and reloads33 + identically. Proven in isolation by p06.34 + 4. **TUI render loop** (§8) — EngineEvents render through `TestBackend` with no35 + TTY and no network. Proven in isolation by p08.37 + If these four connect, the architecture holds. Everything else is widening.39 + ## In scope (the minimum per layer) 41 + | Crate | Ships only | Leans on |42 + |-------|-----------|----------|43 + | workspace (SM-003) | jj repo, Cargo workspace, crate skeletons, `xtask check` | — |44 + | `smith/` (SM-005) | `Message`/`Id` (§5.1), `ProviderEvent`/`ProviderRequest` (§5.2), `AgentTool` (§5.3), `StreamFn` alias (§5.4), a minimal `Config` (§5.6) — and nothing else | — |45 + | `smith-ai/` (SM-007) | one **scripted** `StreamFn` that replays a fixture `ProviderEvent` sequence (deterministic, hermetic) | p05, p29 |46 + | `smith-core/` (SM-006) | one-turn agent loop (§6.1), `EngineEvent` emit (§6.3), one read-only tool via `ToolRegistry` (§6.10), session append + CBOR persist/reload (§6.5/§6.6) | p07, p06, p31 |47 + | `smith-tui/` (SM-008) | message list + input area + status bar (subset of §8.6), driven by EngineEvents through `TestBackend` | p08, p22 |48 + | `smith-harness/` (SM-009) | wire scripted StreamFn → loop → EngineEvent → TUI; register the one tool | p23 |49 + | `smith-cli/` (SM-010) | `smith new` (run one turn, render, persist) and `smith attach` (reload + re-render the persisted session) | — |51 + ## Explicitly deferred (widening, not skeleton) 53 + Lua runtime and plugins (§5.5/§9); real providers, auth, OAuth (§7); compaction54 + and cost (§6.9); session branching (§6.5 tree); the secret proxy (§6.7); the RPC55 + frontend (§10.4); the remaining §8.6 widgets and layout; every CLI subcommand56 + beyond `new`/`attach`. None of these block proving the seams.60 + **One hermetic end-to-end test is the definition of done** (fast tier, §17.1;61 + hermeticity rules, §17.10):63 + > Given a scripted `StreamFn` whose fixture emits text then one tool call, when64 + > `smith new` runs one turn, then the tool executes once, the assistant65 + > `Message` is assembled from the `ProviderEvent` stream, the expected66 + > `EngineEvent` sequence is observed, `TestBackend` renders the exchange, the67 + > session is written as CBOR, and `smith attach` reloads it to a byte-identical70 + One additional **gated** smoke test (`network-tests` feature, off by default per71 + §17.10) swaps the scripted StreamFn for a real Anthropic call, proving the same72 + loop drives a live provider. It never runs in the default lane.76 + Vertical, not the horizontal waves of `TASK-BREAKDOWN`:79 + 1. workspace skeleton + xtask green80 + 2. smith/ minimal types (only what steps 3–7 consume)81 + 3. scripted StreamFn (fixture in, ProviderEvents out)82 + 4. agent loop: one turn over the StreamFn, EngineEvents out, one tool83 + 5. session: append + CBOR persist/reload84 + 6. TUI: render EngineEvents via TestBackend85 + 7. harness wires 3–6; cli exposes `new` + `attach`86 + 8. the acceptance test goes green → skeleton done89 + Each step is mergeable on its own and leaves the tree building.93 + - The acceptance test passes in the fast tier; the gated real-provider smoke94 + passes when explicitly run.95 + - `cargo run -p xtask -- check` (fmt + clippy + arch + pup + test + doc) is97 + - No deferred subsystem was pulled in to make it work.99 + ## First widening steps after green 101 + Add a real provider normalizer behind the StreamFn (§7.2, p29); introduce the102 + Lua runtime and the first built-in plugin (§5.5/§9); grow the widget set (§8.6);103 + add `continue`/`resume` and the session tree (§6.5). Each rides the seams the104 + skeleton already proved.