Conversation
Model: GPT-5
Model: GPT-5
Model: GPT-5
Model: GPT-5
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.
Problem / pressure
The sidebar reads the compact
SessionMeta.pullRequestsreplica, which stores only URL and lifecycle. It has no provider version or merge evidence. A merge can therefore arrive through hosted fan-out asclosed, or a delayedclosedwrite can overwrite a locally correctedmergedvalue.The prior approach tried to certify a terminal generation after one or two reads. That is unsound: repeated stale reads are not causal evidence, and a fingerprint can permanently suppress the only repair path.
Summary
draft,open, andclosedas reversible states that remain recurring exactpullRequest(number:)targets.mergedas final and absorbing.mergedvalue with an older in-flight observation.Visual explanation
Why this closes the race
If an exact query starts from
closed, hosted fan-out writesmerged, and the old query then returnsclosed,applyOwnerre-reads fresh metadata and write-back preservesmerged. If the stale write arrives after the correction instead, it creates a newclosedtarget and exact polling resumes. There is no verified fingerprint that can make the target disappear.Test plan
pnpm --dir apps/cli exec vitest run src/lib/pr-poller— 182 tests passed.pnpm --dir apps/cli typecheck— passed.pnpm run docs check— passed.closedfollowed bymerged, a late same-URLclosedoverwrite, a legitimate reopen, and the in-flight stale-response/fresh-meta race.Full local CLI tests had one unrelated macOS temp-path alias failure (
/private/varversus/var); the components aggregate also hits the existing Node localStorage test-environment failure. The focused owner suite is green.Evidence and limit
For PR #649, GitHub REST reports
state: closedtogether withmerged: true, while the GitHub PR/GraphQL view reportsMERGED. This confirms the representation boundary but does not identify which private hosted delivery produced the stale write. A hosted delivery timeline remains outside this public repository.Rollback
Set
LODY_PR_POLL_DISABLED=1or deploy the previous scheduler. SQLite contains only disposable cadence, quota, cooldown, and discovery memory; there is no lifecycle-verification table to clean up.Context handoff
Instructions for reviewing agents
closedtarget persistence, merged absorption during fresh-meta write-back, and removal of terminal verification state.Authoring context
closedmetadata self-heal without allowing an old result to roll backmerged.