Skip to content

tools: late-push — #224's instrument, detection by CONTENT not SHA - #596

Merged
jobordu merged 1 commit into
mainfrom
tools/late-push
Sep 5, 2026
Merged

tools: late-push — #224's instrument, detection by CONTENT not SHA#596
jobordu merged 1 commit into
mainfrom
tools/late-push

Conversation

@jobordu

@jobordu jobordu commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

#224 specified tools/late-push.py and it did not exist.

A squash merge captures every commit in the PR at merge time. It cannot capture one the author has not pushed yet. Measured there: 37 of 100 merged inside 120s of creation, 25 inside 60s, one at 42 seconds. ★ At 42 seconds the author is not late; the merger is early — and MERGED erases the difference.

⛔ Detection by CONTENT, not SHA — #224 is explicit

A squash does not preserve shas, so git merge-base --is-ancestor answers a different question: whether this commit is on main, never whether its content is. Every squashed commit is a non-ancestor, so ancestry alone reports the whole board lost. This compares git patch-id --stable.

The known-positive — #224's own, re-verified before building

PR #339          merged   2026-08-20T19:56:18Z
commit 7447b1d   authored 19:57:18Z          ← 60 seconds later
                 docs/DEFECT-CLASSES.md +10
                 not an ancestor · patch-id absent from 400 commits of main

--pr 339 reports exactly that, exit 1. Ten lines genuinely lost. (⚠ #224 says 61s — author-vs-commit time.)

⛔ Two deviations from #224's stated commands, both honest

1. --since 24h no longer reaches its own specimen. #339 is 16 days and ~250 merges down; the command was written when it was fresh. --pr N keeps the known-positive runnable without a git-log per PR across the board — and --limit is documented as a recency window, not a filter, on every run.

2. --since 1s returns exit 2 VOID, not the 0 #224 expected. With no commits on main in the window the patch-id comparison set is empty, so every candidate would read as LOST. ⇒ Refusing is correct; a clean 0 there would be a lie. The condition asked for a detector that "cannot return both is not one" — it returns three, and the third is the one that matters.

⚠ A finding is a CANDIDATE, not a proven loss

Content that reached main via a conflict resolution or an altered rebase has a different patch-id and reads as lost here. #445 holds: ORPHANED ≠ CONTENT-LOST, and only the first is mechanically decidable. An unreadable head ref is counted and named UNCHECKED, never folded into clean.

Verification

--self-test 5 legs both directions, driven with synthetic state (#402) · suite 7/7 including the empty-patch-id VOID and test_control_can_fail · --help 0 · bogus flag 2 · check-tools-index 0.

⚠ One test failure was my stub, not the tool: patch_id() calls git show with allow_fail=True, so keying the stub on that returned a stat block where a diff was expected and the finding silently vanished. Keyed on --stat instead.

🤖 Generated with Claude Code

… SHA

#224 specified this and it did not exist. A squash merge captures every commit
IN THE PR AT MERGE TIME and cannot capture one the author has not pushed yet, so
an author who keeps pushing loses everything after the merge — and the PR shows
MERGED with no indication anything is missing. Measured there: 37 of 100 merged
inside 120s of creation, 25 inside 60s, one at 42 seconds.

⛔ DETECTION IS BY CONTENT, AND #224 IS EXPLICIT. A squash does not preserve
shas, so `git merge-base --is-ancestor` answers a different question: whether
THIS COMMIT is on main, never whether ITS CONTENT is. Every squashed commit is a
non-ancestor, so ancestry alone reports the whole board lost. This compares
`git patch-id --stable`.

KNOWN-POSITIVE — #224's own, re-verified live before building:
    PR #339        merged 2026-08-20T19:56:18Z
    commit 7447b1d authored 19:57:18Z — 60s later
                   docs/DEFECT-CLASSES.md +10, not an ancestor,
                   patch-id absent from 400 commits of main
⇒ `--pr 339` reports exactly that, exit 1. Ten lines genuinely lost.
⚠ #224 says 61s; that is author-vs-commit time.

⛔ TWO DEVIATIONS FROM #224's STATED COMMANDS, and both are honest:

1. `--since 24h` no longer reaches #339, which is 16 days and ~250 merges down.
   The command was written when the specimen was fresh. `--pr N` is added so the
   known-positive stays runnable without a git-log per PR over the whole board —
   and `--limit` is documented as a RECENCY WINDOW, not a filter, on every run.

2. `--since 1s` returns exit 2 VOID, not the exit 0 #224 expected. With no
   commits on main in the window the patch-id comparison set is EMPTY, so every
   candidate would read as LOST. Refusing is the correct answer; a clean 0 there
   would be a lie. ⇒ The condition asked for a detector that "cannot return both
   is not one" — it returns three, and the third is the one that matters.

⚠ A FINDING IS A CANDIDATE, NOT A PROVEN LOSS. Content that reached main via a
conflict resolution or an altered rebase has a different patch-id and reads as
lost here. #445 holds: ORPHANED ≠ CONTENT-LOST, and only the first is
mechanically decidable. An unreadable head ref is counted and named UNCHECKED,
never folded into clean.

7 suite tests including the empty-patch-id VOID and test_control_can_fail;
5 self-test legs, both directions, driven with synthetic state (#402).

⚠ One test failure was MY STUB, not the tool: patch_id() calls `git show` with
allow_fail=True, so keying the stub on that returned a stat block where a diff
was expected and the finding silently vanished. Keyed on --stat instead.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DTMf4EvaTEnDKXY47efRZZ
@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 24 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: e1b7c78c-6c42-48e2-b500-1e823a3ca28a

📥 Commits

Reviewing files that changed from the base of the PR and between a268c99 and 1ce8bdd.

📒 Files selected for processing (3)
  • tools/README.md
  • tools/late-push.py
  • tools/test_late_push.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jobordu
jobordu merged commit c60af67 into main Sep 5, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant