WRITING · ESSAY 05 · 2026-10-25
Ideal tooling infrastructure: choosing and building tools
Tool and language choice are architecture decisions, not preferences. The substrate follows the workload; identity never picks it.
Tool choice is an architecture decision
The thesis, stated plainly: tool and language choice are architecture decisions, not preferences. The substrate follows the workload; identity never picks it. I have Rust, TypeScript, and Python in production, and I did not pick them; the workloads did. What I picked, once, is the decision procedure that assigns them.
This essay is that procedure, the figures it produced, and the one decision I got wrong for months.
The decision procedure
Every substrate choice in the fleet answers four questions, in order:
- What does the workload do when it fails? Long-running autonomous loops need failures that are loud and typed. Rust's error model (no nil, no silent exceptions, the compiler refusing to ship an unhandled case) is not an aesthetic preference here; it is the difference between a loop that halts with a report and a loop that limps on producing garbage.
- What is the memory budget? On a $20/year VPS the budget is measured in megabytes, and a runtime that wants a garbage collector per instance loses to a static binary per capability.
- What does the interface surface need to be? Agent-facing tools live behind MCP and CLI; both need schema discipline, and the schema cost is itself a budget line (numbers below).
- Who maintains it after the build? Solo operation means the substrate must be maintainable by one person with AI augmentation, which penalises cleverness and rewards boring, explicit code.
Substrates get assigned per project by those answers, never by what I feel fluent in. The consequence is visible in the fleet: Rust where failure semantics and memory dominate, TypeScript where the surface is an API contract, Python where the work is analytics and glue.
The Rust side: three measurements
Three production systems carry the Rust argument, and each one earns its substrate with a number you can check.
operant, the terminal-native agent runtime: 7 workspace crates (the manifest is the record; the workspace consolidated from 18 in October), 390,981 lines of Rust under crates/ with 4,381 vendored lines printed separately, 4,959 static test attributes, a gate that ran 7,168 tests with zero failures at its pinned commit, llama.cpp integration, and MCP, REPL, and TUI interfaces over one core. The all-Rust choice is what makes the local-first claim structural rather than aspirational: nothing in the runtime requires a cloud round trip, so the privacy property survives every refactor by construction.
deckmill, the slide renderer: 27,383 lines of first-party Rust and 203 static test attributes (re-counted 2026-10-25, methods in the register), zero browser dependencies, with WCAG-AA contrast validation inside the render path. The last one is the substrate argument in miniature: a browser-based renderer validates contrast after the fact, in review; a renderer you own validates before emission and refuses to produce the defective artifact. Owning the substrate moves the check from review to construction.
sourcehound, the intelligence gatherer: a single static binary, roughly 7MB, holding roughly 5MB resident when idle, exposing 23 tools counted from the binary registry and pulling from a catalog of 454 sources across 22 pools (421 active), read from the running binary on 2026-10-25. Zero API keys. The zero is the design: a metered dependency is a hard cap on how much an autonomous loop can do, so the tool authenticates as little as possible and scrapes what it can.
The cost arithmetic the procedure produces
The archetype readers of this essay want the tradeoff data, not the vibe, so here is the intelligence-gathering economics in one table, with the sources named:
| Option | Cost shape | Per autonomous loop |
|---|---|---|
| Tavily | $0.008 per credit, metered | A 20-source recon pass burns credits every run, forever; the cap is the meter |
| Firecrawl | $16 to $399 per month, tiered | The tier caps pages and rate; scaling the loop means scaling the bill |
| sourcehound | $0 marginal, 7MB binary, ~5MB resident | The cap is the host, and the host is already paid for |
The per-loop column is the one that matters. An agent loop that gathers twenty sources per run runs a hundred times a day on the third row's economics and cannot on the first two. That is not a statement about the vendors' engineering; it is a statement about the shape of metered dependencies inside unbounded loops.
The same arithmetic shows up on the rendering side. A headless Chromium costs several hundred megabytes of image and a few hundred megabytes of RAM per instance before it draws anything; deckmill draws from a binary that is already resident for other work. The renderer's marginal cost per slide is rounding error; the browser's is a line item.
The TypeScript and Python side, argued the same way
The Rust argument would be identity if everything were Rust. It is not, and the exceptions prove the procedure.
TypeScript carries the surfaces where the contract is the product: web APIs and the sites that present the fleet's output, including the one rendering this essay. The reasoning is question two and four from the procedure: the interface is HTTP and DOM, the ecosystem's typing discipline gives the contract a compiler, and the maintenance surface (one person plus AI augmentation across many small apps) rewards a language where the framework carries the boring 80 percent. Nothing here needs the error semantics of a daemon, so Rust would be paying Rust costs for no Rust benefit.
Python carries analytics and glue: the measurement passes behind this site's figures, the data chores over the ledgers, the one-off scripts that never live long enough to deserve a compile step. Its failure semantics are the weakest of the three, and the procedure accepts that explicitly where the workload's failure mode is "the script prints an error to me, the operator, right now" rather than "the unattended loop limps on at 03:00". Matching the language's tolerance to the failure's audience is the whole game.
The dual surface: MCP and CLI, split by audit
Every capability in the fleet ships two faces: an MCP server for agent sessions and a CLI for operators and scripts. That is not duplication for its own sake; it is the token audit's output.
The audit measured what an agent session actually pays for tool access: schemas loaded per tool, and the total for a session that loads everything. The full-load figure (21.8k tokens of schema surface) is the cost of promiscuous registration: every tool the server could offer is a tool the session carries whether or not it needs it. The fleet's answer is contextually relevant registration: a server exposes only the tools the session's role needs, everything else stays reachable through the CLI, where schema cost is zero because there is no model in the loop. The lean end of the spectrum is named in the register: the agent-memory server registers 7 tools at roughly 121 tokens per tool.
The pattern has a property beyond the savings: the CLI face is the debugging surface. When an agent misuses a tool, the operator reproduces the call in the CLI at human speed, with the same schema, the same validation, and no session overhead. One capability, two faces, one contract.
The cost of the wrong substrate: a removal story
The clearest evidence for the procedure is a failure, and it cost me months.
I built a custom memory infrastructure, tdg-rust: a cognitive memory engine exposing its surface over hybrid FTS5 and vector search, 47,064 lines and 648 static test attributes as measured last week. The design assumption was that retrieval quality is a data-structure problem, and I wanted retrieval that was typed, exact, and mine.
In practice it never met expectations against the workloads the agent actually runs. Worse, it sat between the agent and its context: every session paid the integration tax of a bespoke system before it read a byte of memory. I removed it. The replacement is agent-memory, and the honest label is that the decision was qualitative at replacement time (latency and recall against expectation, not a captured benchmark), so I state it as that rather than retrofitting a benchmark after the fact.
The number that does exist is the tool-surface audit of 2026-08-26. The replacement's 7-tool server at ~121 tokens per tool against the fleet's 21.8k full-load reality is the budget lesson the months of building taught. The thing I spent months building was also, indirectly, the thing that taught me what the budget actually was.
The general lesson has two halves. Refinement reversals are cheap and frequent: sourcehound went from news-scraping to a total web-search and browser-navigation interface without drama. A true reversal is the one that discards built work. When the measurement, or the honest absence of one, says the substrate is wrong, discard it early. The months are sunk; the sessions it slows down are not.
One substrate, one update path
The quieter benefit of the capability taxonomy is operational: one runtime, one credential store, one output contract, one update path. The fleet's CLIs update through one mechanism; a credential rotates in one store; the output contract changes once and every consumer sees the same change. The alternative shape, a separate stack per platform, multiplies every one of those into the number of platforms, and each multiplication is a place where drift accumulates.
That is the answer to the most common objection to building native tools at all: "why not just use the SaaS?" Because the SaaS's update path, credential store, and cost meter belong to the vendor, and an autonomous loop that depends on all three does not belong to you. The taxonomy keeps the capability while keeping the substrate.
What I would check before trusting this
The register behind this site carries every figure above with its method and date: the manifest count for crates, the grep pattern for test attributes, the binary registry for tool counts, the audit for schema cost. Two of the numbers are deliberately not reproducible from outside (the tool-surface audit and the catalog run on a private host), and the register says so instead of pretending. The test attributes are static counts, labelled static, and runner output replaces them at publication. If you want to falsify any of this, clone the public repos and run the same commands; the methods are written down, which is the whole point of writing methods down.
The substrate follows the workload. The identity follows nothing.
The audience contract this was written under
Written for
- Skeptical Senior Infra Engineer
Has to hit
- Concrete benchmarks with numbers
- Cost and latency tradeoff data
- Failure postmortems and what broke
- Protocol and gateway architecture deep dives
Rejected if it
- Buzzword-dense posts with no artifacts
- Tool marketing disguised as insight
- Tutorial-level content pitched at beginners
Figures in this essay: 10, each linked inline to the measurement record with its method and date.