Repository navigation
Description
Parent
What to build
Tests fake programs with one Rust fake from test-support, not shell scripts. A test asks for a fake of a name (claude, agy, git, …) in a folder with a behaviour: what it prints on stdout and stderr, its exit code, an optional wait before exiting, and whether to record the call. It gets back the fake's path, and can rewrite the behaviour between calls. The fake is the test's own executable started under another name, so it needs no shell, Python or Node and runs the same on macOS, Linux and Windows. workbench/tests/run.rs's fake moves to it, and AGENTS.md "Tests" stops new shell fakes. The research note docs/studio/research/windows.md lands in this ticket's PR, the spec's first.
The design is settled in #805, "Implementation Decisions" ("The Rust fake") and "Made without Daniel" Q4–Q5.
This ticket runs as its own non-draft PR before /implement-spec takes #805's other tickets (docs/agents/ticket-authoring.md, "Checks that need CI"): current_exe through a hard link and the copy fallback behave per platform, and only the ubuntu job, which skips drafts, runs Linux.
Acceptance criteria
-
test-supportplaces a hard link to the running test binary at<folder>/<name>(<name>.exeon Windows), or a copy where a hard link cannot be made, never a symbolic link, and writes the behaviour file beside it. - Code run before the test harness's
main, through thectorcrate (a dependency oftest-supportonly), checks for a behaviour file besidestd::env::current_exe(); when one is there it acts out the behaviour and exits without starting the harness. - Each recorded call appends one entry to a JSON record beside the fake: the arguments, the working folder, stdin and the environment.
-
test-support's own tests check that a fake prints what it was told, exits with its code, records arguments, folder, stdin and environment, waits when told, and acts out the second behaviour after a rewrite. -
workbench/tests/run.rs'sfakeis the Rust fake, and its tests check the same facts as before, read from the record instead of printed lines. - AGENTS.md "Tests" gains one rule: a test that needs a fake program uses
test-support's fake, never a#!/bin/shscript, and no code or test startsshorbashby bare name (on Windows a barebashfrom Rust is WSL's launcher:windows.md, "CI spike results"). -
docs/studio/research/windows.mdis committed, copied from the main checkout's untracked file at/Users/danielrispler/work/plotkeeper/docs/studio/research/windows.md(the worker leaves that file alone). Before the merge'sgit pull --ff-onlyin the main checkout, the merger deletes that untracked copy oncecmpshows it equal to the merged file, or the pull refuses to overwrite it (docs/agents/issue-tracker.md, the merge procedure, step 6). -
npm run checkpasses locally, and the PR'subuntujob is green.
Reading
- Spec: Windows foundations — a separate event-log lock, LF checkouts, a Rust test fake, the Windows npm names #805, "Implementation Decisions" ("The Rust fake") and "Made without Daniel" Q4–Q5: the design, why a symbolic link won't do, and what was set aside.
- Spec: Windows foundations — a separate event-log lock, LF checkouts, a Rust test fake, the Windows npm names #805, "Testing Decisions" ("The Rust fake").
test-support/src/lib.rs'sLauncherGuard: prior art for a helper with its own tests.workbench/tests/run.rs: thefakeit replaces, andno_git_or_gh_is_built_outside_the_runner.
Touches
- Files:
test-support/src/lib.rs,new test-support/src/fake.rs,test-support/Cargo.toml,new test-support/tests/fake.rs,workbench/tests/run.rs,Cargo.lock,AGENTS.md,new docs/studio/research/windows.md - Session: auto mode
- Route: medium · effort medium — a new module whose design the spec settles, with its own tests; no persistence, stored type, queue or UI
Activity
danielrispler commentedon Nov 28, 2026
Implemented in PR #816 (its own PR against main; ubuntu job green).
Route outcome: medium·medium claude/sonnet → pass,pass | 14m; 13m
Studio tests: one Rust fake program from test-support, and the Window…