Repository navigation
fix(qa): a QA round tests the commit it was asked to - #373
Merged
Merged
Conversation
sudoTomas
force-pushed
the
fix/qa-volume-isolation
branch
from
November 5, 2026 03:44
635b3e6 to
7b0bd43
Compare
sudoTomas
force-pushed
the
fix/qa-round-tests-requested-head
branch
from
November 5, 2026 03:44
7cd2283 to
67dc580
Compare
sudoTomas
force-pushed
the
fix/qa-volume-isolation
branch
from
November 5, 2026 16:47
7b0bd43 to
df565a9
Compare
sudoTomas
force-pushed
the
fix/qa-round-tests-requested-head
branch
from
November 5, 2026 16:52
67dc580 to
cf79631
Compare
A QA round verifies one commit: the head its bootstrap clone read, qa["head_sha"]. Every workspace the round's sub-tasks run in holds that commit, and a sub-task whose workspace holds another fails the round. The warmer runs every round. It checks the shared volume's labels, fetches the branch into the volume's checkout (or clones into an empty volume), checks the tree out to the round's commit, and removes every untracked and ignored file except the dependency directories: every node_modules, and at the top of the tree only .pnpm-store, .yarn, Yarn's .pnp files, .venv, __pypackages__ and vendor, plus the stored config's cache.shared_volume.keep patterns. It runs the install only when the recorded lockfile sha differs from the round's, and returns "refreshed" when it skips it. Every git step goes through sandbox_git. A sub-task on a shared volume reads its HEAD and fails the round, with both commits in the failure, when it is not the round's commit. A sub-task without a shared volume (a clone, or a pre-built image's checkout) checks its workspace out to the round's commit first, with the same check. The commit travels from init_orchestrator_node to the warmer as requested_head and through the fan-out to each sub-task as expected_head_sha. cache.shared_volume.keep takes up to 32 gitignore-style patterns, for files an install writes outside the default directories. Each must start with a plain name (no *, ?, [ or backslash in its first path segment), so every path it keeps has a component of exactly that name and no pattern keeps every file; a negated pattern, a comment and a . or .. segment are refused. Fixes: #371
sudoTomas
force-pushed
the
fix/qa-round-tests-requested-head
branch
from
November 5, 2026 17:49
cf79631 to
141ffd2
Compare
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.
Summary
A QA round tests the commit it was asked to,
qa["head_sha"]: every round the warmer checks the shared volume's tree out to that commit and removes every untracked and ignored file except the dependency directories, installing only when the lockfile changed; a sub-task that checks out its own workspace pins it to that commit; and a sub-task whose workspace holds another commit fails the round. Issue #371.Motivation — Intent + Problem
A QA verdict is about one commit. A shared cache volume is reused from round to round, so each round must start from the commit it tests and from a tree holding nothing an earlier round built, and every sub-task must be able to show which commit it ran.
How it works
init_orchestrator_nodereads it from the bootstrap clone (qa["head_sha"]) and passes it to the warmer asrequested_head(a required argument: a full commit id) and, through the fan-out,run_subtaskand the sub-task state, to each sub-task asexpected_head_sha.prep_qa_sandbox_clone(head_sha=…)clones into the volume or fetches the branch into the checkout already there, then checks the tree out to the commit, detached (pin_checkout:cat-file -e <sha>^{commit} || fetch origin <sha>, thencheckout -f --detach <sha>). The warmer checks HEAD is that commit, then runsclean_tree:git clean -ffdxqwith an--excludefor each kept pattern, and.qa/created again. Only then does it install, and only when the recorded lockfile sha differs from the round's ("warmed"); otherwise it records the use and returns"refreshed". Every git step is built and run bysandbox_git.DEFAULT_KEEP:node_modulesat any depth (a workspace install writes one into each package, and nothing builds into a directory of that name), and, anchored at the top of the tree where their installs write them,/.pnpm-store,/.yarn,/.pnp.cjs,/.pnp.js,/.pnp.loader.mjs,/.pnp.data.json,/.venv,/__pypackages__and/vendor, so a build output of the same name deeper down (a builtpublic/vendor/) is removed. Plus the stored config'scache.shared_volume.keep: up to 32 gitignore-style patterns, for files an install writes elsewhere.keep_pattern_problemrequires a pattern's first path segment (after an optional leading/) to be a plain name: no*,?,[or backslash. A literal segment matches only that exact name, so every path a pattern keeps has a component of exactly that name (at any depth with no slash, at the top of the tree with one), and no pattern can keep every file however its wildcards are written (*,?*,*?,[!.]*,**/x,/*are refused). It holds without re-implementing git's matcher; a check against sample paths would not, since a pattern can avoid the samples' names and still keep everything else ([!dn.]*keepsbuild/,out/and every top-level file). Negated patterns, comments and./..segments are refused too, and everyDEFAULT_KEEPentry passes the same rule (a test pins it).head_shatoprep_qa_sandbox_clone, which pins its checkout the same way. Either way a workspace at another commit ends the sub-task asinfra_failure, naming both commits.Pattern provenance
N/A — originated in this PR.
Verification
Automated (on #372 at
df565a90)-n 4 --fail-on-warnings,DOCKER_HOST=unix:///nonexistent.sock:18183 passed, 21 skipped in 390.18s (0:06:30)51 passed, 20 skipped(the Docker-backed ones skip, withDOCKER_HOSTpointed at no daemon)ruff format --check .,ruff check .: clean.mypy embry0:Success: no issues found in 650 source files.test_sandbox_git_guard.pypasses (the warmer's checkout and clean go throughsandbox_git).test_round_tests_requested_head.pyruns the compiled QA workflow (init_orchestrator → orchestrate_qa → qa_report) with the real warmer, fan-out, sub-task graph and acquire node; only the daemon and the sandboxes are fakes. It checks that the warmer pins the shared volume to the commit the bootstrap read, and that a sub-task whose volume holds another commit fails the round naming it.git archiveof fix(cache): collision-free QA volumes, trusted per-repo only #372 (df565a90) with only the test files copied in: 56 failed, each on anAssertionError(orpytest.fail) with its own message. Against the previous head of this PR (67dc5803), the reviewer's forms?*,*?and[!.]*, and every other wildcard-first form in the test, are accepted there and fail the test, and the real-git clean test fails there withapps/py/.venv,public/vendor/and the nested.yarn/.pnp.cjs/.pnpm-store/__pypackages__left behind.requested_head), or any link of orchestrator → fan-out →run_subtask→ sub-task state → acquire (expected_head_sha), or the acquire head check: each caught by the graph test;node_modulesdropped from the keep list, the config'skeepignored, the clean keeping ignored files (-xdropped);keepaccepting a negated or match-everything pattern;?,[or a backslash, checking only whether the whole pattern is wildcards, not stripping the leading/, allowing a comment or a./..segment, or not applied at all;vendor,.venvor.yarnunanchored, the.pnpfiles back to a.pnp.*glob,node_modulesanchored.test_the_clean_removes_build_output_and_keeps_only_the_dependency_directoriesruns the warmer's ownclean_treescript (prelude included) with bash and git on a real checkout:dist/,.next/,.turbo/,public/vendor/, nested.yarn/.pnp.cjs/.venv/__pypackages__/.pnpm-storeand an untracked file go; everynode_modules, the top-level dependency directories and the config's patterns (src/generatedanchored,genat any depth,tools/**) stay.qfix-container serving a bare repository over smart HTTP, embry0's own git configuration written bysandbox_git.configure, the warmer's own steps; 11/11): round 1 clones at commit 1 and leavesdist/,.next/,public/vendor/, an untracked file, an edited tracked file andnode_modules/(top level and in a workspace package); round 2 at commit 2 ends at commit 2 with the tracked file reset,dist/,.next/,public/vendor/and the untracked file gone, bothnode_modules/, the top-levelvendor/and akeeppath kept, and.qa/in place; a commit behind the branch tip is checked out detached.--no-gitover the changed files): no leaks. Name denylist after staging: 0 matches.Deploy notes
infra/deploy.shwith fix(cache): collision-free QA volumes, trusted per-repo only #372. No image rebuild: nothing baked into a sandbox image changes.node_modulesbelow the top of the tree (a workspace package's own.venv/orvendor/) is removed too; such a repository needs it inkeep. A repository whose install writes files outsidenode_modulesand the other kept directories (generated code from apostinstall, say) needs those paths incache.shared_volume.keep; without them a round that skips the install fails to boot or build, which shows in that round's sub-task logs.qa_shared_volume_skippedis gone; a round with an unchanged lockfile logsqa_shared_volume_refreshed, and the warmer returns"refreshed".… is at <sha>, expected <sha>: this round was not run against the commit it was asked to testmeans its workspace held another commit (for example, a concurrent run moved a shared volume); rerunning the round warms the volume again.