Skip to content

fix(ci): prevent Security Review checkout retry collisions - #157652

Merged
joshavant merged 1 commit into
mainfrom
fix/security-review-checkout-retry-isolation
Sep 25, 2026
Merged

joshavant merged 1 commit into
mainfrom
fix/security-review-checkout-retry-isolation

Conversation

@joshavant

@joshavant joshavant commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes Security Review checkout retries that fail with file, index, or lock conflicts after the first attempt times out. Observed in this resolver run and this review run.

User Impact

PR security review can recover without reusing the failed checkout's partial files or Git metadata. Permissions, approval requirements, trusted source selection, and the two five-minute attempt limits stay unchanged.

Why This Change Was Made

Each checkout attempt gets its own directory. A successful attempt supplies only the scripts and policy runtime needed at the existing workspace paths, keeping failed-attempt writes away from the running review. The existing Knip entrypoint inventory names the two staged scripts so unused-export analysis can still follow their production imports.

Evidence

  • Both regression cases failed on the original workflow when a late write in the failed checkout replaced a script consumed by recovery.
  • All 40 workflow tests pass, including runtime imports, trust boundaries, bounded retries, and bootstrap failure reporting. The file completed in 1.79 seconds locally.
  • Workflow validation and the full changed-file checks pass, including types, all three unused-export scans, formatting, and lint. Independent review found no actionable issues.
  • The hosted Git-process collision itself was not reproduced locally; the regression exercises the workflow's actual staging commands and source selection.

CI results

The main CI run completed. Changed-code tests and both dependency and sensitive-code review statuses passed. No observed CI failure is caused by this PR.

The type-check, lint, build, and extension package-boundary failures come from an unrelated import in package-update-npm-pack.ts: it imports the unexported type UpdateStepResult from update-runner-types.ts. This is present in the main revision used for the CI merge; this PR does not change either file. The CI gate is red because those checks failed. Example failure.

@clawsweeper

clawsweeper Bot commented Sep 24, 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.

@joshavant
joshavant marked this pull request as ready for review September 24, 2026 22:48
@joshavant
joshavant requested a review from a team as a code owner September 24, 2026 22:48
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: S labels Sep 24, 2026
@clawsweeper

clawsweeper Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed September 24, 2026, 7:04 PM ET / 23:04 UTC.

ClawSweeper review

What this changes

The branch gives each Security Review checkout attempt its own directory, stages the successful attempt’s trusted scripts and policy files, and updates the related checks and documentation.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this PR open. Current main still retries checkout in the same workspace, and the proposed isolation has no concrete correctness finding. The requested SecOps code-owner review remains outstanding.

Priority: P2
Reviewed head: 54daa54de5a03532dcdf3fe555d0c35156a5c761

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The focused workflow change and staging regression give good patch confidence; its required code-owner review is still pending.
Proof confidence 🌊 off-meta tidepool Not applicable: The ordinary external-contributor proof gate does not apply to this COLLABORATOR PR. The changed Security Review workflow is exercised by tests that run its staging shell against simulated primary and retry directories with a late write; no after-fix hosted timeout run is shown, and no stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The ordinary external-contributor proof gate does not apply to this COLLABORATOR PR. The changed Security Review workflow is exercised by tests that run its staging shell against simulated primary and retry directories with a late write; no after-fix hosted timeout run is shown, and no stored-data contract changes.
Evidence reviewed 7 items Current main still shares the checkout location: The fetched main workflow has two bounded checkout attempts without separate path inputs or a staging step, so this PR remains necessary.
Introduced workflow behavior: The pinned PR delta assigns distinct primary and retry paths in both jobs, then copies files from the selected checkout into the paths consumed by the existing steps. The verified test merge contains the same four PR-owned files.
Recovery regression coverage: The test runs the workflow’s staging command with separate checkout directories, a failed checkout lock, and a late write to the failed source; it checks that the staged script still imports.
Findings None None.
Security None None.

How this fits together

Security Review handles pull request and CI events using scripts checked out from the trusted default branch. Its resolver selects work for the review job, which publishes security review results.

flowchart LR
A[PR or CI event] --> B[Trusted checkout]
B --> C{First attempt succeeds?}
C -->|Yes| D[Primary directory]
C -->|No| E[Retry directory]
D --> F[Stage trusted files]
E --> F
F --> G[Security review result]
Loading

Before merge

  • Complete next step (P2) - Obtain the requested SecOps code-owner review of the changed Security Review workflow before merge.
Agent review details

Security

None.

PR surface

Tests +67, Docs +6, Config +20, Other +3. Total +96 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 73 6 +67
Docs 1 6 0 +6
Config 1 20 0 +20
Generated 0 0 0 0
Other 1 3 0 +3
Total 4 102 6 +96

Review metrics

None.

Technical review

Best possible solution:

Keep the successful trusted checkout as the sole source of staged scripts and policy, with separate directories for the two bounded attempts and the existing fail-closed reporting.

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

No high-confidence reproduction of the hosted Git-process collision is available. The cited runs show failed retries, while current source and the new staging test support the isolation mechanism.

Is this the best way to solve the issue?

Yes. Separate checkout directories and staging from the successful trusted source address the collision without changing checkout authority, permissions, or retry limits.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This is a bounded repair to PR security-review automation with observed failed retries.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.

Label justifications:

  • P2: This is a bounded repair to PR security-review automation with observed failed retries.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.

Evidence

What I checked:

  • Current main still shares the checkout location: The fetched main workflow has two bounded checkout attempts without separate path inputs or a staging step, so this PR remains necessary. (.github/workflows/security-review.yml:50, daecbc5cf54c)
  • Introduced workflow behavior: The pinned PR delta assigns distinct primary and retry paths in both jobs, then copies files from the selected checkout into the paths consumed by the existing steps. The verified test merge contains the same four PR-owned files. (.github/workflows/security-review.yml:83, 54daa54de5a0)
  • Recovery regression coverage: The test runs the workflow’s staging command with separate checkout directories, a failed checkout lock, and a late write to the failed source; it checks that the staged script still imports. (test/scripts/security-review-workflow.test.ts:122, 54daa54de5a0)
  • Pinned checkout path contract: The pinned action input defines path as relative to GITHUB_WORKSPACE. The workflow directly uses this dependency contract. (action.yml, 3d3c42e5aac5)
  • Observed pre-change failures: The cited resolver and review runs each spent five minutes in the first checkout, entered the retry, and ended with a failed retry. The available step summaries do not establish the exact Git lock error.
  • Security workflow ownership: CODEOWNERS assigns this workflow to SecOps. GitHub shows the team was requested and no review has been submitted. (.github/CODEOWNERS:17, 54daa54de5a0)

Likely related people:

  • joshavant: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • steipete: 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 ef2dd32 into main Sep 25, 2026
153 of 174 checks passed
@joshavant
joshavant deleted the fix/security-review-checkout-retry-isolation branch September 25, 2026 01:11
vincentkoc added a commit that referenced this pull request Sep 25, 2026
* commit 'ef2dd3235123371860c9154da7b47b2c1e940788': (41 commits)
  fix(ci): prevent Security Review checkout retry collisions (#157652)
  fix(ci): recover interrupted Security Review response bodies (#157651)
  test(ui): capture live operator authority in guest question fixture
  refactor(agents): deslop runners, harness and recovery (#157294)
  fix(auth): preserve Copilot tenant credentials during Doctor repair (#139131)
  refactor(msteams): share stored service URL validation (#157706)
  fix(codex): honor configured tool PATH in native commands (#157290)
  refactor(msteams): share approval kind labels (#157705)
  fix(sessions): keep session results current during cold reads (#156121)
  fix(testing): capture bounded upgrade integrity diagnostics (#157535)
  refactor(i18n): reuse native branch candidate extraction (#157636)
  fix(update): preserve recovery files after ownership refusal (#148890)
  fix(test): prevent late announcements from contaminating registry tests (#157681)
  fix(e2e): scan full onboarding logs for prompts (#157624)
  refactor(session-tools): derive contracts from schemas (#156365)
  refactor(channels): derive config contracts from schemas (#156367)
  perf(test): reuse MCP archives and batch worker fixture copies (#157689)
  refactor: reuse prepared fixtures in slow core tests (#157685)
  refactor(codex): reuse marketplace reference selection (#157621)
  chore(ui): refresh control ui locales (#157710)
  ...
vincentkoc added a commit that referenced this pull request Sep 25, 2026
* commit '05edd36e124dc376f63475256f45e82ec437412c': (30 commits)
  refactor(matrix): reuse bounded direct-room cache insertion (#157775)
  fix: preserve channel-owner revocation across recovery (#157709)
  fix(ci): stop blocking CI during release validation (#157757)
  refactor(tlon): remove unreachable DM summary branches (#157789)
  chore: speed up worktree recovery tests with Bun (#157674)
  fix(sessions): release PR caches when pending viewers leave (#157776)
  refactor(twitch): reuse setup account selection (#157787)
  test: skip empty task ledger resets in cron fixtures (#157767)
  perf: reduce gateway and state test startup (#157711)
  fix: preserve maintenance leases during slow heartbeat renewal (#157696)
  fix(channels): match non-TTY setup advice to registered flags (#157551)
  fix: keep failed update report uploads in the CLI (#156633)
  fix: preserve rejected settings reason when opening config (#157731)
  test(update): load real filesystem dependencies in swap fixture
  fix(ci): prevent Security Review checkout retry collisions (#157652)
  fix(ci): recover interrupted Security Review response bodies (#157651)
  test(ui): capture live operator authority in guest question fixture
  refactor(agents): deslop runners, harness and recovery (#157294)
  fix(auth): preserve Copilot tenant credentials during Doctor repair (#139131)
  refactor(msteams): share stored service URL validation (#157706)
  ...
vincentkoc added a commit that referenced this pull request Sep 25, 2026
* fix(ui): keep Stop available while drafts cannot send

* chore: integrate main fixes for Stop UI validation

* commit 'ef2dd3235123371860c9154da7b47b2c1e940788': (41 commits)
  fix(ci): prevent Security Review checkout retry collisions (#157652)
  fix(ci): recover interrupted Security Review response bodies (#157651)
  test(ui): capture live operator authority in guest question fixture
  refactor(agents): deslop runners, harness and recovery (#157294)
  fix(auth): preserve Copilot tenant credentials during Doctor repair (#139131)
  refactor(msteams): share stored service URL validation (#157706)
  fix(codex): honor configured tool PATH in native commands (#157290)
  refactor(msteams): share approval kind labels (#157705)
  fix(sessions): keep session results current during cold reads (#156121)
  fix(testing): capture bounded upgrade integrity diagnostics (#157535)
  refactor(i18n): reuse native branch candidate extraction (#157636)
  fix(update): preserve recovery files after ownership refusal (#148890)
  fix(test): prevent late announcements from contaminating registry tests (#157681)
  fix(e2e): scan full onboarding logs for prompts (#157624)
  refactor(session-tools): derive contracts from schemas (#156365)
  refactor(channels): derive config contracts from schemas (#156367)
  perf(test): reuse MCP archives and batch worker fixture copies (#157689)
  refactor: reuse prepared fixtures in slow core tests (#157685)
  refactor(codex): reuse marketplace reference selection (#157621)
  chore(ui): refresh control ui locales (#157710)
  ...

Co-authored-by: Vincent Koc <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 25, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 25, 2026
* fix(ui): keep Stop available while drafts cannot send

* chore: integrate main fixes for Stop UI validation

* commit '5dae23c843013fce2e0bb80037d232bbabfc70e5': (41 commits)
  fix(ci): prevent Security Review checkout retry collisions (openclaw#157652)
  fix(ci): recover interrupted Security Review response bodies (openclaw#157651)
  test(ui): capture live operator authority in guest question fixture
  refactor(agents): deslop runners, harness and recovery (openclaw#157294)
  fix(auth): preserve Copilot tenant credentials during Doctor repair (openclaw#139131)
  refactor(msteams): share stored service URL validation (openclaw#157706)
  fix(codex): honor configured tool PATH in native commands (openclaw#157290)
  refactor(msteams): share approval kind labels (openclaw#157705)
  fix(sessions): keep session results current during cold reads (openclaw#156121)
  fix(testing): capture bounded upgrade integrity diagnostics (openclaw#157535)
  refactor(i18n): reuse native branch candidate extraction (openclaw#157636)
  fix(update): preserve recovery files after ownership refusal (openclaw#148890)
  fix(test): prevent late announcements from contaminating registry tests (openclaw#157681)
  fix(e2e): scan full onboarding logs for prompts (openclaw#157624)
  refactor(session-tools): derive contracts from schemas (openclaw#156365)
  refactor(channels): derive config contracts from schemas (openclaw#156367)
  perf(test): reuse MCP archives and batch worker fixture copies (openclaw#157689)
  refactor: reuse prepared fixtures in slow core tests (openclaw#157685)
  refactor(codex): reuse marketplace reference selection (openclaw#157621)
  chore(ui): refresh control ui locales (openclaw#157710)
  ...

Co-authored-by: Vincent Koc <[email protected]>
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 size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant