M5: wit-demo — the synthetic library the app is built and demoed against - #38
Merged
Conversation
Issue #18 depends on `just demo-library` to make first-run, the timeline and the watcher demoable on a machine with no real Logic library. That recipe called `cargo run -p wit-cli -- demo-library`, and `wit-cli` has never had a `demo-library` subcommand — the guard passed and cargo errored. This builds the thing the recipe was always calling. New crate `wit-demo` writes a ~/Music-shaped tree: Logic/Coastline.logicx 10 saves, one alternative Logic/Night Bus.logicx two alternatives (Logic's own branching) GarageBand/Kitchen Jam.band one save, no backups Ableton/Coastline Project/ five autosaves in Live's Backup/ layout 21 versions, all deterministic — no clock, no RNG, byte-identical run to run. The files carry real ProjectData and .als *framing* holding only the fields Wit extracts, so the whole toolchain reads them end to end: wit scan 3 Logic/GarageBand projects, 1 Ableton lineage, 21 archived (rescan archives 0 — idempotent) wit logic-report 12 pairs, 3 empty, 3 byte-different-but-identical wit diff-als "no musical change detected (view / bookkeeping only)", then "FX+ [Rhodes] added: AutoFilter", "CLIP~ ... muted", "TEMPO 120.0 -> 124.0 BPM", "SAMPLE~ 'rhodes take 3.wav' -> 'rhodes FINAL.wav' (1 clip reference(s))" Three deliberate choices: - **The Logic chain is shaped to measured reality, not to look good.** 3 of 9 pairs show nothing Wit can see, matching the 33% empty-verdict rate measured across 32 real projects, and all 3 are byte-different — §11's 28% case. A demo where every save had something to show would misrepresent the product, and a test pins the ratio so it cannot drift. - **GarageBand gets no backups**, because the probe found real GarageBand keeps none. Inventing some would teach the wrong shape. - **Its own crate, not wit-index.** wit-index documents as an enforced-by- construction property that its only write API takes bytes, not a path, so no caller can hand it a project path by mistake. A generator that writes a tree to a user-named path is precisely what that excludes. The guard rail moves with it: build_demo_library refuses any destination that is not empty, so pointing it at a real library cannot destroy anything. Also fixes a divergence this surfaced: tests/test_repo_hygiene.py's "no audio or DAW project file" check walks the filesystem, while its CI mirror reads `git ls-files`. Generating a demo library into target/ — gitignored, uncommittable — turned the local suite red while CI stayed green. The test now skips root-level target/ the way it already skipped .git. Verified it still fails on a stray tests/*.als. cargo test --workspace 149 passed, 0 failed (was 126; +21 wit-demo, +2 CLI) python3 -m pytest 293 passed, 13 skipped fmt / clippy -D warnings / cargo deny clean Part of #18. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
What and why
Issue #18 depends on
just demo-libraryso first-run, the timeline and the watcher are demoable on a machine with no real Logic library. That recipe calledcargo run -p wit-cli -- demo-library— andwit-clihas never had ademo-librarysubcommand. The guard passed, then cargo errored. This builds the thing the recipe was always calling, and it is the prerequisite for developing the app against something other than someone's real 28 GB library.New crate
wit-demowrites a~/Music-shaped tree:Logic/Coastline.logicxLogic/Night Bus.logicxGarageBand/Kitchen Jam.bandAbleton/Coastline Project/Backup/21 versions, fully deterministic — no clock, no RNG, byte-identical run to run (pinned by a test).
It reads end to end through the real toolchain
Three deliberate choices
The Logic chain is shaped to measured reality, not to look good. 3 of 9 pairs show nothing Wit can see — the 33% empty-verdict rate measured across 32 real projects (#15) — and all 3 are byte-different, §11's 28% case. A demo where every save had something to show would misrepresent the product, so a test pins the ratio and fails if it drifts.
GarageBand gets no backups, because the probe found real GarageBand keeps none. Inventing some would teach the wrong shape, and a test asserts their absence.
Its own crate, not
wit-index.wit-indexdocuments as an enforced-by-construction safety property that its only write API takes bytes, not a path, so no caller can hand it a project path even by mistake. A generator that writes a tree to a user-named path is exactly what that property excludes, so it lives here rather than eroding the claim. The guard rail moves with it:build_demo_libraryrefuses any destination that is not empty — pointing it at a real library cannot destroy anything, verified both at the library level and through the binary.The generated files carry real framing but only the fields Wit extracts. Logic and Live cannot open them, and the command says so on every run — a demo fixture must never be mistaken for a project.
One divergence this surfaced
tests/test_repo_hygiene.py's "no audio or DAW project file" check walks the filesystem; its CI mirror (check_no_binaries.sh) readsgit ls-files. Generating a demo library intotarget/— gitignored, uncommittable — turned the local suite red while CI stayed green, which is the wrong way round for a check whose whole value is failing in two seconds locally. It now skips root-leveltarget/the way it already skipped.git, with the reasoning in a comment. Verified it still fails on a straytests/*.als.Checklist
.gitignore)If this PR touches format parsing
This writes the two formats rather than parsing them, so both boxes apply in the mirror direction — every generated file is fed back through the real
wit-logic/wit-alsreaders in tests, and the offsets it writes are the offsets those crates read:walk_recordsonly returnsOkon an exact clean EOF, which every generated file reachesGates
Part of #18.
🤖 Generated with Claude Code