0290.
Bundled first-party plugin catalog
(edition = "2026")
- Status: Accepted (2026-11-26)
- Date: 2026-11-26
- Plan: Setup & Onboarding Task 03
(
plans/setup-and-onboarding/03-bundled-plugin-stdlib.md); amends 0089
Context
Under ADR-0089,
edition = "2026" embedded only 9 core plugins
(codec, show, args,
config, encoding, uuid,
sqlite, html, http) so the
default plugin index stayed within a 150-token prompt-overhead
cap.
However, the Tenon repository now ships 69 first-party plugins
(tui*, tty, agent*,
openai_chat, mcp*, proc*,
cli_ui, args_mcp, web,
hosting, hsyntax, tvc,
vcfs, fswatch, obs,
zlib, sha256, entropy,
wallclock, harness_*,
script_host, a2a, json,
cli, and agent). External applications
(tenon-dev-mcp, coding-harness-2,
snake-tui, and user projects built outside a
tenon checkout) previously had to clone the
tenon repository or hardcode relative paths such as
path = "../tenon/plugins/tui".
Decision
- Two-tier edition catalog: Split
edition = "2026"into two explicit tiers while keeping{ edition = "2026" }as the single manifest syntax (zerotenon.tomlgrammar churn) andsource = "edition:2026"+ content tree hash intenon.lock:- Tier 1 (
Tier::Core, 9 plugins):codec,show,args,config,encoding,uuid,sqlite,html,http. Exposed viaeditions::core_members("2026")andtenon plugins index --core. Preserves ADR-0089's ≤150-token prompt-overhead cap sorun_t1.pyand prompt builders are unaffected. - Tier 2 (
Tier::Bundled, all other ship-readyplugins/*): Embedded at compile time via a deterministiccrates/tenon/build.rsscanner (OUT_DIR/bundled_plugins.rs) and classified into deterministic categories (core,cli,tui,agent,mcp,proc,web,system,vc).
- Tier 1 (
- Build-time dependency normalization:
Intra-repo relative path dependencies
(
dep = { path = "../<bundled_dir>" }) in embeddedplugins/*/tenon.tomlmanifests are rewritten at embed time todep = { edition = "2026" }(matching the target package's[package].name, includingagent_platformfor../agentandcli_platformfor../cli). Fetchingtui = { edition = "2026" }ormcp = { edition = "2026" }outside thetenonrepository pulls only the transitive bundled dependencies cleanly throughpackages.rswith zero filesystem references to the compiler source tree. - Directory-name aliases for discovery:
Platform packages whose directory name differs from
[package].name(agent→agent_platform,cli→cli_platform) remain strictly keyed by[package].namein manifests/locks (editions::member) whileeditions::lookupresolves either package name or directory name fortenon doc --card <name>andtenon plugins docs <name>. - Offline discovery CLI:
tenon plugins index [dir]shows declared/installed plugins plus Tier 1 core members and a 1-line discovery footer (<N> bundled plugins available; run 'tenon plugins index --all' or '--category tui|agent|cli|mcp|web').tenon plugins index --coreemits only the ≤150-token Tier 1 core list.tenon plugins index --all | --category <cat> | --search <substr> [--json]queries the full bundled catalog from any directory without requiring atenon.toml.tenon plugins docs <plugin-or-file.tn>serves embeddedDOCS.mddirectly when given a bundled plugin name.tenon doc --card <plugin>automatically serves token-budgeted API cards for any bundled plugin from any directory.
Alternatives
- Separate
bundled = "2026"manifest syntax: Adds grammar and lockfile churn for no semantic gain over{ edition = "2026" }. - Materializing all 69 plugins unconditionally on
fetch: Bloats
.tenon/deps/for small projects instead of fetching only the transitive closure of declared dependencies. - Requiring a
TENON_PLUGINS_DIRenvironment variable: Breaks the single-binary self-contained distribution model.
Consequences
- The installed
tenonbinary is 100% self-contained (~2.8 MB of embedded.tn/.toml/.md/.hsources) for building CLI, TUI, MCP, Agent, Web, and System apps from any directory offline. - ADR-0089's ≤150-token core prompt index invariant is preserved and enforced by unit tests.
- Embedded tool launchers (
procman,agentd,forge) cross-check their embedded plugin sets against the bundled catalog in unit tests to catch transitive dependency drift early.