Repository navigation
Description
Phase 1 of the umbrella #847.
Problem Statement
plotkeeper does not build on Windows. The first crates to fail are ones most others depend on: studio-workbench (15 errors, all in workbench/src/run.rs, the process runner's process groups and waitid) and studio-test-support (7 errors), 22 in all, the same on windows-latest and windows-11-arm (CI spike round 2, run 46320441526). With those stubbed, a Windows type-check finds at least 60 errors in shipping code (workbench 15, hook 12, server 33) and 133 in tests, across 42 files; a floor, since cargo stops some crates at their first failing dependency.
Where it would build, it would fail quietly, because every macOS-or-not seam sends Windows down the Linux path:
- The page token reads
/dev/urandomwith anexpect(server/src/web.rs:95-102), so plotkeeper panics at its first start. - The hook binaries are looked for without
.exe(HOOK_BINARIES,hook/src/lib.rs:90), so the copies in the data folder are never made (server/src/hook_copies.rs:25-31). - Programs are found through
$SHELL -lc "command -v …"and only answers starting with/count (understanding/src/lib.rs:528-540), soclaudeis never found and PR briefs are switched off at start (server/src/lib.rs:291-303). - The hook compares
canonicalize's\\?\C:\…with git'sC:/…and paths with/boundaries (hook/src/lib.rs:702-781), so it finds no root: no start or end trees, so a Windows turn has no files at all.EditandWritepaths count only when they start with/(hook/src/lib.rs:1282), and the core reads every path the same way (core/src/studio/roots.rs:33-45,:91-109,core/src/checks.rs:52-57). - The parent pid is
std::os::unix::process::parent_id()(hook/src/main.rs:72), and the walk past shells skips exactly one (hook/src/lib.rs:1538) while Git Bash puts twobash.exebetween Claude Code and the hook. - Background runs would fail with a Linux reason ("
claudewas not found"), API keys with "secret-tool is not installed", Open in editor with "No editor found".
Claude Code runs natively on Windows, and its exec-form hooks work there: spike round 2 recorded SessionStart, UserPromptSubmit, Stop and SessionEnd from a hook binary in a folder whose name has a space, with claude.exe as the hook's direct parent.
This is Phase 1 of the umbrella #847: Claude Code only, nothing released.
Solution
plotkeeper builds and runs on native Windows, x64 and arm64, and records Claude Code sessions correctly.
- It builds, starts and stops. Wherever macOS and Linux differ today, Windows gets its own arm: the data folder in
%USERPROFILE%\AppData\Local\plotkeeper,.exenames, the browser opener, random bytes from the OS, the one-plotkeeper lock's private files.plotkeeperstarts, opens the page and stops on Ctrl+C. - What Phase 1 does not do, it refuses by name. Background runs of every kind (back a law, micro-worlds, the map text review, First map's Draft the map), the API and OpenAI-compatible writers, the other agents' CLI writers, Jump and Open in editor each say they are not available on native Windows, where the page already shows such a state.
plotkeeper installwires Claude Code only and says so for the other agents it finds. - git, gh and Claude Code's writer run as on macOS. The process runner gives each command a Job Object, so a deadline kills the whole tree. Programs are found on
PATHwith Windows' extensions, never through a shell. - Claude Code sessions record correctly. On Windows its hook entries are rendered in exec form. The hook finds
claude.exeas the agent, writes underevents.lock, and finds the session's roots, so a turn has its files and project. The core reads Windows paths in one form. Answering a permission from the page works through the answer file's Windows checks. - An upgrade works while a hook runs. A running hook binary is moved aside and the new one put in its place.
- CI checks Windows on every PR on x64 and arm64, including a real Claude Code session against a stand-in model that must come out recorded with its files and project. Background implementers type-check for Windows on the Mac in seconds.
- Daniel tries it twice in his Parallels VM: early, the bare binaries (Gate A, which blocks nothing), and at the end, a real interactive session (Gate B).
Codex, Cursor, the remaining shell fakes, packaging and release are Phase 2.
User Stories
- As Daniel on Windows, I want
plotkeeperto start, open the page and stop on Ctrl+C, so that I can use it as on my Mac. - As Daniel on Windows, I want plotkeeper's data in
%USERPROFILE%\AppData\Local\plotkeeper, so that it sits where Windows programs keep local data. - As Daniel on Windows, I want
plotkeeper installto wire Claude Code, so that my sessions are recorded. - As Daniel on Windows, I want install to tell me it skips Codex, Cursor and the others on native Windows for now, so that I know why they are not recorded.
- As Daniel on Windows, I want every Claude Code session I run to appear in the session list, live, so that the page shows what my agents do.
- As Daniel on Windows, I want a session to end when its
claude.exeexits, and not when a shell between them exits, so that the list stays true. - As Daniel on Windows, I want a session to end even when Windows has given its old pid to another process, so that a dead session does not stay open.
- As Daniel on Windows, I want each turn to list the files it changed and to belong to its project, so that the rail, Headlines, Where we were, the Brief and the map's lights work.
- As Daniel on Windows, I want check results to show for the commands my agent ran, so that checks work as on macOS.
- As Daniel on Windows, I want to answer Claude Code's permissions, questions and plans from the page, so that "needs you" works.
- As Daniel on Windows, I want an answer file only my own user could have written to be accepted, so that no other local account can approve a call.
- As Daniel on Windows, I want summaries written by
claude -pand PR briefs written, so that the learning layer works. - As Daniel on Windows, I want the map, Fog, First map's free scan and
plotkeeper map checkto work, so that the map is the page's base. - As Daniel on Windows, I want background runs, Draft the map and the map text review to say they need Claude Code's sandbox, which native Windows lacks, so that I am not shown a Linux error.
- As Daniel on Windows, I want saving an API key, the OpenAI-compatible writer and the other agents' writers refused with a line that points to Claude Code's writer, so that I know what to use instead.
- As Daniel on Windows, I want Jump and Open in editor to say they are not on Windows yet, so that a press does not end in a wrong reason.
- As Daniel on Windows, I want an update of plotkeeper to work while a hook waits on a card, so that I never have to close my agents to update.
- As Daniel on macOS or Linux, I want nothing to change for me: the same hook entries, the same fingerprints, no rewire. One fix reaches me too: a hook started through two shells now finds the agent, not the outer shell.
- As Daniel, I want each PR to run the Windows checks on x64 and arm64, so that new Unix-only code cannot land unnoticed once the job is required.
- As Daniel, I want CI to run a real Claude Code session on Windows and check it was recorded with its files and project, so that a hook that silently stops running is caught.
- As Daniel, I want the CI-built Windows binaries from
mainto download into my VM, so that I can run the gates without building in it. - As an implementer on the Mac, I want one command that type-checks the workspace for Windows in seconds, so that I find compile errors before a CI round.
- As an implementer, I want every Unix-only test gated with a reason, so that each crate's tests compile on Windows and the list of what Phase 2 moves is written down.
- As Daniel, I want the stored samples and the macOS and Linux logs to read exactly as before, so that no history changes.
- As Daniel, I want the research note to record spike round 2, so that Phase 2 builds on what was measured.
Implementation Decisions
How the platform split is organised.
- Every Windows arm is a
cfg(windows)arm beside the existing macOS and Linux arms, in the module that already holds that seam. No crate gains acfg(windows)file of its own beyond what a seam needs. The existingcfg(not(target_os = "macos"))arms that mean "Linux" becomecfg(target_os = "linux")where Windows needs a different answer, so Windows never falls into a Linux arm by default. - Decisions that tests should cover on macOS and Linux CI are made by a parameter or by the text, not by
cfg: the switchboard'sPlatformgainsWindows(it is already a parameter,server/src/switchboard.rs:28-33); the runner's config carries whether runs are supported on this machine; the path rule is gated by the text of the path. So the refusals, the exec-form rendering and the path rule are table rows that run on every CI.
Building, starting and stopping.
- Data folder:
data_dir(home)gains a Windows arm,home\AppData\Local\plotkeeper, keeping its signature (hook/src/lib.rs:26-32);runs_dirlikewise (:37-43). The test helpers setUSERPROFILEbesideHOME, sincehome_dirreadsUSERPROFILEon Windows (hook/tests/common.rs:36-44and the server's equivalents); otherwise a Windows test run would write the developer's real data folder. .exenames: every place a binary name is built or matched addsstd::env::consts::EXE_SUFFIX:HOOK_BINARIESand its users (hook/src/lib.rs:90,server/src/hook_copies.rs:25-40), the hook's own-path check (hook/src/lib.rs:71-81), and the rendered hook commands (below).- Random bytes: the answer nonce (
hook/src/answer.rs:451-455) and the page token (server/src/web.rs:95-102) take thegetrandomcrate, already inCargo.lockthroughtempfile, on every platform. - Private files: the
mode(0o600)andmode(0o700)calls (hook/src/answer.rs:125-142,server/src/lock.rs:103-114) becomecfg(unix); on Windows the file inherits the profile's ACL, which the spike saw grant only SYSTEM, Administrators and the user (windows.md, "CI spike results", ACLs). - Browser opener: a Windows arm in
server/src/bin/plotkeeper.rs:66-80callsShellExecuteWwith the URL throughwindows-sys(already inCargo.lock). Notcmd /c start, whose%expansion would meet the percent-encoded project fragment. - Ctrl+C:
ctrlcwithterminationalready covers Windows consoles; no change. Gate A checks it. git ls-files -z's bytes:OsStrExt::from_bytesin the hook (hook/src/lib.rs:12,:633) becomes a UTF-8 read.- Temporary folders:
server/src/projects.rs:29-36's list gainsstd::env::temp_dir(), canonicalised and in the path rule's form, since it can be an 8.3 short name (RUNNER~1) that git's long spelling never starts with; so a repository under%TEMP%is not saved as a project. Tests that compare a temporary folder with git's output canonicalise it the same way.
Refusals. Each says what is missing and, for runs, where they work:
- Background runs. The runner's config carries
runs_supported, true on macOS and Linux, false on Windows. Each kind checks it before any work, with one line, "Background runs need Claude Code's OS sandbox, which native Windows does not have. Inside WSL2 they can run as on Linux.", in the state each kind already draws for a refusal: back a law before itssrtlookup (server/src/back_a_law.rs:509), a micro-world beside its scripts check (server/src/micro_worlds.rs:415), "Review map text" (server/src/map_review.rs:735), First map's start (server/src/map_draft.rs:390).Runner::prepare(server/src/runner.rs:1387) checks it too, as the backstop. The automatic map text review of Daniel's own PRs (brief_stored,map_review.rs:715) does not start and records nothing. The scan screen'sclaudeflag becomes "claude found and runs supported" (server/src/map_scan.rs:64-65,:482-483), so on Windows it leads with "Use your own agent". - The launcher binary
plotkeeper-runbuilds on Windows; there it prints the runs line and exits 1. Everything it runs (server/src/runner.rs:731-1015) iscfg(unix). - API keys: a
cfg(windows)arm ofos_keys()(server/src/settings.rs:777-784) holds no key and refuses a save with "API keys can't be saved on native Windows yet; use Claude Code's writer.", drawn where Linux's "secret-tool is not installed" is today (ui/writers.ts:181-196). No AGENTS.md change: the hard rule names only the Keychain and the Secret Service. - The OpenAI-compatible writer counts as not found on Windows even when
summaries.base_urlis set (server/src/learning.rs:55-59finds it by the base URL alone, no key), with the same line: without TLS on Windows (below) anhttps://base URL would fail at call time with a transport error. - The other CLI writers (agy, Codex, Copilot, Cursor) count as not found on Windows with "not on native Windows yet" (
understanding/src/lib.rs:665-669): their npm installs are.cmdshims that std will not pass the writer's multi-line arguments to, and the sandboxes lawwriter-has-no-toolsnames for them are unchecked on Windows. Only Claude Code's writer, whose no-tools rests on its own flags, runs.agy_version()'s$SHELL -lc(server/src/read_loop.rs:168-177) is not asked on Windows. Phase 2 decides the others. - Jump keeps its "Jump works on macOS only" (
server/src/switchboard.rs:190-192); the page already hides it off macOS (ui/jump.ts:11-13). - Open in editor refuses at the top of
open_in_editoronPlatform::Windows, before anygit, with "Open in editor isn't available on native Windows yet.", shown in the notice line as any command's refusal is (ui/editor-link.ts:22-29). - Install: on Windows
wire,wire_on_startandrewire_changedtake Claude Code only; every other agent found gets a "not on native Windows yet" line, asskipped()prints today (server/src/install.rs:729-737). Which agents are wired is a parameter, so the skip has a test row on every CI. - Uninstall:
remove_dir_all(bin)(server/src/install.rs:1554-1564) cannot delete a running.exeon Windows. The Windows arm removes what it can, moves a running copy aside as an upgrade does, and names what is left to delete once its session ends, instead of stopping with "could not remove". - Everything refused must still compile on Windows: the switchboard's Unix items, the runner's signals and process groups, the launcher, back a law's proof,
server/examples/sandbox_gate.rs. They becomecfg(unix).
The process runner (workbench/src/run.rs).
- The Windows arm of
run(behindrun_until,run_until_with_input,run_until_unless) starts the command throughprocess-wrap(std,job-object), so the command and everything it starts share a Job Object. It waits on the direct child, never on the wrapper'swait(), which waits for the whole job (spike round 2,job-leftover: 8 s for a leftoversleep 8). It terminates the job in the same cases as the Unix arm kills the group: atry_waiterror, the deadline,given_up, and pipes held past the deadline. After a clean exit leftovers are left alone, as on Unix. The public surface,RunError, the stdio choices, the pipe-drain grace, andgit/gh/gh_at/quietas the one builder (lawgit-and-gh-go-through-the-runner) are unchanged. run_loggedandrun_logged_tellingreturnRunError::Startwith an "unsupported on Windows" error on Windows. Their only callers are the launcher and micro-worlds, both refused.
Finding programs.
- One function in the workbench searches
PATHwithPATHEXTand returns an absolute path, with no shell. On Windowsfind/find_program(understanding/src/lib.rs:519-540) andinstall::on_path(server/src/install.rs:264-269) use it; macOS and Linux keep their lookups. The switchboard'sfindis unchanged: both its commands refuse on Windows, soswitchboard-runs-fixed-programskeeps its Unix test, gated. - For
claude, Phase 1 accepts only a realclaude.exe, Claude Code's native build. Aclaude.cmdalone counts as not found, and the writer's and install's lines say to install Claude Code's native build.claude_found(understanding/src/lib.rs:636-640) then holds on Windows, so PR briefs and the writer list work. gitandghrun by bare name through std, which findsgit.exeandgh.exe: on Windowsgh_path(workbench/src/lib.rs:63-87) returns bareghwithout asking a login shell.
Claude Code's hook entries on Windows (server/src/install.rs).
claude_fileskeeps the one template,plugin/hooks/hooks.json. On Windows only, a pure function converts each entry: acommandof the form"\"__PLOTKEEPER_BIN__/<name>\" <words>"becomescommand=<bin>\<name>.exeandargs= the words;type,async,timeout,statusMessageand every other field are kept. Bothplotkeeper-hookandplotkeeper-answerentries take it. macOS and Linux keep today's string replace, so their rendered bytes and fingerprints do not change and nothing rewires there.- The plugin is installed as today, through
claude plugin(lawinstall-never-opens-claude-settingsunchanged). - No
claude --versionfloor in Phase 1: Claude Code below 2.1.139 dropsargs(windows.md, "Claude Code's exec form and older versions"); the release phase decides a floor.
The hook on Windows (hook/).
- Parent pid: a Windows arm of
main.rs:72reads the parent from a Toolhelp snapshot (windows-sys, a target-only dependency of the hook). In exec form the parent isclaude.exeandagent_pidreturns it even wheninspectfinds nothing (hook/src/lib.rs:1539-1543). - The walk:
inspectgains acfg(windows)arm returning the parent pid and the full image path (QueryFullProcessImageNameW).is_shellsplits on\and/, strips.execase-insensitively, and knowspwsh,powershellandcmd.agent_pidskips a run of shells, at most three, on every platform (Git Bash's launcher puts twobash.exebeforeclaude.exe; on macOS and Linux two shells give the wrong pid today).in_applearns VS Code's and Cursor's Windows install folders. - Is the agent alive:
pid_alive(hook/src/sys.rs:6-15) gains a Windows arm,OpenProcessandWaitForSingleObject(h, 0), access denied counting as alive. The server's session-end check (server/src/read_loop.rs:250) on Windows also checks that the process started before the first event that carried that pid (GetProcessTimes), so a reused pid does not keep a dead session open. Not the session's first event:claude --resumekeeps the session id and starts a newclaude.exeafter it, and the session's pid is its latest event's (core/src/studio/take.rs:205-206). The time the current pid was first seen is kept besidesession.pidin memory and rebuilt by the replay; no new stored field. The answer hook's "server lives" check needs no such guard: it also requires a heartbeat newer thanSTALE_MS(hook/src/answer.rs:152-154), which a reused pid does not write. - Roots and trees: the hook compares paths in one form, the same rule as the core's (below):
spelledstrips the\\?\prefixcanonicalizegives,holdsandNamed::root(hook/src/lib.rs:702-781) compare drive-letter paths in that form,claude_treestakes anEditorWritepath that is absolute on Windows (:1282), andnamed_paths(:707-713) keepsC:\…andC:/…tokens whole and reads Git Bash's/c/…asC:/…when the line'scwdis a drive-letter path. What the hook stores as roots and tree keys stays git's spelling; the rest of the payload stays as the agent sent it. - The answer file (
hook/src/answer.rs:417-448, the trust boundary): on Windows the open usesFILE_FLAG_OPEN_REPARSE_POINTand refuses a reparse point (in place ofO_NOFOLLOW; FIFOs do not exist in the file system); the open handle's owner SID must be the token user's orBUILTIN\Administrators(a file plotkeeper wrote while elevated is owned by Administrators, and an unelevated hook must still accept it; an administrator owns the machine anyway); the nonce must match. No DACL check (windows.md, "CI spike results", ACLs).O_NONBLOCK,getuidand the mode check arecfg(unix). Deleting the answer file while its handle is open needs delete sharing, which std's default gives. studio_terminalis recorded as today, fromTERM_PROGRAMorHC_TERMINAL_ID(hook/src/lib.rs:1551-1573); nothing reads it on Windows, since Jump is refused. RecordingWT_SESSIONwaits for Jump's Windows arm.- The session records' locks in
turns/(hook/src/lib.rs:1250-1256,:1458-1479; handed over by Studio: Windows core v1 — the native port after #805's foundations #847): std'sFile::lockisLockFileExon Windows, so the locking holds. What differs is the prune'sremove_fileof the lock: on Windows a deleted file that another hook still has open stays delete-pending, and a third hook's open of it fails with access denied until the last handle closes. The Windows arm keeps a hook from failing on that (the ticket picks: a short retry of the open, or a prune that leaves the lock file to the session's end), with a Windows-job test of hooks racing a prune.
Paths in the core.
- One rule, in the core. The hook, which does not depend on the core, keeps a copy tested by the same table of cases, as it already copies
patched_file(hook/src/lib.rs:843-851). The rule has two parts:read(path, windows_line): a path that starts with/is returned exactly as written, except Git Bash's/c/Users/…, read asC:/Users/…on a line whose owncwdis a drive-letter path (windows_line); a drive-letter path (C:\…,c:/…,\\?\C:\…) becomesC:/…with forward slashes and an upper-case drive letter; a UNC path (\\server\share) becomes//server/share.inside(path, root)andsame(a, b): the one comparison, on read paths, with the/boundary; on drive-letter paths ASCII case-insensitive (NTFS is, and an agent'scwdkeeps the case the user typed, which git's spelling need not share). Every comparison site below uses them instead of its ownstrip_prefix,starts_withor==. Maps keyed by path (the tree keys, the touched roots) take their keys from the hook, which writes every key in one spelling (git's, through the same rule), so their lookups need no folding.
- The core applies
readonce per line as it reads the log (core/src/studio/replay.rs:50-80) toEvent.cwd,studio_touched_roots, the keys ofstudio_turn_startandstudio_turn_end, and eachTool.path; and to the server's root lookups where they meet the log (core/src/studio/roots.rs:16-28).Tool.inputstays raw, so the answer's whole-input match with the ask file keeps working (core/src/session.rs:549-553). - Every site that takes a path out of the raw input reads it through
readtoo: the ledger'srow.filefromfile_path,notebook_pathorpath(core/src/ledger.rs:233-242) and the step detail'sfile_path(core/src/output.rs:321-347). Without that, a Windowsrow.file(C:\repo\src\a.rs) is inside no root, soturn_files.rs:157-185credits no edit to this session or another, while the files still list from the tree diff and a one-session test still passes. - Paths that enter outside the log go through
readwhere they enter: acdtarget in a check's command (core/src/checks.rs:481-486), the folders insettings.json(server/src/settings.rs:441-445,core/src/checks.rs:52-57), and a project saved byplotkeeper addor the start-up registration (server/src/bin/plotkeeper.rs:52-64), which the switchboard and the projects list then compare withsame(server/src/switchboard.rs:589,server/src/projects.rs:85-89). - The
/boundaries then work on one spelling, and the places that decide "absolute" acceptx:/as well as/:core/src/checks.rs:52-57,:481-486,:686-702,:429(a check's program after the last/or\, without.exe),core/src/studio/roots.rs:33-45,:91-109,core/src/turn_files.rs:87-109,:238-285,core/src/ledger.rs:239-242and:40-43,core/src/ask.rs:89-93,core/src/studio/take.rs:286-295,core/src/session.rs:239-244,core/src/output.rs:334-347;understanding/src/fingerprint.rs:122-134,understanding/src/brief.rs:95;server/src/settings.rs:441-445,server/src/map.rs:907-913. - The log keeps the agent's spelling, so a better rule later is a new build plus a
core/src/saved.rsFORMAT bump, and the replay applies it to every old line. The frozen samples (understanding/tests/fixtures/stored/) hold only POSIX paths, which the rule leaves as written, so none changes. - New law
paths-read-in-one-form(oncore, backingcheck): "A path recorded on macOS or Linux reads exactly as written; a path recorded on Windows reads in one form,C:/…, whichever way the agent spelled it, and two spellings of one Windows path compare equal." Its table test runs on every CI.
Paths in the page. With the core's paths in one form, ui/projects.ts:24, ui/evidence.ts:26-29 and ui/map.ts:401 already split on /. Three places need drive-letter paths too: ui/paths.ts:5-18 (shortening paths in a step's detail), ui/plan-rules.ts:104-111 (a plan's file candidates) and ui/map-live.ts:19-24 (in-flight edits). UI changes follow AGENTS.md's two web skills.
Replacing a running hook (server/src/hook_copies.rs). The Windows arm of replace moves the current copy aside to <name>.old-<n>.exe (a running .exe can be renamed but not replaced, spike round 1) and puts the new one at the stable path, one binary at a time as the Unix arm does (server/src/hook_copies.rs:34-41), so the stable path is empty only between one rename and the next. Each start deletes .old-* copies, leaving any still running. install is no longer stopped by a running hook (server/src/install.rs:486-497).
CI and the local check.
- TLS:
ureqbecomes a target-specific dependency ofstudio-understanding, withouttlson Windows, soringis never built for Windows. Its only callers are the two HTTP writers, the API-key one and the OpenAI-compatible one, both refused on Windows (Refusals). The later API-keys phase brings TLS back there. npm run check:windows:cargo check --workspace --all-targets --target x86_64-pc-windows-msvc, using the target already installed on Daniel's Mac. Its speed is measured only on a check that stopped at the first failing crates (4.8 s cold for 71 units,sites-tests-ci.md§4); a full check is expected to stay well undernpm run check's time, and the first ticket measures it. Not part ofnpm run check. AGENTS.md "Checks" says a change to Rust runs it when the target is installed, and/implement-spec's implementers run it for Phase 1..github/workflows/windows.yml: a matrix ofwindows-latestandwindows-11-arm, on ready PRs, pushes tomainand pushes toissue-*branches, drafts included, so an integration branch gets a Windows run after every merge. Every ticket branch is alsoissue-*(docs/agents/issue-tracker.md:47), so a push to a ready ticket PR would start both a push run and a PR run, in different concurrency groups (studio.yml:15-17's key): the job skips apull_requestevent whose head branch starts withissue-, leaving one run per push. Steps: checkout, Node 22, the pinned Rust toolchain,cargo-nextest,npm ci, npm's script shell set to Git Bash (C:\Program Files\Git\bin\bash.exe),npm run check:rustwithoutslot.mjs,cargo clippy --locked --workspace --all-targets -- -D warningsfor the Windows target, and the end-to-end test (Testing Decisions). On pushes tomainit also runsnpm run buildandcargo build --locked --release -p studio-server -p studio-hookand uploadsplotkeeper.exe,plotkeeper-run.exe,plotkeeper-hook.exeandplotkeeper-answer.exeasplotkeeper-windows-<arch>. Nocargo-macheteand no static half on Windows: they read the same files on every OS, and machete has no arm64 Windows build.- Required: not while red. Once Phase 1 lands, Daniel marks both legs required in the repository's branch rules.
- arm64: if the
windows-11-armleg meets a crate or build blocker that x64 does not have, the leg becomescontinue-on-error, Daniel is told, and arm64 moves out of Phase 1 (Daniel's rule). Spike round 2 found none: the same 22 errors, no failed build script. - The merger waits on Windows. In
/implement-spec, after each merge into the integration branch, the merger waits on that push's Windows run; a red run goes back to the ticket's implementer as a red check, under the existing escalation rule.docs/agents/issue-tracker.md:52("CI skips drafts, so …npm run checkis the only check") is reworded to say the Windows job runs on drafts' pushes. - Timing on the runners: the arm64 image has Defender's real-time protection on (
windows.md, "CI spike results"), which slows freshly written.exes. A timed test that fails twice there is a bug under AGENTS.md's rerun rule, so the hook's 1.2 s trees budget (hook/src/main.rs:29,:96-99) and rename-aside's test are watched in the first runs; a budget that Windows needs larger is raised for Windows in the ticket that meets it, with the measured times in its PR.
Tests' Unix habit.
- Phase 1's first ticket gates every Unix-only test with
cfg(unix), each with a one-line reason, so each crate's single test binary compiles on Windows (core,hook,understanding,workbenchandsystem-mapbuild oneitbinary each, so one ungated file blocks a whole crate). The PR lists each gated test. Phase 2 moves the remaining shell fakes to the Rust fake and lifts the gates. - Windows twins in Phase 1, as new rows of existing tests where the test is a table (AGENTS.md "Extend before adding"): the runner's contract (
workbench/tests/run.rs, with the Rust fake in place ofsh), the parent pid and the walk (hook/tests/pid.rsrows for exec form and the Git Bash chain),pid_alive, the answer file's checks (hook/tests/answer.rs), rename-aside (server/tests/hook_copies.rs), the data folder (hook/tests/data_folder.rs, whose tests are gated one by one today), the exec-form rendering, andinstall-never-opens-claude-settings(server/tests/install.rs:596).switchboard-runs-fixed-programsgets no twin: on Windows the switchboard's two commands refuse before running anything, which the refusal rows check. - The Windows twin of
install-never-opens-claude-settingsmust fail when install opens the settings file. Today's test makes it a FIFO (server/tests/install.rs:604); Windows has none in the file system. The ticket picks the mechanism (a symlink to a named pipe that records a connection, or a handle held with no sharing) and shows the twin failing with an open added for a moment. test-support's fake copies the test binary whenever a hard link fails, not only across devices (test-support/src/fake.rs:70-82), since the runners'D:drive is ReFS from 2026-11-30.- AGENTS.md "Tests" gains: test helpers that set
HOMEalso setUSERPROFILE; and new code with a Unix-only item gives Windows an arm or acfg(unix)gate with a reason.
The research note. docs/studio/research/windows.md gains spike round 2 (local-evidence/2026-11-30-windows-port-grilling/spike2/RESULTS.md, Daniel's machine only; the durable figures go in the note), corrects its Codex reading (hooks run through the session's shell, PowerShell on the runner, not cmd.exe /C), and updates its site counts, in the first ticket's PR.
The system map. New files join their parts; windows.yml sits where studio.yml does; the two new laws, paths-read-in-one-form and runs-refuse-without-a-sandbox (on map-briefs-runs, backing check: "No background run starts where Claude Code has no OS sandbox; on native Windows each kind refuses before it clones, fetches or archives."), with tagged tests that run on every CI through the runner's runs_supported parameter. No top-level part, zone or actor changes, so no README picture changes.
Docs. docs/studio/behaviour/storage.md (the data folder on Windows), docs/studio/plugin.md (exec form on Windows; Claude Code only), docs/studio/behaviour/background-runs.md (refused on native Windows), docs/studio/settings.md (API keys refused on Windows), docs/studio/development.md (windows.yml, npm run check:windows), AGENTS.md "Checks" and "Tests". The README's Windows section is Phase 2.
Made without Daniel. Q10 to Q39 in the grilling's reports/decisions.md, each with the options set aside and why. The consequential ones went to Daniel in a veto summary, which he passed on 2026-11-30, with the cold critic's findings answered in reports/critic.md.
Testing Decisions
A good test drives the public seam and checks what a user or another process sees: lines in events.jsonl, files in the data folder, a refusal line, what a fake recorded, a turn's files.
- Pure rules, on every CI (macOS, Linux and Windows), as table rows: the path rule (
paths-read-in-one-form), POSIX rows left as written and every Windows spelling (C:\,c:/,\\?\C:\,/c/on a Windows line and on a POSIX one, UNC), andinside/samewith acwdwhose case differs from git's; the exec-form rendering of the real template (every entry, both binaries, every field kept, and macOS/Linux bytes unchanged);is_shellandagent_pidwith the injectedinspect(hook/tests/pid.rs);named_pathswith Windows tokens; each run kind's refusal withruns_supportedfalse, no folder made, the right state recorded (runs-refuse-without-a-sandbox); Open in editor, API keys, the OpenAI-compatible writer with only a base URL, and the other CLI writers refusing on Windows; install wiring Claude Code only and printing the skip line for the others; the core reading a Windows log into turns with files and a project, including two sessions in one repository, each edit credited to its own session (the row that catches a rawrow.file), a check whose commandcds intoC:\…, and a resumed session whose newer pid started after the session's first event and stays alive. - Windows arms, on the Windows job: the runner's contract twins with the Rust fake (deadline kills the tree, a helper cannot hold the run past its deadline, given up, not found, failed with stderr, both streams whole, leftovers left alone after a clean exit);
pid_aliveand the start-time check; the parent pid canary (the_logged_line_carries_the_parent_pid_or_the_wrappers,hook/tests/pid.rs:94-99); the answer file's owner, reparse-point and nonce checks; rename-aside with a running copy, and uninstall with a running copy; the data folder; hooks racing a prune over a turn lock;install-never-opens-claude-settings's twin;log-writers-hold-the-log-lockas it is, once its binary compiles. - End to end, on the Windows job: a Rust test that runs when
PLOTKEEPER_E2E_CLAUDEis set (the job sets it and installs Claude Code's native build), and fails ifclaude.exeis then missing. It serves a stand-in Anthropic Messages API from inside the test, since a process started in another CI step is gone (spike round 2); runsplotkeeper install --yesin a scratch home; thenclaude -pwithANTHROPIC_BASE_URLat the stand-in and--allowedTools Write, the stand-in asking for oneWriteof a file in a scratch repository and then ending the turn. It asserts the log holds SessionStart, UserPromptSubmit, Stop and SessionEnd fromplotkeeper-hook.exewithclaude.exeas the agent, and that the core reads one turn whose files are that file and whose project is the scratch repository. Ifclaude plugin installcannot work offline in CI, the test passes the rendered hooks through--settingsand its doc comment says so. - What CI cannot check goes to the gates in Daniel's Parallels VM: Smart App Control, console windows under a GUI host, Ctrl+C in a real console, the browser opener's fragment, a real profile's ACL, an interactive session with a permission answered from the page.
- Each new test row is run red first (an assertion failure, not an import failure), and each row added in a fix of review findings is shown to fail with its behaviour broken for a moment (
docs/agents/issue-tracker.md, Claim).
Prior art: hook/tests/pid.rs's injected inspect, server/tests/switchboard.rs's Platform parameter, workbench/tests/run.rs for the runner's contract, hook/tests/prune.rs for the log, spike round 2's hooks.ps1 and mock-llm.mjs for the end-to-end shape.
Out of Scope
- Codex's and Cursor's hook entries and trials (Phase 2). Spike round 2's Codex facts (PowerShell,
commandWindows) go to Phase 2's spec. - Moving the remaining shell fakes to the Rust fake and lifting their gates (Phase 2).
- npm packages, the launcher's Windows signals, release, the README's Windows section (Phase 2), and signing (Q6).
- Background runs, micro-worlds, the map text review and First map's draft on Windows (a later phase, Q3);
run_loggedon Windows with them. - API keys, the OpenAI-compatible writer and TLS on Windows (a later phase, Q4); the other agents' writers on Windows (Phase 2).
- Jump on Windows, recording the terminal (
WT_SESSION), Open in editor on Windows (Q8). - The other five agents.
- A
claude --versionfloor; runningclaude.cmdshims.
Further Notes
- Order. The first ticket makes the workspace compile on Windows, with arms that refuse where later tickets fill them in, gates the Unix-only tests, adds
windows.yml,npm run check:windowsand the binaries upload, and lands the research note's update. So that Gate A has something to try, it also holds the small arms a bare start needs: the data folder, the.exenames,getrandom, the private files'cfg(unix)and the browser opener. It needs CI, so it runs as its own non-draft PR before/implement-spec(docs/agents/ticket-authoring.md, "Checks that need CI"). The runner, the hook's pid and walk, the answer file, program lookup, paths and rename-aside then run in parallel; the exec-form rendering after program lookup; the end-to-end test and Gate B last. - Gate A (a
ready-for-humanticket that blocks nothing): after the first ticket merges, Daniel downloadsplotkeeper-windows-arm64(or x64 under emulation) into the VM and checks that all four binaries start with Smart App Control on (the hook and the answer hook run by hand with a sample input), that Ctrl+C stops plotkeeper, and that the browser opens on the page with its project fragment. If Smart App Control blocks an unsignedplotkeeper-hook.exeorplotkeeper-answer.exe, signing (Q6) is decided before Phase 2. In exec form a hook that cannot start does not block Claude Code: its docs limit "can instead block the action" to shell-form hooks without Git Bash, and say an exec-form call "can go ahead when the program fails, is missing" (hooks, "Failed hooks on Windows without Git Bash"). So a blocked hook means sessions go unrecorded and answers from the page do nothing, with Claude Code asking in its terminal as usual. - Gate B (the last ticket,
ready-for-human): a real interactive Claude Code session in the VM, recorded live, with files per turn, its project, a Headline fromclaude -p, and a permission answered from the page; and no console window flashing when the hooks run under Claude Code. - Effort: about 9 to 16 effort days (
windows.md's units; judgement, low), Phase 1's share of the core v1 estimate. - Every figure above was read at
52936fa6bor in spike round 2; the site reports behind them are in the grilling'sreports/folder.
Activity
danielrispler commentedon Nov 30, 2026
Route draft: #937 (none) → medium·medium — breakdown critic: cut out of the first ticket as platform-neutral prep
Route draft: #938 medium·medium → strong·high — breakdown critic: the interim runner arm is concurrency and the answer hook's refusal a trust boundary
Route draft: #939 medium·medium → strong·high — breakdown critic: the data folder is persistence, the nonce a trust boundary
Route draft: #940 strong·high → strong·high — unchanged
Route draft: #941 medium·medium → medium·medium — unchanged
Route draft: #942 medium·medium → medium·medium — unchanged
Route draft: #943 medium·medium → strong·high — breakdown critic: the never-opened mechanism is left open
Route draft: #944 strong·high → strong·high — unchanged
Route draft: #945 strong·high → strong·high — unchanged
Route draft: #946 strong·high → strong·high — unchanged
Route draft: #947 strong·high → strong·high — unchanged
Route draft: #948 medium·high → strong·high — breakdown critic: the end check appends end events to the log
Route draft: #949 strong·high → strong·high — unchanged
Route draft: #950 medium·medium → strong·high — breakdown critic: the saved projects file, cut from the paths-outside-the-log ticket
Route draft: #951 medium·medium → medium·medium — the rest of that ticket after the cut
Route draft: #952 medium·medium → medium·medium — unchanged
Route draft: #953 strong·medium → strong·medium — unchanged (Daniel's trial)
Route draft: #954 strong·medium → strong·medium — unchanged (Daniel's trial)