Skip to content

DEAD AIR 0.3.0: one Rust binary, Perennos Tempo integration, MCP tools and metrics - #5

Draft
Perennos wants to merge 7 commits into
mainfrom
claude/rust-core
Draft

Perennos wants to merge 7 commits into
mainfrom
claude/rust-core

Conversation

@Perennos

@Perennos Perennos commented Nov 6, 2026

Copy link
Copy Markdown
Owner

Summary

DEAD AIR is now a single Rust binary, dead-air, and the Python implementation is removed. Every command, flag, exit code, TOML key and on-disk state format is kept, so an upgrade keeps existing config and history.

  • Parity. init, status, validate, doctor, check, watch (--max-cycles N / --continuous), gui, failures, ack-delivery, with --json output in the 0.2.0 text form and exit codes 0/1/2/3/130/141/143. All the semantics the docs pin are kept: three independent conditions, UNKNOWN never LIVE, thumbnail-only degraded, the 100 ms prefix and gap rules, stable event IDs with at most three delivery attempts (0/30/120 s), exact-allowlist private targets, FFmpeg -tls_verify 1, and owned-child cleanup on Ctrl+C/SIGTERM.
  • Upgrade continuity is tested. A state file, status --json output and config written by the Python 0.2.0 release are checked in under tests/fixtures/. The Rust status output matches byte for byte apart from two added fields, the config fingerprints match (so stored samples stay fresh), and a Rust watcher recovers a Python-opened incident.
  • Perennos Tempo (opt-in, off by default). A [tempo] table and dead-air explain <incident-id>, plus a page button shown only when Tempo is enabled. It sends incident metadata only; a test asserts that URLs, stream ids, destinations and tokens never appear in the request. The brief and Tempo receipt id are stored and shown by status. Requests are never retried, and check, watch and status never contact Tempo, so alerts never wait on AI.
  • MCP server. dead-air mcp serves five read-only tools over stdio (deadair_status, deadair_incidents, deadair_incident, deadair_deliveries, deadair_sources), and dead-air tempo status|policy|mcp-config prints a secret-free client entry and tool-policy fragment. See docs/TEMPO.md.
  • Metrics. An opt-in [metrics] table makes watch serve Prometheus text on loopback (default 127.0.0.1:47825). A busy port warns and never stops monitoring.
  • Easy setup. install.sh / install.cmd (both with a dry run) download the release build and verify SHA256SUMS; with no release build they fall back to cargo install --locked, and without Rust they print the rustup line. No admin rights needed, and the desktop launcher is kept. CI runs on Linux, Windows and macOS; a tag-triggered release workflow builds five targets with first-party actions only.
  • Bug fixed along the way. In 0.2.0 the GUI's Start always refused once any watch had ever run, because it mistook the permanent .dead-air.lock guard for a live owner. Start now checks the real OS lock. Two Python GUI tests encoded that bug and were not ported.

User-visible changes are listed under 0.3.0 in CHANGELOG.md: no more python dead_air.py, the installer no longer creates a venv or installs yt-dlp, added JSON fields (briefs, incident_id, advice), non-ASCII hostnames must use the xn-- form, and multicast counts as private.

Testing

Run in a Linux container; the coordinator re-ran the first three independently.

  • cargo fmt --check: clean.
  • cargo clippy --all-targets --locked -- -D warnings: clean.
  • DEAD_AIR_REQUIRE_MEDIA=1 cargo test --locked: 217 passed, 0 failed, with real FFmpeg 6.1.1 and test-owned loopback HTTP/HLS, HTTPS, SMTP and Tempo servers. Every behaviour pinned by the 183 Python tests is pinned again.
  • cargo +1.85.0 check --all-targets (declared MSRV): passes.
  • Windows: scripts/check-windows.sh type-checks the Rust code for x86_64-pc-windows-gnu (it stubs the C compiler that bundled SQLite and the TLS library need, so it checks Rust code only).
  • Smoke test of the built binary: init, validate, status, and an MCP initialize / tools/list / tools/call round trip.
  • The dead-air tempo policy output (with an owner caller added) was loaded by Perennos Tempo's own tool_policy.load_policy and accepted.
  • Release binary: 6.1 MB stripped (x86_64). Cold start of validate: 1.6 ms (Rust) vs 105 ms (Python), median.

Not yet verified: no run on real Windows or macOS, the release workflow has never run, the installers were only tested against a fake release folder, and no real Tempo gateway, MCP host or 24-hour soak was tested. Rolling back to 0.2.0 on the same database should work once the [tempo] / [metrics] tables are removed from the TOML, but that was reasoned through, not tested.


Generated by Claude Code

Add a dead-air Rust crate with the 0.2.0 behaviour: strict TOML config,
bounded children with process-group cleanup, policy-checked DNS and a
pinned, proxy-free HTTP/HTTPS client, FFmpeg capture and decoded
coverage, the three independent conditions with sustained/positive
recovery, the schema-2 SQLite ledger and OS writer locks, alert delivery
through owned worker children, read-only status, the loopback GUI with
embedded assets, plus a Tempo client, a read-only MCP server and an
optional loopback metrics endpoint. GUI assets move to gui/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EcaBjEc9MB8YTjxgWuDd8y
Pin every behaviour the Python suite covered: probe/coverage/progress
parsing, the three independent conditions, resolver and thumbnail
fallbacks, incident opening and positive recovery, restart and clock
resets, alert payloads, SMTP TLS rules, attempt deadlines, owned worker
cleanup, the delivery ledger and Retry-After, read-only status,
acknowledgment, writer locks, SIGTERM/Ctrl+C exit codes, the GUI's
token/Host/Origin checks, and native lavfi media plus loopback HLS,
HTTPS and SMTP acceptance. State written by the Python 0.2.0 release
reads byte-identically and keeps its history. The GUI gains a Tempo
brief button shown only when [tempo] is enabled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EcaBjEc9MB8YTjxgWuDd8y
Delete the deadair package, the dead_air.py and dead_air_gui.py entry
points, pyproject/requirements and the Python tests now that the Rust
suites pin the same behaviour. install.sh and install.cmd download the
release build, check it against SHA256SUMS, fall back to cargo install
--locked, or print the rustup line; both keep a dry run and the desktop
launcher. CI runs fmt, clippy and tests on Linux, macOS and Windows; a
tag workflow builds musl, MSVC and macOS binaries, writes SHA256SUMS and
publishes with gh. scripts/check-windows.sh type-checks the Windows
target without MinGW. The starter config documents [tempo] and
[metrics]; the Python 0.2.0 state fixture is now tracked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EcaBjEc9MB8YTjxgWuDd8y
README covers the binary install, upgrading from the Python release, the
optional Tempo briefs and MCP server, and the metrics endpoint.
OPERATIONS adds the metrics contract, the sender worker, bounded DNS
threads, the GUI's lock handling and rollback notes. ARCHITECTURE maps
the crate; docs/TEMPO.md documents the client, data minimisation, the
MCP tools, an example session, policy and mcp-config. CHANGELOG 0.3.0
lists every visible change and the upgrade path; VERIFICATION records
what ran here and what did not.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EcaBjEc9MB8YTjxgWuDd8y
Pick the earliest of CRLF and LF blank lines so a body can never be read
as part of the head, and pin chunked bodies, 100 Continue prefaces,
body caps and short Content-Length bodies in unit tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EcaBjEc9MB8YTjxgWuDd8y
…TTP error

Perennos Tempo's gateway answers its own paths, so a 404 from /health,
/v1/models or /v1/chat/completions means something else is listening on the
port (for example a Tempo service that does not serve the OpenAI-style
routes). Report that plainly and name the fix, instead of "answered HTTP 404".
It is never reported as an authentication problem. /health can still answer
200 in that case, so status/doctor show the message on the models line.

Requested by the Tempo main thread, whose v2 apps start a Rust agent on the
same default port (127.0.0.1:8765). Tests cover a stand-in service that
answers /health but 404s every gateway path; the real binaries were also run
against one. Documented in docs/TEMPO.md.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EcaBjEc9MB8YTjxgWuDd8y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants