Repository navigation
fix(ci): make security-fast hooks network-free - #136388
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 2, 2026, 3:47 PM ET / 19:47 UTC. ClawSweeper reviewWhat this changesThis PR replaces remote pre-commit hook bootstrapping in the security-fast CI job with explicitly installed local scanners and adds executable workflow-contract coverage. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readinessKeep open. The fix is not on current main, the PR is maintainer-authored/protected, and the reviewed patch contains no concrete correctness finding; its exact-head CI is still queued. Priority: P2 Review scores
Verification
How this fits togetherThe security-fast GitHub Actions job scans pull requests for secrets and unsafe workflow changes before the wider CI matrix proceeds. It selects trusted scanner policy, invokes the scanners, and reports the result to the pull-request gate. flowchart LR
A[Pull request or push] --> B[Security-fast workflow]
B --> C[Trusted scanner policy]
C --> D[Local scanner hooks]
D --> E[Secret and workflow checks]
E --> F[CI status]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +280, Config -1. Total +279 across 3 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the local-hook and immutable-policy design, then land after the queued exact-head security-fast path confirms the same scanner coverage on GitHub Actions. Do we have a high-confidence way to reproduce the issue? Yes. Current main's remote-backed pre-commit configuration and the PR-provided hosted failures establish a clear fresh-cache failure path, although this read-only review did not rerun it. Is this the best way to solve the issue? Yes. The workflow owner replaces remote hook initialization with explicitly installed local executables while retaining the existing filters and trusted-policy boundary; current main confirms the problem is not already solved. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2c2e5014f71a. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles) |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Maintainer verification — mergedMerged through the native prepare/merge workflow as 1b535dd2f4fb at 20:06:10 UTC on September 2. GitHub confirms Vincent Koc as the commit author. The verified pre-merge head was fdd4f3e, whose complete source tree is byte-identical to Vincent's reviewed The repaired failure was pre-commit's remote-hook initialization, before private-key detection. Local/system hooks retain the pinned scanner versions, filters, immutable-base policy selection and fail-closed behavior. Actual scanner executions accepted clean input, rejected a temporary private key and an unsafe workflow, ignored candidate hook/policy poisoning, and rejected missing exact-base policy. Those invocations made zero network Git attempts and created no remote-hook repository cache entries. This removes remote Git hook downloads; it does not make package installation or every possible scanner HTTP request offline. Verification includes 744 scanner/routing/workflow-guard tests with two existing skips, canonical workflow sanity, changed-file formatting/typechecking/guards/lint, and fresh full-branch Codex review through P2 with no actionable findings. The actual pinned-scanner proof covers the unchanged workflow bytes. Exact-head CI run 33674687418 completed successfully at 20:00:58 UTC, including the actual security-fast scanner steps, all 14 UI end-to-end shards and both Windows jobs. The required Earlier baseline failures were repaired separately on main: authenticated checkout, the CLI test split, and queue synchronization. The temporary baseline-repair candidate passed 45 real CLI process cases, six queue-ownership cases and the exact 16-file gateway subgroup (30 passed, one existing Mac-only skip); the original queue assertion was reproduced failing in that same shared-worker order. Those temporary copies were removed once main owned the canonical fixes. The final scheduled UI shard passed; this is not a claim that an intermittent UI root cause was repaired here. The actual landed commit changes exactly three files: workflow +30/-31 (net -1), tests +280/-0. No runtime, runner-policy, UI or additional test changes are included. Post-merge inspection confirmed the active scanner path remains the reviewed local-hook implementation. The canonical checkout is clean on main and was fast-forwarded to the merge. |
|
Landing evidence for exact head
Current main is |
|
@clawsweeper re-review Exact head Proof: focused security-fast + test-projects passed |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Reuse the gateway CLI fixture cleanup from #136469 (667ce2b) and the landed startup-recovery queue assertions from #136473 (564e544). These address independent lint and shared-worker test failures while preserving all process, state, cancellation, and survivor assertions. Keep Vincent Koc's scanner implementation and original PR ancestry unchanged. The new commit also refreshes pull-request CI against main's authenticated checkout repair from #136178.
Remove the temporary copies of the CLI fixture and startup queue test fixes. Main now owns the CLI suite split in aef65cc and queue assertions in #136473. Keeping the earlier fixture cleanup here conflicts with main's new shared test support and health suite. Restore the cumulative PR tree exactly to Vincent Koc's reviewed 4a35cef without replacing his ancestry. The merge then retains main's canonical test repairs and authenticated checkout fix from #136178.
|
Merged via squash.
|
Use local/system pre-commit hooks for the exact pinned private-key and workflow scanners. This removes remote Git downloads from hook initialization, which previously failed on GitHub authentication before detection could run. Package installation remains a separate networked step. Keep immutable trusted policy, existing scanner filters, and non-persisted checkout credentials. Add trusted-policy and fail-closed regression coverage and route it into the script-test inventory. Actual pinned scanner fixtures confirm clean inputs pass, private keys and unsafe workflows fail, candidate policy cannot override trusted policy, and missing immutable-base policy fails closed. Hook execution makes no network Git requests. Verification: 744 focused tests passed with two existing skips; workflow sanity and changed-file formatting, typechecking, guards, and lint passed. Fresh independent Codex review found no actionable findings. Exact-head pull-request CI and the required openclaw/ci-gate passed: https://github.com/openclaw/openclaw/actions/runs/33674687418 Co-authored-by: Vincent Koc <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Resolves an intermittent
security-fastfailure where pre-commit bootstraps remote hook repositories after checkout credentials have intentionally been removed. Fresh runners can then fail beforedetect-private-keyruns, even when the pull request did not change scanner configuration.Why This Change Was Made
security-fastnow installs the exact scanner packages and generates one trustedrepo: local,language: systemconfiguration inRUNNER_TEMP. Pull requests load zizmor policy strictly from the exact base SHA; push and manual runs use the policy fromgithub.workflow_sha.This removes candidate-config and moving-branch fallbacks while preserving
persist-credentials: false, the existing detect-private-key and zizmor filters, types, arguments, and serial execution.User Impact
No runtime or product behavior changes. CI secret and workflow scanning no longer depends on anonymous GitHub hook-repository bootstrap, and pull requests cannot select their own scanner policy.
Root Cause And Owner
The
security-fastjob owned a remote-backed pre-commit configuration. Pre-commit initializes remote repositories before filtering to the requested hook, so an empty cache can execute an unauthenticatedgit fetch origin --tagsbefore the scanner starts.The canonical owner repair is in
.github/workflows/ci.yml: install the pinned scanner executables once, invoke them through local system-language hooks, and select policy only from trusted immutable revisions. No token injection, URL rewrite, retry, timeout workaround, or helper script is added.Evidence
Hosted Pre-Fix Reproductions
ba74bc7fa21b7b36efacc0b6de9a7476f99d10ea:security-fastfailed atDetect committed private keysaftergit fetch origin --tagscould not authenticate. https://github.com/openclaw/openclaw/actions/runs/33641446332/job/1002852547092dfe731d6ca40a3b7fcfcc0bdb83f03acf3d8d3b: same step, command, and unauthenticated bootstrap failure. https://github.com/openclaw/openclaw/actions/runs/33642086314/job/100287789482aff8d07a81f876f1ee8d5251e4cb8f964634d7a9: the failure repeated at the same step with exit code 3. https://github.com/openclaw/openclaw/actions/runs/33646162639/job/100301330667Local Pre-Fix Reproduction
With an empty
PRE_COMMIT_HOME, the pre-fix workflow contract failed before scanner execution:The locally available pre-commit 4.3.0 attempted to initialize
https://github.com/pre-commit/pre-commit-hooks, reachedgit fetch origin --tags, and exited 3 because HTTPS was forbidden. The host package index does not expose 4.6.2, so this is contract reproduction, not exact-pin execution proof.Regression Boundary
test/scripts/ci-security-fast-workflow.test.tsfailed 3/3 because the local-only trusted scanner-config owner did not exist and the workflow retained remote/candidate fallbacks.require_serial, local-only repositories, missing-base fail-closed behavior, push/manual harness policy, poisoned-candidate rejection, and a Git deny wrapper that catches network verbs after global options such asgit -c..github/workflows/ci.yml; its previously failing focused case passes.0.93).Remote Real-Tool Proof
The first ready-state exact-head attempt on
8484d958cfb2a9c60bca0175eaf6b761ffd9328afailed before execution becausesecurity-fast,preflight, and ARM each received zero-step runners. A single failed-job rerun then executed successfully:security-fastjob: https://github.com/openclaw/openclaw/actions/runs/33648964471/job/100318313905The earlier standalone Testbox candidate proof remains unavailable:
blacksmith-testboxtbx_01m1hakya5249xadn6w6cqthc4The successful hosted
security-fastrerun supplies the real pinned-tool execution proof; the executable regression supplies deterministic trusted-policy, poisoned-candidate, and network-Git contract coverage. Fresh exact-head CI is still required after the test-routing follow-up commit.Validation
testRootandtoolingfor the workflow and both owning tests.actionlint: passed.pnpm check:workflowsis unavailable because the configured host package index stops at pre-commit 4.3.0.Change Surface
+30/-31, net-1.+302/-0.Landing Gate
Merge remains blocked until patched
security-fastand all required exact-head CI checks pass on979ed7d6108. The failed standalone Testbox infrastructure attempt is not candidate proof and must not be used as merge evidence.Dependency And Codex Contract Checks
Upstream pre-commit source confirms Git environment cleanup preserves
GIT_ALLOW_PROTOCOLandGIT_CONFIG_*, while remote repository initialization can fetch before hook filtering. The pinned pre-commit-hooks and zizmor metadata were checked for the effective entry points, filters, arguments, and serial semantics.Sibling Codex source was inspected at
5f49aba876922d6f2f55caa153bbb0ed1b46feba, includingcodex-rs/git-utils/src/info.rs,codex-rs/core-plugins/src/startup_sync_tests.rs, andcodex-rs/sandboxing/src/seatbelt_tests.rs. No Codex runtime or protocol change is involved.Agent Transcript
Redacted implementation transcript
security-fastowner repair with an exact local-hook, trusted-policy, pinning, LOC, testing, and landing scope.-1while preserving the reviewed hook filters, types, arguments, serial behavior, immutable policy selection, and credential boundary.origin/main; focused post-rebase tests, actionlint, formatting, type-aware lint, and diff checks passed.