Jarvis · implementation retrospective

From parallel subsystems to one authoritative control path

Across 31 commits, Jarvis retired the standalone Companion, removed duplicate report and task state machines, moved control into one validated Controller, consolidated production voice on Pipecat, and fixed the authority bugs found in four follow-up reviews.

Architecture

What changed structurally

Before

Several Jarvis products and truths

Desktop Controller and standalone Companion each owned routing, voice, reports, setup, packaging, and lifecycle concerns. Server behavior was spread across Manager, Task Desk wrapper, completion/report/queue reactors, report outbox, speaker election and leases, and compatibility transports.

Now

One product, one control path

Full and Controller own control and speech. Headless owns execution only. JarvisController adapts a validated closed command into ordinary T3 orchestration. T3 threads remain task truth. Presentation is a live projection, not a second delivery system.

Current request path

utterance → acoustic grounding → Luna semantic proposal → deterministic catalog validation → fresh T3 lookup → ordinary provider/orchestration command

The model proposes action and visible names only. It never supplies IDs, grants approval, chooses an ambiguous target, reads the repository, or dispatches work.

AreaRemoved or collapsedReplacement
Product shellStandalone Companion app, release workflow, setup, updater, relay, voice routingFull / Controller / Headless presets in one Jarvis product
ControllerJarvisManager plus executeWithTaskDeskOne JarvisController
Command parsingPrepare, classify, interpret, plan, project resolver, task resolver pipelineSchema-constrained semantic intent plus pure validation into a discriminated command
ReportsCompletion reactor, report reactor, outbox, cursors, acknowledgements, election, speaker leaseOrigin-scoped live presentation from durable T3 events
Task DeskShadow lifecycle, reactor, browser-style history, synthetic task stateFocused identity, bounded recent identities, one pending interaction
Follow-upsEvent reconstruction and queue recovery reactorNormal durable SQL queue with atomic claim and deterministic retry identity
VoiceCompanion voice and parallel Node Sherpa/Kokoro production runtimeDesktop worker supervising one bundled Pipecat runtime
TransportStandalone Jarvis HTTP and Companion compatibility report subscriptionAuthenticated typed WebSocket RPC

Correctness and behavior

What users can trust now

Exact task authority

Named steer, queue, stop, status, continue, review, reroute, answer, and task focus resolve an exact bounded task, reload its current T3 thread, then use that thread's project, model, runtime, interaction mode, pending request, and lifecycle state.

Explicit beats ambient

A named Rivvl task can be controlled while Jarvis is visible in another project. Current UI project no longer gates task commands or project listing. Context mismatch protection remains only for implicit “continue this” requests.

Clarification resumes the command

Choosing the second ambiguous task no longer degrades “stop task” into “focus task.” Jarvis pins the chosen task and resumes the original stop, steer, queue, status, continue, or review action.

No ghost tasks

Task Desk stores identities, not lifecycle snapshots. Missing or deleted threads are filtered instead of being manufactured as synthetic “known” tasks. Canonical focus RPC validates the node and thread before storing focus.

Fresh project authority

Start, review target, reroute target, and project focus fresh-load the selected project after semantic interpretation. Task-only and no-project commands skip project lookup entirely.

Deterministic pending replies

Typed approval and worker-input replies bypass Luna. The selected pending request is rechecked before dispatch, so a request that changed during interpretation cannot receive a stale answer.

Provider-neutral reviews and reroutes

Reviews create ordinary provider threads and reciprocal activities. Reroute commands carry source identity and target project identity, then inherit execution details from the fresh source thread.

Safe semantic supervision

Luna-low is configurable separately from the coding worker. Structured generation runs in a disposable neutral directory with tools, MCP, apps, hooks, and workspace access disabled. Unsupported unsafe adapters refuse the operation.

Presentation and persistence

Durable work, ephemeral speech

T3 owns the result. Jarvis projects finalized provider results, failures, approvals, and input requests to the exact live origin interaction. Disconnecting does not create replay debt. Reconnecting clients inspect the ordinary durable thread.

  • Removed completion-ready intermediate events and the replaying report state machines.
  • Removed report inbox/outbox, cursor, batch acknowledgement, retention, speaker election, lease, confirmation, and retry state.
  • Added structured terminal result and failure metadata. Presentation no longer parses provider error prose to decide semantics.
  • Normalized provider payloads once and reduced repeated scans with bounded single-pass/set lookups.
  • Moved origin identity to the turn/request path, so the latest controlling interaction receives the live presentation.

Desktop voice

One production speech runtime

node-cpal or macOS renderer PCM → Desktop voice worker → Pipecat → Parakeet ASR / Kokoro TTS → PipeWire or local audio

Removed

Legacy native-speech owners, duplicate deadline/lifecycle layers, Node Kokoro worker/client, sherpa-onnx-node, obsolete voice smoke tooling, and Companion voice.

Kept on purpose

The worker/sidecar process boundary, node-cpal capture, macOS renderer capture, project vocabulary, and platform Sherpa packages used as the frozen Pipecat ONNX Runtime source.

Reliability

Worker requests have bounded timeouts. Malformed Pipecat output fails immediately instead of becoming a silent timeout. Capture state was consolidated into typed state objects, and completion waits for native output drain.

Packaging and performance

Production smoke and benchmark commands exercise Pipecat. The frozen host fails closed on source drift, duplicate ONNX runtimes, or oversize output. The documented Linux host dropped from about 267 MiB to 138 MiB.

Other improvements

Smaller but important changes

  • Project aliases moved to bounded current-state storage with removal support; deleted-project aliases no longer enter voice vocabulary.
  • One shared task-state derivation replaced competing lifecycle mappings.
  • Follow-up rows were trimmed to stable identity and instruction data; dispatch time now records the actual dispatch.
  • Mesh capability cache became advisory. The target server remains authoritative, so stale cached incompatibility cannot block a valid call.
  • Provider replacement as an automatic stop-and-recreate feature was removed. Users explicitly start/reroute work instead.
  • Semantic prompts were trimmed and given terse action definitions and examples.
  • A 50-utterance opt-in Luna eval now reports action, task, project, provider, and clarification accuracy without becoming a networked CI gate.
  • Implementation-first guidance was installed in the repository so future passes prioritize working behavior and focused evidence over receipts and markers.

Evidence

What was verified

HEAD befa40253 remote matched clean worktree

The final review pass ran 39 focused Controller/core/eval tests, targeted lint, and server plus jarvis-core typechecks. The preceding live-authority pass ran 292 focused TypeScript tests and 29 Pipecat tests. Two live Luna-low smoke cases passed: new work with project selection, and exact named-task continuation.

Tests cover named task control, fresh thread state, clarification replay, queue identity, multi-node routing, canonical focus, live presentation, structured failures, worker timeout/failure behavior, and production Pipecat packaging paths.

Honest remaining work

What was deliberately not claimed

Empirical

Physical microphone A/B

Pre-Pipecat PCM buffering still needs real-device comparison for first-word clipping and push-to-talk latency. Static review cannot settle it.

Opt-in

Full Luna corpus

The 50-case eval exists, but only two live cases were run during the pass to avoid unnecessary model spend. A deliberate benchmark run remains useful.

Later cleanup

Protocol parser

The manual Desktop voice protocol decoder is verbose but typed and working. Schema-driven cleanup was correctly deferred.

Later cleanup

Test file split

The Controller test file remains large. It is an ergonomics issue, not a product or authority defect.

Implementation record

The 31-commit series

942e47dab → 51fa45379 → 84595594d → 816117fa6 → 257ca8b1d → 2d3423a12 → a24a73c80 → 80d8bbbc6 → efc53193f → cb95a777c → e9fe39687 → 8e05bbf97 → b60feab9c → 43c4a4b38 → 481b854a9 → befa40253

The omitted hashes in that compact chain are focused documentation, compatibility removal, metadata, follow-up composition, and guidance commits. Git remains the complete record.