Skip to content

fix(ce-babysit-pr): recover from stale base cache - #1348

Open
buntysomroy wants to merge 2 commits into
EveryInc:mainfrom
buntysomroy:fix/babysit-stale-base-update
Open

fix(ce-babysit-pr): recover from stale base cache#1348
buntysomroy wants to merge 2 commits into
EveryInc:mainfrom
buntysomroy:fix/babysit-stale-base-update

Conversation

@buntysomroy

@buntysomroy buntysomroy commented Aug 9, 2026

Copy link
Copy Markdown

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 DIRTY conflict 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 files
  • npx -y bun@1.3.14 run release:validate
  • npx -y bun@1.3.14 run plugin:validate
  • Fresh positive and negative agent evals for stale BEHIND, stale DIRTY, and live-ref probe errors
  • Independent Claude Opus 5 adversarial review plus five local review lenses; two hardening findings applied

Residual 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 DIRTY repair.

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

  • Model: Codex · gpt-5.6-sol via Conductor

🤖 Generated with Codex · gpt-5.6-sol · via Conductor

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
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.

ce-babysit-pr stalls when cached baseRefOid lags live base

1 participant