Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
140 changes: 134 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/studio/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
- `core/`: the studio core, plain Rust whose only I/O is reading the sessions' transcripts (`src/transcript.rs`, `.jsonl` files only), and `scrub`, which turns event log lines into test fixtures. At start the app takes the state its last start saved, `studio-state.json` beside the log, and replays only the log from where that state stopped, then feeds it each new line live; a pruned log, a state of another format or one that does not read means a replay from the start. It keeps the step ledger (`ledger`), the checks (`checks`: the statement parser, a run's worktree and exit code, running checks and checks sent to the background, the feed's checks, and the typical durations with the 2-minute rule: their recording, median and lookup, which `lib.rs` calls), each turn's files (`turn_files`) and the facts Ask shows (`ask`). The `Studio` type is in `src/studio.rs`, its methods by responsibility in `src/studio/`: `take` (one hook event), `roots` (worktree roots and fingerprints), `replay` (a log line applied or replayed), `turn_files` (the turns the shell diffs), `tasks` (what the shell found about each task and its PR) and `selection` (the session list, the selection and the subagent logs).
- Only live lines request cards and notifications.
- `understanding/`: the understanding layer's I/O: the writer interface (turn summaries, goals, "Design so far", Ask, names and risk notes), the `claude -p` writer and the other CLI writers (agy, Codex, Copilot, Cursor) in `writer.rs`, the API-key writers' HTTP calls (`http_writer.rs`: Anthropic's API and an OpenAI-compatible one) and a fake, the worktree fingerprint, the card store with the briefs, the turn summaries, Turn writing (`turn_writing.rs`: what a turn's end and a worker's return write, on a queue for each session), which files are logic and which are tests (`logic_file.rs`), Claude Code's version kept beside the event log, and `weekly`, the command that prints the drift: unrecognised wake-ups and version changes.
- `workbench/`: workbench git (danielrispler/Falinks#328, module 7): a folder's main checkout, `fetch` and what removing a task's worktree would lose; the `gh` to run; and agy's plugin. Its `run` module (`src/run.rs`, #548) is the one process runner: `git(dir)` and `gh(dir)` build every `git` and `gh` the workspace starts, with `--no-optional-locks`, `GIT_TERMINAL_PROMPT=0`, `GH_PROMPT_DISABLED=1` and no input, and a caller adds its own arguments; `run_until(command, deadline)` runs a command in a process group of its own and kills the group at the deadline, and its `RunError` tells apart a command that did not start, one that timed out and one that exited non-zero; `run_logged(command, deadline, given_up)` does the same for a command whose output goes to a file, gives its exit status, and also kills what it left in its group when it exits (#568). On Windows, until #940 gives it a Job Object, `run_until` kills only the command itself, and `run_logged` starts nothing and returns `RunError::Start`, as its callers are refused there. A new `git` or `gh` call uses both, with its deadline a named constant beside it: 30 s for a lookup or a read, 120 s for a fetch. Every wait on a child with a deadline goes through the runner: the launcher's check, setup and harness and the micro-world checks too (#568). A command streamed into another program (the hook's untracked-file listing, `git archive` into `tar`) is built by the runner and waited on by its caller. What only its own tests used is in `archive/workbench/` (#415).
- `workbench/`: workbench git (danielrispler/Falinks#328, module 7): a folder's main checkout, `fetch` and what removing a task's worktree would lose; the `gh` to run; and agy's plugin. Its `run` module (`src/run.rs`, #548) is the one process runner: `git(dir)` and `gh(dir)` build every `git` and `gh` the workspace starts, with `--no-optional-locks`, `GIT_TERMINAL_PROMPT=0`, `GH_PROMPT_DISABLED=1` and no input, and a caller adds its own arguments; `run_until(command, deadline)` runs a command in a process group of its own (on Windows a Job Object) and kills the group at the deadline, leaving alone what it left running after a clean exit, and its `RunError` tells apart a command that did not start, one that timed out and one that exited non-zero; `run_logged(command, deadline, given_up)` does the same for a command whose output goes to a file, gives its exit status, and also kills what it left in its group when it exits (#568). On Windows `run_logged` starts nothing and returns `RunError::Start`, as its callers are refused there. A new `git` or `gh` call uses both, with its deadline a named constant beside it: 30 s for a lookup or a read, 120 s for a fetch. Every wait on a child with a deadline goes through the runner: the launcher's check, setup and harness and the micro-world checks too (#568). A command streamed into another program (the hook's untracked-file listing, `git archive` into `tar`) is built by the runner and waited on by its caller. What only its own tests used is in `archive/workbench/` (#415).
- `system-map/`: `studio-system-map`, a library and the `system-map` binary that check `system-map.json` against the repository, say which parts a change touches and count how well the parts follow the imports (`imports`) (`docs/studio/behaviour/map.md`). Its `scan` module is First map's free scan (#753: the parts proposed from folders and manifests, the loose files and tests, the reference-copy candidates and the placeholder parts and ids), and `cli` its command line, which `plotkeeper map check` and `map scan` share. `npm run check` runs `system-map check` after the tests.
- `server/`: `studio-server`, the state and the logic behind the page's commands, and the `plotkeeper` program that serves it (`src/bin/plotkeeper.rs`, the local page in `src/web.rs`, one function for each command in `src/api.rs`). Its modules include the read loop (`read_loop.rs`), the Map view's (spec #306: `map.rs` the payload, Daniel's positions and tiers and the guarded `git fetch`; `fog.rs` the commits since Daniel last caught up, kept per part, and what reading a brief clears; `history.rs` a part's history, the map at a past commit, a commit's files and a PR's; `ci_laws.rs` the default branch's last finished CI run, the law tests that failed in it and the words for a failed check; `stop_rules.rs` the usage log and the one-time review's counts) and the PR briefs' (spec #334: `prs.rs` which PRs are ready, `pr_briefs.rs` writing, keeping and rewriting the briefs, `ratify.rs` what Daniel accepted or overturned), `settings.rs` (with the API keys' stores: the Keychain on macOS, the Secret Service through `secret-tool` on Linux), `install.rs` (`plotkeeper install` and `uninstall`: the harnesses' plugins and hook files, and what it records to undo them; [install](plugin.md)), `hook_copies.rs` (the hook binaries' copies in the data folder's `bin/`, #356), `statusline.rs` (`plotkeeper statusline`, Claude Code's status line: a link to the page for the session on its stdin, #884) and `runner.rs` (the [background runs](behaviour/background-runs.md), spec #378: the queue and its batches, the ends told to the modules that listen, the `claude` command with its sandbox block and allow list, a run's lock, status and outcome, Cancel, and the logic of the launcher, the crate's second program `plotkeeper-run`, `src/bin/plotkeeper-run.rs`), `back_a_law.rs` (Back a law, #398–#401: the clone, plotkeeper's own proof of a run's patches in `srt`, the kept patches, Open draft PR, and a new law drafted from a PR's brief) `micro_worlds.rs` (micro-worlds, #399: the run, the host checks under the network guard `micro_world_guard.mjs`, the kept pages) and `map_review.rs` (the map text review, #642: the items a PR's map text changed, the read-only run on its head, when it starts, the verdicts kept), `map_scan.rs` (First map's scan screen, #753: the skeleton's lines and its Ignore, Home, Merge and Split) and `map_draft.rs` (the Map draft, #753: the writers' and reviewers' runs, retry, redraft and Discard, Accept's Write and Open a draft PR, and following that PR). `ui/`: its TypeScript page.
- `archive/`: retired code, never built, tested, linted or formatted (#415; its `README.md`): the Tauri desktop app (`src-tauri/`) and the daemon that owned its terminals (`terminal-daemon/`, danielrispler/plotkeeper#334, #332; each folder's `README.md`), the spikes, `real-calls.sh`, and the code and tests that only their own tests used.
Expand Down
2 changes: 1 addition & 1 deletion system-map.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
"id": "workbench", "name": "Workbench", "caption": "Worktrees and PRs",
"purpose": "The one runner of `git` and `gh`, git worktrees and fetches, agy's plugin, and the atomic write every store saves a whole file with. A black box: it never fogs.",
"holds": [
{ "name": "The runner", "text": "Builds every `git` and `gh` with prompts off and no input, and runs commands to a deadline that kills their process group.", "paths": ["workbench/src/run.rs"] },
{ "name": "The runner", "text": "Builds every `git` and `gh` with prompts off and no input, and runs commands to a deadline that kills their whole process tree.", "paths": ["workbench/src/run.rs"] },
{ "name": "Git", "text": "A folder's main checkout, `origin`'s fetch and what removing a worktree would lose, never with force.", "paths": ["workbench/src/lib.rs"] },
{ "name": "The atomic write", "text": "Saves a whole JSON file by a synced temporary file beside it, renamed over it, for the server's and the understanding layer's stores.", "paths": ["workbench/src/lib.rs"] }
],
Expand Down
4 changes: 4 additions & 0 deletions test-support/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,9 @@ libc = "0.2"
serde_json = "1"
tempfile = "3"

# The fake's helper: whether a process still runs, and the fake's own output kept from a helper given none (#940).
[target.'cfg(windows)'.dependencies]
windows-sys = { version = "0.61", features = ["Win32_Foundation", "Win32_System_Threading"] }

[lints]
workspace = true
Loading
Loading