Skip to content

fix: recover completed CI reviews left pending - #180808

Merged
steipete merged 1 commit into
mainfrom
solid2/w-security-review-reconcile
Oct 22, 2026
Merged

steipete merged 1 commit into
mainfrom
solid2/w-security-review-reconcile

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

A completed CI run can remain behind a pending openclaw/ci-gate status when Security Review sees a missing or stale CI response and its successful scheduled pass advances the scan window.

User Impact

Maintainers can recover the combined review for a completed CI run without rerunning CI. There is no Control UI behavior change.

Why This Change Was Made

Carry the completed run ID and attempt from the resolver to the existing review owner. Missing or older observations use the existing bounded retry path; exhaustion fails the scheduled pass, preserving its scan window. A newer active run or attempt remains pending.

A default-branch-only manual replay accepts one completed CI run ID, reloads that run, and uses the existing current-PR, repository, workflow, head, and branch checks. It runs ordinary security and CI review with no caller-supplied SHA or gate waiver. The exact transient API discrepancy affecting the observed stuck PRs was not captured; the lost-window behavior is reproduced by the focused tests.

Evidence

Check Result
Base regression proof Four completion-observation cases fail on the base; newer run/attempt cases pass
Three changed test files Initial run: 292 passed, 5 fixture/expectation failures; corrected affected cases: 8 passed (covers all 297 cases across the runs)
Final test-only lint adjustments Seven focused replay/scheduled-selection cases passed
Targeted lint, workflow validation, tooling typecheck Passed
Changed-file formatting and diff whitespace Passed
Independent review No actionable P0–P2 findings

The existing resolver, review owner, retry budget, and authority checks remain authoritative; no new persistent state or retry machinery. Production/workflow LOC: 1,002 → 1,055 (+53). Test LOC: 3,230 → 3,393 (+163). No startup, dependency, or UI changes; no UI build or screenshots needed. Normal PR CI selection supplies broad proof.

@steipete
steipete requested a review from a team as a code owner October 22, 2026 17:11
@clawsweeper

clawsweeper Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-22T17:14:39.480866Z 83773d7 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts size: M labels Oct 22, 2026

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

Copy link
Copy Markdown
Contributor

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: 83773d760f

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

Comment on lines +70 to +72
throw new GitHubDiffDataError(
"The completed CI run is missing or stale in the current observation.",
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Badge Preserve pending status when completion retries exhaust

When a scheduled reconciliation continues receiving a stale or missing workflow-run listing through every retry, this new GitHubDiffDataError reaches main's generic catch, which publishes a failure status before recovery exhausts. Although the failed workflow preserves the scan window, the next scheduled pass skips the run because security-review-event.mjs ignores any non-pending status created after the CI completion, leaving the PR falsely failed until a manual replay or new CI run occurs. Keep this transient reconciliation failure pending, or otherwise ensure the next scheduled pass reselects it.

AGENTS.md reference: AGENTS.md:L9-L9

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 22, 2026
@clawsweeper

clawsweeper Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

This PR carries completed CI identities into Security Review and adds manual replay for a completed run.

Example: CI run 123, attempt 3, has completed while the workflow listing still reports it as active.

  • Before: Security Review returns pending and a successful scheduled pass can advance beyond that completion.
  • After: Security Review retries the stale observation, but exhausted retries currently publish a failure that later scheduled passes skip.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Focused entry-point regressions support the approach, but a definite exhaustion-path defect blocks the patch.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; supplied evidence exercises real script entry points with synthetic HTTP responses rather than live recovery publication.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Partial
User problem: Maintainers can have completed CI blocked behind a stale combined review status.
Reason: The maintainer-authored direction addresses a concrete automation failure using existing owners, but the exhaustion case remains broken.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep this PR open: the recovery is useful, but exhausted retries can leave a false failure that prevents subsequent scheduled recovery.

Priority: P2
Reviewed head: 83773d760fb48492330a95ab53d23f580426861a

Before merge

  • Preserve pending status when completion retries exhaust (P2) - If every observation remains missing or stale, this new GitHubDiffDataError reaches main's catch, which publishes an Actions-owned failure before rethrowing. After retries exhaust, the scheduled workflow fails and retains its scan anchor, but reconcileCompletedRuns skips that head because its non-pending status is newer than CI completion. The PR stays falsely failed even after GitHub's data recovers. Keep this transient failure pending, or otherwise preserve its reselection, and update the persistent-missing test to cover the next scheduled pass. This confirms the concern already recorded at fix: recover completed CI reviews left pending #180808 (comment).
  • Await maintainer action - An independent openclaw/openclaw-secops reviewer must approve the final head under CONTRIBUTING.md and CODEOWNERS.

Findings

  • [P2] Preserve pending status when completion retries exhaust — scripts/github/security-review.mjs:70-72

Tests

  • Missing end-to-end proof: The supplied fixture-based entry-point tests do not cover retry exhaustion followed by the next scheduled pass recovering the same completed run.
Agent review details

How this fits together

GitHub event resolution selects current PR heads, and the existing Security Review owner evaluates CI and live approval authority before publishing the required commit status.

flowchart LR
  A[GitHub completion or replay] --> B[Run and PR resolver]
  C[Scheduled reconciliation] --> B
  B --> D[Security Review owner]
  D --> E[CI and live approvals]
  E --> F[Required commit status]
Loading

Technical review

Best possible solution:

Keep transient completion-observation failures pending while failing the scheduled pass so the existing reconciler can select them again.

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

Source inspection establishes the missing-observation, failure-publication, and subsequent-skip path; the added test expects that failure, but no target code was executed during this review.

Is this the best way to solve the issue?

Passing completion identity through the existing resolver and retry owner is focused, but recovery is incomplete until retry exhaustion preserves future selection.

Full review comments:

  • [P2] Preserve pending status when completion retries exhaust — scripts/github/security-review.mjs:70-72
    If every observation remains missing or stale, this new GitHubDiffDataError reaches main's catch, which publishes an Actions-owned failure before rethrowing. After retries exhaust, the scheduled workflow fails and retains its scan anchor, but reconcileCompletedRuns skips that head because its non-pending status is newer than CI completion. The PR stays falsely failed even after GitHub's data recovers. Keep this transient failure pending, or otherwise preserve its reselection, and update the persistent-missing test to cover the next scheduled pass. This confirms the concern already recorded at fix: recover completed CI reviews left pending #180808 (comment).
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 3633f4d7ca58.

Provenance checked

  • Scheduled reconciliation and manual replay changes intended behavior with a stated reason (9726512: Recover lost CI completion delivery through bounded scheduled scans; manual dispatch was removed to avoid branch-selected status-writing workflow execution.)
  • Pending CI and combined status publication keeps the original intent (3a722d4: Keep unfinished CI pending while retaining terminal failures and current-head approval checks.)
  • Bounded inconsistent-data recovery keeps the original intent (a98b766: Restart complete evaluations when GitHub diff data settles slowly, retaining bounded retries and fresh authority checks.)
  • Run-to-PR qualification keeps the original intent (8b15f4d: Qualify live head, repository, and branch before accepting associations or using the exact-branch fallback.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 9726512 adds scripts/github/security-review-event.mjs:96 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 97265123677f; files: scripts/github/security-review-event.mjs)

PR surface

Tests +163, Docs +19, Config +10, Other +43. Total +235 across 7 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 3 183 20 +163
Docs 1 19 0 +19
Config 1 11 1 +10
Generated 0 0 0 0
Other 2 47 4 +43
Total 7 260 25 +235

Review metrics

Metric Value Why it matters
New recovery input 1 workflow-dispatch input completed_ci_run_id exposes manual replay of an existing CI run without a caller-supplied SHA or approval waiver.

Labels

Label changes:

  • add P2: The defect blocks affected PR gates after transient GitHub observations exhaust recovery, with manual replay available.
  • add merge-risk: 🚨 automation: The introduced error path can publish a false terminal CI status that scheduled reconciliation then skips.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: The defect blocks affected PR gates after transient GitHub observations exhaust recovery, with manual replay available.
  • merge-risk: 🚨 automation: The introduced error path can publish a false terminal CI status that scheduled reconciliation then skips.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 22, 2026, 1:26 PM ET / 17:26 UTC.

@steipete
steipete merged commit 69716f2 into main Oct 22, 2026
125 of 126 checks passed
@steipete
steipete deleted the solid2/w-security-review-reconcile branch October 22, 2026 17:30
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. scripts Repository scripts size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant