Repository navigation
Description
Split from #5083.
semgrep 1.183.0 and later publish no Intel-Mac wheel, so the compiled src/devops_cli/tools_lock/semgrep.txt has 7 hashes in place of 8 and devops install-tools --tool semgrep fails on darwin-amd64. This issue waits on upstream semgrep publishing an Intel-Mac wheel again. It is deferred from #5083 so that the scanner record route and the osv-scanner, pluto and tflint updates can land.
Acceptance criteria:
- The tools lock pins the newest semgrep release whose compiled requirements file lists the Intel-Mac wheel, and
src/devops_cli/tools_lock/semgrep.txtholds the matching hashes. - The semgrep clean run in
tests/fixtures/scanner_runs/recorded_runs.jsonand the semgrep canary output intests/fixtures/review_canary/recorded_outputs.jsonare recorded again with the new pin inside pytest. tests/security/test_scanner_contract.py::test_each_recording_is_of_the_version_the_tools_lock_pinspasses with the new pin.src/devops_cli/review/rules/rules.locknames the new semgrep version, andtests/commands/test_review_rules_pack.pypasses.devops install-tools --tool semgrepinstalls the pin on darwin-amd64.
Proposed design
Problem statement
semgrep 1.183.0 and later publish no Intel-Mac wheel. The darwin-amd64 install of semgrep fails with a missing hash, so the repository cannot move its semgrep pin past 1.182.0. When upstream publishes the wheel again, the pin, the two scanner recordings and the rule pack move to the new release.
Acceptance criteria
Requirement: Semgrep pin has an Intel-Mac wheel
The semgrep version that the repository pins SHALL be the newest release whose requirements file lists the darwin-amd64 wheel.
Scenario: Install of the pinned semgrep on darwin-amd64
- WHEN the pinned semgrep is installed on darwin-amd64 and
semgrep --versionruns - THEN the command prints the pinned release and the install reports no missing hash.
Requirement: Scanner recordings hold the new semgrep run
The semgrep entries of tests/fixtures/scanner_runs/recorded_runs.json and tests/fixtures/review_canary/recorded_outputs.json MUST state the pinned release.
Scenario: Scanner contract test replays the new recordings
- WHEN
uv run pytest tests/security/test_scanner_contract.pyruns - THEN every case passes, and the semgrep cases replay the re-recorded run and the re-recorded canary output.
Requirement: Rule pack passes with the installed semgrep
The review rule pack MUST pass its check with the pinned semgrep on PATH.
Scenario: Rule pack check under the pinned semgrep
- WHEN
uv run devops review rules test --checkruns with the pinned semgrep on PATH - THEN the command exits 0 and prints the pinned semgrep version.
Requirement: Rules lock holds no semgrep version
src/devops_cli/review/rules/rules.lock MUST hold no semgrep version, and RulesLock MUST refuse a semgrep_version field.
Scenario: Lock entry with a semgrep version does not load
- WHEN
uv run pytest tests/commands/test_review_rules_pack.py::test_a_lock_entry_with_a_semgrep_version_does_not_loadruns - THEN the case passes, and the model raises a validation error that names
semgrep_version.
Existing Tool Considered
No alternatives check has run. semgrep is the open, maintained scanner that the repository already pins, and it covers the need: this item moves its pin and builds no code. The work waits on upstream semgrep, which publishes no darwin-amd64 wheel from 1.183.0.
Key questions
- Does
src/devops_cli/review/rules/rules.lockname the semgrep version?: No. The lock holdsrule_file,rule_sha256,test_fileandtest_sha256for each rule.RulesLockrefuses asemgrep_versionfield, because the installed semgrep states its own version (refactor(tools): read tool versions from the installed tool #4388). The body criterion that the lock names the new version cannot be built. [sources: src/devops_cli/review/rules/rules.lock, src/devops_cli/review/rules_pack.py:42, tests/commands/test_review_rules_pack.py] - Does the compiled tools lock still exist at
src/devops_cli/tools_lock/semgrep.txt, and does the body hash-count criterion hold?: No. ADR 0005 records that the tools lock is gone since chore(tools): remove devops install-tools and tools.lock #4363: the devtools image installs the review tools, and a review profile hashes the versions of its tool runs. The criterion thatsrc/devops_cli/tools_lock/semgrep.txtholds 8 hashes cannot be built as written. [sources: docs/adr/0005-review-findings-come-from-tools-not-models.md] - Where does the repository pin the semgrep version now?: The devtools image installs the review tools, so the pin lives there and not in a tools lock (ADR 0005 status history, chore(tools): remove devops install-tools and tools.lock #4363). Refine confirms the exact file at the head commit before implementation. [sources: docs/adr/0005-review-findings-come-from-tools-not-models.md]
- Does
tests/security/test_scanner_contract.pyhold the casetest_each_recording_is_of_the_version_the_tools_lock_pins?: No. The module holds four cases: the adapter replay, the registry fallback, the fake's PATH answer and the canary answer. No case reads a version from a lock. The body criterion that names that case cannot be built. [sources: tests/security/test_scanner_contract.py] - Which proof shows that the recordings and the rule pack use the new semgrep?: Re-record both fixtures through the scanner fake inside pytest, and run the rule pack check with the installed semgrep on PATH. No test reads a lock file, and the rule pack test uses a stand-in semgrep, so the live check is the proof of the installed version. (best practice) [sources: tests/security/test_scanner_contract.py, tests/commands/test_review_rules_pack.py]
- Chosen: Re-record inside pytest and run the rule pack check live. The scanner contract test replays each recording through the adapter, and the live check runs the real binary.
- Rejected: A pytest test that reads the pinned version from a lock file. The tools lock is gone, no test reads a lock file, and a test cannot show an install.
Fit
Fits in one pull request.
Suspected block
Upstream semgrep must publish a darwin-amd64 wheel for a release later than 1.182.0.
Dependencies
None.
Activity
devops-cli-service commentedon Nov 17, 2026
tools, and .github/labels.yml declares no scope/tools label. Add the label to the file to give the scope to this item.Both items work on the tools lock system, but #1142 builds the lock mechanism while this item updates one pin within it.devops-cli-service commentedon Nov 18, 2026
Owner question: Upstream semgrep must publish an Intel-Mac (darwin-amd64) wheel for a release later than 1.182.0.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
devops-cli-service commentedon Nov 21, 2026
Owner question: See Suspected block in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
dan-petty commentedon Nov 26, 2026
Closed: devops-cli no longer pins or installs semgrep.
#6555 deleted
devops install-toolsand the tools lock, so no darwin-amd64 install can fail here. dan-petty/devtools pins semgrep 1.187.0 for its Linux image. The scanner recordings are no longer tied to a version pin.