Skip to content

Spec: Windows Phase 1 — Claude Code recorded on native Windows, x64 and arm64 #936

Backlog
4 of 19 issues completed

Description

@danielrispler

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/urandom with an expect (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), so claude is never found and PR briefs are switched off at start (server/src/lib.rs:291-303).
  • The hook compares canonicalize's \\?\C:\… with git's C:/… 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. Edit and Write paths 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 two bash.exe between Claude Code and the hook.
  • Background runs would fail with a Linux reason ("claude was 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.

  1. It builds, starts and stops. Wherever macOS and Linux differ today, Windows gets its own arm: the data folder in %USERPROFILE%\AppData\Local\plotkeeper, .exe names, the browser opener, random bytes from the OS, the one-plotkeeper lock's private files. plotkeeper starts, opens the page and stops on Ctrl+C.
  2. 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 install wires Claude Code only and says so for the other agents it finds.
  3. 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 PATH with Windows' extensions, never through a shell.
  4. Claude Code sessions record correctly. On Windows its hook entries are rendered in exec form. The hook finds claude.exe as the agent, writes under events.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.
  5. An upgrade works while a hook runs. A running hook binary is moved aside and the new one put in its place.
  6. 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.
  7. 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

  1. As Daniel on Windows, I want plotkeeper to start, open the page and stop on Ctrl+C, so that I can use it as on my Mac.
  2. As Daniel on Windows, I want plotkeeper's data in %USERPROFILE%\AppData\Local\plotkeeper, so that it sits where Windows programs keep local data.
  3. As Daniel on Windows, I want plotkeeper install to wire Claude Code, so that my sessions are recorded.
  4. 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.
  5. 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.
  6. As Daniel on Windows, I want a session to end when its claude.exe exits, and not when a shell between them exits, so that the list stays true.
  7. 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.
  8. 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.
  9. As Daniel on Windows, I want check results to show for the commands my agent ran, so that checks work as on macOS.
  10. As Daniel on Windows, I want to answer Claude Code's permissions, questions and plans from the page, so that "needs you" works.
  11. 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.
  12. As Daniel on Windows, I want summaries written by claude -p and PR briefs written, so that the learning layer works.
  13. As Daniel on Windows, I want the map, Fog, First map's free scan and plotkeeper map check to work, so that the map is the page's base.
  14. 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.
  15. 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.
  16. 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.
  17. 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.
  18. 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.
  19. 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.
  20. 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.
  21. As Daniel, I want the CI-built Windows binaries from main to download into my VM, so that I can run the gates without building in it.
  22. 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.
  23. 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.
  24. As Daniel, I want the stored samples and the macOS and Linux logs to read exactly as before, so that no history changes.
  25. 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 a cfg(windows) file of its own beyond what a seam needs. The existing cfg(not(target_os = "macos")) arms that mean "Linux" become cfg(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's Platform gains Windows (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_dir likewise (:37-43). The test helpers set USERPROFILE beside HOME, since home_dir reads USERPROFILE on Windows (hook/tests/common.rs:36-44 and the server's equivalents); otherwise a Windows test run would write the developer's real data folder.
  • .exe names: every place a binary name is built or matched adds std::env::consts::EXE_SUFFIX: HOOK_BINARIES and 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 the getrandom crate, already in Cargo.lock through tempfile, on every platform.
  • Private files: the mode(0o600) and mode(0o700) calls (hook/src/answer.rs:125-142, server/src/lock.rs:103-114) become cfg(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-80 calls ShellExecuteW with the URL through windows-sys (already in Cargo.lock). Not cmd /c start, whose % expansion would meet the percent-encoded project fragment.
  • Ctrl+C: ctrlc with termination already covers Windows consoles; no change. Gate A checks it.
  • git ls-files -z's bytes: OsStrExt::from_bytes in the hook (hook/src/lib.rs:12, :633) becomes a UTF-8 read.
  • Temporary folders: server/src/projects.rs:29-36's list gains std::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 its srt lookup (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's claude flag 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-run builds on Windows; there it prints the runs line and exits 1. Everything it runs (server/src/runner.rs:731-1015) is cfg(unix).
  • API keys: a cfg(windows) arm of os_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_url is set (server/src/learning.rs:55-59 finds it by the base URL alone, no key), with the same line: without TLS on Windows (below) an https:// 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 .cmd shims that std will not pass the writer's multi-line arguments to, and the sandboxes law writer-has-no-tools names 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_editor on Platform::Windows, before any git, 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_start and rewire_changed take Claude Code only; every other agent found gets a "not on native Windows yet" line, as skipped() 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 .exe on 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 become cfg(unix).

The process runner (workbench/src/run.rs).

  • The Windows arm of run (behind run_until, run_until_with_input, run_until_unless) starts the command through process-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's wait(), which waits for the whole job (spike round 2, job-leftover: 8 s for a leftover sleep 8). It terminates the job in the same cases as the Unix arm kills the group: a try_wait error, 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, and git/gh/gh_at/quiet as the one builder (law git-and-gh-go-through-the-runner) are unchanged.
  • run_logged and run_logged_telling return RunError::Start with 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 PATH with PATHEXT and returns an absolute path, with no shell. On Windows find/find_program (understanding/src/lib.rs:519-540) and install::on_path (server/src/install.rs:264-269) use it; macOS and Linux keep their lookups. The switchboard's find is unchanged: both its commands refuse on Windows, so switchboard-runs-fixed-programs keeps its Unix test, gated.
  • For claude, Phase 1 accepts only a real claude.exe, Claude Code's native build. A claude.cmd alone 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.
  • git and gh run by bare name through std, which finds git.exe and gh.exe: on Windows gh_path (workbench/src/lib.rs:63-87) returns bare gh without asking a login shell.

Claude Code's hook entries on Windows (server/src/install.rs).

  • claude_files keeps the one template, plugin/hooks/hooks.json. On Windows only, a pure function converts each entry: a command of the form "\"__PLOTKEEPER_BIN__/<name>\" <words>" becomes command = <bin>\<name>.exe and args = the words; type, async, timeout, statusMessage and every other field are kept. Both plotkeeper-hook and plotkeeper-answer entries 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 (law install-never-opens-claude-settings unchanged).
  • No claude --version floor in Phase 1: Claude Code below 2.1.139 drops args (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:72 reads the parent from a Toolhelp snapshot (windows-sys, a target-only dependency of the hook). In exec form the parent is claude.exe and agent_pid returns it even when inspect finds nothing (hook/src/lib.rs:1539-1543).
  • The walk: inspect gains a cfg(windows) arm returning the parent pid and the full image path (QueryFullProcessImageNameW). is_shell splits on \ and /, strips .exe case-insensitively, and knows pwsh, powershell and cmd. agent_pid skips a run of shells, at most three, on every platform (Git Bash's launcher puts two bash.exe before claude.exe; on macOS and Linux two shells give the wrong pid today). in_app learns 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, OpenProcess and WaitForSingleObject(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 --resume keeps the session id and starts a new claude.exe after 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 beside session.pid in 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 than STALE_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): spelled strips the \\?\ prefix canonicalize gives, holds and Named::root (hook/src/lib.rs:702-781) compare drive-letter paths in that form, claude_trees takes an Edit or Write path that is absolute on Windows (:1282), and named_paths (:707-713) keeps C:\… and C:/… tokens whole and reads Git Bash's /c/… as C:/… when the line's cwd is 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 uses FILE_FLAG_OPEN_REPARSE_POINT and refuses a reparse point (in place of O_NOFOLLOW; FIFOs do not exist in the file system); the open handle's owner SID must be the token user's or BUILTIN\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, getuid and the mode check are cfg(unix). Deleting the answer file while its handle is open needs delete sharing, which std's default gives.
  • studio_terminal is recorded as today, from TERM_PROGRAM or HC_TERMINAL_ID (hook/src/lib.rs:1551-1573); nothing reads it on Windows, since Jump is refused. Recording WT_SESSION waits 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's File::lock is LockFileEx on Windows, so the locking holds. What differs is the prune's remove_file of 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 as C:/Users/… on a line whose own cwd is a drive-letter path (windows_line); a drive-letter path (C:\…, c:/…, \\?\C:\…) becomes C:/… with forward slashes and an upper-case drive letter; a UNC path (\\server\share) becomes //server/share.
    • inside(path, root) and same(a, b): the one comparison, on read paths, with the / boundary; on drive-letter paths ASCII case-insensitive (NTFS is, and an agent's cwd keeps the case the user typed, which git's spelling need not share). Every comparison site below uses them instead of its own strip_prefix, starts_with or ==. 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 read once per line as it reads the log (core/src/studio/replay.rs:50-80) to Event.cwd, studio_touched_roots, the keys of studio_turn_start and studio_turn_end, and each Tool.path; and to the server's root lookups where they meet the log (core/src/studio/roots.rs:16-28). Tool.input stays 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 read too: the ledger's row.file from file_path, notebook_path or path (core/src/ledger.rs:233-242) and the step detail's file_path (core/src/output.rs:321-347). Without that, a Windows row.file (C:\repo\src\a.rs) is inside no root, so turn_files.rs:157-185 credits 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 read where they enter: a cd target in a check's command (core/src/checks.rs:481-486), the folders in settings.json (server/src/settings.rs:441-445, core/src/checks.rs:52-57), and a project saved by plotkeeper add or the start-up registration (server/src/bin/plotkeeper.rs:52-64), which the switchboard and the projects list then compare with same (server/src/switchboard.rs:589, server/src/projects.rs:85-89).
  • The / boundaries then work on one spelling, and the places that decide "absolute" accept x:/ 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-242 and :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.rs FORMAT 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 (on core, backing check): "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: ureq becomes a target-specific dependency of studio-understanding, without tls on Windows, so ring is 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 under npm run check's time, and the first ticket measures it. Not part of npm 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 of windows-latest and windows-11-arm, on ready PRs, pushes to main and pushes to issue-* branches, drafts included, so an integration branch gets a Windows run after every merge. Every ticket branch is also issue-* (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 a pull_request event whose head branch starts with issue-, 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:rust without slot.mjs, cargo clippy --locked --workspace --all-targets -- -D warnings for the Windows target, and the end-to-end test (Testing Decisions). On pushes to main it also runs npm run build and cargo build --locked --release -p studio-server -p studio-hook and uploads plotkeeper.exe, plotkeeper-run.exe, plotkeeper-hook.exe and plotkeeper-answer.exe as plotkeeper-windows-<arch>. No cargo-machete and 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-arm leg meets a crate or build blocker that x64 does not have, the leg becomes continue-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 check is 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, workbench and system-map build one it binary 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 of sh), the parent pid and the walk (hook/tests/pid.rs rows 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, and install-never-opens-claude-settings (server/tests/install.rs:596). switchboard-runs-fixed-programs gets 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-settings must 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 HOME also set USERPROFILE; and new code with a Unix-only item gives Windows an arm or a cfg(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), and inside/same with a cwd whose 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_shell and agent_pid with the injected inspect (hook/tests/pid.rs); named_paths with Windows tokens; each run kind's refusal with runs_supported false, 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 raw row.file), a check whose command cds into C:\…, 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_alive and 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-lock as it is, once its binary compiles.
  • End to end, on the Windows job: a Rust test that runs when PLOTKEEPER_E2E_CLAUDE is set (the job sets it and installs Claude Code's native build), and fails if claude.exe is 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); runs plotkeeper install --yes in a scratch home; then claude -p with ANTHROPIC_BASE_URL at the stand-in and --allowedTools Write, the stand-in asking for one Write of a file in a scratch repository and then ending the turn. It asserts the log holds SessionStart, UserPromptSubmit, Stop and SessionEnd from plotkeeper-hook.exe with claude.exe as the agent, and that the core reads one turn whose files are that file and whose project is the scratch repository. If claude plugin install cannot work offline in CI, the test passes the rendered hooks through --settings and 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_logged on 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 --version floor; running claude.cmd shims.

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:windows and 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 .exe names, 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-human ticket that blocks nothing): after the first ticket merges, Daniel downloads plotkeeper-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 unsigned plotkeeper-hook.exe or plotkeeper-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 from claude -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 52936fa6b or in spike round 2; the site reports behind them are in the grilling's reports/ folder.

Sub-issues

Sub-issues

4 of 19 Issues completed
Loading 19 sub-issues

Activity

  1. added
    ready-for-agent
    on Nov 30, 2026
  2. danielrispler commented on Nov 30, 2026

    @danielrispler
    OwnerAuthor

    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)

  3. added
    windows
    on Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentwindows

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions