Conversation
…hing local work Round-4 review of #851 found three blocking defects, all in gate 3e row 1 — the ~230 lines added in round 3 that no prior review had seen. All three share one root cause: a precondition stated in the row table as prose while the executable blocks carried no condition at all. - row 1 is now opt-in in code. `ROW1=run|skip` gates the commit, ancestry and publish blocks. Previously the rows ran for every matched worktree, so a checkout that was clean but held a local-only commit fell through the dirty check, `git commit` failed and was silently discarded, and the user's unreviewed commit was cherry-picked and pushed into the PR. That reproduced on the skill's own #842 worked example. - the cherry-pick branch no longer pushes. It pushed from the throwaway worktree, which shares .git/hooks and has no node_modules, so the pre-push hook failed on every run — and Step 0b's bypass licence does not cover it, because cherry-picked content is new relative to origin. The fix now stays in $WORKDIR and Step 5's collapse publishes it under the lease already pinned in gate 3d. The re-pin block is scoped to the push branch, which would otherwise reset --hard away the cherry-pick. - the cherry-pick branch's backup ref is real code, not a placeholder comment. It was the only thing between row 3's reset --hard and unrecoverable loss, and the prose then told row 3 not to mint one. Row 3 short-circuits on $BACKUP. Also fixed, same class — a status check whose result was discarded: - Step 5 and row 1 capture the push status with `|| PUSH_FAILED=1` and chain the rollback. There is no `set -e`, so an unchained failure was discarded and Step 6 would report a collapse that never landed. Documents why the push must not be piped through `tail`: `$?` then belongs to the filter, and `$PIPESTATUS` is bash-only — under zsh it expands empty and fires the rollback on a push that succeeded. - the cherry-pick is chained; an unchained conflict fell through to a push of $WORKDIR's unchanged head, dropping the fix while reporting success. - row 2's refusal runs the teardown in code instead of a comment saying it should. - PR discovery distinguishes "no PR exists" from "the call failed". An empty PR_NUM selects in-place mode, so an auth expiry or rate limit silently redirected the rewrite at the user's own checkout. - row 1 skips on a clean authored worktree — the documented happy path, which previously reached `git commit` on a clean tree and failed. pr-review: - the pre-existing-dirty subtraction parses porcelain records properly. `cut -c4-` mangles a rename's bare second field, so it *under*-subtracted and left the user's in-progress rename whitelisted — the opposite of the safety direction the surrounding prose claimed. - the partial-failure rationale now matches what the code does, and names the inherited-state case it does not cover. Nits: temp-file cleanup in Step 5b, a distinct exit 2 for the no-net-change no-op so pr-review stops reading it as a refused gate, a TOCTOU-aware message on backup-ref collision, and the -z quoting claim dropped from the cut -c4- rationale. Verified by collapsing PR #842 for real: 3aeae1b + 72358ab -> c5eeec8, tree 56a742c identical on both sides, zero diff, lease pinned to 72358ab and accepted. Refs #849 Refs #851
Deploying offlinecv with
|
| Latest commit: |
2160aad
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://46d8b76a.offlinecv.pages.dev |
| Branch Preview URL: | https://gh-852.offlinecv.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Round-4 review of #851 found three blocking defects, all in
/collapse-prgate 3e row 1 — the ~230 lines added late to #851 that no reviewer had seen when it merged. All three share one root cause, and it is the same one rounds 1 and 2 kept hitting: a safety property stated as prose while the executable block carried no condition at all.Row 1's table entry reads "uncommitted changes this run authored". That is a precondition, but nothing in the code enforced it, and the iterate block runs the rows for every matched worktree. On a checkout that was clean but held a local-only commit, row 1 therefore ran anyway: the dirty check passed,
git commitfailed on a clean tree and was silently discarded (noset -e),WT_PRE_FIX_SHAbecame the user's commit, and it was cherry-picked and pushed into the PR.That reproduces on the skill's own flagship example. In the #842 case the main checkout was clean and held exactly one local-only commit,
6ba92e9— under the merged code that commit is published into PR #842, while the report describes the checkout as row 3 "preserved + reset" and never mentions the push.Refs #849
Refs #851
What changed
Blocking
ROW1=run|skipnow gates the commit, ancestry and publish blocks. A worktree that is not--authored-worktreerefuses on dirt (row 2) and otherwise skips to rows 3/4; the authored worktree skips when clean, which is the documented happy path wherepr-reviewstep 4 already committed..git/hooksand has nonode_modules, so the managedpre-pushhook failed on every run — and Step 0b's bypass licence does not reach it, because cherry-picked content is new relative tooriginand no tree-identity assertion covers it. The fix now stays in$WORKDIRand Step 5's collapse publishes it under the lease gate 3d already pinned. One push instead of two, and the unverified-tree question never arises.# ... row 3's backup runs here ...was the only thing between row 3'sreset --hardand unrecoverable loss, and the prose then told row 3 not to mint one. Row 3 now short-circuits on$BACKUP.Secondary — all the same class, a status that was computed and then discarded:
|| PUSH_FAILED=1and chain the rollback.$WORKDIR's unchanged head, dropping the fix while reporting success.worktreemode, the one mode where the teardown is not a no-op.PR_NUMselectsinplace, so an auth expiry or rate limit silently redirected the rewrite at the user's own checkout.pr-review's pre-existing-dirty subtraction parses porcelain properly.cut -c4-mangles a rename's bare second field, so it under-subtracted and left the user's in-progress rename whitelisted — the opposite of the direction the surrounding prose claimed was safe.pr-review's partial-failure rationale now matches the code and names the inherited-state case it does not cover.Nits: temp-file cleanup in Step 5b; a distinct
exit 2for the no-net-change no-op sopr-reviewstops reading it as a refused gate; a TOCTOU-aware message on backup-ref collision; the-zquoting claim dropped from thecut -c4-rationale; andcollapse-pr's "single source of truth" claim narrowed to the skills, sinceCONTRIBUTING-PROCESS.mdlegitimately restates the rationale for humans.Review focus
.claude/skills/collapse-pr/SKILL.mdgate 3e row 1 — doesROW1=skipreach every block that writes? A missed one is the same defect again.REMOTE_SHAstill the right lease at Step 5, and does the scoped re-pin leaveBASE_SHAcorrect?|| PUSH_FAILED=1— is there any path that reaches Step 6 with a failed push still unreported?Test plan
npm run verifygreen — ran via the managedpre-pushhook on this branch, not bypassedfallowclean on the 3 changed filesgit -C "$WORKDIR" pushremains anywhere in gate 3e# ... row 3's backup runs here ...placeholder is goneHow this was found
/collapse-prwas dogfooded against PR #842 before this review — the run that produceda8e0909onmain. Two commits collapsed to one, tree56a742c98fb9d6afe1370ab5f9432c82abc6c5d3byte-identical on both sides, zero diff, lease pinned to72358aband accepted. The gates behaved as documented end to end.That run also turned up a defect the review did not: reading the push's status through a pipe.
$PIPESTATUSis a bash array, and underzshit expands empty — so the rollback fired on a push that had succeeded. The skill now says not to pipe the push at all, and why.