Skip to content

fix(sourcehunt): make Semgrep explicitly opt-in - #197

Merged
ehartford merged 2 commits into
mainfrom
codex/upstream-semgrep-venv
Aug 30, 2026
Merged

fix(sourcehunt): make Semgrep explicitly opt-in#197
ehartford merged 2 commits into
mainfrom
codex/upstream-semgrep-venv

Conversation

@ropoctl

@ropoctl ropoctl commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Summary:

  • install the SourceHunt extra reproducibly in the container without activating Semgrep
  • default Semgrep off in runner/config/CLI and machine API paths
  • expose explicit --semgrep and strict machine request semgrep: true|false activation
  • propagate the setting through one-shot, watch, webhook, and machine execution
  • prefer the Semgrep executable beside the running Python after activation, so absolute venv/systemd launches do not depend on ambient PATH
  • reject Semgrep with the proof flow instead of silently ignoring it

Contract:

  • installation or discoverability alone never activates Semgrep
  • standard/deep depth no longer implies Semgrep
  • explicit CLI or machine API policy is required

Tests:

  • 38 passed: Semgrep runner/config/CLI/machine/sidecar contract and machine protocol
  • 14 passed: flow compatibility and commit-monitor propagation
  • Ruff passed on all changed Python files
  • git diff --check passed

@ropoctl
ropoctl requested a review from ehartford as a code owner August 29, 2026 06:24
@ropoctl
ropoctl force-pushed the codex/upstream-semgrep-venv branch from 4badbe7 to acab0e6 Compare August 29, 2026 06:40
@ropoctl ropoctl changed the title fix(sourcehunt): resolve Semgrep from active Python fix(sourcehunt): make Semgrep explicitly opt-in Aug 29, 2026
Resolve the runner.py validation conflict as a union: keep both main's
stop_after proof-flow guard (#193) and this branch's Semgrep proof-flow
guard. Both are additive fail-closed checks in the same block.

Document the opt-in contract in docs/cli.md: Semgrep is off by default,
standard/deep no longer imply it, installation/discoverability never
activates it, --semgrep (or machine semgrep: true) is required, and it is
legacy-flow only.
@ehartford
ehartford merged commit 3d124cc into main Aug 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants