ADR-0311:
One-Command Black-Box Binary Certification
(tenon validate-app)
- Status: Accepted
- Date: 2026-11-28
- Wave: Wave 4 (Rank 6 / Idea #39)
- Related: ADR-0271 (MCP dual-era 2026-07-28 /
2025-11-25), ADR-0291 (Freeze Rust, Grow in Tenon), ADR-0292
(Application Actions API), ADR-0305 (Declarative
app_hostRunner), ADR-0306 (Live App Bus)
Context
Tenon applications expose multiple surfaces simultaneously—CLI,
headless Actions API, dual-era MCP stdio (2026-07-28
and 2025-11-25), and Unix-socket live-bus leases
(app_bus). Historically, verifying that a compiled
Tenon binary obeys every agent-readiness invariant (clean exit
codes, ANSI-free piped output, schema validity, secret redaction,
MCP framing limits, approval refusal, and signal hygiene) required
ad-hoc manual commands or bespoke integration harnesses.
Per ADR-0291 ("Freeze Rust, Grow in Tenon"), new developer
workflows should be authored as pure .tn bundled CLI
tools in examples/tools/ rather than expanding the
Rust compiler binary.
Decision
Introduce
tenon validate-app <dir_or_bin> [--json],
implemented as a pure Tenon bundled CLI application in
examples/tools/validate-app/ (probes.tn,
report.tn, main.tn,
unit.tn) using edition = "2026" plugins
(json, mcp, proc).
12-Point Agent-Readiness Certification Suite
Against a compiled binary (or a project directory containing
tenon.toml, built via
tenon build --dev), tenon validate-app
executes 12 automated black-box probes in
< 500 ms:
help_exit_0—--helpexits0with non-empty usage text.invalid_flag_exit_2—--tenon-invalid-flag-probeexits2with non-empty stderr.piped_no_ansi— Piped stdout (!is_tty) emits0raw CSI (\x1b[) or OSC (\x1b]) ANSI escape sequences.no_color_term_dumb—NO_COLOR=1andTERM=dumbemit0ANSI escape sequences.actions_state_valid—state(or MCPapp_statefallback for plain-text CLI hosts) returns validapp.actions/v1*JSON withrev >= 0(state_rev >= 0).actions_schema_valid—actions(or MCPapp_actionsfallback) returns validActionSpecentries whoseinput_schema_json/input_schemaall passmcp.wire.schema_supported.canary_secret_redacted— Canary secret (sk-live-CANARY-9f8e7d6c5b4a) injected via environment never leaks unredacted in stdout, stderr, or projected state.mcp_2026_roundtrip— MCP2026-07-28(server/discover+tools/list+tools/callapp_state) round-trip passes.mcp_2025_roundtrip— MCP2025-11-25(initialize+ping+tools/list) round-trip passes.mcp_oversize_rejected— A> 1 MiBsingle NDJSON line over--mcpis rejected cleanly with JSON-RPC-32600without crashing.headless_approval_refused— Headless invocation (act <name> {}) of anyrequires_approval: trueaction refuses execution and exits3.sigterm_clean_shutdown—SIGTERMagainst a live--mcpchild exits cleanly with0orphan child processes (proc.lib.group_alive == false) and0stale.sockleases in an isolatedXDG_RUNTIME_DIR.
Output & Exit Contract
- Default (human): Prints a per-probe
PASS/FAILtable with millisecond timings, exactrepro:commands for any failing probe, and a final12/12 PASS(or<N>/12 FAIL) summary line. --json: Emits atenon-validate-app-1JSON scorecard (schema,target,binary,passed,failed,total,ok,elapsed_ms,probes[]).- Exit codes:
0when 12/12 pass,1when any probe fails or target cannot be built/found,2on invalid CLI arguments.
Bundled Launcher Wiring
crates/tenon/src/validate_app.rs defines a
standard BundledAppSpec
(exec_replace: true, embedding
examples/tools/validate-app/{README.md,main.tn,probes.tn,report.tn,tenon.toml})
wired as a passthrough subcommand in
crates/tenon/src/main.rs, keeping zero Rust logic
beyond the cached launcher.
Consequences
- Any compiled Tenon app binary (including
plugins/app_host/example) can be certified for agent readiness in a single< 500 mscommand in local development or CI. - All 12 probe evaluators are pure functions in
probes.tn, enabling deterministic dual-backend unit tests (tenon teston both native C andtenon interp) alongside live black-box execution. - Zero Rust compiler/CLI surface expansion beyond the
declarative
BundledAppSpecpassthrough.