fix(ce-babysit-pr): recover from stale base cache - #1348
Open
buntysomroy wants to merge 2 commits into
Open
Conversation
Let a stale PR-object base cache emit only the existing guarded BEHIND maintenance route, bound to the independently read live base OID. Readiness, DIRTY repair, and probe uncertainty remain fail-closed. Fixes EveryInc#1347 Agent-Provenance: host=Conductor harness=Codex model=gpt-5.6
Restore base-ref blocker precedence over terminal-red residuals while keeping an actionable branch-currency item first. Pin the stale-cache exception to BEHIND-only behavior in the contract tests. Agent-Provenance: host=Conductor harness=Codex model=gpt-5.6-sol
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.
Fixes #1347
Summary
A weekly or continuous PR audit can now repair the exact stale-cache state that previously stalled forever: GitHub reports the PR as
BEHIND, while the PR object's cached base OID still trails the independently read live base ref.The watcher emits the existing guarded host-owned update route for that one case. It binds the item to the live base OID and exact observed head. The stale cache still blocks readiness. Probe errors and
DIRTYconflict repair remain fail-closed.Safety boundary
The exception does not widen mutation authority. It still requires a normal-base route, positive
viewerCanUpdateBranch, an invocation-fenced exact-item claim, immediate head/base revalidation,expected_head_sha, and fresh post-update ancestry proof.Wake precedence also stays explicit: new review or CI work runs first; an actionable branch-currency item follows; base-ref uncertainty then outranks a terminal-red standing residual.
Validation
npx -y bun@1.3.14 test- 2,909 passed, 0 failed across 110 filesnpx -y bun@1.3.14 run release:validatenpx -y bun@1.3.14 run plugin:validateBEHIND, staleDIRTY, and live-ref probe errorsResidual risk
A stale PR object can also carry an older head or merge-status observation. The exact-head precondition and post-operation proof fail closed, but such cache lag can cause a redundant claim/reconciliation cycle. Fast base movement can also rotate the live-base-bound observation key. Neither path can declare readiness or authorize
DIRTYrepair.Security Disclosure
This changes when the existing host-owned update-branch operation is reachable. It adds no shell execution, credential handling, or direct-push authority.
Agent Disclosure
Codex · gpt-5.6-sol via Conductor🤖 Generated with Codex · gpt-5.6-sol · via Conductor