Repository navigation
Closed
Description
Problem
The machine-I/O layer (fiberpath/execution/marlin.py + the GUI's interactive subprocess + the Tauri marlin.rs bridge) is an optimistic wrapper, not a protocol implementation:
- No formal contract — Marlin responses are matched by ~5 hardcoded string checks in
_await_ok; no line-number / checksum / resend reliability; no spec doc. - No hardware-free tests — nothing is testable without a physical machine, so fixes are guesses and regressions are invisible until someone plugs in a board.
- Fragile runtime — silent infinite hangs (
echo:busyresets the timeout forever), no send timeout, unsynchronized serial access (stream worker + manual sends share one port), connection readiness guessed by waiting for silence, and ports not released on stop. - Drifting IPC — the Rust
MarlinResponseenum, the Pythonsend_responseemitter, and the TS types are three hand-maintained copies. - No human console — the interactive session protocol is GUI-only JSON; the CLI exposes only one-shot
stream.
This is the hardware-facing analog of the .wind open-format work (#141): rebuild machine-I/O as a first-class, spec'd, conformance-tested component.
Plan (phased)
Phase 1 — Observability & access
- feat(cli): human interactive machine console with serial TX/RX tracing #178 — human interactive console + serial TX/RX tracing
Phase 2 — Hardware-free testability
- test(execution): replay serial transport + recorded-trace conformance corpus #179 — replay transport + recorded-trace conformance corpus
Phase 3 — Formal protocol contract
- feat(execution): formal Marlin response taxonomy + state-machine parser #180 — response taxonomy + state-machine parser (+ normative doc)
- feat(execution): reliable transfer — line numbering, checksum, and resend handling #181 — reliable transfer: line numbering, checksum, resend
- fix(execution): robust connection lifecycle — DTR/reset and readiness handshake #182 — robust connection lifecycle: DTR/reset + readiness handshake
Phase 4 — Streaming
- feat(execution): buffered streaming with a send/ack window [DEFERRED — evidence-gated] #183 — buffered streaming with a send/ack window
Phase 5 — Contract unification
-
refactor: unify GUI<->subprocess IPC contract (single source of truth) #184 — unify GUI<->subprocess IPC contract— folded into Epic: local-API backend + OpenAPI-typed thin-shell GUI #195 (GUI↔backend refactor): the contract becomes OpenAPI and the stdio subprocess protocol is retired, so there's no separate IPC contract to unify.
Related near-term stabilization (independent — NOT blocking this rebuild)
These fix the acute live failures and can land immediately (hardware on hand):
- fix(execution): bound response waits, add send timeout, and release the serial port on stop/error #185 — bound waits, send timeout, release port on stop/error (the silent
[0/N]freeze + locked-port reconnect) - fix(execution): serialize machine access so streaming and manual commands can't interleave #186 — serialize machine access (no stream/manual interleave)
Notes
- Dependency spine: 178 → 179 → (180 → 181 → 183); 182 parallel; 184 independent.
- Library extraction → tracked in Extract machine-I/O into a standalone, published Marlin host-protocol library #188. Build the protocol behind a clean boundary in-repo (from feat(execution): formal Marlin response taxonomy + state-machine parser #180 onward), then extract to a standalone, Apache-2.0, PyPI-published Marlin host-protocol lib at the end of Phase 3 (before feat(execution): buffered streaming with a send/ack window [DEFERRED — evidence-gated] #183). See Extract machine-I/O into a standalone, published Marlin host-protocol library #188 for naming, codegen-from-Marlin ideas, and open decisions.
Transport decision (resolved — see #195)
This epic is the Marlin host-protocol layer (parser, reliability, lifecycle, corpus, console). How it's exposed to the GUI is decided in #195: a REST job resource (polled), not a stdio event protocol. The protocol work here (#178–#183) is transport-independent and unchanged; #190 consumes it.
Plan-review refinements (2026-06-25)
- feat(execution): buffered streaming with a send/ack window [DEFERRED — evidence-gated] #183 DEFERRED (evidence-gated) — synchronous send-wait-
okalready keeps Marlin's planner buffer full; not a throughput fix. Revisit only if dome-turnaround segment-density profiling shows planner-buffer starvation. Removed from the active path. - test(execution): replay serial transport + recorded-trace conformance corpus #179 is the critical-path unblocker — schedule first; building the feat(api): Marlin /jobs polled resource + background job runner #199 job runner before it re-creates the untestable layer.
- feat(execution): reliable transfer — line numbering, checksum, and resend handling #181 reorder last in the reliability trio (after feat(execution): formal Marlin response taxonomy + state-machine parser #180/fix(execution): robust connection lifecycle — DTR/reset and readiness handshake #182); scope to canonical N + checksum + resend + one fixture.
- New sibling deliverable: spec: machine-profile / firmware-compatibility spec ('what hardware must meet to be compatible') #197 machine-profile / firmware-compatibility spec ('what hardware must meet to be compatible'); governance shared with Epic: open winding-program format — normative SPEC, resolvable $id, conformance corpus #141.
- The feat(execution): formal Marlin response taxonomy + state-machine parser #180 taxonomy + test(execution): replay serial transport + recorded-trace conformance corpus #179 corpus are the machine-I/O analog of Epic: open winding-program format — normative SPEC, resolvable $id, conformance corpus #141 — put under the same versioned / published / conformance governance.
Activity
CameronBrooks11 commentedon Jun 26, 2026
The Marlin host-I/O work is being built in the dedicated
fiberpath/marlin-hostrepo (lib name lockedmarlin-host, Apache-2.0), per the extraction plan (#188). Progress so far: scaffold + response taxonomy/parser, a pinned-source codegen pipeline (CI drift-gated), and line framing. Tracking epic: fiberpath/marlin-host#5 (milestones map to #179–#182/#196 here). fiberpath will depend onmarlin-hostrather thanfiberpath/execution/marlin.py.CameronBrooks11 commentedon Jun 28, 2026
Status: the protocol layer is now realized in the standalone marlin-host library — #178 (console/tracing), #179 (replay + conformance corpus), #180 (taxonomy/parser), #181 (line numbering/checksum/resend), #182 (DTR/reset lifecycle) are all implemented there, plus M115 capability negotiation and out-of-band M112.
marlin-host==0.1.0is on PyPI and hardware-validated. Remaining work is the consumer cutover (fiberpath onto marlin-host + machine control on the API sidecar), tracked in epic #259.CameronBrooks11 commentedon Jun 28, 2026
Delivered via the standalone marlin-host library. The protocol layer — #178 (console/tracing), #179 (replay + conformance corpus), #180 (taxonomy/parser), #181 (line numbering/checksum/resend), #182 (DTR/reset lifecycle) — is implemented and published (marlin-host 0.2.1, hardware-validated). #184 was folded into #195; the acute stopgaps #185/#186 landed; #183 is superseded by marlin-host #15. The consumer cutover shipped via #195 (0.9.0). Closing.