Repository navigation
fix(ship-queue): keep land's merged checks out of the checkout's git config and hooks (GST-1747) - #4119
Closed
garrytan wants to merge 6 commits into
Closed
fix(ship-queue): keep land's merged checks out of the checkout's git config and hooks (GST-1747)#4119garrytan wants to merge 6 commits into
garrytan wants to merge 6 commits into
Conversation
…config and hooks (GST-1747) Land records the checkout's git config and hooks before land.merged_checks run, puts back anything a check changed or added and refuses; every ship-queue git call runs with hooks and fsmonitor off. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
Guard the commondir and gitdir files and the checkout's .git, follow symlinked config and hooks to their targets, never read a FIFO, socket or device, restore per entry by rename with modes reset children first, and run the restore in a finally so a thrown check still puts the git directory back. Recheck where git finds the git directory after the checks and refuse when it moved or a path could not be put back. Review-Finding: p1/red-team#1 reader=red-team Review-Finding: p1/specialist-batched#1 reader=security Review-Finding: p1/red-team#2 reader=red-team Review-Finding: p1/red-team#3 reader=red-team Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Put back a guarded symlink whenever its target differs, open directories (u+rwx, parents first) before restoring into them, and when a path cannot be put back make no further git call in the checkout: land refuses and leaves the land lock held instead of pushing its release. Run the merged tree's rev-parse and status with the checks' environment, before the restore and followed by a stray-process sweep. Review-Finding: p2/specialist-batched#1 reader=security Review-Finding: p2/red-team#1 reader=red-team Review-Finding: p2/red-team#2 reader=red-team Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Per the Captain's grant (a-6bbdd886c96b) replace the restore with a refusal: land compares the guarded git paths (every symlink hop recorded) after land.merged_checks, and on any change it names each path, makes no further git call in the checkout, pushes no lock release and prints the command that releases the lock without running the checks. Review-Finding: p2/outside-voice#1 reader=outside-voice Review-Finding: p2/outside-voice#2 reader=outside-voice Review-Finding: p2/adversarial-native#1 reader=adversarial-native Review-Finding: p2/adversarial-native#2 reader=adversarial-native Review-Finding: p2/adversarial-native#3 reader=adversarial-native Review-Finding: p2/adversarial-native#4 reader=adversarial-native Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…e captain table Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This was referenced Nov 7, 2026
Contributor
|
Closing while parked at 59b7b26. Its thread is archived. The branch |
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.
Parked. This PR is parked at 59b7b26 by the Captain's ruling; GST-1766 continues from this branch.
What changed
gstack-ship-queue land --pin --allow-repo-commandsrecords the guarded git paths of the checkout beforeland.merged_checksrun:config,config.worktree,hooks/,commondirandgitdirin the checkout's git directories, the checkout's.gitentry, and every hop of a symlink among them.QUEUE_LAND_MERGED_CHECKSand names each changed path. It makes no further git call in the checkout, so it does not merge, remove the worktree or push the lock release, and the land lock stays held. TheLOCK:line names the release command: once the named paths are restored from a trusted copy (or an added hook is deleted),gstack-ship-queue land --pr <n> --pin <sha>without--allow-repo-commandsrefuses withREPO_COMMANDS_NOT_ALLOWEDand releases the lock without running the checks.rev-parse HEADandstatusin the merged tree now run with the checks' scrubbed environment, before the after-snapshot, followed by a stray-process sweep on Linux.lib/ship-queue-gate'sgit(), the runner behind every queue, lock, notes and train call, runs withcore.hooksPath=/dev/nullandcore.fsmonitor=falsethroughGIT_CONFIG_COUNT, appended after any count the caller already sets.Why
The merged checks run with a scrubbed environment (GST-1421) so land's tokens never reach repo commands, but they share the checkout's
.gitthrough the worktree, and land's later git calls run with its full environment. Land now stops instead of trusting a git directory the checks changed, and leaves the lock held so a person checks the checkout before any further git call there.Blast radius
landwith--allow-repo-commandson a moved base takes the snapshot. A merged check that writes the shared.git/configor installs a hook now stops land and holds the lock until someone restores the paths and runs the release command.gstack-ship-queuegit call stops running hooks and fsmonitor.node_modules, other files in the checkout, the user's global git config and directories onPATH, and on macOS read land's starting environment throughps -E. Pass--allow-repo-commandsonly for PRs you trust to run.Approvals
Approved: yes (record r-32e4bf46e427). The full approval record stays private: this repository is public or its visibility is unknown.
Test Coverage
core.hooksPathnever runs and land still merges; a repointedcommondiris refused with the lock held; a repointed middle link of a symlinked.git/configchain is detected.Pre-Landing Review
Pass 1 (specialists, red-team) found 4 issues, all fixed. Pass 2 found 3 blocking issues in the fix round, all fixed. Step 11's voices (adversarial-native, outside voice gpt-6.1-sol, targeted) found 3 blocking issues in the restore code; the granted fix-check round replaced the restore with the refusal above. The fix-check found one blocking issue, which the owner ruled a disclosed note (below).
REVIEW_LOOP: passes=2 blocking_found=8 deferred=0 noted=6 fixed=10 scope=frozen unbound=3 ledgers_read=4 fix_checks=1 dispatches=8
Ruled note: lib/land-merged-checks.ts:62:fix-check at d8efd24 ruled by Captain GStack Minder (GSTA-36), 2026-11-07 at 2026-11-07T08:11:29.416Z: ships as a disclosed note: a checkout whose .git is reached through a symlink chain is not re-located after the checks; GST-1766 moves merged-tree checks to a separate clone (approval a-0530ca53a87c)
Gate edits: 3 listed, 2 read, 0 findings — 0 kept, 0 restored, 0 open
Outside review: openai/gpt-6.1-sol (outside voice) reviewed; its two blocking findings were resolved by the fix-check round.
Review notes
.gitis reached through a symlink chain is not re-located after the checks (ruled note above; GST-1766 follows up by running the checks in a separate clone).[include]orincludeIfin the checkout's config are not among the guarded paths.QUEUE_LAND_MERGED_CHECKSfix:text still says to merge main and push, which does not match the hold-and-inspect detail for changed git paths.--break-lock.git()'s global hooks-off setting also skips the managed pre-push guard on train, stamp and notes pushes; whether to scope it to land is a design question for the Captain.refs/replacein the shared object store was already reachable before this PR.git worktree prune.Issues
Refs GST-1747
Documentation
Status: updated. Two downstream docs now describe land's git-directory guard.
Scope: the 6 selected committed files (base 5862765..d8efd24): lib/land-merged-checks.ts, lib/ship-queue-gate.ts, lib/ship-queue-land-direct.ts, docs/ship-policy.md, changelog.d/capy-gst-1747-land-git-dir.md, test/ship-queue-land-direct.test.ts.
Documentation health:
Coverage debt: the policy explanation string LAND_EXPLANATION does not mention the git-dir refusal. No diagram drift.
Test plan