Skip to content

fix: remove unavailable OpenGrep install alternatives - #130585

Merged
steipete merged 1 commit into
mainfrom
steipete/gifted-meitner-941e83
Aug 27, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/gifted-meitner-941e83

Conversation

@steipete

Copy link
Copy Markdown
Contributor
Additional instructions

Maintainers can edit this same-repository branch.

What Problem This Solves

Fixes an issue where developers running the local OpenGrep scan without OpenGrep installed would receive installation commands for an unavailable PyPI package and an unavailable Homebrew tap.

The diagnostic still recommended pipx install opengrep and brew install opengrep/tap/opengrep. Live checks returned HTTP 404 for both the PyPI package endpoint and the Homebrew tap repository endpoint.

Why This Change Was Made

Keep the existing pinned official GitHub installer and remove the unsupported alternatives from the missing-tool diagnostic. The publisher's current installation instructions document the GitHub installer and release binaries; the retained v1.27.1 installer supports the existing version-selection argument.

This is a diagnostic-only repair at the script's missing-dependency boundary. Scan flags, rulepack selection, path selection, output handling, exit status, and all dependency pins remain unchanged. No new installer or fallback path is introduced.

User Impact

Developers who are missing OpenGrep receive the official installation command rather than dead-end package-manager alternatives. Existing installations and CI scans behave exactly as before.

AI-assisted with Codex; the change and validation were reviewed by the maintainer's agent.

Evidence

  • Added one subprocess-boundary regression to test/scripts/run-opengrep.test.ts, using an isolated PATH containing Bash and the required system utilities but no OpenGrep. It checks exit 127, empty stdout, actionable official-installer guidance, absence of the unavailable alternatives, and no scan-output directory.
  • Red proof against the original script: the new test failed specifically because stderr contained pipx; five existing tests were skipped for that focused run.
  • Green proof: node scripts/run-vitest.mjs test/scripts/run-opengrep.test.ts — all 6 tests passed, including existing rulepack, empty-SARIF, Git-discovery-failure, and merge-base cases.
  • bash -n scripts/run-opengrep.sh and node_modules/.bin/oxfmt --check test/scripts/run-opengrep.test.ts passed.
  • node scripts/check-changed.mjs -- scripts/run-opengrep.sh test/scripts/run-opengrep.test.ts passed, including the selected guards, formatting, root-test typecheck, and script lint. An initial worker attempt could not fetch pnpm signature metadata; the unchanged gate subsequently passed locally without disabling verification or changing dependencies.
  • Executed the actual worktree script with OpenGrep absent from an isolated PATH: exit 127 with the corrected stderr diagnostic. Verified all script bytes outside the missing-tool heredoc are unchanged from the pre-fix script.
  • Independent autoreview reported no accepted/actionable findings; refreshed before commit.
  • Scope: tooling +1/-3 (net -2); tests +31/-0. No lockfile, version, workflow, or dependency-pin edits.

@clawsweeper

clawsweeper Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: XS maintainer Maintainer-authored PR labels Aug 27, 2026
@steipete
steipete marked this pull request as ready for review August 27, 2026 01:53
@steipete steipete self-assigned this Aug 27, 2026
@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 Aug 27, 2026
@clawsweeper

clawsweeper Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 10:01 PM ET / August 27, 2026, 02:01 UTC.

ClawSweeper review

What this changes

Updates the local OpenGrep scan script’s missing-binary diagnostic to retain the pinned official installer and remove unavailable Homebrew and PyPI alternatives, with a subprocess regression test.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

This PR remains necessary: current main still tells local users to install unavailable OpenGrep alternatives, while the branch removes only those dead-end instructions and adds boundary-level coverage.

Priority: P2
Reviewed head: 7415491d399e97288a1e5c58eea8273a0d3e12e0

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-covered diagnostic repair with no actionable patch defect found.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its submitted isolated-PATH script run and regression result are supporting evidence.
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 PR is exempt from the external-contributor proof gate; its submitted isolated-PATH script run and regression result are supporting evidence.
Evidence reviewed 6 items Current-main behavior: Current main still prints both the unavailable Homebrew tap and PyPI alternatives in the missing-binary diagnostic.
Narrow owner-boundary repair: The branch changes only the diagnostic heredoc, preserving the existing pinned installer and exit-127 behavior before scan-flag processing.
Behavior-oriented regression coverage: The new test runs the actual shell script with an isolated PATH lacking OpenGrep, checks exit 127 and the retained installer guidance, and confirms no output directory or removed advice is emitted.
Findings None None.
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs test/scripts/run-opengrep.test.ts

Result: FAIL (failed) — step 1 run node scripts/run-vitest.mjs test/scripts/run-opengrep.test.ts: previous terminal command was still running after 30 seconds: "node scripts/run-vitest.mjs test/scripts/run-opengrep.test.ts"

[test] starting test/vitest/vitest.tooling.config.ts

 RUN  v4.1.11 /tmp/clawsweeper-live-proof-130585-hMkyKA/target

→ Running opengrep (precise) against scripts/run-opengrep.sh
  Using exclusions from .semgrepignore
→ No changed first-party paths for opengrep.
→ Running opengrep (precise) against src/pr.ts
  Using exclusions from .semgrepignore
 ✓  tooling  test/scripts/run-opengrep.test.ts (6 tests) 356ms

 Test Files  1 passed (1)
      Tests  6 passed (6)
   Start at  02:02:40
   Duration  802ms (transform 228ms, setup 54ms, import 18ms, tests 356ms, environment 0ms)

[test] passed 1 Vitest shard in 7.40s

Assertions:

  • FAIL expect_output: fails before scanning with official installation advice when opengrep is missing
  • FAIL expect_output: 6 passed

How this fits together

The local OpenGrep wrapper selects scan paths and invokes the scanner for developers and CI. Its early missing-binary branch is the local operator’s installation guidance before any scan output is created.

flowchart LR
  A[Developer runs local scan] --> B[OpenGrep wrapper]
  B --> C{Binary on PATH?}
  C -- No --> D[Installation diagnostic]
  D --> E[Supported installer guidance]
  C -- Yes --> F[Scan selected paths]
  F --> G[Terminal or SARIF output]
Loading

Before merge

  • Complete next step (P2) - This is an active maintainer-authored, maintainer-labeled PR with no discrete automation repair to queue.
Agent review details

Security

None.

PR surface

Tests +31, Other -2. Total +29 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 31 0 +31
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 3 -2
Total 2 32 3 +29

Review metrics

Metric Value Why it matters
Production versus test delta tooling -2, tests +31 The repair removes obsolete user guidance and adds isolated subprocess coverage without expanding the runtime surface.

Stored data model

Persistent data-model change detected: serialized state: test/scripts/run-opengrep.test.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Land the narrow diagnostic repair after the normal exact-head CI and mergeability gates complete, keeping the existing pinned installer as the single supported recommendation.

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

Yes—current main contains the exact stale diagnostic, and the added isolated-PATH subprocess test directly exercises the missing-binary branch; this read-only review did not execute it.

Is this the best way to solve the issue?

Yes—the patch fixes the message at its producing boundary and leaves scanning, output handling, and the existing pinned installer unchanged.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: The broken local developer diagnostic has limited blast radius and a focused repair.
  • 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 PR is exempt from the external-contributor proof gate; its submitted isolated-PATH script run and regression result are supporting evidence.

Label justifications:

  • P2: The broken local developer diagnostic has limited blast radius and a focused repair.
  • 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 PR is exempt from the external-contributor proof gate; its submitted isolated-PATH script run and regression result are supporting evidence.

Evidence

What I checked:

  • Current-main behavior: Current main still prints both the unavailable Homebrew tap and PyPI alternatives in the missing-binary diagnostic. (scripts/run-opengrep.sh:48, 96ea1e33ea63)
  • Narrow owner-boundary repair: The branch changes only the diagnostic heredoc, preserving the existing pinned installer and exit-127 behavior before scan-flag processing. (scripts/run-opengrep.sh:44, 7415491d399e)
  • Behavior-oriented regression coverage: The new test runs the actual shell script with an isolated PATH lacking OpenGrep, checks exit 127 and the retained installer guidance, and confirms no output directory or removed advice is emitted. (test/scripts/run-opengrep.test.ts:45, 7415491d399e)
  • Caller and sibling behavior: Both CI workflows install and verify the pinned OpenGrep release before calling this wrapper, so the changed branch affects local missing-tool guidance rather than CI scanning. (.github/workflows/opengrep-precise.yml:58, 96ea1e33ea63)
  • Feature provenance: History identifies Peter Steinberger as the author of the current script/test area; current main has not changed these paths since the PR base. (scripts/run-opengrep.sh:44, 3dd18ccc8ced)
  • Upstream dependency check limitation: The retained installer URL is an OpenGrep dependency-contract signal, but direct upstream retrieval was unavailable because DNS could not resolve GitHub, PyPI, or the GitHub API; the PR’s submitted live-check evidence remains uncontradicted. (scripts/run-opengrep.sh:49, 7415491d399e)

Likely related people:

  • steipete: Current-area history attributes the original wrapper and its test harness to Peter Steinberger, with subsequent adjacent OpenGrep maintenance. (role: introduced current script and test area; confidence: high; commits: 3dd18ccc8ced, 3fc7d8b9a351; files: scripts/run-opengrep.sh, test/scripts/run-opengrep.test.ts)

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.

@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready proof for reviewed head 7415491d399e97288a1e5c58eea8273a0d3e12e0.

The missing-dependency diagnostic was the owner of the invalid advice: it advertised an unavailable PyPI package and Homebrew tap. Removing those two alternatives is the canonical fix; replacing the installer or adding fallback logic would widen this diagnostic-only repair. The official pinned v1.27.1 installer is unchanged, as are all script bytes outside the diagnostic. Production/tooling: +1/-3 (net -2); tests: +31/-0. Dependency pins and scan behavior are untouched.

Validation:

  • node scripts/run-vitest.mjs test/scripts/run-opengrep.test.ts — 6/6 passed, including a rerun at the exact published head. The new test was first demonstrated failing on the original script specifically at the unsupported-pipx assertion.
  • bash -n scripts/run-opengrep.sh — passed.
  • node_modules/.bin/oxfmt --check test/scripts/run-opengrep.test.ts — passed.
  • node scripts/check-changed.mjs -- scripts/run-opengrep.sh test/scripts/run-opengrep.test.ts — passed: selected guards, formatting, root-test types, and script lint. The initial worker registry/signature fetch failure was resolved by running the unchanged gate locally, without disabling verification.
  • git diff --check — passed.
  • Actual worktree script, with OpenGrep absent from an isolated PATH — exit 127, empty stdout, corrected official-installer diagnostic. The subprocess regression additionally verifies no scan-output directory is created.
  • Fresh independent autoreview — no accepted/actionable findings.
  • Exact-head CI run 33031560034 — completed successfully, including openclaw/ci-gate.
  • Exact-head OpenGrep scan run 33031559973 — completed successfully.
  • Native review artifacts are stamped for this head and passed scripts/pr review-validate-artifacts 130585.

Current-main check: the two affected files remain identical to the original pre-fix files at fetched main ba6034c2750547626fc1fde56f71cbe84d282c56; the defect has not been superseded. Historical provenance was checked beyond the local shallow boundary: the original advice is present in the script added by PR #69483, which introduced the OpenGrep detector workflow, authored and merged by @jesse-merhi in 6de9d71. The shallow local boundary was not treated as the introduction.

Proof scope: no publisher installer was executed and no broad local build/full suite was needed for this text-only production change. The real missing-tool flow, live publisher endpoints, existing scan-wrapper boundary tests, and hosted OpenGrep scan cover the changed contract and its sibling paths.

ClawSweeper currently has a review-started placeholder, not a verdict or Rank-up moves. Feedback will be checked again immediately before merge; pending review publication is not counted as approval. Live rules show no enforced independent-review requirement, and the maintainer role is explicitly exempt from the Clownfish binding rule. The CI gate is green; no rules or bypass settings were changed. Proceeding through the repository-native prepare/merge flow.

@steipete

Copy link
Copy Markdown
Contributor Author

Reviewed the newly published ClawSweeper review at the unchanged head 7415491d399e97288a1e5c58eea8273a0d3e12e0. It identifies no actionable patch or security findings; maintainer review and the landing decision are complete.

Two generated proof notes do not require source changes:

  • The live-verification result is internally inconsistent: it reports the command still running after 30 seconds, but its attached log ends with all 6 tests passing and the test wrapper reporting success in 7.40 seconds. Our independent exact-head invocation completed with exit 0 and 6/6 tests passing; exact-head CI also passed. The test-name output assertion is not a runtime behavior requirement. This does not replace a failing test with an exception: the observed tests passed. The proof-result/reporting mismatch is a separate ClawSweeper follow-up.
  • The “persistent data-model change” classifier points to test/scripts/run-opengrep.test.ts. The actual patch changes only a diagnostic heredoc and adds an isolated subprocess test; it changes no persistent store, schema, migration, or upgrade contract. No migration proof applies.

There is no Rank-up moves list or concrete source repair requested. The existing land-ready proof covers the changed owner boundary, current-main behavior, upstream checks, and exact-head gates. Proceeding with the repository-native prepare/merge flow without source changes or gate bypasses.

@steipete
steipete merged commit 7602af0 into main Aug 27, 2026
177 checks passed
@steipete
steipete deleted the steipete/gifted-meitner-941e83 branch August 27, 2026 02:20
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit to openclaw/clawsweeper that referenced this pull request Aug 27, 2026
Reuse the existing production-path scope for persistence detection so test fixture writes do not request migration proof. Preserve production, rename, semantic documentation, and unknown-evidence detection.

Includes the diagnostic-only diff from openclaw/openclaw#130585 as regression evidence; the already-landed OpenGrep fix is unchanged.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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: XS 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