docs: ADR-0009 — live-capture effects channel (spike, closes #58)#66
Merged
Conversation
The #58 spike re-examined the zero-config runtime for an async Msg channel the live GUI (#59/#60) needs. Finding: a full effects system exists — update_fx + fx.spawn (streams a subprocess's stdout lines back as on_line Msgs), fx.fetch / fx.timer / file ops, and a showNotification platform service (notifications permission). Outcome (i): #59/#60 proceed IN-RUNNER via update_fx + a self-spawned `studio capture --ndjson`; no runner eject. This corrects the S4 replay spike's "no effect scheduler" conclusion, which examined only the plain `update` path — so wall-clock replay auto-play (#44, parked in #33) is also revisitable. Records the API shape (SpawnOptions, EffectLine/on_line, NotificationOptions) for #59/#60 to build on. Closes #58.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #58. A spike (investigation + ADR, no shipping code) that resolves whether the live GUI (#59/#60) is feasible in the zero-config runner.
Finding — outcome (i): the channel exists, richly
Re-examining the runtime source (
runtime/ui_app.zig,runtime/effects.zig,platform/types.zig) found a full effects system that the S4 replay spike missed (it looked only at the plainupdatepath):update_fx: fn(*Model, Msg, *Effects)— the effects-capable update (exactly one ofupdate/update_fxper app; the runtime calls it with a live*Effects). Adopting it is acreate-options change, not a runner eject.fx.spawn(SpawnOptions{ key, argv, output=.lines, on_line, on_exit })— runs a subprocess and streams its stdout back asMsgs (each line → anon_lineMsg in.linesmode), cancellable viafx.cancel(key), bounded, rejection reported viaon_exit. Plusfx.fetch/fx.writeFile/fx.readFileand anEffectTimer.services.showNotification(NotificationOptions{title,subtitle,body})+ anotificationspermission — for feat(capture): OS notifications on critical failures #60.Decision
#59 and #60 proceed in-runner — no #33 eject.
update_fx;fx.spawnthe app's own binary asstudio capture … --ndjsonin.linesmode; each NDJSON line →on_lineMsg → decode → append to the live timeline;fx.cancelstops it. This is winning-idea ci: build/test/check/doctor on macOS + Linux + automation smoke test #2 (self-spawn worker), reusing the exactstudio captureengine shipped in feat(cli): studio capture subcommand (NDJSON event stream) #57.services.showNotificationon a critical live failure; addnotificationstoapp.zon.Also
Corrects the S4 spike's "no effect scheduler" conclusion → wall-clock replay auto-play (#44, parked in #33) is revisitable in-runner. ADR-0009 records the API shape for #59/#60 and a de-risking hand-off (start #59 with a minimal
fx.spawnsmoke; resolve the self-exe path for the spawn argv).Docs-only; CI runs the full matrix as a coherence check.