Wire memopop-native to the FastAPI Sidecar — Tests, Rust Transport, Frontend SSE
End-to-end integration of the desktop client with the orchestrator's FastAPI sidecar across four phases: pytest coverage on the server, a Rust transport layer with lazy spawn and /healthz poll, a TypeScript Transport implementation with SSE event subscription, and a Generate flow that streams milestones live into the UI.
Summary of what landed
Phase 0 — Tests (orchestrator):
tests/init.py, tests/test_server.py with 6 tests (5 from plan + 1 bonus partial-line buffering test)
[tool.pytest.ini_options] block in pyproject.toml
All 6 pass in 0.17s. Refactored resolve_artifact_path() out of the endpoint to make the path-traversal guard testable in isolation.
Phase 1 — Rust (memopop-native):
Cargo.toml — added reqwest + tokio (time feature only)
src/api/sidecar.rs (new) — SidecarManager with lazy ensure_running (spawns {repo}/.venv/bin/python -m src.server, polls /healthz for 15s), forward (reqwest GET/POST), shutdown (kills CommandChild)
src/api/mod.rs — declared the new module
src/api/router.rs — added /memos* match arms that call forward_to_sidecar (strips repoPath from the body before forwarding so FastAPI's strict Pydantic doesn't reject the request)
src/lib.rs — registers SidecarManager in app state, WindowEvent::Destroyed handler kills the sidecar
cargo check — clean, no warnings
Phase 2 — Frontend (memopop-native):
transport/types.ts — added JobEvent, JobEventHandler, subscribeEvents to the Transport interface
transport/local.ts — implemented subscribeEvents via browser EventSource direct to localhost:8765 (bypasses Rust)
transport/index.ts — re-exports the new types
stores/flow.svelte.ts — added running_job flow stage with markRunning, appendEvent methods that update status from status/complete/error events
components/DealCreationModal.svelte — confirmation panel CTA changed from "Close" to "Generate memo →" which calls POST /memos, captures job_id, transitions to running_job. Form's submit CTA renamed to "Review →" so the names match the actions.
components/JobLogViewer.svelte (new) — live job panel with status pill (pulsing dot when running), terminal-style log pane that auto-scrolls, success/error banners on terminal states, hint that closing doesn't kill the job
routes/+page.svelte — renders JobLogViewer for running_job stage
components/JourneyBreadcrumbs.svelte — recognizes running_job (Generate step active)
bun run check — same 1 pre-existing error (vite.config.js) and 19 pre-existing warnings; my changes added zero
bun run build — clean, 1.6s