Skip to content

fix: complete deterministic guarded-open reviews - #477

Merged
steipete merged 13 commits into
mainfrom
fix/guardedopen-deterministic-completion
Jul 10, 2026
Merged

steipete merged 13 commits into
mainfrom
fix/guardedopen-deterministic-completion

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Summary

  • complete exact-item reviews when apply returns one of five deterministic remain-open guards and the captured record agrees
  • emit guarded completion only when the candidate remains the final authoritative four-file tuple
  • suppress stale verdict routing for guarded results and requeue changed revisions or publish-race losers

Why

Stable apply guards were already writing the correct open state, but the publisher required comment-sync or terminal proof. Those jobs therefore retried indefinitely instead of completing. This keeps the completion path narrow and deterministic while preserving retries for transient or stale reviews.

Verification

  • pnpm run build:all
  • node --test test/repair/event-apply-proof.test.ts test/repair/event-record-store.test.ts test/repair/git-publish.test.ts test/sweep-workflow.test.ts (100 passed)
  • pnpm run lint:repair
  • pnpm run lint:scripts
  • targeted oxfmt --check
  • GPT-5.6 Sol High autoreview: clean, no accepted/actionable findings

@steipete
steipete requested a review from a team as a code owner July 10, 2026 11:44
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. labels Jul 10, 2026
@clawsweeper

clawsweeper Bot commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 10, 2026, 11:00 AM ET / 15:00 UTC.

Summary
The PR adds tuple-verified completion for guarded-open, terminal-close, and missing exact reviews, defers ordinary synced-verdict routing through the serialized router, and requeues reviews when locks or close-guard labels are removed.

Reproducibility: yes. at source level: current main lacks a successful exact-event disposition for stable deterministic remain-open apply outcomes, causing those jobs to retry. No live current-main event was executed during this read-only review.

Review metrics: 3 noteworthy metrics.

  • Patch surface: 24 files, +1630/-151. The final head spans workflow orchestration, repair code, webhook intake, documentation, and focused tests.
  • Verified dispositions: 4 outcome classes. Guarded-open, terminal-close, terminal-missing, and routed-sync outcomes each control different downstream behavior.
  • Final-head runtime proof: 0 artifacts supplied. The post-force-push comment is only a review-start placeholder, not evidence of the changed behavior.

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🐚 platinum hermit
Result: blocked until real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Attach redacted final-head exact-event workflow or terminal output demonstrating the changed lifecycle.

Proof guidance:

  • [P1] Needs real behavior proof before merge: Automated checks are supplemental only; add redacted final-head Actions or terminal logs, update the PR body to trigger a fresh review, and request @clawsweeper re-review if it does not run automatically.

Risk before merge

  • [P1] The final force-pushed head has no after-fix evidence from a real or disposable exact-event run.
  • [P1] The live interaction among GitHub item state, state-repository publication, workflow outputs, and deferred router dispatch remains unobserved outside automated tests.

Maintainer options:

  1. Add final-head runtime proof (recommended)
    Run disposable exact-event cases on the current head and attach redacted logs for guarded-open, terminal missing and closed, deferred routing, and stale-race requeue behavior.
  2. Accept test-only integration risk
    Merge while explicitly accepting that the live multi-system automation path has not been observed after the fix.

Next step before merge

  • [P1] No code repair is indicated; require contributor-supplied final-head runtime proof and then complete normal maintainer merge review.

Security
Cleared: No dependency, Action source, permission, secret access, artifact execution, lifecycle hook, or package-resolution regression was found.

Review details

Best possible solution:

Keep the tuple-authoritative implementation and merge after redacted final-head runtime logs demonstrate guarded completion, terminal missing and closed behavior, stale-race requeueing, and successful deferred-router handoff.

Do we have a high-confidence way to reproduce the issue?

Yes at source level: current main lacks a successful exact-event disposition for stable deterministic remain-open apply outcomes, causing those jobs to retry. No live current-main event was executed during this read-only review.

Is this the best way to solve the issue?

Yes: strict action whitelisting, captured-record agreement, final full-tuple equality, and fail-closed retries are the narrowest maintainable solution.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against a55bf55b55ae.

Label changes

Label justifications:

  • P2: This fixes indefinitely retrying maintenance jobs with a bounded operational blast radius.
  • merge-risk: 🚨 automation: Merging changes exact-review completion, state publication, webhook requeueing, and router dispatch behavior.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Automated checks are supplemental only; add redacted final-head Actions or terminal logs, update the PR body to trigger a fresh review, and request @clawsweeper re-review if it does not run automatically.
Evidence reviewed

What I checked:

  • Current-main reproduction: Current main accepts successful exact-event application only when durable comment synchronization or terminal closure is proved, so deterministic remain-open guards reach the retry error despite recording a stable open state. (src/repair/publish-event-result.ts:142, a55bf55b55ae)
  • Guard proof contract: The final head completes guarded-open only for a single exact action whose captured record action agrees, whose live guard was verified, and whose action is in the six-entry deterministic whitelist. (src/repair/event-apply-proof.ts:14, 88f523d2f8fb)
  • Authoritative publication check: After publication, the code refreshes from remote, compares the complete candidate record tuple, derives one disposition, and throws specific race errors whenever the expected outcome lost authority. (src/repair/publish-event-result.ts:279, 88f523d2f8fb)
  • Workflow routing gates: Inline routing excludes terminal, guarded, and deferred outcomes; an authoritative synced tuple instead queues the target-wide serialized router workflow. (.github/workflows/sweep.yml:718, 88f523d2f8fb)
  • Guard-removal requeue: Both webhook implementations accept unlock events and only close-guard label removals, marking those events as superseding an in-progress exact review. (src/repair/comment-webhook.ts:274, 88f523d2f8fb)
  • Proof remains absent: The PR body lists builds, tests, lint, formatting, and autoreview only; the post-force-push comment is a review-start placeholder and supplies no final-head runtime output. (88f523d2f8fb)

Likely related people:

  • steipete: Authored the dominant current-main history for exact-review publication, reconciliation, mutation leases, terminal handling, and serialized planning. (role: feature owner and recent area contributor; confidence: high; commits: c85315c3238b, 416c17cb9c6f, a2ade04e9916; files: .github/workflows/sweep.yml, src/repair/publish-event-result.ts, src/repair/event-record-store.ts)
  • brokemac79: Current-main blame attributes older publisher scaffolding and control flow in the central file lineage to this contributor. (role: original publisher lineage contributor; confidence: medium; commits: 9a28b280a9ec; files: src/repair/publish-event-result.ts)
  • Vincent Koc: Recently changed exact-review admission behavior in the same workflow area and is relevant to intake and concurrency interactions. (role: adjacent queue contributor; confidence: medium; commits: 9b7281103ab5; files: .github/workflows/sweep.yml)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (1 earlier review cycle)
  • reviewed 2026-07-10T11:48:54.881Z sha 06d83a6 :: needs real behavior proof before merge. :: none

@steipete
steipete force-pushed the fix/guardedopen-deterministic-completion branch from 06d83a6 to 88f523d Compare July 10, 2026 14:53

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 88f523d2f8

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

echo "remote_tuple_verified=false" >> "$GITHUB_OUTPUT"
echo "routing_deferred=false" >> "$GITHUB_OUTPUT"
echo "::notice::Treating $TARGET_REPO#$ITEM_NUMBER as terminal because the repository is accessible but the item is missing."
exit 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Publish missing-item artifacts before completing

When the item is deleted after Review exact event item succeeds but before this publish step runs, this 404 branch exits before checking artifacts/event/$ITEM_NUMBER.md and before invoking pnpm run repair:publish-event-result. That bypasses the new terminalMissingVerified archive path in apply-decisions, so the workflow reports a successful terminal-missing review with remote_tuple_verified=false while leaving the stale open tuple in durable state; let the publisher handle the 404 whenever a review artifact exists.

Useful? React with 👍 / 👎.

@steipete
steipete merged commit 7ee8bb2 into main Jul 10, 2026
8 checks passed
@steipete
steipete deleted the fix/guardedopen-deterministic-completion branch July 10, 2026 15:05
azaj01 pushed a commit to azaj01/clawsweeper that referenced this pull request Sep 21, 2026
* fix: complete deterministic guarded-open reviews

* fix: verify exact event dispositions

* fix: require terminal close confirmation

* fix: complete locked exact review lifecycle

* fix: complete missing exact review items

* fix: requeue removed close guards

* fix: resume reviews after guard removal

* refactor: centralize close guard labels

* fix: complete close-exempt reviews

* fix: bind synced event routing to exact tuples

* test: cover kept-open event tuple drift

* fix: hand off exact verdicts after authoritative publish

* fix: complete missing exact review status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. P2 Normal priority bug or improvement with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant