Repository navigation
Every collection of a turn is its own commit, and the session's last commit moves only with it, so a landing that fails loses nothing - #249
Merged
Conversation
This was referenced Nov 15, 2026
Merged
SitgesRun
force-pushed
the
commit-per-collect
branch
from
November 15, 2026 21:40
6c5cba6 to
1a01624
Compare
…commit moves only with it, so a landing that fails loses nothing A running turn's collections staged their files with no commit, and its end made one commit of everything since the session's last commit. The last capture fetched (refs/pine-drama/result) moved before its files landed, so a landing that failed after writing a file left that file unrecorded, a later restore of it was never landed, and the turn settled with the file wrong. Now every collection, while the turn runs and once after Pine's end, is the same: it lands every path that any capture since the session's last commit changed (git log acked..to, changesAlong), each as the newest capture holds it, in one pine-computer commit with the turn's trailers, and moves the session's last commit in that commit's ref transaction. A landing that fails, once or several times in a row, leaves the last commit behind, so the next collection lands every path the failed ones may have written. What the folder holds that no commit records is committed first as client-found-changes-on-disk, so a file the person and the turn both changed keeps the person's version in history and gets the turn's; a file only the person changed stays (git's 3-way rule per file; codex-rs git-utils/src/apply.rs applies with git apply --3way). Deleted: forgetCaptures, the `last` flag, the edited path and its receipt pair waiting for the end, and the stage-without-commit branch. Once a session is gone, the captures fetched from it and not landed still land (landCaptures), from the project's own refs. A running collection's left-out paths are told when it finds them, through the follower's own stream, which waits for the collection at the turn's end, since no later collection sees them again; a settled turn's files are those of all its commits, read by its trailer with listHistory. doc/protocol.md 2.1, 2.3, 3, 4.3 and 5 say so. Signed-off-by: SitgesRun <169425442+SitgesRun@users.noreply.github.com>
SitgesRun
force-pushed
the
commit-per-collect
branch
from
November 15, 2026 21:43
1a01624 to
9b045c1
Compare
This was referenced Nov 15, 2026
Open
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.
This makes every collection of a turn its own commit, and moves the session's last commit only inside that commit's ref transaction. Design:
~/RunVid/exports/2026-11-15-commit-per-collect-design.md(approved; revised after a Codex read-only review). The docs PR #248 describes the same behaviour and lands with this one.The bug it fixes (on staging)
collectTurnmovedrefs/pine-drama/resultinfetchCapturebeforelandTurnFiles. A landing that failed after writing a file left that file unrecorded. A later restore of it was never landed, and the turn settled with the file wrong.The model
acked..tochanged (git log --name-only, newchangesAlong), each as the newest capture holds it. It lands them as onepine-computercommit with the turn's trailers (commitEntriesToHistory), withackedmoving in the sameupdate-ref --stdintransaction.ackedbehind. Every path such a landing may have written is in the chain, so the next collection lands it from the newest capture.client-found-changes-on-disk.git-utils/src/apply.rs:55applies withgit apply --3way, and Aider commits dirty changes first.landCaptures), from the project's own refs.Deleted
forgetCaptures, and its call inchats.ts;lastflag;stagePathsandcommitIndexPathsin the landing;Added, each for a bug the change would otherwise cause
push. No later collection sees them again, and the timer used to discard what a running collection yields.listHistoryfiltered byturnId. Without that,latestTurnFilesand the Chat's episode list would see only the last collection.Not in this PR
#250 covers a gap that is on staging already: every stage-then-commit path leaves an edit staged and unrecorded when the stage succeeds and the commit then fails. The index-vs-HEAD snapshot edges are there too. It is planned for after the stable tag.
Codex review
landCapturesand its test.Tests
index.lockandHEAD.lock, so two landings in a row fail, and the second one restores the file. On staging's code (763fffe, the same test with staging's API) it FAILED: 330 tests, 328 pass, 1 fail, on "the restore lands" ('for a moment'stayed).Size
9 files, +208/−196. Core and doc alone: 5 files, +114/−101.
doc/protocol.md changes 2.1, 2.3, 3 (the 3-way rule), 4.3 and 5.