Repository navigation
Closed
Description
Goal: a host library that reliably drives a Marlin controller (connect → reliable send → stream → out-of-band e-stop → query), replacing fiberpath's broken streamer.
Design (locked): synchronous request→ok; pure core, pyserial optional; literals generated from a pinned Marlin source via codegen (CI drift-gated); serve streaming + interactive equally; pin latest stable but design for multi-version. Full plan: working/mvp-plan.md; codegen: working/codegen.md.
Milestones
- Scaffold (dev-toolbox
python-uv) + response taxonomy/parser - Codegen foundation — pinned fetch → committed
_constants.py→ CI drift gate - Framing — line-number + XOR checksum
- feat: transport abstraction + FakeTransport (+ conformance replay) #1 — transport abstraction + FakeTransport
- feat: MarlinHost — connection lifecycle + reliable send + emergency stop #2 — MarlinHost: lifecycle + reliable send + e-stop (the payload)
- feat: streaming + M115 capability negotiation #3 — streaming + M115 capabilities
- test: hardware validation — capture real traces, calibrate timing (needs-hardware) #4 — hardware validation (needs hardware)
- extend codegen coverage (M115 caps /
//actionverbs / G-code metadata) as warranted
Corresponds to the fiberpath Marlin-I/O epic (fiberpath/fiberpath#187) and issues #179–#182, #188, #196.
Dialect & behavioral-mock track (post-MVP hardening)
From the working/dialect-and-mock-investigation.md design (one Profile seam:
version produces it, M115 negotiation fills it, host + mock consume it).
- fix(host): resend recovery returns the request-ack early; wait for the resent line's real ok #11 — bug: resend recovery returns the request-ack
okearly (off-by-one); fix + stateful resend responder as regression test (now) - feat(host): connect-time Profile assembly — declared baseline ∩ negotiated caps #12 — connect-time Profile assembly: declared baseline ∩ negotiated M115 caps (next)
- feat: minimal Profile dataclass + dialect matrix test via the resend responder #13 — minimal
Profiledataclass + dialect matrix test (next) - build(codegen): optional STR_KILL_PRE fallback to unlock 2.0.x codegen (deferred) #14 — optional
STR_KILL_PREcodegen fallback for 2.0.x (later, deferred — single literal table suffices) - feat(host): opt-in ADVANCED_OK buffer-aware look-ahead streaming (deferred) #15 — opt-in ADVANCED_OK buffer-aware look-ahead streaming (later, deferred)
- test(host): cover AUTOREPORT telemetry-interleave as wire behavior, not just a cap flag #19 — cover AUTOREPORT telemetry-interleave behaviorally (later, minor — from feat: minimal Profile dataclass + dialect matrix test via the resend responder #13 review)
Metadata
Metadata
Assignees
Labels
No labels
Activity
CameronBrooks11 commentedon Jun 26, 2026
Codegen scope decided (multi-agent assessment). Full opportunity-space review (
working/codegen-assessment.md) → widen exactly one notch now, defer the rest:a80c7bc): generate FATAL_MARKERS fromlanguage.h(kill/halt, thermal runaway, heating failed, MAX/MINTEMP, stopped,!! KILL). Parser now classifies any line with a fatal marker as HALT — safety-critical so the host stops streaming into a dead/thermally-tripped controller. Feeds the M3 safety path. (The pinned pull also caught a real version delta vs bugfix-2.1.x — validating why codegen reads pinnedvendor/.)Cap:names (when feature-gating logic lands),//action:verbs (when pause/resume/prompt dispatch lands), G-code inventory (help table only),PROTOCOL_VERSION/keepalive defaults (when version-gating lands). All ~10-line adds, so no carrying cost to deferring.Next: the MarlinHost (#2 / M3) payload.
CameronBrooks11 commentedon Jun 26, 2026
Hardware-free MVP core complete. Progress:
send(busy keepalive consumed; unresponsive + paused-for-user raise; fatal → HaltError), reliable-mode resend, out-of-band M112 e-stopmarlin-host[serial]; the remaining piece of feat: MarlinHost — connection lifecycle + reliable send + emergency stop #2. Writable now but unvalidated until hardware → pair with the lab session.66 tests, all hardware-free, CI-gated. The library's logic core can drive a controller end-to-end against
FakeTransport; only the real serial wire + validation remain.CameronBrooks11 commentedon Jun 26, 2026
Code-complete for hardware bring-up. Merged overnight via PRs:
marlin-host[serial], DTR reset on open.marlin-host --port …REPL (:caps/:stream/:estop) +--logsession capture for the corpus.Full MVP now: parser · codegen (pinned, drift-gated, fatal markers) · framing · transport (Fake/Serial/Tracing) · MarlinHost (send/stream/capabilities/e-stop) · console. 81 tests, all hardware-free, CI-gated.
Only remaining: #4 hardware validation — tune
SerialTransport.reset()DTR timing, capture real traces (via--log) → replay as corpus tests, confirm the modeled contract. Needs the physical winder.CameronBrooks11 commentedon Jun 28, 2026
MVP achieved and shipped — marlin-host 0.2.1 on PyPI, hardware-validated on a real RAMPS 1.4 / Marlin bugfix-2.1.x board. M0-M4 + Mh + codegen done: connect/M115 negotiation, reliable framed send, streaming + pause/resume, out-of-band M112 e-stop + recovery, plus on_action / list_ports / position and a thread-safe io-lock. fiberpath now consumes it (fiberpath/fiberpath 0.9.0). Remaining as standalone issues: #4 (12V hardware validation) and the deferred dialect items #14/#15/#19. Closing the MVP epic.