FrankenTerm

Engineering Discipline

765 words3 min read5 subsectionsFrom the README at ft 0.15.21

On this page5
Async runtime — asupersync, Cx-first, tokio-bannedUnsafe codeReality-check disciplineFour-Surface Platform & Companion CLI MatrixSubstrate audit discipline (extended)

Async runtime — asupersync, Cx-first, tokio-banned

The project uses asupersync exclusively. Direct tokio usage is forbidden at three layers:

  1. Dependency layer. deny.toml declares a [bans] entry for tokio; the cargo deny check bans release gate fails the build if any first-party Cargo.toml declares tokio as a direct dependency.
  2. Type layer. The RuntimeProof sealed trait makes tokio::sync::* types fail to compile in RuntimeProof-bounded API surfaces. The sealed-trait soundness argument is modeled in docs/proofs/runtime-proof-soundness.lean and checked by scripts/check-runtime-proof-soundness.sh.
  3. Test layer. scripts/check_asupersync_test_only.sh (run by scripts/release-gates.sh) plus tests/wa_22x4r_no_tokio_test_in_supported_paths.rs are release-gate and cargo-test-time checks that no active #[tokio::test] attribute lands in supported paths. The supported async-test substrate is the asupersync_test! declarative macro and the LabRuntime helpers in crates/frankenterm-core/tests/common/asupersync_test.rs.

runtime_async is the canonical asupersync wrapper API surface, exposing Mutex, RwLock, Semaphore, mpsc, watch, broadcast, oneshot, plus project-curated ergonomic helpers (sleep_with_cx, timeout_with_cx, RuntimeBuilder).

Unsafe code

The workspace sets unsafe_code = "forbid" in [workspace.lints.rust] for crates that inherit those lints. The CLI and core library also declare #![forbid(unsafe_code)]. Native/FFI crates, including the GUI and vendored WezTerm code, have separately audited exceptions; the entire workspace is not unsafe-free. See docs/vendored-wezterm-design.md.

Reality-check discipline

Reality-check is a quarterly / full-run discipline that produces a date-stamped bridge plan, a substrate of proof slots, and a per-release bundle. The current round (RC4, ft-mgy5t2, opened 2026-11-20, documented in docs/reality-check-bridge-plan-2026-11-20.md with drumbeat report docs/reports/reality-check-2026-11-20.md; cross-linked to RC3 ft-xxfwy, RC2 ft-tf6g3, and RC1 docs/reality-check-bridge-plan.md) is closing four-surface convergence gaps:

  • Release-channel split (stable cross-platform signed releases vs companion-appstore prerelease tags) and Linux GLIBC_2.35 ABI floor gating
  • Codec-75 workspace test greenness, PROVENANCE.json gate, and atomic-redeploy skew diagnostics
  • Attestation --strict-deferred unblock (closing ft-7h5da.10.2, ft-7h5da.1.5, ft-7h5da.13.7), live-proof receipt wiring, and first signed release bundle
  • Four-surface truth sync (Desktop Metal/PageGrid + Swarm Control Plane + Native iOS/Air-Gapped QR/Mac Exporter + Browser WASM), unified multi-client controller lease (TLA+), and proof-backed bead closeout discipline
  • scripts/ft-reality-check.sh status / next / silent-close-audit / structure-audit operator verbs (a shell script, not an ft subcommand) and mass-restore-immune scripts/check-reality-check-due.sh

See docs/process/reality-check-discipline.md for trigger rules; scripts/check-reality-check-due.sh reports when another full pass is due.

Four-Surface Platform & Companion CLI Matrix

FrankenTerm spans four surfaces on one shared terminal/mux/codec substrate (honestly distinguishing shipped capabilities from opt-in/preview surfaces):

Surface Primary Code Location Current State (2026-11-20) Key Commands / Entrypoints
Desktop Terminal crates/frankenterm-gui/, crates/frankenterm-renderer-metal/, frankenterm/ Shipped (macOS arm64); Preview (Linux/Windows). OpenGL is still default; Native Apple Silicon Metal (front_end = "Metal") and PageGrid (FT_GRID_ENGINE=page) are opt-in while tab-bar/overlay parity finishes (ft-yccm0). FrankenTerm.app, frankenterm-gui, frankenterm-mux-server, frankenterm-pty-guardian
Swarm Control Plane (ft) crates/frankenterm/, crates/frankenterm-core/ Working on matching codec generation. Live 77-pane CLI↔GUI attach, Robot Mode, MCP, Web SSE, Policy/Kill-Switch, Tx, ft mobile, ft mermaid, ft process-triage, ft analytics vc-export. ft watch, ft status, ft doctor, ft robot ..., ft mcp serve, ft mobile, ft mermaid, ft process-triage, ft analytics vc-export
Native iOS + Mac Exporter + Air-Gapped QR apps/ios/, apps/apple/, apps/macos/FrankenTermExport/, crates/frankenterm-mobile-*, crates/frankenterm-machines/ iOS 1.0 approved on App Store Connect; notarized FrankenTerm-Exporter.dmg live on companion-appstore channel. Encrypted animated QR (FTAG/FTQR1 + RFC 9180 HPKE) implemented; unified multi-client lease (ft-mgy5t2.21) & fountain adversarial qualification (ft-mgy5t2.23) tracked in RC4. FrankenTerm.app (iOS), FrankenTermExport.app, ft mobile
Browser FrankenTerm (WASM) crates/frankenterm-browser-ui/, crates/frankenterm-terminal-wire/ Loopback read-only preview. Authenticated Tailscale Serve mode, interactive WebSocket pane attach with unified controller lease, live OpenAPI discovery, and DSR WASM packaging are tracked in ft-browser-frankenterm-7z4il / ft-mgy5t2.27. ft web

Substrate audit discipline (extended)

Beyond the seven defect families catalogued earlier, the audit discipline has produced a set of meta-rules that future code follows:

  • is_safe() returns are never gates. A method named is_safe may not be the only check before releasing a release gate. The release gate must also verify that measurements were recorded, that the safety bound is non-vacuous, and that the verdict was computed after the latest input was seen.
  • pub struct fields are a privilege escalation surface. Constructor-controlled invariants only hold if callers can't reach in and edit the fields directly. The audit converted dozens of pub fields to private + builder/constructor APIs.
  • Float validation is part of the contract. Any public function that takes f64/f32 must reject NaN, INFINITY, and NEG_INFINITY at the boundary. Default-trait derives (Default::default()) must produce inputs that pass this check.
  • Sanitization rejects, not silently filters. A sanitizer that returns its input with bad bytes stripped is worse than one that rejects the input outright; silent stripping hides upstream bugs.
  • Privacy fields are required, not optional. The redaction field on ChunkMetadata was made non-optional because the optional version let callers persist unredacted output by simply not setting the field.
  • Argv flag injection is the same class as SQL injection. Anywhere user-controlled strings reach an argv vector, the flag-prefix bytes (-, --) are normalized or rejected; see cass argv flag-injection closure.

The full catalog lives in docs/audit-checklist.md with bead-keyed exemplars for each family.