Repository navigation
A dispatch describes what its workspace actually changed (#3236) - #3704
Merged
Merged
Conversation
darkmux describes; it never reads the model's claim and never changes a dispatch's result. The host reads the workspace right before the sandbox starts and again when the dispatch ends, and records what changed: - the envelope (`dispatch --json`) gets `workspace_changes`: method, files_changed, not_measured, line totals, what was excluded, and the files by name (at most 100, then files_omitted); - `dispatch.complete` / `dispatch.error` carry the same counts and totals and no file list, so no path reaches the flow stream or the fleet relay (flow schema 2.10.0, additive, read leniently); - `run stats` (text and --json) reads them from the run's terminal record (run stats schema 2.6.0); - the viewer's dispatch page shows a `changes` row: "no changes outside dist/, target/", "2 files · +12 −3", "not measured: <why>". `files_changed` is 0 only when the workspace was read and nothing changed, and null (with the reason) when it could not be read. A line total is null unless every changed file's lines were measured. Two existing mechanisms moved into darkmux-crew's `workspace_changes` rather than written again: the client work copy's git tree snapshot (serve now calls it) and the lab's workspace delta (re-exported under its lab name, with the artifact directory names beside it). A checkout whose own `.git` the run could not write is measured with git, through a scratch index seeded from its own and a scratch object store with the repository's as an alternate, so the repository is only read; every other workspace is measured by snapshot. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFCFz4Ba6sjXBsGaK2g5aB
…e stream (#3236 review) The independent review of #3704 found these; each now has a test. - The git path adds into a fresh, empty index, never a copy of the checkout's: a seeded gitlink made `git add` run git inside a submodule whose `.git` a run can write, executing its filter on the host, and a hanging one held the dispatch's close forever (host_git.rs's rule: add "into a fresh, empty index, which holds no gitlink to check"). It also hid --assume-unchanged / --skip-worktree edits. - Every git call while measuring runs under bounded_command, sharing one deadline (runtime.step_command_timeout_seconds); past it the changes are not measured and the close goes on. - `not_measured` is a fixed reason that names no path (git's stderr named the file it failed on, on dispatch.complete). - What a "no changes" did not look at is named: `submodules` (work inside one is not in its gitlink) and `files-over-50mb` (compared by size and mtime). The snapshot now counts symlinks by their target without following them, permission changes, a large file's moved mtime, and names that are not UTF-8; it opens files no-follow and regular-only, and counts an added file's lines in chunks, capped. - The exit between the launch and the watch (a failed observer start) records the workspace as not read instead of no block. - A dependency's envelope forwarded to the next step's model, and so to that step's dispatch.start prompt on the flow stream, keeps its workspace counts and drops the file list. - FLOW_SCHEMA_VERSION's version history names 2.10.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFCFz4Ba6sjXBsGaK2g5aB
… gitlinks (#3236 review 2) - Every measuring git call now reads the repository's filter drivers under the read's deadline (HostGit::filter_drivers_command, parsed by filter_drivers_in) and builds its command with them (HostGit::command_with_drivers). A config can include.path a file in the work tree, which a run can replace with a FIFO; the unbounded read inside HostGit::command held the close. The read is per call, so a driver the run defines through such an include is still passed empty. HostGit::command is unchanged for every other caller: it is now command_with_drivers over the same unbounded read it always made. - A dispatch.internal step whose dispatch exits non-zero fails with the envelope minus its file list (builtins::dispatch_exit_text): that text is the step's output and step.error record and reaches run_on: error dependents' prompts. - Gitlink detection streams plain `git ls-tree -r -z` under the deadline and keeps only a flag: no 1 MiB capture (big repositories were unmeasurable) and no `--format` (git 2.36). - The git-path label no longer spells "git" as a literal (the host-git conformance scan reads it as a spawn). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFCFz4Ba6sjXBsGaK2g5aB
…#3236 CI) - No alternate object store: through one, git "freshens" each object it already holds by rewriting its file's mtime, a write to the operator's repository. Every object of both trees now lives in the scratch store. - Every measuring call adds gc.auto=0, maintenance.auto=false and both autoDetach=false (MEASURE_GIT_CONFIG, through HostGit::with_config), so no auto gc or auto maintenance (CI's git 2.56 left objects/maintenance.lock) runs against the checkout. - The test fixture's own git calls turn auto maintenance off too, so a detached maintenance from a setup commit never races a test's read. - The repository checks compare every file under .git, mtime included. - Clippy: no octal-looking escapes, a byte string where it suggested one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFCFz4Ba6sjXBsGaK2g5aB
Under the checkout's core.splitIndex, the scratch index kept its shared index in the operator's .git and expired old ones there, which could delete the operator's own and make `git status` fatal. Every measuring call now sets core.splitIndex=false. The regression test (shortest expiry, two reads) asserts no file is added, removed or rewritten; git's own mtime freshen of the shared index on read is the one change, as the operator's own `git status` makes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFCFz4Ba6sjXBsGaK2g5aB
…atchet) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFCFz4Ba6sjXBsGaK2g5aB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3236.
What broke: a coder dispatch whose model claimed a fix it never made still ended
stopwith exit 0. Nothing recorded that the workspace was untouched. This happened in 10 of 12 runs in the 2026-10-14 gate.Decided with the operator ("describe the change"): a dispatch always records what its workspace actually changed. darkmux never parses the model's claim and never changes the result. Decisions are recorded on the issue.
What ships:
WorkspaceChanges(flow 2.10.0):method(gitorsnapshot),files_changed,not_measured,lines_added,lines_removed,excluded.dispatch.completeanddispatch.erroras counts only. The type has no field that could hold a path.files, capped at 100, plusfiles_omitted.0means it was measured and nothing changed.nullplusnot_measuredmeans the workspace couldn't be read. A missing block means no workspace was read.nullunless every changed file's lines were measured.excludednames what the measure skipped (the snapshot's skipped directories, orgit-ignored/nested-repositories), so "no changes" never overclaims.--workdirwhose.gitthe run cannot write. It uses a scratch index seeded from the repo's own and a scratch object store with the repo as an alternate, so the repository is only read. A repo whose config defines a filter driver falls back to the snapshot.workspace_deltaand serve client git-snapshot mechanisms, moved intodarkmux-crew(git mv), not copied. Lab and serve re-export under their old paths.run stats(text line and--json), with run stats 2.6.0changesrow: "no changes outside dist/, target/", "2 files · +12 −3", "1 file · lines not measured" or "not measured: …"cli-json.goldenand the bundle are regenerated.Cost (after three review rounds: a fresh index, bounded filter-driver reads on every measuring call, a streamed gitlink scan):
Git calls in measuring: every one is bounded under one deadline, the filter-driver read included, and no call spawns a child process on a hostile tree (round 2 traced 19 calls). The git path uses no
--format, so it no longer needs git 2.36. It is only tested on 2.50.1.Tests:
--test cliand--bin darkmuxpass (1567); vitest passes (3859). Both complexity ratchets pass.Not yet looked at on screen: the viewer row (it needs a served daemon). The Docker proof (
mock_dispatch_proof.rs,#[ignore]) didn't run here.Labeled
full-ci, since this is a contract change across several crates.🤖 Generated with Claude Code
https://claude.ai/code/session_01EFCFz4Ba6sjXBsGaK2g5aB