repositories / smith

smith

There are many coding harnesses - but this one is fast

owned by bugabinga

State the case for Smith before anyone reads its spec (#130)

233aa0107ea817e61d897b3e1546007bd690c5c9

Oliver Jan Krylow <oliver@bugabinga.net> ·

SSH signature · not checked

Browse filesCompare with HEAD

The repository had no first contact. A reader arriving at the root found a
navigation index written for agents and a 3000-line specification, neither of
which answers why the project should exist. The case itself was already
written — the owner's comment on #12 names the two costs that pushed Smith out
of pi, and those are the argument, so the "Why Smith" section is built from
them rather than from invented positioning.

Wrote it against what the spec actually claims, which meant dropping the more
attractive version twice: Smith answers the extension-sharing complaint with
one plugin API its own built-ins are written against, but not distribution, and
the Cargo-only rule governs the Rust workspace rather than every artifact.
Performance figures are labelled targets because the workspace is stubs.

One new file, `README.md`, at the repo root; SPEC coverage for it stays
unwritten pending owner approval.

Closes #12

Changed files (1)

+112 / −0 text lines

Diff layout

README.md

Added
new file mode 100644

+112 / −0 text lines

1# Smith
2
3A coding-agent TUI written in Rust, extended in Lua.
4
5> **Status: specification.** Smith is being specified before it is built. The
6> workspace crates are stubs; the product described below does not run yet.
7> [`docs/SPEC.md`](docs/SPEC.md) is the canonical description of what it will
8> be, and it is considerably further along than the code.
9
10## Why Smith
12[pi](https://github.com/earendil-works/pi) is Smith's starting point and its
13philosophical ancestor. It is well designed, and it hits a sweet spot: handle
14the annoying LLM details, stay minimal, stay extensible. Smith exists because
15two of its costs are structural rather than incidental — they follow from
16implementation choices that cannot be patched out from the outside.
18**The runtime.** Node and npm carry a dependency-security surface that has to
19be re-audited continuously, and a performance floor a terminal UI keeps
20bumping into. Smith is a single Rust binary. The targets it is specified
21against are a stripped release under 20MB and `--help` under 100ms
22(§13) — targets, not measurements, until there is something to measure.
24**Sharing extensions.** This is the deeper one. pi's extension mechanism has
25good hooks and a broadly stable API, but its audience is a single developer or
26a small team. Extensions are hard to share across a community, because a
27principled interface and an IPC channel are missing. The symptom is visible in
28the ecosystem: dozens of separate subagent extensions, some of them
29dependencies of other extensions that needed subagent functionality, with no
30common contract to depend on. For a consumer of community extensions that is a
31mess, and the rational response is to give up and maintain your own — which is
32the outcome an extension system is supposed to prevent.
34Smith's answer is to make the plugin API the *only* extension API. Everything
35user-visible — tools, slash commands, themes, keybindings, prompts, layouts,
36feature UI — is a Lua plugin, and the built-in tools are written against the
37same interface third-party plugins get (§9). An interface its own author must
38use is one that stays honest. Plugins declare identity and dependencies in a
39manifest, run sandboxed, and talk over a typed, versioned SDK rather than
40reaching into internals.
42Two more things fall out of the design rather than being features bolted on:
44- **Provider independence.** The agent loop depends on `StreamFn` — a request
45 in, a stream of provider events out — and on nothing else (§5.4). Providers
46 are adapted to that shape, so the loop has no idea which one it is talking
47 to.
48- **Sessions you can replay.** Conversation state is a tree, stored as CBOR,
49 and a recorded trace can be re-executed deterministically without touching a
50 live provider (§6.5, §6.6, §6.11).
52**Who it is for.** People who live in a terminal, want their coding agent to
53start instantly and stay out of the way, and expect to reshape it — and to be
54able to use what someone else built without adopting their dependency tree.
56**What Smith is not.** Not a pi fork and not pi-compatible: no shared data, no
57shared formats, no code lineage. Not a GUI, not an IDE plugin, and not an
58onboarding wizard — the first run has no setup flow, and a missing credential
59is reported as an error that names the env var to set.
61## The shape of it
63Interactive TUI, a non-interactive eval mode, and a JSON-RPC stdio mode, over
64one agent loop (§1). Conversation history is a tree you can navigate, separate
65from a VCS-backed timeline of what your files looked like — moving through the
66conversation does not move your working copy, and vice versa. Mid-run
67corrections queue as steers rather than forcing a cancel.
69## Layout
71```
72smith/ shared types, StreamFn, AgentTool, config, Lua runtime
73smith-ai/ providers, auth, model registry, provider streams
74smith-core/ agent loop, sessions, tools
75smith-tui/ terminal UI
76smith-harness/ wiring, plugin management, the Lua SDK
77smith-cli/ the binary
78xtask/ custom build tasks
79```
81`docs/` holds project management rather than code: the specification, the
82invariants every contributor and agent follows, research notes, and execution
83plans. `prototypes/` holds disposable programs written to prove or disprove a
84specific spec claim (§18).
86## Building
88Cargo is the only build system for the Rust workspace — there is no Makefile,
89justfile, or script to learn, and anything cargo does not do natively lives in
90`xtask`:
92```sh
93cargo check
94cargo test
95cargo run -p xtask -- check # the full gate: fmt, clippy, tests, architecture
96```
98Smith tracks latest stable Rust on edition 2024. A pinned nightly is used for
99exactly one thing — the `cargo-pup` architecture gate — and never for product
100code.
102## Reading further
104- [`docs/SPEC.md`](docs/SPEC.md) — what to build. Canonical.
105- [`docs/PROJECT-INVARIANTS.md`](docs/PROJECT-INVARIANTS.md) — the rules that
106 do not bend without explicit approval.
107- [`docs/plans/AGENTIC-DEVELOPMENT.md`](docs/plans/AGENTIC-DEVELOPMENT.md) —
108 how Smith is developed, which is itself specified: the work is carried out
109 by agents against the spec, through the workflows in `.github/`.
110- [`CLAUDE.md`](CLAUDE.md) — the navigation index.
112Section marks above (§N) refer to `docs/SPEC.md`.