Importable effect registry, the meadow as an effect, and ambience-paint #21
No reviewers
Labels
No labels
agent:run
ambient-effects
architecture
bug
bugs
codex:run
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
queue
terminal-client
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
romaine-life/ambience!21
Loading…
Reference in a new issue
No description provided.
Delete branch "att-43-paint"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Work package: ATT-43
ambience's side of ambience effects as at-terminal tab backgrounds, run locally (not synced with the server).
Removed: the effect registry in package main (
cmd/ambience/effects.go'sregister, the 37cmd/ambience/effect_*.goadapters,effect_frames.go) and the WASM build's hand-kept effect list and constructor switch (cmd/ambience-wasm/effects_all.go, itsmakeTypedRuntime).Added:
effects/: importable registry. Each effect'sDefinitionand runtime adapter (moved as-is, plusResize, and rain'sOverlayFrame), listed once ineffects.All(). The server, the full WASM bundle and the painter all read that list; therainonlybundle names onlyeffects.Rainandeffects.RainOnWindow, so the linker still drops the rest (3.55 MB before, 3.58 MB after; the full bundle 6.64 to 7.01 MB, the meadow included).Definition.GridHeightrecords a calibrated grid height (rain 180, meadow 216).cmd/ambience/scene_*.go: the authority's scene generation and config drift, split out of the old adapters unchanged and registered withregisterScenes;atmosphere.golooks transitions up there instead of by interface assertion.sim/meadow.go,sim/meadow_paint.go: at-terminal's dusk meadow (frontends/rioterm/src/meadow/scene.rs) ported line for line in float32 with Rust's saturating casts. Compared against a build of scene.rs itself: 0 differing pixels in 11 cases (sizes 1x1 to 640x360, frames 0 to 250000). Steady effect (lifecycle always running), knobsfps(8) andspeed(1) whose defaults are scene.rs's meadow; a grid taller than 216 rows draws each art pixel as a square, scene.rs'sscale_for. scene.rs's tests are ported.cmd/ambience-paint: one painter process holding every effect, for at-terminal to start directly.list; stdinsize W H,show <effect>,hold; stdout only frames, "AMBF" + LE u32 width, height, scale + RGBA8. Only the shown effect steps (60 ticks/s), frames at-fps(12); held, it has no timer at all. Every pixel is held under a fifth of white's luminance, hue kept; a test holds that for every effect. Protocol:docs/ambience-paint.md.Changed docs: cookbook, scaffold (
scripts/agent/scaffold-effect.shnow writeseffects/<effect>.go), AGENTS.md, CLAUDE.md, README, effect-candidates, terminal-integration-status. Dockerfile copieseffects/.Left alone: server behaviour and every test's assertion. One test line changed form:
persistence_test.goread rain's sim through the unexported runtime type, and now reads the same config throughSnapshot(). No release or delivery wiring for the painter (pipeline-templates, machine/state.json) is in this PR.Not done here: the meadow joins the server's rotation pool like every registered effect, so it can come up on ambience.romaine.life once this ships.
Checks:
ci-checkpassed (go format/vet, web-app tests);go test ./...passed; both WASM artifacts built and the Node smoke test ran all 38 effects; the painter was driven as a child process (first frame within 10 ms ofshow, 12 frames/s, none while held, clean exit on EOF, about 5% of one core while animating).