Skip to content

chore(pstack): land card worktree commits and hold commits no ref reaches - #5182

Merged
zbeyens merged 3 commits into
mainfrom
codex/card-worktree-commits
Oct 17, 2026
Merged

zbeyens merged 3 commits into
mainfrom
codex/card-worktree-commits

Conversation

@zbeyens

@zbeyens zbeyens commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Why

A card session that committed in its own worktree lost that work at landing: the patch was git diff --cached HEAD, which leaves out every commit. And the cleanup scan never checked whether a worktree's commits sat on any branch, so it could delete a worktree holding the only copy of a commit made on a detached HEAD.

What changed

Synced from udecode/dotai@e23bf33, which carries ecaca2a and c13b58f:

  • Landing. A card session may commit in its worktree. It lands everything since git merge-base HEAD <checkout branch>, so the patch carries its commits, uncommitted edits and new files.
  • Cleanup. The scan, --landed and --remove hold a worktree whose HEAD or HEAD history keeps a commit that no branch, tag or remote reaches, and print the git branch <name> <sha> that saves it.
  • The cleanup skill also saves a removal patch only for changes the checkout lacks.

Verification

  • An end-to-end run in a scratch repository committed in a worktree, left more work uncommitted, moved the checkout's branch, then landed one merge-base patch: the checkout got the committed change, the uncommitted change and the new file, and scan.mjs --landed passed. The old HEAD-based patch carried none of the commit.
  • dotai's cleanup suite passes 25 tests; its new test fails on the old scan. The sync-pstack suite passes 290.
  • pnpm check:workflow passes here.

Shipped fast, no review.

…ommit hold

A card session in Plate may now commit on its worktree's own branch and lands
everything since its merge base with the checkout branch, commits included, so committed card
work no longer drops out of the patch. Cleanup holds a worktree whose HEAD
history keeps a commit no branch, tag or remote reaches.

Shipped fast, no review.
@zbeyens
zbeyens requested a review from a team October 16, 2026 23:40
@codesandbox

codesandbox Bot commented Oct 16, 2026

Copy link
Copy Markdown

Review or Edit in CodeSandbox

Open the branch in Web Editor • VS Code • Insiders

Open Preview

@changeset-bot

changeset-bot Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 790a840

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-16T23:40:16.501675Z 559ef1d PR opened
ℹ️ 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@zbeyens
zbeyens merged commit ae66aa7 into main Oct 17, 2026
4 checks passed
@zbeyens
zbeyens deleted the codex/card-worktree-commits branch October 17, 2026 00:01
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