Skip to content

fix(ci): prevent false Security Review failures - #155231

Merged
joshavant merged 1 commit into
mainfrom
fix/security-review-surveillance-gaps
Sep 21, 2026
Merged

joshavant merged 1 commit into
mainfrom
fix/security-review-surveillance-gaps

Conversation

@joshavant

@joshavant joshavant commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes false Security Review failures when a delayed skipped CI run follows successful CI, a GitHub read hits a transient connection error, or optional lockfile cleanup cannot obtain an App token.

User Impact

PRs avoid these infrastructure failures while keeping the same CI and maintainer approval requirements. No configuration changes are required.

Why This Change Was Made

  • Ignore completed, wholly skipped PR CI runs when selecting substantive CI, after verifying their live attempt has not become a substantive rerun. Newer running, failed, or canceled runs and explicit release gates remain authoritative.
  • Retry recognized connection errors on reads within the existing retry count and request timeout. Writes are never replayed.
  • Skip optional cleanup when its token is unavailable and let the normal dependency approval check decide whether the PR can merge.

Evidence

  • Reproduced the defects with failing regression tests before applying the fixes.
  • All 279 relevant tests pass, including approval, retry-exhaustion, cancellation, and timeout coverage. The four security suites initially passed 273 tests in 22.65 seconds wall time. After adding six live-rerun regressions, the combined-review suite passed all 91 tests in 11.47 seconds; the other 188 passing cases were unchanged.
  • Observed examples: skipped CI replacing successful CI, connection failure, and unavailable cleanup token. The historical connection log does not identify the request method or underlying error; this fix covers recognized transient read failures.
  • Changed-file checks pass, including formatting, type checking, lint, and repository guards.
  • Independent review found no remaining actionable P0–P2 issues.
  • CI passed for 927ac04cab53c362a16d6ebe9f51523fdfb5ab13 in 13 minutes 12 seconds elapsed. Automatic Security Review reevaluation published successful dependency, sensitive-file, and combined CI statuses. No CI failures were observed.

@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:02
@joshavant
joshavant requested a review from a team as a code owner September 21, 2026 22:02
@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 complete

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

View the workflow run.

@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:10 PM ET / 22:10 UTC.

ClawSweeper review

What this changes

The PR prevents skipped CI runs, transient GitHub read failures, and unavailable optional cleanup credentials from causing false Security Review failures, with regression tests and documentation.

Merge readiness

⛔ Needs changes before merge - 1 item remains

This remains a useful, focused fix absent from the reviewed current-main revision. No actionable patch defect was found; collaborator authorship and the protected maintainer label also preclude cleanup closure.

Priority: P2
Reviewed head: 927ac04cab53c362a16d6ebe9f51523fdfb5ab13

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with meaningful regression coverage and no identified correctness defect.
Proof confidence 🌊 off-meta tidepool Not applicable: The collaborator-authored PR is exempt from the external-contributor proof gate. Historical GitHub runs support the reported failures, and inspected tests exercise the changed guards with mocked GitHub responses; neither is claimed as after-fix live execution.
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. Historical GitHub runs support the reported failures, and inspected tests exercise the changed guards with mocked GitHub responses; neither is claimed as after-fix live execution.
Evidence reviewed 8 items Introduced scope: Reviewed the pinned merge-base-to-head delta across the three guard scripts, two test files, and CI documentation. The verified test merge has the recorded base followed by the exact PR head; its CI-selection change matches the introduced patch.
Still necessary on current main: Current main still selects the highest matching CI run ID without excluding completed skipped PR runs. Comparing the three production scripts against the merge base produced no changes, so the proposed repairs remain absent.
Observed skipped-run ordering: GitHub returned completed skipped pull-request run 35650726385 after successful run 35650628868 for the same head. This independently supports the CI-selection failure mechanism; it is historical input evidence, not an after-fix execution.
Findings None None.
Security None None.

How this fits together

Security Review combines GitHub CI results with dependency and sensitive-change approvals to publish the required merge status. Its shared GitHub client also supports optional lockfile cleanup.

flowchart TD
  A[PR events and CI completion] --> B[Security Review]
  B --> C[GitHub reads with bounded retries]
  C --> D[Select substantive CI run]
  C --> E[Check current approvals]
  E --> F[Optional lockfile cleanup]
  D --> G[Required merge status]
  E --> G
Loading

Before merge

  • Complete next step (P2) - Obtain independent SecOps code-owner approval and add the repository-required measured focused-test wall time and available CI timing to the PR evidence.
Agent review details

Security

None.

PR surface

Tests +237, Docs +9, Other +58. Total +304 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 239 2 +237
Docs 1 14 5 +9
Config 0 0 0 0
Generated 0 0 0 0
Other 3 65 7 +58
Total 6 318 14 +304

Review metrics

Metric Value Why it matters
Production versus regression coverage Production/tooling +58 net lines; tests +237 net lines Production growth implements bounded recovery within existing owners, with most added code devoted to regression coverage.

Technical review

Best possible solution:

Keep infrastructure recovery within the existing guard owners while preserving substantive CI, current approvals, bounded retries, and non-replayed writes.

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

Yes, from source: a newer skipped PR run displaces successful same-head CI, and GitHub confirms that ordering occurred. No runtime reproduction was executed during this review.

Is this the best way to solve the issue?

Yes. The patch extends existing selection, transport, and cleanup owners without duplicating policy or relaxing required approvals.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This repairs concrete false failures in PR review automation without changing shipped application behavior.
  • 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. Historical GitHub runs support the reported failures, and inspected tests exercise the changed guards with mocked GitHub responses; neither is claimed as after-fix live execution.

Label justifications:

  • P2: This repairs concrete false failures in PR review automation without changing shipped application behavior.
  • 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. Historical GitHub runs support the reported failures, and inspected tests exercise the changed guards with mocked GitHub responses; neither is claimed as after-fix live execution.

Evidence

What I checked:

  • Introduced scope: Reviewed the pinned merge-base-to-head delta across the three guard scripts, two test files, and CI documentation. The verified test merge has the recorded base followed by the exact PR head; its CI-selection change matches the introduced patch. (scripts/github/security-review.mjs:67, 927ac04cab53)
  • Still necessary on current main: Current main still selects the highest matching CI run ID without excluding completed skipped PR runs. Comparing the three production scripts against the merge base produced no changes, so the proposed repairs remain absent. (scripts/github/security-review.mjs:67, f56c75f2a854)
  • Observed skipped-run ordering: GitHub returned completed skipped pull-request run 35650726385 after successful run 35650628868 for the same head. This independently supports the CI-selection failure mechanism; it is historical input evidence, not an after-fix execution. (0bc877168a18)
  • Retry and approval boundaries: Connection retries require GET or HEAD, a recognized error code, an un-aborted signal, and remaining shared retry budget. Missing cleanup credentials return without a branch write, while enforcement still requires approval. CI success publication retains approval and PR-state revalidation. (scripts/github/guard-shared.mjs:353, 927ac04cab53)
  • Regression coverage and execution limits: Read both complete test files. Added cases cover skipped-run reruns, invalid identities, failed/canceled/running CI, release dispatches, missing cleanup tokens, read retry exhaustion, non-replayed writes, cancellation, and timeout. The body reports 279 passing tests but supplies no measured test timing. Tests were not executed during this read-only review. (test/scripts/security-review-script.test.ts:482, 927ac04cab53)
  • Independent SecOps approval: CODEOWNERS assigns all three changed production scripts to openclaw/openclaw-secops. CONTRIBUTING.md explicitly requires independent SecOps approval even for maintainer-authored changes. Live main rules require code-owner review; the live PR review endpoint returned no reviews. (.github/CODEOWNERS:16, 927ac04cab53)

Likely related people:

  • joshavant: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • openclaw/openclaw-secops: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; 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.

@joshavant
joshavant merged commit f7c0c42 into main Sep 21, 2026
140 checks passed
@joshavant
joshavant deleted the fix/security-review-surveillance-gaps branch September 21, 2026 22:22
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 22, 2026
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