Skip to content

Watch mode plan: rebuild on change, swap at the loop wrap - #32

Merged
ninjudd merged 2 commits into
mainfrom
docs/watch-plan
Aug 6, 2026
Merged

ninjudd merged 2 commits into
mainfrom
docs/watch-plan

Conversation

@ninjudd

@ninjudd ninjudd commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Plan doc for bloom play --loop --watch (and the underlying bloom build --watch), sketched with Justin and decided: v1 swaps at the loop wrap (daemon gains a reload that queues takeover; you always hear whole passes), with the bar-synced in-place swap recorded as the successor rather than built now.

The load-bearing decisions: a red project never stops the music (check gates every rebuild; half-saved files are the common case); "did anything audible change" is an output-hash question the cache answers, so fmt and comment edits swap nothing while a fader move re-runs one sum; trigger policy holds under watch for free (build never generates generative sounds), which makes bloom choose against a running watch live variant A/B-ing; and slow renders can't glitch — the old mix loops until the new artifact lands atomically.

Queued in next.md behind the MCP surface line. Written in the §4 vocabulary that lands with #31; nothing here depends on the migration beyond spellings. Note next.md is also touched by #31 — whichever merges second gets a trivial rebase.

play --loop --watch keeps the loop playing while the project changes:
check gates every rebuild (a red project never stops the music), 'did
anything audible change' is an output-hash question the cache answers,
and the daemon takes the new mix at the next wrap — the bar-synced
in-place swap is recorded as the successor for when wrap latency
chafes. build --watch is the underlying headless verb; trigger policy
holds for free, so bloom choose against a running watch is live
variant A/B-ing.

@ninjudd ninjudd left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at head 2d8dde4 (via git show — the checkout stays on #31). Docs-only, CI green. One P3, inline: the §1.1 citation credits playback.md with recording the native-loop wrap, and it doesn't — nothing does, which is the sharper version of the problem. Everything else checks out against the records and the code as built.

Verified against the code and records:

  • Decision 3's correct-by-construction claim is true of the engine as built: outputs land atomically (tmp → CAS → action entry last, build.ts), mix inputs are stem content hashes so a fader move re-runs exactly one sum, and fmt/comment edits are cache hits by the canonical-spec design — "hash moved ⇒ swap, hash same ⇒ silence" needs no watcher intelligence the graph doesn't already have.
  • Decision 5 is real, not aspirational: the graph registers no rule node for a generative sound (buildGraph adds committed-content nodes only), so no watch-triggered build can ever generate one — and a chosen: repoint flows the new variant's content hash through stem and mix keys, so the live A/B-ing claim is exactly how the invalidation already works.
  • The --from note matches #23's architecture: region loops take the CLI requeue path (native loop requires no --from), so "the region re-applies to the new file" after a swap is the requeue path doing what it always does. CLI owns musical time, daemon never learns bars — consistent with the recorded seam.
  • The cross-PR vocabulary dependency is handled honestly: the status line names it, §1.2 (cited for trigger policy) exists on main today, §4 lands with #31, and the PR body flags the trivial next.md rebase whichever merges second.
  • List hygiene: next.md entry sits behind MCP surface as stated, links resolve, status line carries the date, sections are appended-only by construction (new file).
  • The daemon-version-bump-no-shims stance follows #23's version-guard precedent; excluding .bloom/ from the watch is load-bearing (materialized outputs would self-trigger) and the plan says why.

One footnote, no thread: --watch requires --loop, and §2 covers the --from requeue case — but multi-item play --loop (also a requeue path) is neither supported nor excluded by the text. Probably the answer is "one label per watch session" falling out of decision 4's build --watch <label> singular; a clause saying so would close the door §5's multi-target question half-opens.

Comment thread docs/projects/all/watch.md Resolved
@ninjudd
ninjudd merged commit 6a6fbb6 into main Aug 6, 2026
1 check failed
@ninjudd
ninjudd deleted the docs/watch-plan branch September 28, 2026 04:10
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.

1 participant