Files
pad/.github
xarmian 38d8803603 fix(nix): gate the vendorHash heal on state, not on the push range (BUG-2974) (#1303)
* fix(nix): gate the vendorHash heal on state, not on the push range (BUG-2974)

The heal job asked whether THIS push touched go.mod/go.sum. That is the right
question for loop prevention and the wrong one for recovery: after a lost push
race the tree needing the fix was written by an EARLIER push, so every later
merge that did not itself move the module set refused to heal, exited GREEN,
and left main carrying a hash a clean `nix build` rejects. It happened on
b7235a1a -> bc543a1d and main stayed stale until a human committed the value.

The gate is now a question about STATE — does what main committed differ from
what the build job recomputed — which is equally true for a hash this push
broke and one an earlier push broke and could not land. The loop still
terminates and never depended on the range: the heal commit corrects
package.nix, so the run it triggers finds the build green, never sets `bumped`,
and this job does not start.

An unhealed committed hash is now LOUD. A rejected push and a recomputed
artifact identical to the committed file both end the run RED with an
::error:: naming the state, instead of the silent exit 0 that hid this.

The step is a script rather than a `run:` block so it can be driven against a
real git remote: nix/heal-vendor-hash_test.sh, wired into the Go job beside the
parser suite. Its load-bearing case is the one that shipped, with a frozen
reproduction of the pre-fix gate as the negative control.

Folds in the two prose warts parked on TASK-2954's trail: the doubled
"one commit after the merge" clause, and the comment naming the push-range gate
as the loop guard when the terminator is a corrected tree computing no bump.

* fix(nix): the heal test must own the guard's environment, not inherit it (BUG-2974)

Codex round 1, P1, reproduced: GitHub Actions always sets GITHUB_ACTIONS=true,
which the test process inherits, so case 6 satisfied the run-location guard it
was written to trip. It passed locally and would have failed the new Go CI step
on every run — the suite's first act in CI would have been to report a defect it
had introduced itself.

Fixed at the class rather than the instance: the suite unsets both GITHUB_ACTIONS
and HEAL_ALLOW_LOCAL up front, so no case can be decided by the caller's
environment, and each opts in explicitly. Case 6b is new and covers the arm this
exposed as unasserted — in Actions, with no override, the script runs and heals.

Verified green in four environments: bare, GITHUB_ACTIONS=true, a stray
HEAL_ALLOW_LOCAL=1, and init.defaultBranch=master. Mutation matrix re-run and
extended to 7 (added: guard condition inverted); all killed.
2026-09-09 10:52:14 -04:00
..
2026-03-26 01:52:36 +00:00