Skip to content

docs: ADR-0009 — live-capture effects channel (spike, closes #58)#66

Merged
sepehr-safari merged 1 commit into
mainfrom
spike/effects-channel
Jul 12, 2026
Merged

docs: ADR-0009 — live-capture effects channel (spike, closes #58)#66
sepehr-safari merged 1 commit into
mainfrom
spike/effects-channel

Conversation

@sepehr-safari

Copy link
Copy Markdown
Member

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 plain update path):

  • update_fx: fn(*Model, Msg, *Effects) — the effects-capable update (exactly one of update / update_fx per app; the runtime calls it with a live *Effects). Adopting it is a create-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 as Msgs (each line → an on_line Msg in .lines mode), cancellable via fx.cancel(key), bounded, rejection reported via on_exit. Plus fx.fetch / fx.writeFile / fx.readFile and an EffectTimer.
  • services.showNotification(NotificationOptions{title,subtitle,body}) + a notifications permission — for feat(capture): OS notifications on critical failures #60.

Decision

#59 and #60 proceed in-runner — no #33 eject.

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.spawn smoke; resolve the self-exe path for the spawn argv).

Docs-only; CI runs the full matrix as a coherence check.

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.
@sepehr-safari sepehr-safari merged commit 71f7b08 into main Jul 12, 2026
3 checks passed
@sepehr-safari sepehr-safari deleted the spike/effects-channel branch July 12, 2026 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

spike(ui): live-capture effects / Msg-injection channel (ADR-0009)

1 participant