chore: sync align local command templates #6
Loading…
Reference in a new issue
No description provided.
Delete branch "chore/align-local-forge"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Regenerates the repository's managed files with Align 13.0.0 so declaration-check recovery instructions use the current local repair command. Includes the staged-snapshot cleanup update and review wrapper update with the existing zero-failure requirement retained.
Review
01M5PDGEM0X15E82HRR1DE664H— head58029b8ce21c50383b24ba80ffa17f1613b51597Review — j4k-oss/askpplx @
67d084827eScope: diff against base tree
7b1cb72307afReview finished: 10 succeeded, 0 failed
Triage: settled
Facts: current review-wide projection
Computed under:
Findings (2)
medium — The cleanup watcher can finish before worktree creation stops
01M5PDNZ9PAAZ3C3Y06BSYHWGD.githooks/commit-msg(snippet)01M5PDPGGF5CBK0B97VB45X6NY· valid: The grounded anchor shows git worktree add running in the foreground with '6>&-', so it does not hold the watcher's pipe open. Claim 01M5PDMVF4 grounds the watcher, which waits for EOF on fd 6, and describes run_step as the path that sends PIDs. Worktree add sends no PID. If only the hook process is SIGKILLed during worktree add, its last write end closes and the watcher gets EOF right away with an empty process group. It then runs remove_snapshot_files while the orphaned git child keeps going: a parent's SIGKILL does not end the child. Git can then recreate the directory contents and the worktree registration after cleanup. The trace is internally consistent, and nothing in the batch suggests the watcher waits for or kills that child. The reported reproduction gives specific conditions (Bash 5.2, Git 2.47, a PATH shim delaying only worktree add before it execs the real git, and SIGKILL to the hook PID only). Its result, a leftover pre-commit-snapshot.* directory and a worktree-list entry, follows from the mechanism. The shim widens a window that real checkouts also have. The defect needs a kill aimed at the hook PID alone, such as a supervisor timeout, rather than a process-group kill. That narrows its reach, but SIGKILL is exactly the case the watcher exists to handle. Medium severity is defensible, though low-to-medium would also be reasonable given the narrow trigger.low — The snapshot watcher's SIGKILL cleanup only works if every later command closes fd 6 by hand and every cleanup path is assigned before the watcher forks
01M5PDMVF4V7DTA4JCQ3RWQ7KJ.githooks/commit-msg(snippet)01M5PDPGGF5CBK0B97VB45X6NY· valid: The grounded exec line shows that the watcher detects hook death by EOF on fd 6, a pipe every child inherits. Claim 01M5PDNZ9P independently grounds the git worktree add line ending in '6>&-', which confirms that callers close the fd by hand. The body quotes both governing rules verbatim from comments: the fd-6 close rule above the exec, and the 'assign every path used here before starting it' rule above remove_snapshot_files. It names the places that follow them by hand: run_step's background job, the worktree add line, and the three mktemp calls placed between the trap and the exec. Two watcher-internal decisions (EOF-based liveness and a fork-time copy of the cleanup paths) are therefore constraints every later call site must honor without enforcement, and a slip fails silently on the SIGKILL path only. This matches the Information Leakage and Nonobvious Code red flags and the skill's ranking of hidden required knowledge as the costliest symptom. Claim 01M5PDNZ9P shows how fragile this is: the worktree add call honors the fd rule, yet the watcher does not stop or wait for it before cleanup. The claim correctly scopes itself as a maintenance hazard with no present malfunction, and low severity fits. One remedy caveat: sending each path over the pipe after allocation leaves a small window where a kill between mktemp and the send leaks the path. Allocating and announcing in one helper, or keeping the current fork-time order for paths allocated before the watcher starts, avoids that. The caveat narrows the remedy, not the defect.Other claims
Coverage
Coverage pass: 01M5PDGET597H4KDBW6R4FGB2X
Accounting: complete (all slots terminal; see slot results for failures)
Slot health: healthy
@ -146,0 +202,4 @@# Job control gives the watcher its own process group; its standard input is the pipe. The watcher# sees EOF only once every holder of fd 6 has exited, so close it (`6>&-`) on any command that can# leave a process behind, such as a check or a smudge filter's daemon.exec 6> >(set -m; watch_snapshot <&0 > /dev/null &)low — The snapshot watcher's SIGKILL cleanup only works if every later command closes fd 6 by hand and every cleanup path is assigned before the watcher forks
lens
aposd-plain· armdefault· tally 1 valid / 0 invalid / 0 uncertainclaim
01M5PDMVF4V7DTA4JCQ3RWQ7KJof review01M5PDGEM0X15E82HRR1DE664HThe fork-time path allocation and fd-6 closure rules are real maintenance constraints. Current paths are allocated before the watcher forks; the finding itself confirms current call sites obey the rules. The concrete checkout race is separately owned by Align #826. For these controlled repositories we decline dynamic path messages, PID polling, and a general spawning abstraction: they add machinery without another demonstrated current failure. This is an accepted maintenance cost, not a claim that the coupling is absent or fixed.
@ -146,2 +205,3 @@exec 6> >(set -m; watch_snapshot <&0 > /dev/null &)# Relative worktree paths would upgrade the repository format; post-checkout hooks must not run here.git --git-dir="$git_common_dir" -c worktree.useRelativePaths=false -c core.hooksPath=/dev/null worktree add --quiet --detach "$snapshot_dir" "$snapshot_commit"git --git-dir="$git_common_dir" -c worktree.useRelativePaths=false -c core.hooksPath=/dev/null worktree add --quiet --detach "$snapshot_dir" "$snapshot_commit" 6>&-medium — The cleanup watcher can finish before worktree creation stops
lens
general-bug· armdefault· tally 1 valid / 0 invalid / 0 uncertainclaim
01M5PDNZ9PAAZ3C3Y06BSYHWGDof review01M5PDGEM0X15E82HRR1DE664HConfirmed with real Git on macOS, without filters: killing only the hook during delayed snapshot checkout can leave a temporary snapshot and worktree registration. The current hook retains this documented limitation; this PR does not fix it. The producer correction and focused regression are owned by j4k/align#826, which routes checkout through the existing run_step helper. Consumers will receive the generated correction after that release.