Repository navigation
Description
Friction
_classify_scanner_files in src/devops_cli/ai/review/pipeline.py puts every file that ends in .lock or .lockb in the lockfile bucket, and the bucket goes to osv-scanner as --lockfile arguments. A file such as src/devops_cli/review/rules/rules.lock or src/devops_cli/tools_lock/tools.lock is no lockfile that osv-scanner reads.
Evidence
On 2026-11-04 with osv-scanner 2.6.0: osv-scanner scan source --format json --offline --offline-vulnerabilities --all-packages --all-vulns --lockfile uv.lock --lockfile src/devops_cli/review/rules/rules.lock printed could not determine extractor suitable to this file: ".../rules.lock" on stderr, exited with 127 and printed no report. So the scan of a review that covers such a file reports a failure and gives no advisory for the real lockfiles.
What should happen
The bucket takes a file as a lockfile only when its name is in CONST_LOCKFILE_NAMES, as OsvScanner does since #2131. A test pins that a rules.lock is no lockfile.
Proposed design
Problem statement
The review pipeline sends every file that ends in .lock or .lockb to osv-scanner as a lockfile. osv-scanner rejects files such as rules.lock and exits with 127. The scan then reports a failure and gives no advisory for real lockfiles. The fix limits the osv-scanner lockfile bucket to CONST_LOCKFILE_NAMES.
Acceptance criteria
Requirement: Known lockfile names only
The scanner file classification SHALL place a file in the lockfile bucket only when its name is in CONST_LOCKFILE_NAMES.
Scenario: rules.lock and tools.lock are excluded
- WHEN the classifier receives src/devops_cli/review/rules/rules.lock, src/devops_cli/tools_lock/tools.lock, and uv.lock
- THEN the lockfile bucket contains uv.lock and does not contain src/devops_cli/review/rules/rules.lock or src/devops_cli/tools_lock/tools.lock.
Requirement: osv-scanner gets only real lockfiles
The review pipeline MUST pass only files in the lockfile bucket to osv-scanner as --lockfile arguments.
Scenario: Scan arguments omit rules.lock
- WHEN the pipeline scans a review that covers src/devops_cli/review/rules/rules.lock and uv.lock
- THEN the osv-scanner invocation receives uv.lock as a --lockfile argument and receives no --lockfile argument for src/devops_cli/review/rules/rules.lock.
Requirement: Regression test pins rules.lock exclusion
The test suite SHALL pin that a file named rules.lock is not classified as a lockfile.
Scenario: Regression test for rules.lock
- WHEN the test classifies src/devops_cli/review/rules/rules.lock
- THEN the test asserts that the lockfile bucket does not contain the file.
Existing Tool Considered
No alternatives check has run. osv-scanner 2.6.0 is already pinned in src/devops_cli/tools_lock/tools.lock. It covers dependency scans for supported lockfiles. It lacks support for arbitrary .lock files such as rules.lock and tools.lock, so the pipeline must filter by CONST_LOCKFILE_NAMES. The change modifies one filter and adds one test. It builds no replacement tool.
Key questions
- Which files should the review pipeline put in the osv-scanner lockfile bucket?: Only files whose name is in CONST_LOCKFILE_NAMES. A .lock or .lockb suffix alone does not qualify. (best practice) [sources: src/devops_cli/ai/review/pipeline.py, src/devops_cli/config/constants.py, src/devops_cli/security/osv_scanner.py]
- Chosen: Use the CONST_LOCKFILE_NAMES allowlist. This matches OsvScanner since feat(review): one devops command fetches the osv-scanner and trivy databases that a sandboxed review binds read-only #2131 and keeps rules.lock and tools.lock out of osv-scanner.
- Rejected: Keep .lock and .lockb suffix detection. osv-scanner rejects rules.lock with exit 127 and reports no advisory for real lockfiles.
- Rejected: Detect lockfiles by file content. The repository already keeps a maintained allowlist, and content detection adds code that osv-scanner does not require.
- Should the allowlist filter apply to files that _lockfiles_beside adds?: Yes. The bucket SHALL add a file from _lockfiles_beside only when its name is in CONST_LOCKFILE_NAMES. (best practice) [sources: src/devops_cli/ai/review/pipeline.py, src/devops_cli/config/constants.py]
- Chosen: Filter the whole bucket by CONST_LOCKFILE_NAMES. One rule controls every lockfile entry and prevents a second path for unsupported files.
- Rejected: Filter only suffix matches from all_resolved. A file from _lockfiles_beside could still reach osv-scanner.
- Rejected: Leave _lockfiles_beside unchanged. The bucket could still contain a file that osv-scanner cannot read.
- Which test should pin the fix?: Extend tests/security/test_review_pipeline_go.py with a case that classifies rules.lock and asserts that the lockfile bucket does not contain it. (best practice) [sources: tests/security/test_review_pipeline_go.py, src/devops_cli/ai/review/pipeline.py]
- Chosen: Extend the existing pipeline test. The file already tests _classify_scanner_files and keeps the regression near related cases.
- Rejected: Add a separate test module. The existing test file already covers the classifier, so a separate module adds no coverage.
- Rejected: Use an integration test with osv-scanner. An offline unit test pins the classification without the scanner binary.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 4, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
fixprefix of the title gives the type.(review)scope of the title gives the scope.The bug causes osv-scanner to exit 127 and produce no advisory output, blocking the entire review scan when any non-standard .lock file is present.Users receive no advisory data at all when a non-standard .lock file appears in the review, making the security scan useless.The fix changes a suffix match to a name lookup against CONST_LOCKFILE_NAMES and adds one test, a small targeted change.Both items work on the osv-scanner integration in the review pipeline, but #2131 fetches databases while the candidate fixes file classification to use CONST_LOCKFILE_NAMES.devops-cli-service commentedon Nov 4, 2026
Status set to Ready at 1ad0e59 (see proposed design in issue body).
feat(review): one command fetches the osv and trivy databases (#3543)
[-]fix(review): the review pipeline hands osv-scanner every .lock file as a lockfile[/-][+]fix(review): Limit lockfile bucket to CONST_LOCKFILE_NAMES[/+]dan-petty commentedon Nov 6, 2026
The job shortened the title of this item. The summary had 68 characters, and the limit is 60. The type and the scope stay.
fix(review): the review pipeline hands osv-scanner every .lock file as a lockfilefix(review): Limit lockfile bucket to CONST_LOCKFILE_NAMESdevops-cli-service commentedon Nov 6, 2026
Staged: branch
fix/3536-limit-lockfile-bucket-to-const-lockfile, draft pull request #3808. The pull request plans the item and closes no issue.The task groups, with the tokens of the inputs of each step, for a budget of 64000 tokens:
A model review of the plan found these points. They stop no draft, and a person judges them:
otherat group 1 / decisions: Changing_lockfiles_besideto filter by CONST_LOCKFILE_NAMES also changes the shared helper that_collect_scanner_commit_filesuses to build the allowed commit-file set, and the plan touches neither that caller nor its test, which calls the helper directly. Evidence: "_lockfiles_besideinsrc/devops_cli/ai/review/pipeline.pyadds only files whose name is inCONST_LOCKFILE_NAMES, so no other path reaches the lockfile bucket."The runs of the planner and the review made 14 model request(s), and used 461318 input tokens and 11726 output tokens. The tool calls, in order:
search_code({"text":"_classify_scanner_files"})search_code({"text":"CONST_LOCKFILE_NAMES"})read_spec({"capability":"review-tool-databases","requirement":"osv-scanner is named only files that it reads as lockfiles"})read_file({"path":"src/devops_cli/ai/review/pipeline.py","start_line":1600,"end_line":1720})read_file({"path":"tests/security/test_review_pipeline_go.py"})read_file({"path":"src/devops_cli/config/constants.py","start_line":4910,"end_line":4950})search_code({"text":"CONST_REVIEW_GENERATED_FILES"})search_code({"text":"lockfiles="})read_file({"path":"src/devops_cli/security/osv_scanner.py","start_line":200,"end_line":250})search_code({"text":"classify_scanner_files"})search_code({"text":"CONST_LOCKFILE_NAMES"})read_file({"path":"src/devops_cli/ai/review/pipeline.py","start_line":1595,"end_line":1675})read_file({"path":"tests/security/test_review_pipeline_go.py"})search_code({"text":"CONST_REVIEW_GENERATED_FILES"})search_code({"text":"classify_scanner_files"})search_code({"text":"CONST_LOCKFILE_NAMES"})read_file({"path":"src/devops_cli/ai/review/pipeline.py","start_line":1590,"end_line":1700})search_code({"text":"_lockfiles_beside"})read_file({"path":"src/devops_cli/ai/review/pipeline.py","start_line":340,"end_line":420})read_file({"path":"src/devops_cli/config/constants.py","start_line":4900,"end_line":4970})search_code({"text":"CONST_REVIEW_GENERATED_FILES"})read_file({"path":"tests/commands/test_review_scope.py","start_line":380,"end_line":420})Tool calls: read_file=10 (empty=0), read_spec=1 (empty=0), search_code=11 (empty=0)
The stage job read the open pull requests and their files in 1 GraphQL request(s).
6 remaining items
docs(openspec): plan #3536 Limit the review lockfile bucket to known …
fix(review): Pin the lockfile bucket to CONST_LOCKFILE_NAMES (#3536)
docs(openspec): archive the change (#3536)
fix(review): Make check Plan Check pass (#3536)
fix(review): Make check Tests & Coverage pass (#3536)
devops-cli-service commentedon Nov 6, 2026
Pull request #3808 is ready for review. The checks passed.
Spend: 128 model requests, 7818001 input tokens, 59833 output tokens.
fix(review): Drop the plan-check change from the lockfile fix (#3536)
devops-cli-service commentedon Nov 6, 2026
The runner Job devops-cli-runner-20261106-170711-fd99 ended: succeeded.
Image digest: sha256:a9dc6858faa3d5935996a1419736ced97d308ec525ba1ca5667def0b7f4add5f
The last lines of its log:
devops-cli-service commentedon Nov 6, 2026
Released in v0.71.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.71.0
devops-cli-service commentedon Nov 6, 2026
Live since 2026-11-06 19:47 UTC