Skip to content

fix: 60-git-reconcile.sh conflict-abort restore can still destroy a concurrent write before the rebase --quit snapshot window (residual after #966) #969

Closed

Description

@fdaviddpt

Found by: gate 3 release audit (round 2, range v0.42.0..HEAD, HEAD 1556c3b), composition lens over
#932/#939/#946/#952/#966.

What's wrong: hooks.d/after_save/60-git-reconcile.sh's _grc_report_conflict (about lines
583-665) still discards another slug's concurrent write, even after #966's pre/post-rebase --quit
hash-snapshot fix. The window #966 closed only covers the time around the git rebase --quit call
itself. The window it left open -- from the start of git rebase --no-autostash through the conflict
firing, up to the pre-quit snapshot -- is not covered: a foreign write landing there is already
present when the "before" hash is taken, compares as unchanged against the "after" hash, and is
discarded by checkout HEAD -- anyway. The hook still logs "aborted, the tree is unchanged".

This is the fifth consecutive destroys-class finding on this hook across two releases
(#932, #939, #946, #952's regression, #966), each fix opening the next window.

Reproduced (observed, macOS, scratch repro, round-2 auditor): a store-local post-checkout hook
injects a foreign write into other/now.md while rebase-merge state exists (a deterministic
stand-in for the real TOCTOU timing). Against HEAD (1556c3b): the foreign write is discarded, log
reads "aborted, the tree is unchanged". Against v0.42.0's copy of the hook: the same foreign write
survives. Confirms this is reachable on the current tree, not only a theoretical residual.

Rank: destroys -- blocking a release unconditionally per the ranking table in
skills/manager/phases/findings.md.

Scheduler ruling for this release (recorded for traceability): because this is a further blocking
finding on this same hook in gate 3 round 2, the v0.42.1 release does not dispatch another fix for
this window. Instead the hook is being hard-disabled for v0.42.1 (exits 0 immediately, unconditionally,
with a one-line notice naming this issue) while this issue tracks the real fix, to be hardened later on
its own branch.

What would settle it: a test that injects the foreign write during the rebase itself (not only
during --quit), which the current test suite (test_write_in_the_toctou_window_inside_the_restore_set_survives_the_abort)
does not do.


Filed by the release loop from a gate 3 audit finding, not co-decided with the maintainer in session.

[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. added 4 commits that reference this issue on Oct 7, 2026
  5. added a commit that references this issue on Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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