Skip to content

fix(carry-ci): stacked PRs get a restack command instead of a wrong carry model - #700

Merged
lastobelus merged 3 commits into
lastcode/mainfrom
lastcode/stacked-carry-ci
Nov 14, 2026
Merged

lastobelus merged 3 commits into
lastcode/mainfrom
lastcode/stacked-carry-ci

Conversation

@lastobelus

@lastobelus lastobelus commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Closes #690.

Stacked PRs could fail carry CI with misleading reconciliation advice or retain commits that their parent had already squash-merged, causing those commits to be replayed again at a later checkpoint.

Carry validation now identifies both stale stack shapes before attempting the landing merge and provides the exact git rebase --onto command:

  • A child behind its unpublished topic base must rebase onto the parent's current tip.
  • A child retargeted after its parent lands must drop the already-landed portion of its range. Detection checks the parent's full retained source range as well as compiled contribution metadata, including when the child forked before the parent's final commit.

The shared validator protects both CI and lastcode:merge. Up-to-date stacks and ordinary PRs behind main retain their existing compilation behavior.

Validation: changed-file checks, exact-head Quick CI, and real same-base carry compilation pass on 0654d05e07a9f3dc821b5004bdcfce35468752fd, based on 6ce03b91395240e705d16dbda90cb68a0c4ae990. All 35 carry-CI tests pass. Regression fixtures fail before the relevant fixes, execute the suggested rebases, resolve the intentional conflict where needed, and verify the resulting compiled tree.

Local review: 4 rounds with gpt-6.1-terra (xhigh), approved. All accepted findings are fixed and regression-tested. An independent gpt-6-astra (high) churn-gate judgment found the change focused, with no cuts or restart required.

Implemented with Claude Opus 5.5 through the Claude Code harness in T3 Code; updated and validated with GPT-6.1 Sol through the Codex harness.

@lastobelus
lastobelus marked this pull request as ready for review November 13, 2026 22:45
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-14T01:18:15.474746Z 0654d05 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: a70c2e4697

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

lastobelus added a commit that referenced this pull request Nov 14, 2026
Checkpoint carries replaced the callers of two upstream helpers but left their exports behind. Knip reports both as unused, which blocks CI on `lastcode/main` and PR #700.

Remove `installedAgentDeviceEntry` and `selectionInOneCodeBlock`. The repair changes no active caller and keeps each deletion in its owning carry group.

Proof: reproduced both knip failures on main; the changed-file checks and Quick CI pass on this repair, including 32 tests and the React compiler check. Same-base carry compilation reproduces the exact repair tree.

Local review: 1 round with gpt-6.1-terra (xhigh), approved.

Implemented with GPT-6.1 Sol through the Codex harness in T3 Code.

Carry-Source-Ref: refs/lastcode/carry-sources/pr-702/a212eb5bce8981e23c54a9872be99ead7a5b93bd
Carry-Source-Base: 8444100
Carry-Source-Head: a212eb5
@lastobelus
lastobelus force-pushed the lastcode/stacked-carry-ci branch from a70c2e4 to c645028 Compare November 14, 2026 00:40
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: c6450288f7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@lastobelus
lastobelus force-pushed the lastcode/stacked-carry-ci branch from c645028 to 2c134a1 Compare November 14, 2026 00:49
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 2c134a1bc3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@lastobelus lastobelus closed this Nov 14, 2026
@lastobelus lastobelus reopened this Nov 14, 2026
lastobelus and others added 3 commits November 13, 2026 18:11
…arry model

A child behind its topic base failed carry CI with misleading reconcile
advice. A child retargeted to main after its parent merged passed while
recording the parent's commits a second time in its carry source range.
Both now fail with the exact `git rebase --onto` command that restacks
them, in carry CI and in lastcode:merge's carry recheck.

Carry-Group: incubator
Co-Authored-By: Claude <[email protected]>
A child retargeted after its parent merged can conflict with the parent's
squash, which hid the restack command behind a generic conflict message.

Carry-Group: incubator
Co-Authored-By: Claude <[email protected]>
Carry-Group: incubator

Carry-Observation: This refinement depends on the existing incubator carry-CI implementation and must replay after it.
@lastobelus
lastobelus force-pushed the lastcode/stacked-carry-ci branch from 2c134a1 to 0654d05 Compare November 14, 2026 01:15
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 0654d05e07

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@lastobelus
lastobelus merged commit e77aafa into lastcode/main Nov 14, 2026
20 checks passed
@lastobelus
lastobelus deleted the lastcode/stacked-carry-ci branch November 14, 2026 01:26
lastobelus added a commit that referenced this pull request Nov 15, 2026
PRs give no signal when they grow LastCode's in-place edits to upstream files. That growth is what makes checkpoint rebases conflict, and right now nobody sees it until a rebase hurts.

Part of #720.

## What changed

A new reporting step in the Lint job prints an **Upstream-owned line changes** table to the log and the job summary:

| Comparison | Measures |
| --- | --- |
| This PR | lines added/deleted from PR base to head |
| Whole fork | lines added/deleted from the pinned upstream commit to head |

- **Which files count:** only paths that exist at the pinned upstream commit, `merge-base(PR base, origin/main)`. Fork-only files never count.
- **How:** endpoint comparisons with `git diff --numstat --no-renames`. Binary files are excluded. Moving an upstream file to a fork-only path counts as a deletion.
- **Cost:** reuses Lint's existing full-history checkout, with no extra fetch.
- **Never blocks:** no threshold or gate. The step runs with `continue-on-error`, and if the comparison can't be resolved it prints "unavailable" instead.

## Proof

- Matches a direct path-restricted `git diff --numstat` on real PRs:
  - #708: This PR +26 / -28; whole fork +158,190 / -25,331
  - #702: This PR +0 / -18; whole fork +153,798 / -24,594
  - #700 (fork-only): +0 / -0
- A subdirectory invocation regression failed before `ls-tree --full-tree` and passes after the fix.
- Real-Git tests cover replayed and merge ancestry, renames, deletions, binaries, unusual paths, reverts, and the non-blocking error path.
- `check:changed` passed: format, lint, knip, 41 affected typechecks, tests.
- Quick CI passed on final head `6059683f631877765e539d7db581babba9ef41cf` against base `217eac9e1863a9819e5d99efc97392c0c7b8d5c5`.

Local review: 2 rounds with GPT-6.1 Terra (xhigh) and Claude Opus 5.5 (high), not clean: Terra approved the final diff; Opus completed round 1 but its round-2 recheck was unavailable due to weekly quota. Every accepted finding is fixed. The PR description received the Opus writing pass.

Review decisions: keep the owner's literal base-to-head endpoint metric rather than substitute a synthetic merge result; the report prints its comparison SHAs. Rare invalid-UTF-8 path aliasing and fixture sensitivity to global Git signing settings remain optional follow-ups.

Implemented by GPT-6.1 Sol (xhigh) in the Codex harness.

Carry-Source-Ref: refs/lastcode/carry-sources/pr-724/6059683f631877765e539d7db581babba9ef41cf
Carry-Source-Base: 217eac9
Carry-Source-Head: 6059683
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.

Carry CI fails a stacked PR whose topic base has unsquashed parent commits

1 participant