Repository navigation
Description
Consolidates three trap.d fragments from the v0.42.0 release gate 3 audit (rounds 3 and 4), all reproduced by the auditor against real scratch stores and re-checked directly against hooks.d/after_save/60-git-reconcile.sh at current HEAD while curating trap.d/ (2026-10-07) -- all still true. All three are regressions introduced by commit 84a6ea5 (#945), which replaced the earlier git rebase --abort-based conflict handling with git rebase --quit (line 459) plus a scoped checkout/restore (the #943 approach). None of the three fixes below are present in the current tree.
1. Neither git rebase call site (lines 533, 559) nor the rebase --quit call (line 459) passes --no-autostash / sets rebase.autoStash=false. With rebase.autoStash=true (a common git setting) and another slug's uncommitted tracked write present when a real conflict happens, git autostashes that write when the rebase starts, and rebase --quit does not re-apply it the way the old --abort did -- the write ends up sitting in git stash list with nothing announcing it, while the hook's own notice still claims "aborted, the tree is unchanged." Reproduced by the auditor: with autostash on, another slug's write reverted to its pre-write content and was found only in git stash list; with autostash off (control), the write survives because the rebase simply refuses to start. No existing test covers autostash behavior (grep -r 'autostash|autoStash' tests/: 0 hits). A stash entry is lost on git stash drop/clear, or by ordinary git gc past gc.reflogExpire (90 days default).
2. The scoped restore (lines 445-452, 466-468) assumes every commit the rebase could have replayed is confined to this run's own $SLUG/, which is false. The ahead/behind commit set can include OTHER slugs' commits from either machine, which the rebase has already moved before the scoped checkout/rm restores only $SLUG/. Reproduced by the auditor in three shapes: another slug's content reverted and silently dropped on its next ordinary save; a conflict left live in the OTHER slug with the hook's notice claiming only $SLUG was reset; and upstream content for another slug left staged on top of local HEAD.
3. git symbolic-ref HEAD refs/heads/$BRANCH_NAME (line 467) restores HEAD to the CONFIGURED branch, not to whatever branch the rebase actually started from (recorded by git itself in rebase-merge/head-name, which can differ from the configured branch). Reproduced by the auditor: working on branch work with main configured left HEAD silently switched to main (behind work), with $SLUG reset to main's content and other-slug content staged on top; a configured branch with no local ref (e.g. backup) left HEAD pointing at an unborn ref, $SLUG keeping its conflict markers, and every file in the tree reading as freshly added.
All three are ranked fails-to-preserve (non-blocking) by the release-gate findings table because a copy of the lost content survives somewhere (a stash entry, git history, or a reachable commit) -- but each copy expires or is prunable, so if that is judged equivalent to "no copy anywhere," each row becomes destroys and would block a release.
What would settle each:
- pass
--no-autostash(or-c rebase.autoStash=false) at everygit rebasecall site in this hook, with a regression test. - scope the restore to the paths the rebase actually changed (a diff of
ORIG_HEADagainst the index/tree), not to$SLUG. - read the rebase's own recorded head-name from
rebase-merge/head-name(beforerebase --quitdiscards it) and restore HEAD to that branch, or refuse when it differs from the configured branch instead of silently switching.
Original fragments: trap.d/945.reconcile-autostash-not-disabled-for-rebase.md, trap.d/945.reconcile-restore-scoped-to-slug-not-rebase-paths.md, trap.d/945.reconcile-symbolic-ref-uses-configured-not-actual-branch.md (deleted by this same curate pass).
[AI-generated]
Activity
curate: promote 2 rules, decline 11 fragments (5 new issues, 3 alread…
trap: log #951 investigation -- PR #960's separate macOS reconcile-90…
fdaviddpt commentedon Oct 7, 2026
PR #960 round 4 (commits 010769f, e7aae1e, a407dcd) re-verification: CI is still red on this issue's own regressions.
All 5 macos-latest legs (pytest 3.9/3.10/3.11/3.12, "hook tests (compiled)") on commit a407dcd fail identically:
tests/test_git_reconcile_903.py, 7 failed / 4149 passed / 35 skipped, same assertions as round 3 -- conflict markers surviving an abort, the restore not reaching paths outside$SLUG, a stray upstream-added file left behind, "hook wrote no log at all", and a fixture-assumption guard ("CONFLICT" not found in log) also failing, meaning the rebase itself behaves differently on this runner, not just the downstream restore logic.This round's commits touch only
tests/test_autonomous_log_retention_487.py(the separate #951 fix) plus a trap note -- nothing inhooks.d/after_save/60-git-reconcile.shortests/test_git_reconcile_903.pychanged, so this is the same unresolved #952 regression, not a new one. Seetrap.d/951.pr960-macos-reconcile-903-not-reproducible-locally.mdon that branch: not reproducible locally (23/23 passing, 3 runs) despite matching git version (2.55.0) with the CI image, so this may be order-dependence within the full suite or a genuine macOS-CI-image-specific git/rebase behavior difference -- still unestablished.Flagging per this round's review: #951's own fix (Windows PATH-building) now passes cleanly on all 5 windows-latest legs, confirmed by reading the job logs directly, not just the green check. #952 itself remains unfixed in CI despite PR #960's description claiming to close it.
[AI-generated]
fix(#951): fast-path tests now carry positive mktemp evidence (#961)
fix(#962): avoid bash 4.0+ mapfile in the git-reconcile scoped restore
fix(#966): scope the conflict-abort restore to paths unchanged since …
trap(#952): log two gate-3 misreports findings in 60-git-reconcile.sh (…
trap(#952): log two gate-3 misreports findings in 60-git-reconcile.sh (…
fix(#969): hard-disable 60-git-reconcile.sh pending the real TOCTOU f…
curate: promote 1 rule, decline 10 fragments (5 new issues, 1 stale) (#…
fix(#972,#975,#982): anchor v1 cache substitution, harden reconcile t…
fix(Digital-Process-Tools#952,Digital-Process-Tools#953): close three…