Some checks are pending
build-images / api (push) Waiting to run
build-images / worker-gpu (push) Waiting to run
build-images / web (push) Waiting to run
codeql / Analyze (javascript-typescript) (push) Waiting to run
codeql / Analyze (python) (push) Waiting to run
perf / API hot-path micro-smoke (budgeted) (push) Waiting to run
perf / Desktop engine crates (release build check) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (comfy-workflow-schema) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (effects-core) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (eventbus-types) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (growth-analytics) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (trends-schema) (push) Waiting to run
vision2026-ci / API phase modules (ruff + pytest) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (provider-adapter-kit) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (publishing-connectors) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (render-core) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (shot-template-schema) (push) Waiting to run
vision2026-ci / Python SDK resource tests (push) Waiting to run
vision2026-ci / Desktop engine crates (test + clippy + fmt) (push) Waiting to run
vision2026-ci / Alembic upgrade + drift check (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (caption-engine) (push) Waiting to run
Paid, hosted product at menivor.com, now retired as a company project. Fresh squashed history of the cleaned working tree (secret-scanned, no .env, no customer data, no outreach logs). Built on MoneyPrinterTurbo (MIT, harry0703) — see NOTICE.
3.0 KiB
3.0 KiB
ADR 0006 — Desktop engine: pure cores, injected transport
Status: accepted
Context
The desktop app is a local render farm + ComfyUI bridge + clipfarm operator + offline
project store (see apps-desktop.md).
Its logic must be deterministic and unit-testable without a GPU, a network, or the
GPUI shell — but it also must compose into coherent operations the UI and the
on-device MCP daemon call. A hardening pass over the rf-* crates surfaced a
recurring shape worth pinning down as a decision.
Decision
Every engine crate is a pure core: it owns policy/format/decision logic as
plain functions + value types, and the actual I/O (GPU calls, HTTP, node transport,
FFmpeg exec, blob writes) is an injected boundary — a trait or a now/handle
parameter — supplied by the runtime/app layer.
- Pure decision crates (
rf-renderlease scheduler,rf-syncreconcile,rf-comfyVRAM pool,rf-clipfarmfan-out,rf-jobsenvelope): takenow, task lists, and budgets; return leases/plans/decisions. No clock, no sockets. - Pure argv/graph builders (
rf-encode,rf-capture,rf-ffmpeg,rf-gatewayrequest bodies): assemble strings/vectors; the runtime spawns them. - Trait seams for real I/O:
rf-assets::BlobStore(persist/delete bytes),rf-pluginscapability allowlist (host supplies the approved set),rf-devproto(runtime dispatches the validated request). rf-runtimeis the only composer: it wires the pure cores into operations (submit_project,report_progress/complete_job/fail_job,plan_clipfarm) and holds the small amount of session state (job envelopes, seen-hashes). It uses the job-aware scheduling path so a terminal shot is never re-leased, and heartbeats leases on progress so long renders aren't reclaimed mid-flight.
Invariants enforced by the pass:
- Integer math where a value crosses a surface (µ-dollars, ms, per-mille speed) — no floats in content-addressed or duration paths.
- A declared dependency must be used; an unused crate dep is a defect (it hides an unwired composition, as with the render↔jobs and runtime↔clipfarm gaps).
- A doc claim must match behavior (e.g.
watermark_free, theBlobStoretrait, the clipfarm parity note were all corrected to match the code).
Consequences
- The whole engine is testable with
cargo testand no environment: 138 pure-lib unit tests (cargo test --workspace --exclude reelforge-desktop), deterministic, no GPU/network/Metal needed. Only the top-level GPUI binary requires the platform toolchain. CI gates test +clippy -D warnings+cargo fmt --checkon this set (.github/workflows/vision2026-ci.yml→desktop-crates). - Swapping transport (local vs. LAN node, on-disk vs. R2 blobs) never touches core logic — it's a different trait impl injected at the app layer.
- Cross-surface parity holds by construction: the same integer/string builders
(
rf-ffmpegchromakey/ass/vstack,rf-gatewaycost) mirror the Python renderer.