On this page

Tenon Build Plan Archive (M0–M29)

Archived 2026-11-29 from root PLAN.md (IDE-12). Reconciled shipped checkboxes (M0.12, M14.12, M22.7–M22.9, M28.1–M28.6). Active milestones (M30+), the formal M31+ additive feature freeze, and Wave 2 consolidation live in PLAN.md.


Tenon build plan

The source of truth for what to build, in what order, and how we know each piece works. AGENTS.md says how to work; docs/design-review.md and docs/decisions/ say why. Run make status to see where the project stands and make next for the next task.

How to read this plan

Legend: - [ ] open, - [x] done, ~~struck~~ dropped (with a one-line reason).

Principles

  1. Walking skeleton first. A program runs end to end in M1; every later milestone widens a path that already works.
  2. Always green, always tagged. Every commit passes make check; every working chunk becomes a checkpoint tag you can return to.
  3. The kernel holds mechanisms; plugins hold policies (ADR-0004). Build features as if they were plugins even before the plugin machinery exists.
  4. Design for zero training data (ADR-0009). Familiar syntax, a spec that fits in a prompt, diagnostics that teach.
  5. Emit C first; the interpreter is the reference (ADR-0003).
  6. Immutable semantics, mutable implementation (ADR-0007). Scoped arenas, no garbage collector.
  7. Measure before optimizing. No optimization lands without a benchmark that shows the need.
  8. Agents are values, not processes (ADR-0010).

Milestone map

Milestone Goal Checkpoints Gate
M0 Repository, gate and agent setup CP-0.1 make check green; scripts tested end to end
M1 Walking skeleton: hello and fib compile to C and run CP-1.1, CP-1.2, CP-1.3 golden programs pass; fib(30) matches Python
M2 Static types, diagnostics and formatter CP-2.1, CP-2.2 every program type-checks; formatter idempotent; T0 recorded
M3 Typed IR, reference interpreter, differential testing CP-3.1, CP-3.2 interpreter and C backend agree on every program
M4 Records, unions, match, generics, interfaces, results CP-4.1, CP-4.2, CP-4.3 exhaustiveness, ? and coherence tested
M5 Memory model: arenas, strings, vectors, blocks CP-5.1, CP-5.2, CP-5.3 107 MB CSV run peaks under 110 MB; carry appends are O(1)
M6 cli platform v0 and the first real tools CP-6.1, CP-6.2 tools byte-identical to Python, faster, peak memory reported
M7 LLM authoring: spec, idioms, diagnostics, transfer benchmark CP-7.1 spec at or under 6,000 tokens; T1 baseline recorded
M8 Performance pass with Go and Rust baselines CP-8.1 workload-class targets measured
M9 Modules, packages and plugins v1 CP-9.1 to CP-9.4 three real plugins per extension point before it freezes
M10 Platforms as plugins, capabilities, sandboxed processes CP-10.1, CP-10.2 cli rebuilt as a plugin with no regression; sandbox escapes fail
M11 Deterministic data parallelism CP-11.1 identical output for 1 to N threads; speedup measured
M12 agent platform v0 CP-12.1 to CP-12.3 fake-adapter scenarios and crash-point tests pass
M13 Agent density CP-13.1 density targets met or explained
M14 Harness² coding harness CP-14.1 to CP-14.3 $0 efficiency gate; capped live loop; gain reported
M15 Distribution and interop CP-15.1 to CP-15.3 static binaries on three OSes; FFI and wasm-host tested
M16 1.0 hardening CP-16.1 kernel spec frozen; security review done

The walking skeleton is deliberately crude: it compiles straight from the AST to C with no type checker (ADR-0011). M2 adds types and M3 replaces the AST-to-C path with the typed IR. Tag cp/1.2-fib keeps the crude version reachable for comparison.

Parallel tracks sit after Appendix C and are not part of the ordered M0–M16 table: M17 local version control, M18 agent tooling, and M19 the procman TUI process manager (plan, ADR-0267); M20 language spikes; M21 language for apps, M22 isolation and runtime plugins, M23 the single-box web and server stack (ADRs 0275–0282, accepted 2026-11-22).


M0 — Repository, gate and agent setup

Goal: a repository where any agent can make a safe, verifiable change and record a checkpoint. Scope: git, instructions, scripts, Rust workspace stub, CI. No language features.


M1 — Walking skeleton

Goal: tenon run hello.tn prints hello, world. Then integers, functions and loops, so fib runs. In scope: one source file; fn, let, var, assignment, if/else, while, break, continue, return; integers and booleans; print/println of an integer or a string literal; arithmetic, comparison and logical operators; // comments. Type annotations are parsed but not yet checked. Out of scope: type checking (M2), string values (M5), modules (M9), any optimization. Pipeline: source → tokens → AST → C → cc → executable. No IR yet (ADR-0011).

Experiments from CP-1.2: tcc-run (TinyCC in-process for tenon run: does edit-to-run latency drop enough to justify bundling it?); c-ast (emit C through a small C AST instead of strings: simpler and safer?). Risk: building a "proper" architecture inside M1. Resist it; M3 replaces the backend path anyway.


M2 — Static types, diagnostics and formatter

Goal: every program is type-checked before code generation, and one formatter defines canonical source. In scope: name resolution; i64, bool, str (literals and interpolation only), unit and function types; type errors with fixes; formatter; diagnostics registry; a first model smoke test. Out of scope: user-defined types (M4), building strings (M5).

Experiments from CP-2.1 (resolved by T0, ADR-0019): let-mut keep var; interp-syntax keep {x}.


M3 — Typed IR, reference interpreter and differential testing

Goal: one typed IR that both backends consume, and an interpreter that defines what programs mean.

Experiment from CP-3.1: ssa (is an SSA control-flow graph worth its cost over the structured IR?).


M4 — Records, unions, generics, interfaces and results

Goal: the data-modelling core real programs need.

Experiment from CP-4.1: union-layout (a tagged C union or one struct per variant?).


M5 — Memory model

Goal: dynamic data with no garbage collector, and memory use you can predict and measure.

Experiments from CP-5.2: perceus-rc (does reference counting with reuse beat arenas alone for large persistent values?); arena-va (reserved address space or chunk lists?).


M6 — cli platform v0 and the first real tools

Goal: useful command-line tools written in Tenon that beat Python with byte-identical output.

Experiment from CP-6.1: mmap-threshold (where does mmap beat read, by file size and file count?).


M7 — LLM authoring: spec, idioms, diagnostics and transfer

Goal: measure, then improve, how well models write Tenon from documentation alone.

Gate: spec within budget; T1 baseline recorded; kernel surface syntax frozen, or changed by ADR.


M8 — Performance pass

Goal: hit the workload-class targets and know where Tenon stands against Go and Rust.

Gate: text-heavy work 2–6× faster than Python, byte loops 20–60×, map-heavy work at least 2.5×, startup about 10×; Go and Rust ratios reported (within 2× of Go is the target, not yet a promise).


M9 — Modules, packages and plugins v1

Goal: the plugin architecture working on real plugins (ADR-0004, ADR-0006).


M10 — Platforms as plugins, capabilities and sandboxing

Goal: cli becomes an ordinary plugin; authority can be narrowed, and it stops at the sandbox.


M11 — Deterministic data parallelism

Goal: use every core in CLI tools without giving up deterministic output.


M12 — agent platform v0

Goal: agents as step(state, event) state machines on a platform plugin, tested against deterministic fakes before any real provider.


M13 — Agent density

Goal: thousands of agents per process, measured against explicit targets (ADR-0010).


M14 — The Harness² coding harness

Goal: the flagship app: recursive agent-harness improvement (Harness²) as a Tenon program on the agent platform. Where: the app lives in its own repo (~/Programming/coding-harness, package coding_harness). An independent evaluator lives in ~/Programming/coding-harness-evals. Platform tasks land here. Plan and rationale: plans/harness2/PLAN.md, owner-approved 2026-11-03. It covers the reference's schedule and scoring, the deliberate deviations, and evaluation on this Mac with deepseek/deepseek-v4.1-flash-1017 through OpenRouter under a ~$1 cap.

Owner requirement, 2026-11-08 (Maintainer): “the harness 2 should have the tenon MCP built in.” “The tenon MCP” means tenon-lang/tenon-dev-mcp, the maintainer's Tenon-language development MCP server, whose public tools are search_tools and action. It does not mean a commercial Tenon product. Inspection baseline: server main 0ea8c77, TENON_PIN 71edc08f4208be7d8b7bede07877ea28a1129bc1.

The requirement is direct: coding-harness must have built-in executor-client access to the maintainer's harness-dev-mcp, preserving its search_tools and action tools. The only remaining owner clarification is which milestone/task carries the client integration and who owns its deployment.

This conflicts only with the current Harness² v0 non-goal excluding MCP tools in the executor. Exposing coding-harness itself as an MCP server is a separate optional capability, not required or equivalent. Do not silently remove the executor exclusion or treat M13.3/M15.6 completion as proof of application integration. See the bounded follow-up proposal in plans/harness2/PLAN.md. M14.7 implements manifest compatibility only.

Finish line (CP-14.3):

  1. At $0 with scripted replies, our probes send a smaller fixed prefix and use less memory than an OpenCode probe on the same tasks, and idle-agent memory stays under ADR-0122's ceiling of 28,672 B per agent (spawn and fork times are reported, not gated).
  2. A K=1 step completes live on at least 6 scored tasks within the cap.
  3. Per-task gain and absolute scores are reported. Parity with the paper is recorded as UNVERIFIED unless enough tasks run.

Phase 0: platform, in this repo, after CP-13.1

Phase A: app foundations, in coding-harness

Phase B: one agent on one task

Phase C: the step

Phase D: evals and evaluation

Experiment from CP-14.2: late-guidance (does placing probe-varied guidance after the cached prefix keep its effect while raising cache hits?).


M15 — Distribution and interop


M16 — 1.0 hardening


Cross-cutting tracks

These run through every milestone rather than being separate tasks.

Deferred until a measurement asks for them

Relative references and persistent arenas · variable-size packed unions · small-string optimization · an LLVM backend · a JIT · user-facing SIMD · reducer transition tables · A2A beyond the adapter · self-hosting (ADR-0176).

Parking lot

Ideas outside the current milestone go here, one line each with a date, instead of into code.

Early measured performance round (owner-requested 2026-10-30)

Maintainer requested round 1 before M2.6 and the normal M6/M8 sequence to establish reproducible correctness-gated benchmarks and measure the observed print overhead and quadratic compiler paths before investing in optimizations. The agreed PERF-PLAN.md schedules the benchmark harness under M6.8, runtime print work under M8.5, and compiler work under M8.7; these are partial contributions and their task boxes remain open. The first run adds only the benchmark harness and baseline, without compiler or runtime optimizations. Future optimization commits require before/after measurements and unchanged semantics, goldens and trap locations. Items 5–6 (cgen string churn and the expression span table) target temporary code M3 replaces; keep that work minimal. The benchmark harness and runtime print work survive M3. This owner-approved scheduling exception does not complete M2.6 or otherwise reorder the milestone plan.

Open decisions

Decision Default until decided Decided by
Final language name and file extension Tenon, .tn M0.9
License Decided: MIT (LICENSE) M0.10
var or let mut for reassignable locals Decided: var (ADR-0019) M2.6 (T0)
Interpolation syntax Decided: {x} (ADR-0019) M2.6 (T0)
Bootstrap compiler language Decided: Rust through 1.0 (ADR-0176) M16.5
Pinned Rust version Pinned: 1.92.0 (ADR-0155, pending confirmation) M0.7 (macOS gate)
Parameters are assignable although the spec says only var locals are keep accepting assignment; regions home it at function level M5.3
Stack exhaustion semantics: native code segfaults (exit 139) and loses buffered stdout; tenon interp flushes and exits 2 at its depth limits unspecified, no golden M5
M14 finish line Decided: three-part gate ($0 efficiency, capped live loop, gain reported) (plan); fork cost is gated on ADR-0122's density ceiling, not the deferred M13.4 targets owner, 2026-11-03; fork cost 2026-11-04
Harness² v0 editing scope always-on files and SKILL.md text only; code components after CP-14.3 M14.7
Evals repo location ~/Programming/coding-harness-evals M14.20
DeepSeek reasoning setting Decided: none (lowest setting that passed the tool-call check; reasoning text never sent back) M14.5
Pinned OpenRouter provider Decided: Morph morph/fp8 (tools, reports cached tokens, $0.022/M input). Relace relace/fp4 passed the tool-call check at none but rate-limited the prefix (HTTP 429). M14.5
Procman secrets policy Decided: separate procman policy (explicit env, .env files, log redaction mask); do not reuse agent Host.secret Maintainer, 2026-11-21 12:37 PM MST
Procman app name and location Decided: examples/tools/procman Maintainer, 2026-11-21 12:37 PM MST
Procman CLI command shape Decided: tenon procman serve / attach / start / stop / status / restart Maintainer, 2026-11-21 12:37 PM MST
Procman gate harness for pure Tenon Decided: a small Rust module runs the pure core in-process in make check Maintainer, 2026-11-21 12:37 PM MST

Appendix A — Coverage of the design review

Every decision and gap in the design review maps to plan items below. If you change one side, update the other.

Review item Plan items
Structure and plugins
Split decisions into kernel, core plugins, platforms and ecosystem ADR-0004, M9, M10
Kernel holds mechanisms only ADR-0004, M3.6, M10.5
Platforms as an extension point (cli, agent, wasm-host) ADR-0005, M6.1, M10.1–M10.2, M12, M15.3
No grammar plugins; DSLs through generators ADR-0006, M9.5
Five extension points M9.10
Whole-program coherence and bridge plugins M4.7, M9.4
Per-item interface hashes and compatibility check M9.3
Process plugins through the lockfile M10.6
Discovery index and 1,500-token docs M9.7
Generated code as readable files M9.5
Requirements before agent plugins join an edition M9.9, M15.5
Wasm inside wasm-host M15.3
Capabilities make imports safe; they stop at exec M6.1, M10.3, M10.4
Pluggable programs (static, process and Wasm plugins) M9, M10.6, M15.3
Zero training data
Syntax by transfer ADR-0009, M2.6, M7.6
Token-budgeted spec M0.5, M7.1
Teaching diagnostics M1.9, M2.5, M7.3
One idiom per task M7.2
Text edits, replace-by-name, compiler rename M7.4
Transfer benchmark before syntax freezes M2.6 (T0), M7.5 (T1)
Language semantics
Small core of orthogonal concepts M7.1 budget; scope notes per milestone
Immutable values over mutable storage ADR-0007, M4.2, M5.2–M5.6
First-order functions and non-escaping blocks M1.7, M5.5
Monomorphized generics M4.4
Nominal interfaces, no trait machinery M4.7
Generators with a fixed trigger syntax M9.5
Defer async/await; actions and events M12.1–M12.2
No shared mutable state; left-to-right evaluation M1.6, M11.1
Exhaustive matching M4.3
Opaque IDs, interning, with updates M4.2, M4.6, M9.1
while and loop allowed M1.7
?, result, no exceptions or implicit conversions M4.5, M5.7
Fuel as platform policy M3.6, M10.5
Memory and representation
Scoped arenas and lifetime classes M5.1–M5.2
Destination passing as a guarantee M5.6
Hidden builders sealed into values M5.3–M5.4
No GC; counting only for large persistent values ADR-0007, perceus-rc experiment
O(1) appends to unique carry state M5.4
Escape analysis M5.2
No scalar-replacement or update-fusion passes M8.4
Compact values; small strings deferred M4.1, Deferred list
Chunked streams, slices and views M5.3, M6.2
Streaming input; mmap with a SIGBUS policy M6.2
Reserved address ranges M5.1, arena-va experiment
Relative refs, persistent arenas, packed unions Deferred list
Tables and typed IDs for links; inductive recursion only through vec/map (ADR-0270) M4.6, M20.1
Insertion-ordered maps M6.6, M8.6
Compiler and backend
Typed IR from the start M3.1–M3.3
C first, plus a fast dev path ADR-0003, M1.5, M8.7, tcc-run experiment
The interpreter's production duties M3.4, M9.5
No VM bytecode tier ADR-0003
Differential tests against the C backend M3.5
Near-zero startup M1.5, M6.8
Whole-program for release, per-module for dev M8.7
No custom inlining, jump tables or loop shaping M8.4
Bounds and overflow checks removed from facts, reports, checkfree M8.3
Byte-class tables and branchless lowering M8.2
Runtime library as the CLI performance surface, SIMD inside M8.5
Reducer tables only after profiling Deferred list
Several C compilers in CI; no LLVM or JIT yet M0.7, M8.4, Deferred list
Data, schemas and wire formats
The type is the schema; projections are generators M9.5–M9.6, M12.5
Fused parsers with no DOM M9.6
JSON at boundaries, binary inside M9.6, M12.7
Duplicate keys, unknown fields, explicit wire integers M9.6
Provider projections and capability errors M12.8
Content-addressed caching M9.3, M12.9
Effects and the agent runtime
step(state, event) with actions M12.1
The runner owns authority M12.2
Action and attempt IDs; unknown outcomes M12.7
Outbox, snapshots and durability classes M12.7
Streams, backpressure, UTF-8 and partial JSON M12.4
Budgets M12.6
Cancellation as several facts M12.2
Child tasks with budgets and narrowed capabilities M12.2, M12.6, M13.2
MCP, A2A and provider adapters M12.8, M13.3, M15.6
Fake adapters and crash-point tests M12.3, M12.7
Security and authority
Capabilities passed and narrowed M6.1, M10.3
Model output as a proposal M12.5
SecretRef and scoped network grants M12.5
Validation, authorization and acceptance kept apart M12.5, M14.13
Sandboxed subprocesses M6.5, M10.4
Trusted tier with human review M9.9, M15.2, M16.3
Authoring, tooling and context
Canonical formatting M2.4
Readable syntax decided by measurement M2.6, M7.6
Edit tools and revision preconditions M7.4
Type-check the whole edited candidate M2.2, M7.4
Context by relevance M7.4, M12.9
Cache-aware context ordering M12.9
Tokens per accepted task and first-compile rate M2.6, M7.5, M9.8
Measurement
Python baselines, byte-identical output, peak memory M6.8
Go and Rust baselines M8.1
Bytes copied, lifetimes, replay cost, stream high-water M5.2, M5.6, M12.4, M12.7
Expectations by workload class M8 gate
Agent-density benchmarks M13.4
Scope and sequencing
Kernel and cli first; agent second milestone order M1–M8, then M12
Only IR-shaping performance work early M3, M5
One provider first M12.8
Gaps
Strings, bytes and paths M5.3, M6.4
Subprocesses and pipes M6.5, M10.4
Data parallelism M11
FFI M15.2
Build speed M8.7
Debugging and profiling M1.10, M15.4
Distribution M15.1
Testing M1.1, M3.5, M16.2
Package registry M15.5
Agents and Harness²
Agents as values ADR-0010, M13.1
Shared context and prefix caching M12.9
Shared tools and copy-on-write workspaces M13.2–M13.3
Density targets M13.4
The Harness² loop M14

Appendix B — Conventions

Thing Format Example
Task ID M<milestone>.<n> M1.4
Checkpoint ID CP-<milestone>.<n> CP-1.2
Checkpoint tag cp/<milestone>.<n>-<slug> cp/1.2-fib
Experiment branch exp/<milestone>.<n>/<name> exp/1.2/tcc-run
Archived experiment archive/exp/<milestone>.<n>/<name> archive/exp/1.2/tcc-run
Parallel task branch task/<id>-<slug> task/M4.6-newtypes
Commit subject type(scope): summary feat(parser): parse while loops
Commit trailers Plan:, Checkpoint:, Experiment: Plan: M1.7
ADR file docs/decisions/NNNN-slug.md 0012-core-ir.md
Diagnostic code E plus four digits, ranges per phase E0301
Benchmark results bench/results/cp-<id>.md bench/results/cp-6.2.md

The full rules are in AGENTS.md.

Appendix C — Definition of done

A task is done when:

  1. Tests exist that fail without the change, and they pass.
  2. make check is green.
  3. The spec and the diagnostics registry are updated if anything user-visible changed.
  4. The task's box is ticked, and the commit carries its Plan: trailer.
  5. The diff contains nothing unrelated.
  6. If the task completes a checkpoint, make checkpoint has been run.

M17 — Local item version control (parallel track)

Implementation authority: user request of 2026-11-05. Design task aliases M-VC.k map to M17.k; foundation M-VC.0 is included in M17.1. Detailed scope, dependencies, task status and evidence are maintained in plans/vc/MASTER_TASK_LIST.md, design, task briefs, and format contract.

Tenon VC rewrite and remotes (authorized 2026-11-17; ADR-0265). Steps are informal IDs from PLAN-vc-remote §4, which holds each step's scope, sizes and acceptance. Commits use Plan: M17.<n>.

M18 — Agent tooling (sequential feature delivery)

Implementation authorized November 5, 2026. Ledger: agent tooling. Each repository task ends its session with a gate, commit and handoff.

M19 — Procman TUI process manager (parallel track)

Planning approved by maintainer 2026-11-21. A daemon owns services and a TUI attaches over a Unix socket; the supervisor is the new FFI plugin plugins/proc (ADR-0267). Scope, sizes, dependencies, acceptance and test placement for each task are in plans/procman/PLAN.md §7; D1–D3 and Q1 were decided 2026-11-21 (see §6 and the open-decisions table). Q2–Q6 remain open. No task edits frozen files; no task adds an E-code unless a compiler diagnostic is required (then from E1100). C first; M19 needs interpreter parity and Linux/macOS evidence to finish.

M20 — Language spikes (parallel)

Spikes that unblock AI-app data shapes without waiting on M16 hardening. Each task keeps make check green and does not edit M14-frozen paths.

M21 — Language for apps: modules, strings, closures, in-place state (parallel)

Accepted 2026-11-22: ADR-0279, ADR-0276, ADR-0275, ADR-0278. Frozen-file edits are approved only for the paths each ADR lists. FMT_VERSION stays 1.

M22 — Isolation and runtime plugins (parallel)

Accepted 2026-11-22: ADR-0277, ADR-0280. Frozen-file edits are approved only for the paths each ADR lists.

M23 — Single-box web and server stack (parallel)

Accepted 2026-11-22: ADR-0281, ADR-0261 with the web toolkit plan, ADR-0282. Batteries (ADR-0272/0273) are tracked separately.

M24 — TUI agent surface (parallel)

Ledger: plans/tui-agent-surface/PLAN.md. Waves 1–2 of plans/tui/IMPROVEMENTS.md.

M25 — Agent velocity & self-hosting (parallel)

Accepted 2026-11-25 (master plan, ADR-0284). Tracks tenon-main deliverables alongside open M21/M22/M24 tasks and companion repos tenon-dev-mcp and coding-harness-2-compact-tui.

M26 — Terse UTF-8 surface, ergonomic frontend sugar & semantic auto-fix (parallel)

Accepted 2026-11-28: ADR-0314, ADR-0315.

M27 — Core IR Iterator Fusion, SWAR SwissTable & Profiler

M28 — Single-file scripts, implicit derives & stdlib batteries (parallel)

Accepted 2026-11-28: ADR-0318, ADR-0319.

M29 — Purity/authority badges & capability trace replay (parallel)

Accepted 2026-11-28: ADR-0320, ADR-0321.