Skip to content

60-git-reconcile.sh: three regressions from the rebase --quit rewrite (#945) -- autostash, restore scope, symbolic-ref target #952

Closed

Description

@fdaviddpt

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:

  1. pass --no-autostash (or -c rebase.autoStash=false) at every git rebase call site in this hook, with a regression test.
  2. scope the restore to the paths the rebase actually changed (a diff of ORIG_HEAD against the index/tree), not to $SLUG.
  3. read the rebase's own recorded head-name from rebase-merge/head-name (before rebase --quit discards 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

  1. added
    priority:high
    filed-by-loop
    lane-storage
    on Oct 7, 2026
  2. self-assigned this
    on Oct 7, 2026
  3. added a commit that references this issue on Oct 7, 2026
  4. fdaviddpt commented on Oct 7, 2026

    @fdaviddpt
    ContributorAuthor

    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 in hooks.d/after_save/60-git-reconcile.sh or tests/test_git_reconcile_903.py changed, so this is the same unresolved #952 regression, not a new one. See trap.d/951.pr960-macos-reconcile-903-not-reproducible-locally.md on 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]

  5. removed their assignment
    on Oct 7, 2026
  6. added 2 commits that reference this issue on Oct 7, 2026
  7. added 6 commits that reference this issue on Oct 7, 2026
  8. added a commit that references this issue on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    filed-by-looplane-storagepriority:high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions