Skip to content

fix: Security Review fails after transient status publication errors - #155248

Merged
joshavant merged 1 commit into
mainfrom
fix/security-status-publication-recovery
Sep 21, 2026
Merged

joshavant merged 1 commit into
mainfrom
fix/security-status-publication-recovery

Conversation

@joshavant

@joshavant joshavant commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes Security Review stopping after a transient GitHub error while publishing a commit status, as observed in this failed run for #153745.

User Impact

Security Review can recover automatically from a temporary status publication failure in the same workflow run. Approval requirements are unchanged, and no configuration changes or manual guard runs are needed. Persistent failures still fail the job.

Why This Change Was Made

A status write can fail after GitHub accepts it. Recovery therefore restarts the complete evaluation with current PR, approval, permission, and CI data instead of replaying an earlier decision. Transient status failures share the existing three-restart limit and job deadline with rate-limit recovery. Other uncertain writes, permission errors, cancellation, and request timeouts do not gain retries.

If reporting a fatal evaluation error also fails, the original error remains visible and does not become a reason to retry.

Evidence

  • Reproduced the missing recovery with failing regression tests before changing production code.
  • All 297 focused tests pass across the combined review, event resolver, dependency guard, and security-sensitive guard suites. Single-worker wall time: 26.97 seconds (Vitest: 25.36 seconds).
  • Coverage includes HTTP 500/502/503/504, connection resets, writes accepted before an error, changed authority/head/CI during recovery, bounded retries, and non-retriable failures.
  • Changed-scope repository checks passed, including formatting, root-test type checking, dead-export scans, and script/test lint. Independent review found no actionable issues.
  • Hosted guard tests: all 297 passed on f94cd4bd13104b7125de0ead663fa58ec0a48661. Summed individual CI test durations, excluding setup and other files: combined review 15.976 seconds; resolver 5.831 seconds; dependency guard 2.425 seconds; security-sensitive guard 9.158 seconds.
  • Unrelated CI failure: the package-manager workflow assertion rejects the existing REPLAY_PNPM_VERSION variable in windows-testbox-probe.yml. Reproduced locally; both that workflow and its test are byte-identical to the branch base.
  • Transient GitHub errors are injected in the production CLI test fixture; no live GitHub outage is induced.

@clawsweeper

clawsweeper Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review in progress

ClawSweeper is reviewing this revision. This supersedes any previous blocked status.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts size: M maintainer Maintainer-authored PR labels Sep 21, 2026
@joshavant
joshavant marked this pull request as ready for review September 21, 2026 22:42
@joshavant
joshavant requested a review from a team as a code owner September 21, 2026 22:42
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 21, 2026
@clawsweeper

clawsweeper Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed September 21, 2026, 6:50 PM ET / 22:50 UTC.

ClawSweeper review

What this changes

Security Review restarts its evaluation after transient GitHub status-publication failures, with bounded retries, fresh approval checks, regression coverage, and updated CI documentation.

Merge readiness

⛔ Needs changes before merge - 1 item remains

The fix remains useful: current main does not recover transient commit-status publication failures. No actionable defect was found in the introduced patch; the maintainer-authored PR is also protected from cleanup closure.

Priority: P2
Reviewed head: f94cd4bd13104b7125de0ead663fa58ec0a48661

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with meaningful regression coverage and no actionable correctness finding.
Proof confidence 🌊 off-meta tidepool Not applicable: The collaborator-authored PR is exempt from the external-contributor proof gate. Its production CLI tests use mocked fetch and do not demonstrate live GitHub recovery; the patch preserves authorization semantics and presents no unresolved material authority-chain violation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The collaborator-authored PR is exempt from the external-contributor proof gate. Its production CLI tests use mocked fetch and do not demonstrate live GitHub recovery; the patch preserves authorization semantics and presents no unresolved material authority-chain violation.
Evidence reviewed 8 items Introduced change: Reviewed the pinned merge-base-to-head delta. Recovery is restricted to classified status-publication failures and existing rate limits; both production entrypoints restart their complete evaluation.
Still needed on main: Fetched main retains rate-limit-only evaluation recovery and an unwrapped status POST. Its four affected production modules match the PR merge base, so the proposed recovery is not already present.
Release comparison: The latest supplied release, v2026.9.5, has read-request retries but lacks this status-publication recovery. Release source was read through GitHub after the local release object was unavailable.
Findings None None.
Security None None.

How this fits together

Security Review combines GitHub PR metadata, maintainer approvals, and CI results into commit statuses used to gate merging. Its shared GitHub client and evaluation loop control recovery when publishing those results fails.

flowchart TD
  A[PR or CI event] --> B[Resolve current PR head]
  B --> C[Read approvals and CI]
  C --> D[Publish review status]
  D --> E{Transient publication failure?}
  E -->|Yes, within budget| B
  E -->|No| F[Record result or stop on error]
Loading

Before merge

  • Complete next step (P2) - Obtain the enforced independent approval from @openclaw/openclaw-secops for the changed security-review scripts.
Agent review details

Security

None.

PR surface

Tests +145, Docs +8, Other +42. Total +195 across 9 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 4 175 30 +145
Docs 1 11 3 +8
Config 0 0 0 0
Generated 0 0 0 0
Other 4 75 33 +42
Total 9 261 66 +195

Review metrics

Metric Value Why it matters
Production versus regression coverage Production/tooling +42 net lines; tests and fixtures +145 net lines Production growth implements classified recovery and error preservation; the larger test delta checks recovery limits and authority changes.

Technical review

Best possible solution:

Keep recovery in the existing evaluation owner, preserving fresh authorization checks and bounded retries without replaying cached approval decisions.

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

Yes, from source: a transient status POST failure on current main escapes the rate-limit-only recovery loop. The added CLI fixture targets that path, but no reproduction was executed during this read-only review.

Is this the best way to solve the issue?

Yes. Restarting the existing evaluator is a narrow repair that refreshes authorization and CI instead of retrying a stale status decision.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 1497878e0bc6.

Labels

Label changes:

  • add P2: This addresses intermittent failure of repository review automation with a bounded scope and no product-runtime change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The collaborator-authored PR is exempt from the external-contributor proof gate. Its production CLI tests use mocked fetch and do not demonstrate live GitHub recovery; the patch preserves authorization semantics and presents no unresolved material authority-chain violation.

Label justifications:

  • P2: This addresses intermittent failure of repository review automation with a bounded scope and no product-runtime change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The collaborator-authored PR is exempt from the external-contributor proof gate. Its production CLI tests use mocked fetch and do not demonstrate live GitHub recovery; the patch preserves authorization semantics and presents no unresolved material authority-chain violation.

Evidence

What I checked:

  • Introduced change: Reviewed the pinned merge-base-to-head delta. Recovery is restricted to classified status-publication failures and existing rate limits; both production entrypoints restart their complete evaluation. (scripts/github/guard-shared.mjs:51, f94cd4bd1310)
  • Still needed on main: Fetched main retains rate-limit-only evaluation recovery and an unwrapped status POST. Its four affected production modules match the PR merge base, so the proposed recovery is not already present. (scripts/github/guard-shared.mjs:45, 1497878e0bc6)
  • Release comparison: The latest supplied release, v2026.9.5, has read-request retries but lacks this status-publication recovery. Release source was read through GitHub after the local release object was unavailable. (scripts/github/guard-shared.mjs, ec9c1a13db89)
  • Recovery and authority coverage: The CLI fixture exercises HTTP 500/502/503/504, connection reset, accepted-before-error writes, revoked author permission, changed heads, changed CI, retry exhaustion, and fatal comment-write errors. Assertions reject success after permission revocation and reject further writes after a superseded head. The fixture replaces fetch; these are supplemental tests, not live transport proof. The captured PR body reports 297 passing tests in 26.97 seconds; this read-only review did not execute them. (test/scripts/security-review-script.test.ts:255, f94cd4bd1310)
  • Failure and authorization boundaries: Every restart creates a fresh review, rereads permissions and comments, and retains final approval/head revalidation. Fatal evaluation errors remain fatal even if publishing their failure status also fails. No workflow permissions, dependency sources, or approval eligibility rules change. (scripts/github/security-review.mjs:127, f94cd4bd1310)
  • Required code-owner approval: CODEOWNERS assigns the changed guard and review scripts to openclaw/openclaw-secops. Live main rules require code-owner review and dismiss stale approvals; the live PR review list was empty. (.github/CODEOWNERS:18, f94cd4bd1310)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

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

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 maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant