fix(changed): guard the index, which is the tree the sandbox comes from - #13
Merged
Merged
Conversation
CI refuted the guard in fifty-one seconds, on the first run of the gate it was written to protect. RunChanged demanded a clean worktree; the Devbox install step modifies devbox.lock, a tracked file with nothing to do with any change, and the gate refused to run at all. The condition was wrong, not merely strict. The sandbox is `git checkout-index --all`, so it holds the INDEX, and a range scope names bytes of HEAD: the two agree exactly while the index agrees with HEAD. A worktree modification is never written into the sandbox and therefore cannot move a verdict. A STAGED one is, and would mean scoping against one tree while mutating another -- the defect measured at seven of eight verdicts moving. So the check is `git diff --cached --name-only`, and it is named for what it actually asks. The public test keeps the refusal; the allow case is pinned in internal/staged rather than at the top, because allowing it there would run a real release to prove a guard did not fire.
|
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.



CI refuted the guard in fifty-one seconds, on the very first run of the gate it
was written to protect:
The Devbox install step modifies a tracked lockfile that has nothing to do with
any change, and the gate refused to run at all.
The condition was wrong, not merely strict
The sandbox is
git checkout-index --all, so it holds the index. A rangescope names bytes of HEAD. Those agree exactly while the index agrees with
HEAD — which is narrower than a clean worktree.
A worktree modification is never written into the sandbox, so it cannot move a
verdict; refusing it only stops runs that would have been correct. A staged
change is written into it, and running then would mean scoping against one tree
while mutating another — the defect measured at seven of eight verdicts moving,
and silent.
So the check is
git diff --cached --name-only, and the method is named forwhat it actually asks.
Tests
The public test keeps the refusal. The allow case is pinned in
internal/stagedrather than at the top, because allowing it there would run a real release to
prove that a guard did not fire — the first version of this change did exactly
that and took 50 seconds to say so.
Readme, changelog and backlog entry 21 all corrected: they described the wrong
condition too.