On this page

0290. Bundled first-party plugin catalog (edition = "2026")

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

  1. Two-tier edition catalog: Split edition = "2026" into two explicit tiers while keeping { edition = "2026" } as the single manifest syntax (zero tenon.toml grammar churn) and source = "edition:2026" + content tree hash in tenon.lock:
    • Tier 1 (Tier::Core, 9 plugins): codec, show, args, config, encoding, uuid, sqlite, html, http. Exposed via editions::core_members("2026") and tenon plugins index --core. Preserves ADR-0089's ≤150-token prompt-overhead cap so run_t1.py and prompt builders are unaffected.
    • Tier 2 (Tier::Bundled, all other ship-ready plugins/*): Embedded at compile time via a deterministic crates/tenon/build.rs scanner (OUT_DIR/bundled_plugins.rs) and classified into deterministic categories (core, cli, tui, agent, mcp, proc, web, system, vc).
  2. Build-time dependency normalization: Intra-repo relative path dependencies (dep = { path = "../<bundled_dir>" }) in embedded plugins/*/tenon.toml manifests are rewritten at embed time to dep = { edition = "2026" } (matching the target package's [package].name, including agent_platform for ../agent and cli_platform for ../cli). Fetching tui = { edition = "2026" } or mcp = { edition = "2026" } outside the tenon repository pulls only the transitive bundled dependencies cleanly through packages.rs with zero filesystem references to the compiler source tree.
  3. 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].name in manifests/locks (editions::member) while editions::lookup resolves either package name or directory name for tenon doc --card <name> and tenon plugins docs <name>.
  4. 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 --core emits 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 a tenon.toml.
    • tenon plugins docs <plugin-or-file.tn> serves embedded DOCS.md directly when given a bundled plugin name.
    • tenon doc --card <plugin> automatically serves token-budgeted API cards for any bundled plugin from any directory.

Alternatives

Consequences