Skip to content

fix(ci): fetch security scan history during authenticated checkout - #136232

Merged
steipete merged 2 commits into
mainfrom
codex/fix-security-scan-history-checkout
Sep 2, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/fix-security-scan-history-checkout

Conversation

@steipete

@steipete steipete commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Why

The security-fast job can fail before running its scanners: checkout removes temporary credentials as requested, then a separate PR-history fetch reaches GitHub without authentication. This happened on #136205 in run 33613960320, job 100195389239, where Git exited 128 with an authentication challenge. The log does not establish why that public request was challenged.

Change

Calculate the existing validated PR commit count plus two before checkout and pass it to the pinned checkout action. That action now acquires the complete bounded scan range while it owns authentication, then removes credentials as before. Delete the redundant later fetch and its unused merge-SHA environment value.

Non-PR depth remains two. Event ref/SHA selection, manual target checkout, scan base/head, scanner pins, permissions, and persist-credentials: false are unchanged. The removed supplemental fetch's 120-second deadline does not transfer to checkout; the existing checkout lifecycle and 20-minute job deadline apply. There is no new credential scope or authentication fallback.

Verification

A real local Git fixture creates a three-commit PR and synthetic merge. The regression fails before the change because the initial depth-two checkout contains only two of the four required range commits; it passes with the complete range afterward. Six targeted security cases pass, including invalid commit counts and unchanged non-PR defaults.

The original two complete canonical owner suites passed 244 tests, with two existing Linux-only tests skipped on macOS. Expanded verification across all three Git-owner suites passed 448 tests with 88 unchanged native platform skips. A subsequent mechanical lint cleanup passed 22 affected cases; these selected cases do not replace the full-suite result. Changed-code checks and the full workflow checker pass, including actionlint and zizmor. The first workflow-check attempt used system Python 3.9 and could not install the unchanged pre-commit pin; rerunning the same checker with the existing Python 3.14 passed without changing pins.

Direct inspection of pinned actions/checkout confirms authentication wraps its fetch and is removed in finally when persistence is disabled. The local fixture does not reproduce GitHub's remote authentication challenge or claim to execute the Actions runner; exact-head CI remains required.

Workflow delta: +17/-19 (net -2). Tests and support: +155/-53 (net +102). This is a CI correctness repair, not a performance result.

Follow-up from hosted CI

The first candidate security-fast job passed on GitHub Actions (run 33615893519, job 100201497622). The Linux Git test shard then found three stale tests still selecting the deleted supplemental-fetch step. Remove those obsolete cases and unused fixture inputs; the new first-checkout range and invalid-depth guards cover the replacement owner.

The expanded macOS suites exposed a fixture portability gap: publisher scenarios expected timeout without using the stub already supplied to related fixture families. Extend that existing provision to publishers. Production deadlines, assertions and platform skips stay unchanged. Nearby changed-file lint fixes preserve expected values and ordering.

ClawSweeper's final-head September 2 review found no code defect and requested hosted workflow confirmation because its environment could not retrieve the pinned checkout source. The maintainer and independent review inspected that source directly. Final head 04c51bf8fb7062da1e12fd2b1f545a641f76c004 now passes CI run 33618909815, attempt 2: 184 passing checks and 23 appropriate skips. Attempt 1 passed checkout and TruffleHog but failed while pre-commit fetched its separate public hook repository; the ordinary failed-job retry passed without source, credentials or scanner changes. This completes the review's requested rank-up proof. Final isolated Codex review also found no actionable P0 defect.

@clawsweeper

clawsweeper Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@clawsweeper

clawsweeper Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 2, 2026, 6:27 AM ET / 10:27 UTC.

ClawSweeper review

What this changes

The PR makes the security workflow obtain a pull request’s full scan history during authenticated checkout, then removes the redundant post-cleanup fetch and updates its tests and fixtures.

Regression provenance

Possible regression — probable (reviewed change; failure trace). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep this maintainer-owned, protected PR open. No branch-introduced correctness defect was found; the final head still needs its normal hosted workflow completion, and the pinned checkout action contract could not be independently retrieved in this review environment.

Priority: P2
Reviewed head: 04c51bf8fb7062da1e12fd2b1f545a641f76c004

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch has focused owner-boundary coverage and no identified defect; completion of hosted final-head CI will resolve the remaining action-runtime uncertainty.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored internal CI repair is exempt from the external-contributor proof gate; the PR supplies a relevant local Git-range fixture, while exact-head hosted CI remains the normal merge gate.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored internal CI repair is exempt from the external-contributor proof gate; the PR supplies a relevant local Git-range fixture, while exact-head hosted CI remains the normal merge gate.
Evidence reviewed 5 items Changed workflow owner: The introduced workflow calculates the validated pull-request commit count before checkout, passes the resulting depth to checkout, retains persist-credentials: false, and removes the later direct fetch.
Owner-boundary regression coverage: The workflow guard executes the depth step, creates a synthetic merge with three pull-request commits, fetches at the calculated depth, and asserts the scanner range is present without a later fetch.
Current main remains affected: The fetched main revision still uses depth two for the initial checkout and performs the pull-request history fetch later, after credential cleanup.
Findings None None.
Security None None.

How this fits together

The security-fast GitHub Actions job prepares a Git history range for TruffleHog before scanning a pull request. Checkout fetches the range while temporary authentication is available, then the scanner consumes it after credentials are removed.

flowchart LR
A[Pull request event] --> B[Calculate scan depth]
B --> C[Authenticated checkout]
C --> D[Credentials removed]
D --> E[Resolve scan base]
E --> F[TruffleHog scan]
Loading

Before merge

  • Resolve merge risk (P1) - The local fixture proves the required Git range but does not execute the pinned checkout action; the action source could not be retrieved here, so final-head hosted CI remains the practical confirmation of its authenticated fetch lifecycle.
Agent review details

Security

None.

PR surface

Tests +102, Config -2. Total +100 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 4 155 53 +102
Docs 0 0 0 0
Config 1 17 19 -2
Generated 0 0 0 0
Other 0 0 0 0
Total 5 172 72 +100

Review metrics

Metric Value Why it matters
Production versus test delta workflow production +17/-19 (net -2); tests and test support +155/-53 (net +102) The production change replaces one Git-fetch owner with another while the added test support exercises the complete synthetic pull-request range.

Merge-risk options

Maintainer options:

  1. Complete final-head workflow confirmation (recommended)
    Let the current security-fast run validate the pinned checkout action’s authenticated fetch behavior on the exact PR head before merging.

Technical review

Best possible solution:

Land the single checkout-owned history path once the exact-head security workflow confirms that the pinned action fetches the required range before credential cleanup.

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

Yes: the checked-in guard constructs a synthetic pull-request merge and demonstrates that depth two lacks the required range while the calculated depth includes it.

Is this the best way to solve the issue?

Yes, with one remaining external-contract check: moving the existing bounded fetch into checkout is the clean owner-boundary repair, but hosted CI should confirm the pinned action’s actual lifecycle.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This is a bounded CI correctness repair for pull-request security scanning.
  • add merge-risk: 🚨 automation: The PR changes the checkout behavior that prepares history for an automated security scan.
  • 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: This maintainer-authored internal CI repair is exempt from the external-contributor proof gate; the PR supplies a relevant local Git-range fixture, while exact-head hosted CI remains the normal merge gate.

Label justifications:

  • P2: This is a bounded CI correctness repair for pull-request security scanning.
  • merge-risk: 🚨 automation: The PR changes the checkout behavior that prepares history for an automated security scan.
  • 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: This maintainer-authored internal CI repair is exempt from the external-contributor proof gate; the PR supplies a relevant local Git-range fixture, while exact-head hosted CI remains the normal merge gate.

Evidence

What I checked:

  • Changed workflow owner: The introduced workflow calculates the validated pull-request commit count before checkout, passes the resulting depth to checkout, retains persist-credentials: false, and removes the later direct fetch. (.github/workflows/ci.yml:1656, 04c51bf8fb70)
  • Owner-boundary regression coverage: The workflow guard executes the depth step, creates a synthetic merge with three pull-request commits, fetches at the calculated depth, and asserts the scanner range is present without a later fetch. (test/scripts/ci-workflow-guards.test.ts:4260, 04c51bf8fb70)
  • Current main remains affected: The fetched main revision still uses depth two for the initial checkout and performs the pull-request history fetch later, after credential cleanup. (.github/workflows/ci.yml:1724, c6dcb97176cf)
  • Feature-history routing: Recent workflow history includes the first PR commit and multiple prior CI workflow changes by Peter Steinberger; the follow-up commit removes obsolete tests for the deleted step and fixes the publisher fixture. (.github/workflows/ci.yml:1656, 7c51c2b4c6be)
  • Pinned dependency inspection unavailable: The workflow directly invokes pinned actions/checkout revision 3d3c42e5aac5ba805825da76410c181273ba90b1, but the authorized GitHub API request could not connect; its fetch/authentication implementation was therefore not independently inspected. (3d3c42e5aac5)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Let the exact-head security workflow complete successfully before merge.

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-02T09:55:01.506Z sha 7c51c2b :: needs maintainer review before merge. :: none

@steipete

steipete commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Release triage on 7c51c2b4c6be1660fb9619d5921a3a5c75ac2024: this also addresses the authenticated-history gap observed in #136184 and #136196. Those jobs completed checkout and credential cleanup, then failed the later Git fetch before scanning.

The remaining Node failure in CI attempt 1 is a sibling-fixture migration: test/scripts/ci-linux-git.test.ts still selects the deleted security-fast/Fetch pull request scan history step. The two history-profile cases call at line 332 and the malformed-depth case at line 434; all three throw Missing executable workflow step before Git runs. These Linux-only cases explain why the local macOS suite missed it. Please move the relevant depth validation coverage to the new checkout-depth owner and retain the shared Git cleanup coverage for the remaining supplemental-fetch callers, without restoring the removed unauthenticated fetch.

The separate UI shard failure is at ui/src/e2e/sidebar-attention-scope.e2e.test-support.ts:146, reached from line 171 after switching to Writer: the approval-row count stays zero rather than one. That UI source is unchanged by this PR; its cause and flakiness are not established by this run. The other 103 tests in that shard passed.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. 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 2, 2026
@steipete

steipete commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

The next exact-head failure is a different Git bootstrap boundary. On 04c51bf8fb7062da1e12fd2b1f545a641f76c004, security-fast job 100211118372 gets past checkout/history preparation, then fails in Detect committed private keys. pre-commit==4.6.2 starts initializing https://github.com/pre-commit/pre-commit-hooks; its git fetch origin --tags exits 128 with could not read Username for 'https://github.com'. The detector has not run, so this is not a private-key finding. The log does not establish the underlying HTTP cause. I am checking the shared Git/bootstrap boundary without restoring persistent checkout credentials or exposing credentials to PR-controlled hooks.

The earlier UI failure is now reproduced intermittently on unchanged 7c51c2b: an initial pass and two CI-mode passes were followed by the same missing approval-row failure. A passive browser trace shows the Writer URL and cron scope update before the router commits; the fixture opens the inbox, then the route commit intentionally closes it through sidebar-attention.ts's willUpdate. The global approval remains in the queue. I am preparing a fixture-only repair using the existing committed-route wait, keeping the approval assertions and production navigation behavior unchanged.

@steipete
steipete merged commit 9fda3b1 into main Sep 2, 2026
396 of 400 checks passed
@steipete
steipete deleted the codex/fix-security-scan-history-checkout branch September 2, 2026 10:42
@steipete

steipete commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Sep 2, 2026
Reuse the authenticated security-history checkout repair from #136232.
Wait for rendered Android model labels and align the plaintext bootstrap
fixture with its existing manual TLS preference.

Retain bounded Windows termination diagnostics and both primary and cleanup
failures without changing process-tree acceptance or shutdown deadlines.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 3, 2026
…penclaw#136232)

* fix(ci): fetch security scan history during authenticated checkout

* test(ci): align Git history guards with checkout ownership
steipete added a commit that referenced this pull request Sep 3, 2026
* feat(control-ui): add human mentions and temporary inbox

Bind explicit composer selections to authorized human profiles and deliver
recipient-owned Inbox entries only after a fresh canonical user-message commit.
Carry selections through first sends, queues, recovery, and native transcript
mirrors without treating replay or rewritten content as a new mention.

Reuse existing profile/session visibility and Web Push owners. Keep the Inbox,
dismissals, and delivery dedupe bounded and process-local; no SQLite schema or
migration change. Add an optional default-off browser notification category.

Document the API, temporary retention, retry semantics, and notification limits.
Refs #135645.

* refactor(gateway): keep active-leaf response helper private

The responder is now called only inside its admission owner. Remove the obsolete export while preserving its response shape and control flow.

This clears the production and full-tree unused-export guard.

* refactor(mentions): consolidate visibility and commit ownership

Reuse profile session filters instead of fabricating recipient clients.
Derive request types from the wire schema, reuse sanitized input, carry one
Codex persistence receipt, and let Inbox rows own their navigation target.

Preserve current permissions, replay fencing, and explicit dismissal.
No schema, migration, configuration, or protocol changes.

* test: fix cache restore and sidebar navigation fixtures

Seed only historical declaration chunks outside the final cache inventory,
so the portable restore still proves every owned output byte. Reuse the
test-only repair from upstream 5e6117d.

Wait for committed routes before interacting with the Inbox after navigation,
while preserving every click and scope/dismissal check. Capture diagnostics
before closing the browser on failure.

Co-authored-by: ruel225 <[email protected]>

* fix(ci): align checkout history and fixture readiness

Reuse the authenticated security-history checkout repair from #136232.
Wait for rendered Android model labels and align the plaintext bootstrap
fixture with its existing manual TLS preference.

Retain bounded Windows termination diagnostics and both primary and cleanup
failures without changing process-tree acceptance or shutdown deadlines.

* fix: publish real profile changes and stabilize CI fixtures

Emit profile invalidations only after an effective state write, through the
existing synchronous transaction and post-commit owner.

Keep shared Gateway test config at its owner and carry explicit model config
across preparation. Reuse the bounded subprocess helper for complete CLI JSON.
Preserve the alias regression cases in their existing owning test suite.

This repair adds no schema, Gateway configuration, protocol, or dependency.

* perf(control-ui): keep inbox state behind its lazy owner

Create mention state with the application-owned Inbox controller, retain it
across presenter remounts, and dispose it with that owner. Keep dismissal
identity policy in the dismissal store so startup does not load the full
Inbox projection. Preserve authorization, persistence, and size limits.

Co-authored-by: ruel225 <[email protected]>

* perf(control-ui): load compact menu styles with their renderer

Keep shared sidebar and chat-header compact menu styles with the module
that renders them instead of the startup shell. Preserve all declarations
and the existing startup size limit.

Co-authored-by: ruel225 <[email protected]>

* fix(ci): account for the human mentions schema owner

Keep the registry inventory check aligned with the additional reviewed
human-mentions module. No runtime or generated protocol change.

* refactor(control-ui): import mention type from its protocol owner

Use the same public type directly instead of the chat re-export. This
also resolves the adjacent-import conflict with current main without
changing emitted JavaScript or pulling unrelated changes into the PR.

* refactor(control-ui): keep dismissal types with their owner

Remove the type cycle between Inbox entries and dismissal storage by
moving the two dismissal types to the existing dismissal owner and
updating internal imports. Preserve runtime imports and behavior.

* refactor(gateway): apply request handler overrides once

---------

Co-authored-by: ruel225 <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 4, 2026
…5853)

* feat(control-ui): add human mentions and temporary inbox

Bind explicit composer selections to authorized human profiles and deliver
recipient-owned Inbox entries only after a fresh canonical user-message commit.
Carry selections through first sends, queues, recovery, and native transcript
mirrors without treating replay or rewritten content as a new mention.

Reuse existing profile/session visibility and Web Push owners. Keep the Inbox,
dismissals, and delivery dedupe bounded and process-local; no SQLite schema or
migration change. Add an optional default-off browser notification category.

Document the API, temporary retention, retry semantics, and notification limits.
Refs openclaw#135645.

* refactor(gateway): keep active-leaf response helper private

The responder is now called only inside its admission owner. Remove the obsolete export while preserving its response shape and control flow.

This clears the production and full-tree unused-export guard.

* refactor(mentions): consolidate visibility and commit ownership

Reuse profile session filters instead of fabricating recipient clients.
Derive request types from the wire schema, reuse sanitized input, carry one
Codex persistence receipt, and let Inbox rows own their navigation target.

Preserve current permissions, replay fencing, and explicit dismissal.
No schema, migration, configuration, or protocol changes.

* test: fix cache restore and sidebar navigation fixtures

Seed only historical declaration chunks outside the final cache inventory,
so the portable restore still proves every owned output byte. Reuse the
test-only repair from upstream 670a5b5.

Wait for committed routes before interacting with the Inbox after navigation,
while preserving every click and scope/dismissal check. Capture diagnostics
before closing the browser on failure.

Co-authored-by: ruel225 <[email protected]>

* fix(ci): align checkout history and fixture readiness

Reuse the authenticated security-history checkout repair from openclaw#136232.
Wait for rendered Android model labels and align the plaintext bootstrap
fixture with its existing manual TLS preference.

Retain bounded Windows termination diagnostics and both primary and cleanup
failures without changing process-tree acceptance or shutdown deadlines.

* fix: publish real profile changes and stabilize CI fixtures

Emit profile invalidations only after an effective state write, through the
existing synchronous transaction and post-commit owner.

Keep shared Gateway test config at its owner and carry explicit model config
across preparation. Reuse the bounded subprocess helper for complete CLI JSON.
Preserve the alias regression cases in their existing owning test suite.

This repair adds no schema, Gateway configuration, protocol, or dependency.

* perf(control-ui): keep inbox state behind its lazy owner

Create mention state with the application-owned Inbox controller, retain it
across presenter remounts, and dispose it with that owner. Keep dismissal
identity policy in the dismissal store so startup does not load the full
Inbox projection. Preserve authorization, persistence, and size limits.

Co-authored-by: ruel225 <[email protected]>

* perf(control-ui): load compact menu styles with their renderer

Keep shared sidebar and chat-header compact menu styles with the module
that renders them instead of the startup shell. Preserve all declarations
and the existing startup size limit.

Co-authored-by: ruel225 <[email protected]>

* fix(ci): account for the human mentions schema owner

Keep the registry inventory check aligned with the additional reviewed
human-mentions module. No runtime or generated protocol change.

* refactor(control-ui): import mention type from its protocol owner

Use the same public type directly instead of the chat re-export. This
also resolves the adjacent-import conflict with current main without
changing emitted JavaScript or pulling unrelated changes into the PR.

* refactor(control-ui): keep dismissal types with their owner

Remove the type cycle between Inbox entries and dismissal storage by
moving the two dismissal types to the existing dismissal owner and
updating internal imports. Preserve runtime imports and behavior.

* refactor(gateway): apply request handler overrides once

---------

Co-authored-by: ruel225 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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