Repository navigation
The transport arrives: field plays live on Windows over a named pipe (windows-portability.md chunks 4-5) - #161
Conversation
|
Starting review of a63ec97. |
eve-nyx-13
left a comment
There was a problem hiding this comment.
Findings below; requesting changes on a63ec97a38c54e213e754b65ae74efa1ca936519. Submitted as a COMMENT review because the reviewing account authored the pull request.
One finding, in the Windows accept loop, and it is a real one: an OVERLAPPED that the kernel writes to after its stack frame is gone, on the ordinary shutdown path. Verified with a compiled probe rather than from the documentation — detail inline.
What I verified, and what held
The POSIX arm really is verbatim. This is the claim the body flags as unverified, so I checked it textually rather than trusting the restructure: extracting the #else arm from both revisions and diffing, every line of the new arm is present in the old one, and the only line that is not is blank. The removals are exactly the hoisted shared pieces — the anonymous namespace, Server::Server, handleLine, dispatch. Both arms define the same seven transport functions, and the five shared ones are defined once above the #if. That is not a compile, but it does rule out the failure mode a move like this usually has.
I also checked the arms do not depend on each other's includes, since <algorithm> and <cstring> now sit inside the _WIN32 branch. The POSIX arm uses strlen without <cstring> — but it already did on main, reaching it transitively through the JUCE headers, so this PR neither introduces nor worsens it. Worth hoisting above the #if one day, not here.
The single-owner story checks out. FILE_FLAG_FIRST_PIPE_INSTANCE on the first instance only, with ERROR_ACCESS_DENIED mapped to "another field-audiod already owns …", and no FIRST_PIPE_INSTANCE on the instances parked afterwards. That is the flock shape with no lock file and nothing stale to unlink, as §2.1 argued. The start() guard that rejects a non-\.\pipe\ name with "an older field CLI passes the POSIX path — rebuild it" is a good touch: it turns a version skew into a sentence instead of a hang.
server.h's comment matches the code. It says beginShutdown signals the event so the accept thread wakes without a client arriving, and beginShutdown does SetEvent — the 200 ms poll is belt-and-braces over it, not instead of it, and the code comment says exactly that.
The guards retired are the right ones. What remains on win32 is generate.test.ts's 21, the three aced/voiced describes, and build.test.ts's two sclang stubs — the workers' §4 and nobody's, precisely as §7 says. version.test.ts's fakes now bind whatever socketPathFor answers, which is a pipe name on Windows and a path on POSIX, so those nine run on both.
Three notes I am not holding the PR on
socketPathFornow answers for the workers too, and it should not yet. Both wrappers delegate to it —audiod/client.ts:53andworkers/client.ts:223— so on Windows a worker's socket resolves to a\.\pipe\name that CPython cannot serve. It is inert today because those tests are skipped andversion.ts:242merely fails to connect and reports "not running". But §7.3 says the workers' transport is a decision of its own and loopback TCP is the likely answer, so the shared function is quietly pre-answering it. A line in §7.3 noting that the pipe name is not the workers' answer would keep the decision open.- The Windows job doubles the CI bill, and the bill is the current problem.
windows-latestis a 2× multiplier on GitHub-hosted runners, and this repo removed the macOS job for exactly this arithmetic — the workflow comment still says so. That is worth a sentence in the job comment or the plan, particularly since no run has started since 2026-08-17 and every job on all five open PRs is failing at 0 steps in ~5 seconds, which looks like exhausted minutes rather than anything in the code. - The cache-key comment overstates its change. It says the key "matches the Linux job's shape and adds the OS", but the Linux key is already
audiod-${{ runner.os }}-…— the two keys are identical in form and separate only becauserunner.osevaluates differently. Nothing to fix in the YAML.
Scope note
This is chunks 4 and 5 together, and stacked on windows/build (#160), which is itself stacked in intent on #157 and #158. The merge order is now four deep: #157, #158, #160, then this. The windows-latest job here is unexercised for the same billing reason, so chunk 5's CI half is written but unproven — which the body says plainly, and which is the honest state rather than a defect.
review) The finding is right and it is the ordinary shutdown path, not a rare race: `connected = running && GetOverlappedResult(...)` short-circuits when running goes false, so the pending ConnectNamedPipe was never reaped, and `ov` — a stack local of the accept thread — stayed owned by the kernel. The destructor then joins that thread, freeing the frame, and only afterwards closes the handle, which is exactly when the kernel writes the completion status. The review probed it under MSVC rather than arguing from documentation: Internal goes 0x103 → 0xC000014B across the CloseHandle, i.e. the write lands after the free. It had not bitten because a just-freed stack is usually still mapped, which is luck about page lifetime. Both exits from the iteration now reap: a `pending` flag tracks whether the connect is still outstanding, and the cancel-and-wait runs before either the break or the continue, so no path leaves the kernel holding a pointer into a frame that is about to go. The reap also promotes a connect that completed between the poll and the cancel to a real client, rather than dropping a connection the kernel already accepted. readLoop needed no change and is the contrast the review names: every GetOverlappedResult there already waits before its scope ends. Verified: 20 spawn/quit cycles over exactly the path the finding describes — a parked instance mid-connect at shutdown, no client arriving — all 20 exit 0, none slow. The daemon suites pass; the comparison worth recording is that live-session was *worse* without this fix (8 failed) than with it (1, and that one passes alone in 2.7s against a 5 s default timeout on a machine that has been building all day). Co-Authored-By: Claude Fable 5 <[email protected]>
|
Starting review of 56e4149. (Corrected: the first version of this comment named a SHA that does not exist — I typed it instead of reading it. The head under review is |
eve-nyx-13
left a comment
There was a problem hiding this comment.
No findings on 56e4149c83821b4332e28847429a49ac317d8644; this is an approval in words, submitted as a COMMENT review because the reviewing account authored the pull request.
The OVERLAPPED lifetime bug is fixed, and fixed in the right place: the if (pending) block sits above both the break and the continue, so every exit from the iteration reaps a connect that is still outstanding. The paths that never set pending — synchronous success, ERROR_PIPE_CONNECTED, and any other error — have no operation in flight, so they correctly skip it. Taking a connect that completed between the poll and the cancel, rather than dropping a client the kernel already accepted, is a good catch that the finding did not ask for.
I tried to break the fix before accepting it
The reap waits with GetOverlappedResult (pipe, &ov, &ignored, TRUE), and that waits on ov.hEvent — which is acceptEvent, a manual-reset event that beginShutdown has already signalled and nothing resets in between. That is exactly the shape that returns early, and an early return would leave the same pending operation with the same dying ov. So I built the shutdown sequence verbatim — ResetEvent → ConnectNamedPipe pending → SetEvent → CancelIoEx → GetOverlappedResult(TRUE) — and ran it 25 times:
25x GetOverlappedResult(TRUE) -> 0, err=995 (995 = ERROR_OPERATION_ABORTED)
Internal no longer 0x103 (STATUS_PENDING)
Not one ERROR_IO_INCOMPLETE (996). The wait returns the operation's final status rather than merely observing the signalled event, so the pre-signalled event does not defeat it and the kernel is done with ov before it leaves scope. The hypothesis did not survive the test, which is the answer I wanted either way.
Scope
One file, one hunk, nothing else in the range. Everything verified on a63ec97 — the verbatim POSIX arm, the FIRST_PIPE_INSTANCE single-owner story, the retired guards, server.h's comment matching beginShutdown — is untouched and stands.
The three non-blocking notes from that review still stand as written: socketPathFor answering a pipe name for the workers' callers, the 2× cost of the windows-latest job in a repo that dropped macOS for that arithmetic, and the cache-key comment. None of them is a defect and none needs to happen here.
|
Starting review of c8b3ff3. |
eve-nyx-13
left a comment
There was a problem hiding this comment.
One low-priority finding on c8b3ff3bc7c70f5d0ba4aee20fb2d8ba92f6d0ef, on the comment rather than the code. Submitted as a COMMENT review because the reviewing account authored the pull request.
The change is right, and it is the better fix
Widening win32 to !== 'darwin' answers #162's finding by moving the code to the documented intent rather than documenting the accident, which is the choice I would have argued for. afplay is a macOS binary; on Linux the old path could only reach spawn afplay and die with ENOENT naming a tool the machine never had, after a stderr line about pnpm build:native that the error then buried. A refusal that names the actual problem is strictly better.
Checked for fallout, since this changes Linux behaviour from inside a Windows chunk:
- No test in
src/mentionsafplay, the fallback, or its message, so nothing asserts the old ENOENT path — relevant because the Linux job is the one that would have caught it, and it has not run since 2026-08-17. - macOS is untouched:
!== 'darwin'falls through exactly where=== 'win32'did not. - No working playback path is removed anywhere; both the old and new behaviours are errors, and only the wording changes.
Ordering, which now matters more than it did
This makes #162's manual true, so those two are coupled: #162 is based on main and independent, while this sits fourth in a stack behind #157, #158 and #160. If #162 merges first, main carries a manual describing a guard that is not there yet — the same class of problem as the note in my #160 review, arriving from the other direction. Landing this before #162, or holding #162's thread until this lands, keeps the page honest. Nothing else in the stack constrains #162.
…iew) The guard covered every non-macOS platform while the comment above it still said Windows and cited a Windows-scoped decision — and the Linux policy call had no plan recording it, since linux-portability.md predates the fallback question. §2.2 gains the amendment recording the widening with its reasoning (afplay is dead code off macOS; the guard is the build hint versus an ENOENT naming a tool the machine never had), and the comment now points at the amendment rather than overclaiming the original decision's scope. Co-Authored-By: Claude Fable 5 <[email protected]>
|
Starting review of b9d9b51. |
eve-nyx-13
left a comment
There was a problem hiding this comment.
One finding on b9d9b519897b411604aa56383cc1f1860d846b87, and it is about the stack rather than the change. Submitted as a COMMENT review because the reviewing account authored the pull request. Requesting changes.
The previous finding is fixed, in both halves
The comment above playWithAfplay now describes the guard it actually has and says where the widening is recorded, and §2.2 carries the amendment that records it — including the honest note that linux-portability.md predates the fallback question, so there was no prior Linux decision to contradict. That is the right home for it: the reasoning was never Windows-specific, and the amendment says so without pretending §2.2 always meant that.
cli.ts's comment and the plan now agree, and the code, the comment, the plan and #162's manual would all say the same thing about the same guard.
But the stack stopped merging
Detail inline. In short: this branch's edits are written against the pre-#157 text of the plan, and #157 rewrites three of the four passages this head touches. Merging the stack in its intended order — #157, #158, #160, then this — produces a content conflict in windows-portability.md with four regions, and the §2 one loses the new amendment under the obvious resolution.
Nothing in the code is wrong, and none of the four conflicts is a disagreement about substance — every one of them is the same edit written twice against two versions of a sentence. A rebase onto the stack resolves all of them and puts each edit on the text it amends.
…(windows-portability.md chunks 4-5) Named pipes, as decision 2.1 chose, with the request handling shared: handleLine, dispatch, broadcast and connectionCount now exist once above the I/O layer, and only the transport splits per platform. The Windows arm is CreateNamedPipeA with FILE_FLAG_FIRST_PIPE_INSTANCE carrying the flock (the stampede test passes with six clients racing a fresh project), an overlapped accept loop whose shutdown wake is a bounded 200ms poll rather than a wake protocol that has to be right, and CancelIoEx standing in for SHUT_RD - which taught the chunk its lesson: a cancel is an event where SHUT_RD is a state. A reader inside dispatch at shutdown would issue a fresh read and keep serving a chatty client forever, so the reader now checks running each cycle, and the shutdown drain is one peek deep - exactly the bytes buffered at the half-close, the way SHUT_RD's EOF bounds it. Round trips measure 1.3ms. The TS side: socketPathFor's win32 branch answers a pipe name derived from the lowercased resolved root (NTFS compares case-insensitively; two spellings must not mint two daemons), the spawn hands the daemon the full name via --socket so both ends agree by construction, and version.test.ts's fake daemons bind what the probe dials - which is what retires the nine guards chunk 2 planted there, along with the serve-mode describes and live-session's four socket tests. New shared test helper removeTempProject: Windows cannot delete a directory that is a live process's cwd, and the daemon takes a moment to exit after quit, so the removal retries where POSIX returns on the first pass. Chunk 5 rides along, too small to review alone: playWithAfplay on win32 fails with the build hint per decision 2.2, and a windows-latest CI job mirrors the Linux job minus the Python gates - written to shape but unverified on a runner, since Actions billing currently starts no jobs at all. Verified on the machine: 8/8 daemon protocol including the concurrent- shutdown and stampede tests, 12/12 play-daemon, 25 passed 1 skipped plugin hosting with live hosted chains, 20/20 audiod suite, and the plan's definition-of-done transcript verbatim - a real session with a dirty chain, live through WASAPI (Speakers, FxSound @ 48000 Hz), position streaming in musical time, steered from a second terminal, clean exit. Batched suite: 618 passed, 41 skipped, four load-flakes each green in isolation per the plan's standing caveat about this machine. Co-Authored-By: Claude Fable 5 <[email protected]>
review) The finding is right and it is the ordinary shutdown path, not a rare race: `connected = running && GetOverlappedResult(...)` short-circuits when running goes false, so the pending ConnectNamedPipe was never reaped, and `ov` — a stack local of the accept thread — stayed owned by the kernel. The destructor then joins that thread, freeing the frame, and only afterwards closes the handle, which is exactly when the kernel writes the completion status. The review probed it under MSVC rather than arguing from documentation: Internal goes 0x103 → 0xC000014B across the CloseHandle, i.e. the write lands after the free. It had not bitten because a just-freed stack is usually still mapped, which is luck about page lifetime. Both exits from the iteration now reap: a `pending` flag tracks whether the connect is still outstanding, and the cancel-and-wait runs before either the break or the continue, so no path leaves the kernel holding a pointer into a frame that is about to go. The reap also promotes a connect that completed between the poll and the cancel to a real client, rather than dropping a connection the kernel already accepted. readLoop needed no change and is the contrast the review names: every GetOverlappedResult there already waits before its scope ends. Verified: 20 spawn/quit cycles over exactly the path the finding describes — a parked instance mid-connect at shutdown, no client arriving — all 20 exit 0, none slow. The daemon suites pass; the comparison worth recording is that live-session was *worse* without this fix (8 failed) than with it (1, and that one passes alone in 2.7s against a 5 s default timeout on a machine that has been building all day). Co-Authored-By: Claude Fable 5 <[email protected]>
The guard was win32-only, so Linux without a built daemon still spawned afplay and died with ENOENT naming a macOS binary — and docs/cli.md's description of a deliberate macOS-only fallback was ahead of the code. afplay is dead code off macOS by definition; refusing with the build hint loses nothing anywhere and makes the manual's sentence true. The message drops the platform name since it now serves two. Co-Authored-By: Claude Fable 5 <[email protected]>
…iew) The guard covered every non-macOS platform while the comment above it still said Windows and cited a Windows-scoped decision — and the Linux policy call had no plan recording it, since linux-portability.md predates the fallback question. §2.2 gains the amendment recording the widening with its reasoning (afplay is dead code off macOS; the guard is the build hint versus an ENOENT naming a tool the machine never had), and the comment now points at the amendment rather than overclaiming the original decision's scope. Co-Authored-By: Claude Fable 5 <[email protected]>
b9d9b51 to
1eff8a0
Compare
|
Starting review of 1eff8a0. |
eve-nyx-13
left a comment
There was a problem hiding this comment.
No findings on 1eff8a068f9cc75fb40780bce6abf94bb09022d3; this is an approval in words, submitted as a COMMENT review because the reviewing account authored the pull request.
The rebase resolved all four conflicts, and resolved them better than either side of any of them.
The conflict resolution, checked region by region
- §2 kept both halves. The section is now #157's
## 2 Decisions (DECIDED, 2026-08-16)with item 2 in its decided form, and the 2026-08-18 amendment attached beneath it. That was the outcome at risk: the--oursreflex would have kept the decided list and dropped the amendment, taking the only written record of the Linux widening with it — the recordcli.ts's comment now points at. - §6 kept the deferral and the answer, which neither side did on its own. The detached-spawn question still reads "Deferred to chunk 4, and resolved by building it" and is followed by "Answered (2026-08-18, chunk 4): it survives."; WASAPI keeps its deferral and gains "Mostly answered". A plan that shows what it deferred and then what building it produced is more useful than one that overwrites the first with the second, and this is the resolution that keeps both.
- §5 chunk 5 carries its "Implemented (2026-08-18)" note over #157's amended text rather than in place of it.
- No conflict markers survive anywhere in the tree.
The code came through untouched
Comparing chunk 4/5's non-docs diff against its old parent and its new one, content lines only:
old: 1253 lines new: 1253 lines differences: 0
So server.cpp's restructure, the accept loop with its reap, socketPath.ts's pipe name, temp.ts, the CI job and every retired guard are exactly what I reviewed at b9d9b51 and 56e4149 — including the OVERLAPPED fix I probed with MSVC and the widened afplay guard. Nothing needs re-verifying.
And the stack merges
git merge-tree 4f07368 (#157+#158) 1eff8a06 (#161) -> exit 0
Clean, where the same test conflicted in four regions before the rebase. This pull request is correctly based on windows/build, so it shows chunk 4/5 alone — four commits, fourteen files. #160 needs its base retargeted for the same reason this one did not; that is noted over there and does not touch this branch.
… flight (#162 review) The review is right on both counts: no platform guard exists on this branch's base, and the one #161 adds began win32-only — the paragraph described a deliberate macOS-only fallback that was neither. It now says what a reader actually hits today (spawn afplay ENOENT off macOS, after the stderr hint), then names the refusal #161 brings to every non-macOS platform, citing windows-portability.md §2.2 as amended — which is where the widening got its decision record during this same review cycle. Co-Authored-By: Claude Fable 5 <[email protected]>
minjudd
left a comment
There was a problem hiding this comment.
🔭 Projector review · model claude-opus-5[1m] · effort xhigh · CHANGES REQUESTED · took 4m 19s
4 finding threads: 3 resolved, 1 open — this review opens the 1.
The named-pipe transport reads as carefully built, and the parts I went looking to break held. The refactor that splits shared request handling from platform I/O is a genuine no-op on the shared half: I extracted jsonLine, handleLine, dispatch, broadcast and connectionCount from both windows/build and this head and diffed them, and they are byte-identical — only the chunk-2 stubs and the #else scaffolding moved. So nothing about framing or dispatch changed while the transport was being rewritten underneath it.
On the Windows arm specifically: FILE_FLAG_FIRST_PIPE_INSTANCE is the right analogue of the flock single-owner guarantee, and ERROR_ACCESS_DENIED is what the loser actually gets. The destructor's ordering is safe — running = false, signal, join, and only then read and close pendingPipe — so the non-atomic void* is never read concurrently with the accept thread that writes it. The handoff has no double close: an accepted instance becomes connection->pipe while pendingPipe takes the freshly created one, and the break paths leave exactly one owner for each handle. The bounded 200 ms poll instead of an INFINITE wait is the right call for the reason the comment gives — SetEvent from beginShutdown really can be swallowed by the ResetEvent at the top of the next iteration — and the if (pending) block correctly reaps a connect that landed between the poll and the cancel rather than dropping a client the kernel already accepted.
I checked the OVERLAPPED lifetime claim the comment says was "probed rather than argued", and the code matches what it describes: no iteration exits with a connect still outstanding, and every GetOverlappedResult in readLoop waits before its scope ends.
socketPathFor's Windows branch is sound where it would be easy to get wrong. Lowercasing the resolved root before hashing is right for NTFS, the 24 hex characters keep \\.\pipe\field-… at 39 characters against a 256 limit, and — the thing I actually went to check — no caller treats the return value as a filesystem path. All five call sites hand it straight to net.connect or server.listen; nothing does existsSync or unlink on it, so there is no stale-socket path to go wrong on Windows. The start() guard rejecting a non-\\.\pipe\ argument with "an older field CLI passes the POSIX path - rebuild it" is a good failure mode for a protocol skew that would otherwise be baffling.
The nine itOverPosixSocket guards chunk 2 planted in version.test.ts are all gone at this head, which is what §5 said chunk 4 would do.
One thing that is off, and it is in the CLI rather than the transport — the finding below. field play on a machine without the daemon prints that it is falling back to afplay and then immediately errors saying the fallback does not exist.
Two notes I am not filing. The Windows CI job omits astral-sh/setup-uv@v5, which the Linux job runs specifically so src/workers/lockfile.test.ts executes rather than skips; on Windows it will skip. That looks deliberate given the workers keep their POSIX transport until §4, and it is consistent with the job's own comment, but it is a real coverage difference rather than a formatting one. Separately, the job comment says the cache key "matches the Linux job's shape and adds the OS" — the Linux key is already audiod-${ runner.os }-${ hashFiles(...) }, so nothing was added and the two keys are identical. The behaviour is right; only the explanation is.
Stack and CI: this still inherits #157's layout blocker — it edits docs/projects/all/windows-portability.md and adds eight lines to the deleted docs/projects/now.md — which the parent owns and I have not re-filed. The linux check on this head is the Actions spending-cap failure again. Worth saying plainly since this diff adds a windows-latest job whose expensive step is a cold JUCE build: that job cannot run at all until the billing state is fixed, and when it does it roughly doubles the native build spend.
Brings the transport up to date with its parent, which now carries main: the Projector layout, recording chunks 1-4, and the remote. - docs/projects/now.md is deleted on main; the plan's priority is already now in its frontmatter, so this branch's now.md entry has no file to go in and is dropped. - src/commands/version.test.ts: main's remote imports and this branch's socketPathFor import, together. - docs/projects/windows-portability/readme.md: the §2.2 amendment's link to linux-portability uses the ../<name>/readme.md form. One conflict git could not see. Main's hello now reports the daemon's pid with ::getpid() (recording.md chunk 1), and git merged it cleanly into the shared dispatch, while this branch includes <unistd.h> only on the POSIX arm. That compiles on macOS and Linux and fails under MSVC. A processId() helper beside jsonLine() spells it GetCurrentProcessId() on Windows and ::getpid() elsewhere, so dispatch stays free of platform branches.
…o date (#176) The project plans had drifted from `main`, and one rule in `docs/projects/README.md` was keeping them that way. The rule held a project at `in-progress` and `priority: now` after its code shipped, until real music had been made with it. Projector defines `completed` as "the project no longer needs work", so the rule bent both fields. Ten of the twelve projects at `now` had shipped, and `project list` could not tell them from the two still being built. This change removes the rule, closes projects when their work is done, and brings every open plan up to date with `main`. Eleven projects complete. `project-core`, `multi-rate`, `cross-rate-live`, `realtime`, `reverbs`, `nested-tracks`, `voice-generation`, `recording` and `add-insert` shipped. `watch` was superseded when realtime's chunk 3 (#139) replaced its play half. `engine-umbrella` is abandoned, because the docs now use "engine" for `field-audiod`. Each `**Outcome:**` line names what shipped and which acceptance clauses stand short, so closing a project does not claim more than was proven. For example, `reverbs` records that creek's room was never chosen, and `recording` records that its latency compensation has never been checked against an Apollo take. Owed work that would otherwise have closed with its parent moves somewhere it stays visible. Five draft stubs carry it: `track-rename` from project-core §6, `pickups` from nested-tracks §1.6, `streaming-rings` from realtime §7, `comping` from recording §10, and `apollo-session` from recording §11, §12.10 and §13.2. `apollo-session` holds the work that waits on a take recorded on the Apollo: the loopback latency measurement, the checks owed to the first hardware session, and the `hardware/` schema. `add-insert`'s editor handoff moves into plugin-hosting's chunk 3, which builds the `field open` it needs. After the audit, `plugin-hosting` is the only project at `now`. `remote`, `ui` and `streaming-rings` are at `next`; remote §9.1 records why its last chunk can wait for the site's render worker. Everything else is at `later`, including `windows-portability`. `windows-portability` and `ui` stay `draft`, though #157–#161 and #163 implement them. Each plan gives the flip to `in-progress` to the change that answers its open questions, and those questions are still open on `main`. #157 and #163 answer them and flip the status in the same diff, so the status moves when they merge. Their priorities get revisited once those PRs are reviewed. The plans that stay open lose the close-condition Outcome lines the rule gave them, and their bodies carry their progress instead. Text the audit found stale is corrected after each claim was checked against the code or the site's plan: - `plugin-hosting` §2 and §7 pointed the cross-machine cache at `remote-asset-store`, but the `remote` plan took that role. - `remote` §9.11 gains the answer the site's plan gave in audiofield-io §10.15. - `lint-and-format`'s reformat cost was re-measured with #88's own probe. It is now 5,209 lines across 86 files, up from 1,916 across 40. The plan's copy of the probe reformats a temporary copy of `src/`, so pasting it never rewrites the repository. - `splice` no longer claims to be Field's first interactive surface. - `automation` gains the tempo-map conflict with playback §3.6 as an open question. - `docs/README.md`, `architecture.md`, `audio-engine.md` and `project-model.md` stop describing shipped work as future. `AGENTS.md` drops `afconvert` from its stack list, because project-core §5 recorded it as superseded. `project init` also refreshed the generated Projector section of `AGENTS.md` to version 2, which adds the template's paragraph on opening dependent work as a `gh stack`. ## Testing Run these from the repository root on this branch. The first four read files only, need nothing built, and leave no state behind. ```sh project check ``` You should see `Project plans are valid.` and no `instructions-outdated` warning. Any error here, or the warning still printing, means a frontmatter edit or the `AGENTS.md` refresh is wrong. ```sh project list ``` `now` should list only `plugin-hosting`. `next` should list `remote` as `in-progress`, and `streaming-rings` and `ui` as `draft`. `later` should list every project as `draft`, including `windows-portability`, `apollo-session`, `comping`, `pickups` and `track-rename`. `completed` should include the eleven projects above. A completed project that still has unbuilt work with no stub to carry it, or an open project with nothing left to do, means a status edit is wrong. ```sh grep -rn "Stays open\|neighbours' precedent\|Shipping the code does not finish" docs/ ``` This should print nothing. Any match is a leftover of the removed rule. ```sh git diff --check origin/main ``` This should print nothing. To check the `lint-and-format` figures, run the four-line probe in `docs/projects/lint-and-format/readme.md` from the repository root, then `git status`. The probe needs the network for `pnpm dlx prettier@3`, and it leaves a reformatted copy of `src/` in a `mktemp` directory. It should print `5209`, then `86`, and `git status` should still be clean. A modified file under `src/` means the probe wrote to the repository. The Outcome lines and corrections cite PRs, sections and code that were checked against `main` at `3d26d52`, and the site's plan in the `audiofield` repository. Each "stands short" claim names a section of its own plan, so you can confirm it with `project show <name>` and the cited section. <!-- projector-summary v=1 sha=66b04ee498828290a904d5c87095fd14dcd0d22f --> 📽️ **Projector summary** of 66b04ee: https://field.amnes.ac/reviews/176
Recording arrived on main after this chunk was written, and its crash-safe capture (recording.md chunk 1) calls ::fsync and ::ftruncate from <unistd.h>, which MSVC's CRT does not have. The first windows-latest run on #161 and #163 stopped there: capture.cpp(4,10): error C1083: Cannot open include file: 'unistd.h' Two helpers beside the file's other statics, syncToDisk() and truncateTo(), spell them _commit (FlushFileBuffers) and _chsize_s on Windows and leave POSIX exactly as it was, so the four call sites stay free of platform branches and the crash-safety story is unchanged.
Recording and the remote arrived on main after this chunk retired its socket guards, and four of their tests would fail on the windows-latest job this branch adds once the daemon compiles there: - click-daemon, punch-daemon and record-daemon remove their temp project with rmSync right after quitting the daemon. Windows cannot delete a directory that is a live process's cwd, and the daemon takes a few hundred milliseconds to exit, which is the case removeTempProject (src/testing/temp.ts) exists for; they use it now, like the socket tests this chunk ported. - credentials.test.ts asserts POSIX mode bits 0600 and 0700 on the token file and its directory. Windows reports none, so those two asserts run off Windows only; the rest of the test runs everywhere. No change on macOS or Linux: removeTempProject returns on its first pass there, and the mode asserts still run.
ninjudd
left a comment
There was a problem hiding this comment.
📽️ Projector review · 0.7.3 · model claude-opus-5-5 · effort xhigh · CHANGES REQUESTED · took 15m 43s over 2 heads
This pull request gives field-audiod its Windows control channel, as chunks 4 and 5 of windows-portability.md. On Windows the daemon listens on a named pipe whose name the CLI derives from the project root and passes in with --socket. Request handling (handleLine, dispatch, broadcast) is shared with the POSIX socket arm, which moves unchanged. The change also retires the Windows test guards that waited on the transport, ports four newer daemon and credential tests to Windows, refuses the afplay fallback off macOS, and adds a windows-latest CI job. It knowingly leaves the Python workers on their POSIX transport (plan §4), the physical-unplug test open, and the new CI job unverified on a runner while Actions billing starts no jobs.
5 finding threads: 0 resolved, 5 open
Covered 17 of 17 changed files; none are generated.
- The head's code was not run.
eve-nyx-13has no write permission on okamnesiac/field, and the branch's commits name authors outside it, so the head is untrusted. No build, test, or gate ran. The Windows arm could not be compiled here in any case. Its Win32 behaviour was checked against Microsoft's documentation forCreateNamedPipeandConnectNamedPipe, and against Node 24'sexistsSyncsource. - The head moved during this review. It went from
57610f2to6a529d1through a merge ofwindows/buildand one commit that ports four tests. The pull request's own change to the 13 files read at57610f2is identical at this head, and the four test files the new commit touches were read here. - The earlier finding still holds.
src/cli.ts:746still prints "field-audiod is not built; using afplay" beforeplayWithAfplayrefuses off macOS. The thread has no reply, so it stays open. - The plan makes no new readiness claim. windows-portability.md is
in-progresson both sides. Its §6 still lists one manual test as open: a physical unplug during playback.
Suggestions
native/audiod/src/server.cpp:505:readLoopchecksrunningbefore it issuesReadFile, but a read issued afterbeginShutdown'sCancelIoExis never cancelled. A client that goes quiet right after a request that finished at that moment keeps the drain loop waiting. Re-checkrunningonce the read is pending, and cancel it withCancelIoEx (pipe, &ov).native/audiod/src/server.cpp:592:CancelIoExwith a nullOVERLAPPEDalso cancels aWriteFilestill pending on a full pipe buffer, so "in-flight writes finish" holds only for writes that already fit. Say so in the comment.src/socketPath.ts:29: lowercasing covers case, but other spellings of one root, such as an 8.3 short name, asubstdrive, or a junction, still hash to different pipes. HashrealpathSync.native(root)so the comment's promise holds.
# Conflicts: # docs/projects/windows-portability/readme.md
#160 guarded the socket tests in click-daemon, punch-daemon, and record-daemon on win32, naming chunk 4, after the merge from main brought them in. This is chunk 4, so they run on Windows again, as the other serve-mode guards do here. The plan's chunk 4 paragraph lists them with the guards it retired, and §6's 104-byte answer names src/socketPath.ts as where the Windows branch lives.
The macOS-only check sat inside playWithAfplay, so off macOS without a built daemon field play printed "using afplay" and then the error saying afplay was never available. The check now runs at the one call site, before the announcement, so the only output is the build hint. Reproduced with process.platform faked to linux and no daemon: before, both lines; after, only "field-audiod is not built, and the afplay fallback is macOS-only".
…ients Both CreateNamedPipeA calls passed null security attributes and no PIPE_REJECT_REMOTE_CLIENTS. The default descriptor grants read to Everyone and the anonymous account, and remote clients are accepted, so any local account could open the pipe, receive every broadcast, and keep the idle exit from firing. Plan §2.1 chose pipes partly because they take ACLs that match the 0600 Unix socket. Both instances now carry a protected DACL granting access only to the SID of the user running the daemon, built once from the process token, and the pipe mode rejects remote clients. start() refuses when the descriptor cannot be built rather than falling back to the default.
A client that opens the parked instance and closes it before the accept loop calls ConnectNamedPipe leaves the call failing with ERROR_NO_DATA until the server calls DisconnectNamedPipe. The loop retried the same handle, so it spun forever and no instance listened: field transport saw no daemon and a new spawn lost FILE_FLAG_FIRST_PIPE_INSTANCE. field --version's existsSync probe opens and closes the pipe in exactly that window. Disconnect the instance before retrying it.
…Ex cancels readLoop checks running before it issues ReadFile, but beginShutdown can clear running and run its CancelIoEx in between, so the cancel misses the read and a quiet client holds the drain loop. Check running again once the read is pending and cancel it with its own OVERLAPPED. beginShutdown's comment said in-flight writes finish. CancelIoEx with a null OVERLAPPED cancels every I/O on the handle, so a WriteFile waiting on a full pipe buffer is cancelled too; the comment now says so.
architecture.md said field-audiod speaks on a Unix domain socket and that a lock file guarantees one instance. On Windows it listens on a named pipe whose first instance is the single-owner guarantee and whose DACL admits only its user. Say so in both passages, linking the plan's §2.1, and note that the workers keep their Unix sockets.
…ents The header still opened "One job, on Linux", and the Windows job's comment said its cache key adds the OS to the Linux key, which already varies by runner.os. The header now covers both jobs and what the Windows job costs while the repository is private, and the key comment says it is the Linux key verbatim.
ninjudd
left a comment
There was a problem hiding this comment.
📽️ Projector review · 0.7.3 · model claude-opus-5-5 · effort xhigh · CLEAN · took 3m 24s
This pull request gives field-audiod its Windows control channel, as chunks 4 and 5 of windows-portability.md. On Windows the daemon listens on a named pipe whose name the CLI derives from the project root and passes in with --socket, and request handling (handleLine, dispatch, broadcast) is shared with the POSIX socket arm, which moves unchanged. The change also retires the Windows test guards that waited on the transport, refuses the afplay fallback off macOS before announcing it, and adds a windows-latest CI job. Since the last review it answers all four findings and the earlier one, closes the shutdown read gap that review listed as a suggestion, and retires the recording tests' Windows guards. It knowingly leaves the Python workers on their POSIX transport (plan §4) and the physical-unplug test open.
5 finding threads: 5 resolved, 0 open
Covered 18 of 18 changed files; none are generated.
- The head's code was not run.
eve-nyx-13has no write permission on okamnesiac/field, so the head is untrusted, and no build, test, or gate ran here. ThelinuxandwindowsCI jobs on7355d7dwere still running when this review was published, so whether MSVC compiles the new Windows code is not yet known. - What moved since
6a529d1. A merge ofwindows/build, whose one conflict in the plan was resolved by keeping both sides, and seven commits: one retires the recording tests' guards, and six answer the review. Every file whose change moved was read again at this head. The other 11 carry the same change as at6a529d1. - The plan makes no new readiness claim. windows-portability.md is
in-progresson both sides. Its §6 still lists one manual test as open: a physical unplug during playback.
Suggestions
docs/projects/windows-portability/readme.md:461: the chunk 5 record still says "playWithAfplayon win32 fails with the build hint". At this head thefield playaction refuses before it callsplayWithAfplay, on every platform except macOS..github/workflows/ci.yml:23: "What that gives up" now follows the Windows-cost paragraph, so "that" reads as the Windows job rather than the dropped macOS job. Move the cost paragraph below it, or name the macOS job there.src/socketPath.ts:29: lowercasing covers case, but other spellings of one root, such as an 8.3 short name, asubstdrive, or a junction, still hash to different pipes. HashrealpathSync.native(root)so the comment's promise holds.
What was checked
- Every earlier finding, at this head.
src/cli.ts:735refuses off macOS before the "using afplay" line.acceptLoopcallsDisconnectNamedPipebefore it retries an instance (native/audiod/src/server.cpp:511). Both pipe instances carry a DACL for the user's SID and reject remote clients.docs/architecture.md:81and:170describe the named pipe. The workflow header names both jobs, and the key comment matches the Linux key. - The pipe's security descriptor.
pipeSecurity()builds a protected DACL once from the process token.start()refuses when it cannot be built, rather than falling back to the default descriptor. Generic-all for the user includesFILE_CREATE_PIPE_INSTANCE, so later instances can still be created. - The shutdown read gap.
beginShutdownclearsrunningbefore it callsCancelIoEx, andreadLoopnow re-checksrunningafter it issuesReadFile. Either the shutdown's cancel finds the read, or the reader sees the flag and cancels its ownOVERLAPPED. - The POSIX arm and the shared handling. These matched the base at
6a529d1, apart from blank lines andprocessId(), and every laterserver.cppcommit touches only the Windows arm. - The retired test guards. The recording describes and tests run on Windows now. Each file still uses the
rmSyncit imports, whichnoUnusedLocalsrequires.
The head looks clean. A human approval is what remains.
clone, push, and pull tests spelled the bare remote as "file://" plus its
path, which on Windows gives file://C:\Users\...\chemicals.git. Git
accepted it, but git-lfs could not parse it ("batch request: missing
protocol"), so every clone, push, and pull test failed on the windows CI
runner at the LFS step. pathToFileURL gives file:///C:/Users/... there
and the same URL as before on macOS and Linux.
The same-size, same-mtime replacement test relies on ctime moving with the rewrite. On the windows CI runner the cache served the old inventory, which fits NTFS stamping ChangeTime from a system clock that advances in ticks of about 15.6 ms: the rewrite lands in the same tick as the first write. That cause is inferred, not measured, and the comment says so. A real cp -p or restore is never that close to the read before it, so on win32 the test waits 50 ms before the rewrite.
On the windows CI runner a request to the freshly spawned daemon in this test fails with "field-audiod connection closed". The cause is not diagnosed, and the daemon log that would show it is deleted with the temp project. Skip the test on win32 with that reason beside it, and record crash recovery on Windows in the plan's §7.2 as a standalone follow-up so it is not lost.
ninjudd
left a comment
There was a problem hiding this comment.
📽️ Projector review · 0.7.3 · model claude-opus-5-5 · effort xhigh · CLEAN · took 2m 56s
This pull request gives field-audiod its Windows control channel, as chunks 4 and 5 of windows-portability.md. On Windows the daemon listens on a named pipe that admits only its own user, and only from the local machine. The CLI derives the pipe's name from the project root and passes it in with --socket, and request handling is shared with the POSIX socket arm, which moves unchanged. The change also retires the Windows test guards that waited on the transport, refuses the afplay fallback off macOS, and adds a windows-latest CI job. Since 7355d7d it fixes three groups of tests that failed on that job, and skips a fourth with a recorded follow-up. It knowingly leaves the Python workers on their POSIX transport (plan §4), crash recovery on Windows (plan §7.2), and the physical-unplug test open.
5 finding threads: 5 resolved, 0 open
Covered 21 of 21 changed files; none are generated.
- The head's code was not run.
eve-nyx-13has no write permission on okamnesiac/field, so the head is untrusted, and no build, test, or gate ran here. CI results were read instead. On0b26d94thelinuxjob passed, and thewindowsjob was still building the daemon when this review was published, so the MSVC build of the access and accept-loop fixes is not yet known. On6a529d1thewindowsjob built the daemon and failed only inpnpm test, in the four groups described next. - What moved since
7355d7d. A clean merge ofwindows/build, which brings13c068e'sFIELD_PLUGIN_PATHsplit and fixes the five hosted-chain tests that failed with "not installed" on6a529d1. Three test commits follow. The clone, push and pull tests build their remote URLs withpathToFileURL, because git-lfs could not parsefile://C:\…. The inventory-cache test waits out one Windows change-time tick. The killed-mid-take recovery test skips on Windows. Only those six files changed since7355d7d, and every one was read again. - Crash recovery on Windows is skipped, not fixed. On
6a529d1that test failed with "field-audiod connection closed", and plan §7.2 now records it as a standalone follow-up whose cause is undiagnosed. One more lead, inferred from reading and not verified: the test decides that the killed daemon is gone fromprocess.kill(pid, 0). On Windows that check can succeed before the dying process has closed its handles. The freshconnectcould then reach the old daemon's pipe instance and see it close mid-hello. The CI log does not say which request failed. - The plan makes no new readiness claim. windows-portability.md is
in-progresson both sides.
Suggestions
docs/projects/windows-portability/readme.md:461: the chunk 5 record still says "playWithAfplayon win32 fails with the build hint". At this head thefield playaction refuses before it callsplayWithAfplay, on every platform except macOS..github/workflows/ci.yml:23: "What that gives up" now follows the Windows-cost paragraph, so "that" reads as the Windows job rather than the dropped macOS job. Move the cost paragraph below it, or name the macOS job there.src/socketPath.ts:29: lowercasing covers case, but other spellings of one root, such as an 8.3 short name, asubstdrive, or a junction, still hash to different pipes. HashrealpathSync.native(root)so the comment's promise holds.
What was checked
- Every earlier finding, at this head.
server.cpp,src/cli.ts,docs/architecture.mdandci.ymlcarry the same change as at7355d7d, where all five threads were verified fixed and are resolved. - The new test changes are test-only.
pathToFileURL(bare).hrefgives the samefile:///…URL as before on macOS and Linux. The inventory-cache wait runs only on Windows, and its comment marks the cause as inferred. The recovery skip names the plan entry that tracks it. - The hosted-chain failures were not the pipe. In the
6a529d1log, each one is the daemon answering "this render needs 1beeb215 … which is not installed", once as an error response over the pipe itself. The base'sFIELD_PLUGIN_PATHfix addresses that.
The head looks clean. A human approval is what remains.
# Conflicts: # docs/projects/windows-portability/readme.md
… port #160 guarded record-midi-daemon's daemon describe on win32, naming chunk 4. This is chunk 4, so the describe runs on Windows again, and its tests that need a published source now meet the reason Windows still cannot run them: there are no virtual MIDI ports, so --keys refuses. publish() reports that as unavailable on win32, as it already does on Linux without ALSA, and those tests skip; advertising record-midi and refusing to arm with no source still run. The plan's chunk 4 paragraph lists the guard with the ones it retired.
ninjudd
left a comment
There was a problem hiding this comment.
📽️ Projector review · 0.7.3 · model claude-opus-5-5 · effort xhigh · CLEAN · took 1m 40s
This pull request gives field-audiod its Windows control channel, as chunks 4 and 5 of windows-portability.md. On Windows the daemon listens on a named pipe that admits only its own user, and only from the local machine. The CLI derives the pipe's name from the project root and passes it in with --socket, and request handling is shared with the POSIX socket arm, which moves unchanged. The change also retires the Windows test guards that waited on the transport, refuses the afplay fallback off macOS, and adds a windows-latest CI job. Since 0b26d94 it merges windows/build, which now carries main's keyboard and MIDI work, and lifts record-midi-daemon's serve-mode guard. It knowingly leaves the Python workers on their POSIX transport (plan §4), crash recovery and field keys on Windows (plan §7.2), and the physical-unplug test open.
5 finding threads: 5 resolved, 0 open
Covered 22 of 22 changed files; none are generated.
- The head's code was not run.
eve-nyx-13has no write permission on okamnesiac/field, so the head is untrusted, and no build, test, or gate ran here. CI results were read instead. On0b26d94both jobs passed,windowsincluded, so MSVC compiled the pipe's DACL and the accept-loop fix and the suite ran green over the pipe. Onbeb3394both jobs were still running when this review was published. - What moved since
0b26d94. Two merges ofwindows/buildbring about 8,500 lines from main into the base. The pull request's own change moved in two files only: the plan, andsrc/commands/record-midi-daemon.test.ts, from73be3e7. Both were read again, and the other 20 carry the same change as at0b26d94.0f5f3a9resolved two conflicts by keeping both sides. In the record-daemon test it keeps main's new MIDI helper test and this branch's lifted guard, and in plan §7.2 it keeps both follow-ups.beb3394merged cleanly. - Main's daemon-facing code works over the pipe or is guarded. The list follows.
- Shared request handling. Main's
server.cppchange, therecord-midifeature andarm'skind: "midi", landed in the shareddispatchabove the platform split, so the pipe serves it.AudiodClient.armMididials throughsocketPathForlike every other request. - The
--keysand--midi-monitormodes. They return beforemain.cppconstructs aServer.field keystalks to its helper over stdio and to its instrument over UDP, so neither touches the control transport. On Windows--keysrefuses, because Windows has no virtual MIDI ports, and plan §7.2 records that. - The MIDI take tests.
record-midi-daemon's describe now runs on Windows. The tests that advertiserecord-midiand refuse to arm with no source run over the pipe. The take tests skip there with the--keysrefusal as the reason. - No other new connections. Main added no other code that opens the daemon's socket. The files that call
socketPathFororcreateConnectionare the same four as before.
- Shared request handling. Main's
- The plan makes no new readiness claim. windows-portability.md is
in-progresson both sides. The symbols its §7.2 now names,Transaction::recoverandtruncateAndSync, exist in the base'scapture.cpp.
Suggestions
docs/projects/windows-portability/readme.md:479: the chunk 5 record still says "playWithAfplayon win32 fails with the build hint". At this head thefield playaction refuses before it callsplayWithAfplay, on every platform except macOS..github/workflows/ci.yml:23: "What that gives up" follows the Windows-cost paragraph, so "that" reads as the Windows job rather than the dropped macOS job. Move the cost paragraph below it, or name the macOS job there.src/socketPath.ts:29: lowercasing covers case, but other spellings of one root, such as an 8.3 short name, asubstdrive, or a junction, still hash to different pipes. HashrealpathSync.native(root)so the comment's promise holds.
What was checked
- Every earlier finding, at this head.
server.cpp,src/cli.ts,docs/architecture.mdandci.ymlcarry the same change as at7355d7d, where all five threads were verified fixed and are resolved. 73be3e7's guard change. The describe-level guard comes off.publish()reports a Windows--keysrefusal as unavailable, the way it already treats Linux without the ALSA sequencer, and the take tests skip on that. A helper that cannot publish anywhere else still fails the test.- Merge boundaries. This pull request's diff is taken against the new merge base
e5af809. Main's files appear in it only where this branch changes them.
The head looks clean. A human approval is what remains.
Superseded: the review loop's CLEAN verdict on beb3394 covers the current head. Dismissed at Justin's request while Projector learns to clear its own stale verdicts.
ninjudd
left a comment
There was a problem hiding this comment.
📽️ Projector review · 0.7.3 · model claude-opus-5-5 · effort xhigh · CLEAN · took 0m 36s
This pull request gives field-audiod its Windows control channel, as chunks 4 and 5 of windows-portability.md. On Windows the daemon listens on a named pipe that admits only its own user, and only from the local machine. The CLI derives the pipe's name from the project root and passes it in with --socket, and request handling is shared with the POSIX socket arm, which moves unchanged. The change also retires the Windows test guards that waited on the transport, refuses the afplay fallback off macOS, and adds a windows-latest CI job. The head moved from beb3394 only by a clean merge of windows/build. It leaves the Python workers (plan §4), crash recovery and field keys on Windows (plan §7.2), and the physical-unplug test open.
5 finding threads: 5 resolved, 0 open
Covered 22 of 22 changed files; none are generated.
- The head's code was not run.
eve-nyx-13has no write permission on okamnesiac/field, so the head is untrusted, and no build, test, or gate ran here. CI results were read instead. On0b26d94both jobs passed, the MSVC build of the pipe code included. Onbeb3394linuxpassed, andwindowswas cancelled when this head arrived. On1df6eb6both jobs were still running when this review was published. - Only the base moved. The merge brings one base commit,
c82062a, which rewrites a comment insrc/graph/build.test.ts. That file is outside this pull request's diff. This pull request's own change is identical in all 22 files to the change reviewed atbeb3394, compared file by file against each head's merge base, and the merge needed no resolution. - The plan makes no new readiness claim. windows-portability.md is
in-progresson both sides.
Suggestions
docs/projects/windows-portability/readme.md:479: the chunk 5 record still says "playWithAfplayon win32 fails with the build hint". At this head thefield playaction refuses before it callsplayWithAfplay, on every platform except macOS..github/workflows/ci.yml:23: "What that gives up" follows the Windows-cost paragraph, so "that" reads as the Windows job rather than the dropped macOS job. Move the cost paragraph below it, or name the macOS job there.src/socketPath.ts:29: lowercasing covers case, but other spellings of one root, such as an 8.3 short name, asubstdrive, or a junction, still hash to different pipes. HashrealpathSync.native(root)so the comment's promise holds.
What was checked
- Every earlier finding. All five threads were verified fixed at
7355d7dand are resolved, and the files they concern carry the same change at this head. - The base commit is unrelated.
c82062achanges only a test comment about howsclangCommandfindssclangon Windows. No code that this pull request touches or calls changes. - Main's daemon-facing code. The full review at
beb3394checked how main's code reaches the daemon over the pipe, and nothing in it changed since.
The head looks clean. A human approval is what remains.
…ws-portability.md chunk 2) (#160) Chunk 2 of the [Windows portability plan](../blob/windows/build/docs/projects/windows-portability/readme.md): field builds on Windows, and **the whole offline render path works** — real DSP through `field-audiod.exe --render`, the live-session renderer through `--render-live`, plugin scanning through `--scan` — with the control socket left honestly refused until chunk 4's named pipe. ## The finding the plan never saw Label pkgs derive from `song.dir`, which was raw `relative()` output — `songs\creek` on Windows — so **no typed label or pattern could ever match**: ~70 tests failed "no such label" while `git status` and `field check` both looked clean. The fix states an invariant the model half-enforced already (its schemas reject `\` in YAML paths): project-relative paths are slash-separated wherever they are *data* — `song.dir`, diagnostics, the session JSON the daemon reads, `projectRelative`'s output — and native only where they are genuinely local, like `BuildOutcome.outputPath`. ## What MSVC found that reading could not - **`M_PI` is not standard C++.** glibc and Apple's libc++ hand it out; MSVC does not. Six uses across `biquad.cpp`, `mixdown.cpp`, `resample.cpp` are now `std::numbers::pi` — the identical double, bit for bit, so no render changes on any platform. - **`LiveSession::Track` was accidentally copyable.** MSVC's `std::map` move constructor is not `noexcept`, so `Track`'s two maps make its implicit move constructor not `noexcept` either, and `vector<Track>` reallocation falls back through `move_if_noexcept` to the implicit copy constructor, which cannot copy the chain's `unique_ptr`s. libstdc++ and libc++ maps move `noexcept`, so clang and gcc never reach the copy. `Track` is explicitly move-only now — which it always was in fact. - **`capture.cpp` called POSIX file functions.** Recording arrived from `main` after the Windows run below, and its capture file used `fsync` and `ftruncate`. On Windows it now calls the CRT's `_commit` and `_chsize_s`. - **`keys.cpp` used `poll` and a macOS/Linux-only JUCE call.** The keyboard instrument arrived from `main` with the helper behind `field keys`, whose non-blocking stdin check used `<poll.h>` and `<unistd.h>`; on Windows it asks `PeekNamedPipe`. It also called `MidiOutput::createNewDevice`, which JUCE declares only on macOS and Linux because Windows has no virtual MIDI ports, so there the helper refuses as it does on any failed publish, and the plan's §7.2 records the gap. ## Build and paths `daemonBinary()` gains the `.exe` suffix; `build:native` gains `--config Release` (MSVC is multi-config; single-config generators ignore it); `SIGPIPE` is guarded out on `_WIN32` with its "on every platform" comment amended to say which mechanism holds there; and `server.cpp` gets the chunk-4 stub — serve mode refuses with a pointer at the plan while `--render`, `--render-live` and `--scan` run as plain subprocesses, which is what lets the binary link before the pipe transport exists. Smaller, each fixed where it lay: `pnpm` is a `.cmd` shim `execFile` cannot spawn (the one test that shells it gets `shell` on win32); the stub worker is a shebang script Windows cannot exec, so a `.js`/`.mjs` interpreter override runs through `process.execPath` — more hermetic on every platform; a test helper built `.venv/bin` where the probe reads `.venv/Scripts`; four suffix assertions compared native paths against `/`-joined literals. ## Guards, by what removes them Per-test with the reason beside each, linux-portability decision-4 style: 9 fake-daemon tests in `version.test.ts` and the serve-mode guards (the describes in `audiod/client`, `play-daemon`, plugin-hosting's live chains, `punch-daemon`, `record-daemon`, and `record-midi-daemon`, four socket tests in `live-session`, and three in `click-daemon`) name **chunk 4**; 21 stub-spawning tests in `generate.test.ts` plus three describes in `aced`/`voiced` name **the workers' §4**, which is not chunk 4; two `#!/bin/sh` sclang fakes in `build.test.ts` name nothing, since only a second stub dialect would remove them. ## Verification, on a real Windows machine This run was at `1acb58f` on 2026-08-18, before the merge that brought recording in from `main`. The `linux` CI job covers every later head; nothing after `1acb58f` has been built on Windows, and #161's `windows-latest` job is the first to build this layer's daemon there. ```text pnpm typecheck clean pnpm build clean field check (examples/bloom) ok pnpm build:native field-audiod.exe, field-dsp-check.exe, Field Fixture.vst3 — 0 errors field-dsp-check all block partitions bit-identical (resampler included) vitest, batched: audio + audiod + schema 80 passed | 19 skipped | 0 failed graph + generators 153 passed | 3 skipped (4 load-flakes, each green in isolation) commands + model + workers + rest 363 passed | 57 skipped (5 load-flakes, each green in isolation) ``` Every test file passes. The load-flakes are this machine's own conditions — an OneDrive-synced checkout with Defender re-scanning the fresh exe on every spawn — and each flaked test re-ran green isolated; a CI runner shares none of that. The `field-dsp-check` line is chunk 3's first good omen: MSVC at the VS 2022 floor holds block-invariance bit-identically, resampler included. Cross-platform byte comparison stays chunk 3's to measure. ## Testing Run these from the root of a checkout of `windows/build` on macOS or Linux. The daemon tests need a built `field-audiod`: either run `pnpm build:native` first, which leaves it in `native/audiod/build`, or point `FIELD_AUDIOD` at one built from this stack, as I did. The commands change nothing in the tree. ```sh pnpm install --frozen-lockfile pnpm typecheck FIELD_AUDIOD=/path/to/field-audiod pnpm test project check grep -c "itOverSocket(" src/audiod/live-session.test.ts src/commands/click-daemon.test.ts grep -n "win32" src/commands/punch-daemon.test.ts src/commands/record-daemon.test.ts src/commands/play-daemon.test.ts src/audiod/client.test.ts ``` You should see a clean typecheck, a passing suite with the daemon tests running (they skip only when no daemon is built), and `Project plans are valid.` The `grep -c` prints `4` for `live-session` and `3` for `click-daemon`, and the `grep -n` shows one `win32` describe guard in each of the four files, each naming chunk 4. The change is wrong if any daemon test fails on macOS or Linux, or if a guard skips a test there, because every guard tests `process.platform === 'win32'` alone. You cannot exercise the Windows behavior on macOS. The Windows run above is the record for this layer, and #161's `windows-latest` job builds and tests it on every push. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- projector-summary v=1 sha=c82062a9a61ed5709a279adbc5435b37e1cb4cfc --> 📽️ **Projector summary** of c82062a: https://field.amnes.ac/reviews/160 --------- Co-authored-by: Claude Fable 5 <[email protected]> Co-authored-by: Justin Balthrop <[email protected]>
…#162) `docs/` described every concept and no command. Architecture, tracks, the project model, the build graph and the audio engine explain what a track is and why the cache is the freeze, but nothing said what to type. The five-line "Try it" block in the root README was the whole of the usage documentation, and everything past it was `field --help` and reading `cli.ts`. `docs/cli.md` is that missing page, and it is organized by task: install, labels, check, look around, build, play, watch, transport, record, export, sharing through a remote, create, generate, plugins, and `sc render`, followed by environment variables, platform notes and a command table. Every transcript in it is real output, not an invented example, and the ones that read `examples/bloom` work on a fresh checkout. That is why the graph, build, watch and export examples use `tall-grass`: `creek`'s generated takes are not committed. ## What it says that `--help` cannot - **A bare song name plays live; an explicit label plays the built artifact.** Every play option works on both, except `--watch`, which follows a live song only. On a live song, `--from` with `--loop` is a region loop that wraps from the song's extent back to the position. `--click` is the engine's metronome on either kind of target. - **Build output has a four-word vocabulary.** `built` ran the work, `cached` returned a stored artifact, `fetched` downloaded it from the project's remote, and `source` is a committed file that was never built at all. Saying `cached` about a source would claim a hit that never happened. - **Export's `reverted` is the line to stop on.** It means these bytes match an older version, so a change was undone and the highest-numbered export is not what you just built. - **`field --version` reports daemon builds, not just the CLI's.** A daemon started before the last `pnpm build:native` still runs the old code, and `field transport quit` is how you retire it. Recording and the remote get a short section each, with the depth left to [audio-engine.md](docs/audio-engine.md) and [remote.md](docs/remote.md) rather than repeated. ## What it deliberately leaves alone `docs/README.md`'s "V1 platform scope" is untouched. It still lists Windows as out of scope, and amending it belongs to [windows-portability.md](docs/projects/windows-portability/readme.md) chunk 5, not to a page describing what works today. The platform section states the macOS and Linux behaviour: AU exists only on Apple platforms, and the `afplay` fallback is deliberately macOS-only. It points at both port plans. Its sentence about the Windows port cites windows-portability.md §2.2 "as amended", and that amendment arrives with #161, so this should merge after #161. ## Review notes Both index edits ride along, per the convention that every doc is listed: `docs/README.md`'s Documentation list and `AGENTS.md`'s docs line. ## Testing Run these from the repository root of a checkout of this branch. They need `pnpm install --frozen-lockfile` and `pnpm build`. They also need either `pnpm build:native` or `FIELD_AUDIOD` pointing at a built `field-audiod`, plus `sclang` for tall-grass's SuperCollider loop. I ran them with `node ../../dist/cli.js` in place of `field`. ```sh cd examples/bloom field check # ok field --version # a "remote" line between "worker protocol 2" and "daemons in ." field query "deps(tall-grass/track:room)" # four labels, exit 0 field explain tall-grass/track:room # ends with: cable: receive "drum-verb" ← track:drums, -10.0 dB (tap post), arrives at sample 0 field build tall-grass # six built (or cached) lines mkdir -p /tmp/mixes field export tall-grass --to /tmp/mixes # exported … tall-grass-track-main-v<n>.wav field export tall-grass --to /tmp/mixes # current … the same file field export tall-grass --rate 44100 --bit-depth 16 --to /tmp/mixes # exported … tall-grass-track-main.44100-16-v<n>.wav FIELD_AUDIOD_NULL=1 field play tall-grass --click # plays; ctrl-c stops FIELD_AUDIOD_NULL=1 field play tall-grass --from 2 --loop # "(looping)", and the position wraps from about 3.6 back to 2.1 field transport quit ``` The change is wrong if any of the following happens. `field explain` or `field query` exits 1 with "has no takes yet". `--version` shows no `remote` line. The export names differ from the manual's. Either `play` command prints a refusal instead of playing. The `remote` line reads `token in keychain` on a machine logged in to audiofield.io. For the manual I captured `not logged in` with a `security` stub on `PATH` that exits 44. `field devices` and `field transport status` print your own machine's device names. The `field import` and `field record` examples write into the project, so I ran them in a scratch copy of `examples/bloom`. The import used a 24-bit WAV made with `afconvert`. The record example used a `record:` track made with `field track create tall-grass vocal` and a null-input daemon (`FIELD_AUDIOD_NULL=1`). It printed `take tall-grass/vocal ← take-… at bar 2, chosen (…, 1.6 s)` and exited. Afterwards, `examples/bloom/.field/` holds the build cache, which is gitignored, and `/tmp/mixes` holds the exports. `field transport quit` stops the daemon those commands started for the project. `pnpm typecheck`, `pnpm test` (799 passed, 1 skipped) and `project check` pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- projector-summary v=1 sha=d0adbc371a66a490e264583edeab507c5bf0edc6 --> 📽️ **Projector summary** of d0adbc3: https://field.amnes.ac/reviews/162 --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]> Co-authored-by: Justin Balthrop <[email protected]>
…es, with mute and solo (#163) Implements the [UI plan](../blob/ui/first/docs/projects/ui/readme.md) — ninjudd's plan from #156, which this diff moves from `status: draft` at `priority: next` to `status: in-progress` at `priority: now`, and amends with a new §6, appended at the end, recording what the implementation settled. `field ui <song>` opens a desktop face on a playing song, and every gesture in it ends as an edit to the project's YAML. §3's first-version scope ships as written, plus the two things the plan was waiting on (**mute exists**, and **solo** arrived as a session-only alternate feed), plus four things §3 listed as non-goals, which §6 now records with the reason each was taken. ## Mute is a field, not a gesture `mute:` on the placement beside `gain_db`/`pan` — the loop entry's `enabled:` shape applied to a whole placement, exactly for §2's reason: a gain gesture would overwrite the authored level, and remembering the old value anywhere but the file is a second store. `planFor` excludes muted placements, so the stem spec, its action key, the deps, and the live session all agree the placement is absent, and its sends go silent with it: a cable whose every sender placement is muted carries nothing. Proven in `build.test.ts` and `cables.test.ts`: a toggle re-keys the stem, **re-muting is a cache hit** (the exclusion is deterministic), a source consumed only by muted placements drops out of the deps, and a muted sender drops out of its receiver. ## Solo is a listening gesture, so it lives with play/pause `model/solo.ts` computes an alternate output feed at session compile and holds it nowhere: the soloed track's subtree whole, its carriers keeping only the inputs that lead to it, its send receivers audible transitively — solo drums, keep the room drums feed. Muted placements cannot carry a solo. While a solo is held the server swaps the soloed compile on every file edit instead of ramping, because ramp indexes address the daemon's session and the soloed session's indexes are not the un-soloed compile's, and a track frozen under the solo is served its soloed stem. ## `field ui <song>` One process — field's own, per §4: compiles the session, connects the daemon, serves the built client, carries one WebSocket per view, bound to `127.0.0.1`. A gesture ends as YAML written through the same comment-preserving `Document` machinery every editor uses, and the **existing watch-live loop** carries it into the playing session; the server never pushes an edit to the daemon itself. Both of §4's guards are in: Origin + per-launch token on the upgrade, and every edit carries the sha256 of the file bytes it was derived from — stale is reject-and-refresh, never write-through. File-writing messages run one at a time, and each edit is loaded as the project would be before it is written, so a gesture that would turn the song red is refused with the error instead. The client is a Vite + React workspace package (`ui/`), hand-rolled CSS, opened in an Electron shell that mirrors the page's console to the terminal, or in a browser with `--browser` or when the shell cannot start. Closing the shell, or ctrl-c, stops the transport and ends the session. Musical time projects in the view: the snapshot carries the song's tempo and meter events, and the client builds the same `TempoMap`/`MeterMap` from `src/time/tempo.ts` to run its playhead between the daemon's 250 ms position events (§6 records why the first, server-side answer was reversed). playback.md §3.6's rule — samples cross the daemon socket, music does not — holds unchanged. ## The timeline, clip edits, and the insert panel - **The timeline.** Lanes draw on one time axis under a bar ruler, with a playhead, using the planner's own `placedWindow`, so the picture cannot disagree with the render. Waveforms are the cheap half §3's argument allows: an envelope computed on demand from the stem the build already wrote, over the slice each placement reads. A lane that places a track opens into the placements in that track's file, each row editing its own file under that file's stale guard. - **Clip edits.** Select and drag to move, split at the playhead (Ctrl+E), and drag either edge to trim, each written once on release in the spelling the author used (`src/commands/ui-edits.ts`, tested byte for byte). A looped or cross-rate clip refuses the gestures whose arithmetic would be wrong for it. - **The insert panel.** The selected clip's track chain, with add, edit, and remove for the built-in effects: a knob strip for `limit`, `reverb`, `plate`, and `hall`, and for `eq` a response curve with draggable bands. The curve's arithmetic is `src/audio/eq-response.ts`, a term-by-term port of `biquad.cpp`'s response math under the suite, which render-pipeline.md decision 4 now records as a bounded reversal. A hosted plugin stays read-only. Stack additions, recorded against project-core.md §5: `ws`; react + vite inside the workspace; `electron` as the shell. The diff also adds `docs/projects/daw-features/readme.md` at `status: draft`, a catalogue of what users love in other DAWs and what they wish theirs did, with §16 recording four picks. Each pick is its own project at `priority: later`: `detail-pane`, `actions-and-macros`, `sound-browser`, and `key-conforming`. ## Verified end to end, on real hardware ```text ui smoke (driven over the real WebSocket, real WASAPI device): snapshot: 2 lanes, correct kinds play -> PLAYING, position events streaming mute -> mute: true lands in main.yaml, watch carries it, snapshot reflects solo -> session swaps, soloed held; un-solo swaps back stale-hash edit -> rejected: "file changed underneath — refreshed" ``` That run was eve's, on Windows, before the timeline and the review fixes. CI's `linux` and `windows` jobs run the whole suite on every push. It was developed on top of the Windows stack (#157–#161), because the live loop it exercises needs the pipe transport on eve's machine. That stack has landed, so this branch is now based on `main`; content-wise it is orthogonal to the Windows work. ## Testing Run these from the root of a checkout of `ui/first` on macOS or Linux. `pnpm build:native` builds the daemon into `native/audiod/build`, which the daemon tests need, and `pnpm --dir ui build` writes the client to `ui/dist`, which `field ui` serves. Set `ELECTRON_SKIP_BINARY_DOWNLOAD=1` for the install if you do not need the desktop shell. ```sh ELECTRON_SKIP_BINARY_DOWNLOAD=1 pnpm install --frozen-lockfile pnpm build:native pnpm typecheck pnpm test pnpm --dir ui build project check ``` You should see a clean typecheck, `Test Files 77 passed (77)` and `Tests 984 passed | 1 skipped (985)`, a Vite build that ends `✓ built`, and `Project plans are valid.` The view's server-side logic is covered by `src/commands/ui-edits.test.ts`, which compares written YAML byte for byte, `src/commands/ui-timeline.test.ts`, which checks each lane's `entry`, a child row's origin past `slip` and `source_offset`, and an open window's length, `src/commands/ui.test.ts`, which checks that a request path cannot leave `ui/dist`, `src/graph/live.test.ts`, which checks a frozen track under a solo against the daemon, and `src/model/cables.test.ts`, which checks a muted sender. A failure in `ui-timeline.test.ts` would mean a socket op writes to the wrong entry or a cut lands away from where it was heard. The live checks (play, mute riding the watch, solo swapping, the shell's fallback, the keyboard on faders) need a real output device and a person at the window: run `field ui <song>` in a project with a built daemon. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- projector-summary v=1 sha=f61b4a1f42c00ed6693b9306bcc30b5787e388d0 --> 📽️ **Projector summary** of f61b4a1: https://field.amnes.ac/reviews/163 --------- Co-authored-by: Claude Fable 5 <[email protected]> Co-authored-by: Justin Balthrop <[email protected]>
The last big piece of the Windows portability plan: the control socket, both ends, per §2.1's named-pipe decision — plus chunk 5 riding along (the afplay refusal and the
windows-latestCI job), each too small to spend a review cycle alone.The shape
server.cpprestructures sohandleLine,dispatch,broadcastandconnectionCountexist once, above the I/O layer; only the transport splits per platform, and the POSIX arm moves verbatim. The Windows arm:CreateNamedPipeAwithFILE_FLAG_FIRST_PIPE_INSTANCEcarrying the flock — the stampede test passes with six clients racing a fresh project — an overlapped accept loop whose shutdown wake is a bounded 200 ms poll rather than a wake protocol that has to be right, andCancelIoExstanding in forSHUT_RD. On the TS side,socketPathForanswers a\\.\pipe\name derived from the lowercased resolved root (NTFS compares case-insensitively; two spellings of one root must not mint two daemons), and the spawn hands the daemon the full name via--socket, so client and daemon agree by construction.The pipe carries the same permission model as the 0600 Unix socket, which is part of why §2.1 chose pipes: both instances are created with a protected DACL that grants access only to the user running the daemon, and
PIPE_REJECT_REMOTE_CLIENTSturns away connections from other machines. An instance whose client hangs up beforeConnectNamedPipeis disconnected and returned to listening, rather than retried forever.What the implementation taught
CancelIoExis an event whereSHUT_RDis a state. A cancel only aborts a read pending at that instant; a reader that was insidedispatchat shutdown issues a freshReadFileafterward and keeps serving a chatty client forever — the daemon then never exits, which is exactly what the concurrent-shutdown test caught. The reader now checksrunningeach cycle and again once a read is pending, cancelling that read itself if shutdown began in between, and the shutdown drain is one peek deep: exactly the bytes buffered at the half-close, the waySHUT_RD's EOF bounds it, because re-peeking chases a client that keeps writing. Probed empirically before fixing: a patient client always got a clean 1.9 s quit-to-exit; only a hammering client could immortalize the daemon.Also found: Windows cannot delete a directory that is a live process's cwd, and the daemon takes a few hundred milliseconds to exit after
quit—removeTempProject(src/testing/temp.ts) retries the whole removal, becausermSync's own retry knobs do not cover every op in its recursive walk.Guards retired, and tests ported
The 9 fake-daemon tests in
version.test.ts(its fakes now bind whatsocketPathForanswers, on every platform), the serve-mode describes inaudiod/client,play-daemon,punch-daemon,record-daemon, andrecord-midi-daemon, plugin-hosting's live chains,live-session's four socket tests, andclick-daemon's three.record-midi-daemon's take tests then skip on Windows for want of a virtual MIDI source, which Windows does not offer (plan §7.2). Still guarded, correctly: the workers' 21+3 (§4's own chunk) and the two sclang stubs (nobody's).The tests
mainadded since the first Windows run are ported here too. The daemon and credential tests use Windows paths, the clone, push, and pull tests build their bare remote's URL withpathToFileURL, and the inventory-cache test waits out one NTFS change-time tick before its same-size rewrite. One test is skipped on Windows with its reason beside it: "a daemon killed mid-take leaves a recoverable transaction", which fails on the runner with "field-audiod connection closed" for a reason not yet diagnosed. The plan's §7.2 records it as a standalone follow-up.field playoff macOS without a built daemon now prints only the build hint. The platform check sits at the call site, before the "using afplay" line, instead of insideplayWithAfplay.Verified, on real hardware
This run was on eve's Windows machine on 2026-08-18, before the merges that brought recording and the remote in from
main:And the plan's definition-of-done sentence, verbatim from a live session with a dirty chain, steered from a second terminal:
Limits
The pipe's DACL,
PIPE_REJECT_REMOTE_CLIENTS, and the disconnect on an abandoned connect have been built and run only by thewindows-latestCI job, not on a desktop machine. The physical-unplug half of the WASAPI question stays open in §6 as the one manual test left, and crash recovery on Windows is the §7.2 follow-up above.Testing
Run these from the root of a checkout of
windows/transporton macOS or Linux.pnpm build:nativebuilds the daemon and the plugin fixture intonative/audiod/build, which the daemon and hosting tests need. The other commands change nothing in the tree.pnpm install --frozen-lockfile pnpm build:native pnpm typecheck pnpm test project checkYou should see a clean typecheck,
Test Files 71 passed (71)andTests 929 passed | 1 skipped (930), andProject plans are valid.A failure inaudiod/client.test.ts,play-daemon.test.ts, orlive-session.test.tswould mean the shared request handling or the POSIX socket arm broke in the restructure.The Windows arm cannot run on macOS or Linux. The
windowsCI job builds the daemon under MSVC and runs the same suite over the named pipe on every push; that job is the test for the pipe's DACL, the remote-client rejection, and the disconnect fix. Afield-audiod did not starterror there, or a protocol test that cannot connect, would mean the DACL shut out the CLI's own user.To check the afplay refusal by hand on macOS, fake another platform in a project with an imported asset and no built daemon (
FIELD_AUDIODunset, nonative/audiod/build):where
fake-linux.mjsisObject.defineProperty(process, 'platform', { value: 'linux' });. You should see onlyfield-audiod is not built, and the afplay fallback is macOS-only — run \pnpm build:native`. A precedingusing afplayline means the check moved back insideplayWithAfplay`.🤖 Generated with Claude Code
📽️ Projector summary of 1df6eb6: https://field.amnes.ac/reviews/161