Repository navigation
Description
Problem
devops ci audit reads two ignore files of its own, .osv-scanner-ignore.yaml and .npm-audit-ignore.yaml, with its own loader and filter (src/devops_cli/core/dependency_audit.py:91-162, src/devops_cli/commands/ci.py:427-470, constants.py:5258-5264). osv-scanner has a native config file (osv-scanner.toml) for the same need. All 6 osv entries name tools_lock/semgrep.txt, which #4363 deletes.
Change
After #4363 deletes tools_lock/semgrep.txt and the devtools image takes the npm lock folders:
- Delete
.osv-scanner-ignore.yamland.npm-audit-ignore.yaml, the loader and filter (dependency_audit.py:91-162, ci.py:427-470), and their tests and constants (constants.py:5258-5264). - A future ignore goes in
osv-scanner.tomlas[[IgnoredVulns]]witheffectiveUntil(ignoreUntilis deprecated) and a reason, or in[[PackageOverrides]]for a per-lockfile scope. - Keep the guard of SECURITY.md:91 and :93 (a date, a #N statement, no wildcard) with a check-jsonschema pre-commit hook on
osv-scanner.toml. - The devops-cli
package-lock.jsonof build(npm): make openspec and style-dictionary devDependencies #6409 stays in this repository. Audit it with osv-scanner, not npm audit. Update SECURITY.md (A Finding with No Fix) for the new file names.
Renovate. osv-scanner comes from the devtools mise.toml (mise manager). The pre-commit manager bumps the check-jsonschema rev.
Risk. The native config makes the expiry and the reason optional, so the schema check must stay. A root osv-scanner.toml does not apply to subfolders.
Proof
git grep -n load_osv_audit_ignoresgives nothing, anduv run devops ci auditpasses.- The PR compares the osv-scanner and npm audit results on
package-lock.json.
Depends on: dan-petty/devtools#1, #4363, #6409
Alternatives check of 2026-11-19: not-applicable.
Class: refactor, no search.
Tool: none found.
Proposed design
Problem statement
devops ci audit still keeps a custom ignore loader, filter, models, messages and constants for .npm-audit-ignore.yaml, because npm audit reads no ignore file. The six .osv-scanner-ignore.yaml entries and their loader are already gone with #4363, and the remaining npm ignore file holds no entry. osv-scanner has a native osv-scanner.toml config with [[IgnoredVulns]], and it can audit the root package-lock.json of #6409. The change deletes the npm ignore file, loader, filter, models, messages and constants, runs osv-scanner on the root lockfile, adds osv-scanner.toml with a check-jsonschema hook that keeps the SECURITY.md guard of an expiry date, a #N statement and no wildcard, and updates the guidance and the ci-dependency-audit spec.
Acceptance criteria
Requirement: Native config passes the schema hook
The repository SHALL validate osv-scanner.toml with the check-jsonschema pre-commit hook.
Scenario: The committed config passes the schema hook
- WHEN A developer runs
uv run pre-commit run check-jsonschema --files osv-scanner.toml. - THEN The hook exits 0 and reports no schema error.
Requirement: Schema requires expiry and tracking reason
The project schema MUST require effectiveUntil and a reason with a #N statement on each [[IgnoredVulns]] entry.
Scenario: An entry with no reason is refused
- WHEN A developer adds an
[[IgnoredVulns]]entry with noreasontoosv-scanner.tomland runsuv run pre-commit run check-jsonschema --files osv-scanner.toml. - THEN The hook exits non-zero and names
reason.
Requirement: Schema refuses a wildcard
The project schema MUST refuse an [[IgnoredVulns]] id that holds *.
Scenario: A wildcard entry is refused
- WHEN A developer adds an
[[IgnoredVulns]]entry with the idGHSA-*toosv-scanner.tomland runsuv run pre-commit run check-jsonschema --files osv-scanner.toml. - THEN The hook exits non-zero and names the
idfield.
Requirement: Custom npm ignore loader is removed
The project SHALL remove the custom npm ignore loader, filter, models, command builders, messages and constants.
Scenario: No custom npm ignore symbol remains
- WHEN A test searches
src/devops_cli/core/dependency_audit.py,src/devops_cli/commands/ci.py,src/devops_cli/config/commands.py,src/devops_cli/config/constants.pyandsrc/devops_cli/lang/en/messages.pyforload_npm_audit_ignores,active_npm_ignores,NpmAuditIgnore,AppliedIgnores,npm_advisory_ids,_read_npm_failure,build_npm_audit_cmd,npm_audit_lockfile,CONST_NPM_AUDIT_IGNORE_FILE,audit_ignoredandaudit_ignore_expired. - THEN The test finds none of these names.
Requirement: Custom ignore file is deleted
The repository SHALL delete .npm-audit-ignore.yaml and keep .osv-scanner-ignore.yaml absent.
Scenario: The custom ignore files are absent
- WHEN A developer runs
git ls-files .npm-audit-ignore.yaml .osv-scanner-ignore.yaml. - THEN The command prints no path.
Requirement: npm audit leaves the audit row
The audit row SHALL run no npm audit command.
Scenario: The audit command list holds no npm audit
- WHEN A test inspects the audit
CheckSpeccommands insrc/devops_cli/commands/ci.py. - THEN No command of the row has
npmas its program, and nobuild_npm_audit_cmdcall remains.
Requirement: Root package-lock is audited with osv-scanner
The audit row SHALL scan the root package-lock.json of #6409 with osv-scanner.
Scenario: The audit row scans the root lockfile
- WHEN A test inspects the audit
CheckSpeccommands insrc/devops_cli/commands/ci.py. - THEN The row holds an
osv-scannercommand whose arguments name the rootpackage-lock.json.
Requirement: The audit reads the osv-scanner exit status
The audit SHALL read an osv-scanner finding from exit code 1 and an audit that could not run from any other non-zero exit code.
Scenario: The osv-scanner verdict follows the exit code
- WHEN A test calls
audit_verdictwith anosv-scannercommand and exit code 1, then 2. - THEN The first call returns
VULNERABLEand the second returnsNOT_RUN.
Requirement: Guidance names the native config
SECURITY.md, docs/ROUTINE_TASKS.md and docs/SDLC.md SHALL name osv-scanner.toml for an ignore and osv-scanner for the audit of the root lockfile, and MUST NOT name the deleted ignore files.
Scenario: The guidance uses the native file name
- WHEN A test reads
SECURITY.md,docs/ROUTINE_TASKS.mdanddocs/SDLC.md. - THEN The text names
osv-scanner.tomlandosv-scanner, and contains neither.osv-scanner-ignore.yamlnor.npm-audit-ignore.yaml.
Requirement: Audit spec states the native config
The change SHALL carry a ci-dependency-audit spec delta that states the audit reads osv-scanner.toml and drops the npm audit and the two custom ignore files.
Scenario: The openspec gate accepts the change
- WHEN A developer runs
uv run devops ci --check --only openspec. - THEN The command exits 0, so the change folder's spec delta passes the OpenSpec gate.
Requirement: Audit row passes with the native config
devops ci audit SHALL pass after the change.
Scenario: The audit row passes with the native config
- WHEN A developer runs
uv run devops ci auditin the repository root. - THEN The command exits 0 and reports no unignored advisory.
Existing Tool Considered
osv-scanner (Google) is the open, maintained tool that covers the need: its native osv-scanner.toml holds [[IgnoredVulns]] with effectiveUntil and a reason, and it reads the config from the directory of the lockfile it scans (https://github.com/google/osv-scanner, fetched 2026-11-22). It lacks a mandatory expiry and reason, and it reads no config above the lockfile, so the change adds one osv-scanner.toml beside the root lockfile and a check-jsonschema pre-commit hook with a project schema. check-jsonschema (python-jsonschema) covers the schema validation of a TOML file and needs the project schema for these fields. The change builds no custom replacement for the ignore loader: it deletes the npm loader, filter, models, messages and constants and adds one schema file.
Key questions
- Which file holds the audit ignore entries after this change?:
osv-scanner.tomlin the directory of the lockfile it scopes. Each ignored advisory goes in[[IgnoredVulns]]with itsid,effectiveUntiland areasonthat names the tracking issue as#N. The file's directory gives the scope. The rootpackage-lock.jsonis the only lockfile that osv-scanner audits, so the repository holds one rootosv-scanner.toml. (best practice) [sources: src/devops_cli/security/osv_scanner.py:297, src/devops_cli/config/constants.py:5396-5404, tests/security/test_review_tool_runs.py:393-405, docs/SELF_IMPROVEMENT.md:699, https://github.com/google/osv-scanner]- Chosen: Native osv-scanner.toml. osv-scanner reads it and the project keeps no custom loader.
- Rejected: Keep .npm-audit-ignore.yaml. npm audit reads no ignore file, so the project must keep a loader and a filter.
- Rejected: Keep .osv-scanner-ignore.yaml. The file and its loader are already gone with chore(tools): remove devops install-tools and tools.lock #4363, and osv-scanner does not read it.
- How does the project keep expiry and reason mandatory in the native config?: Add a
check-jsonschemapre-commit hook onosv-scanner.tomlwith a project schema. The schema requireseffectiveUntiland areasonwith a#Nstatement, and it refuses a wildcard advisory ID. The hook checks the two rules of SECURITY.md that the native config drops. (best practice) [sources: SECURITY.md:91, SECURITY.md:93, .pre-commit-config.yaml:48]- Chosen: check-jsonschema hook. osv-scanner makes the expiry and the reason optional, and check-jsonschema is the open, maintained tool that validates a TOML file against a schema.
- Rejected: Rely on osv-scanner validation. The native config accepts an entry with no reason and no expiry.
- Rejected: A custom devops ci check. It builds and keeps code that check-jsonschema covers.
- Which tool audits the devops-cli npm lockfile of build(npm): make openspec and style-dictionary devDependencies #6409?:
osv-scannerscans the rootpackage-lock.json.npm auditreads no ignore file, so auditing the lock with it would keep the custom loader and filter that this change deletes. (best practice) [sources: src/devops_cli/commands/ci.py:882-886, src/devops_cli/config/commands.py:219-242, src/devops_cli/core/dependency_audit.py:7-15, package-lock.json]- Chosen: osv-scanner. It reads the native config and lets the custom filter go.
- Rejected: npm audit. It reads no ignore file, so the custom loader and filter must stay.
- What happens to the six osv ignore entries that name
src/devops_cli/tools_lock/semgrep.txt?: They are already gone. chore(tools): remove devops install-tools and tools.lock #4363 deletedsrc/devops_cli/tools_lock/semgrep.txt,.osv-scanner-ignore.yamland the osv-scanner audit of the tools lock; the archive records that.osv-scanner-ignore.yamlnamed only requirement files of the tools lock. The repository now holds only.npm-audit-ignore.yaml, and itsvulnerabilitieslist is empty. The new rootosv-scanner.tomlstarts with no[[IgnoredVulns]]entry. [sources: openspec/changes/archive/2026-11-20-4363-remove-tools-lock/specs/ci-dependency-audit/spec.md:12, openspec/changes/archive/2026-11-21-6480-bump-mcp-in-the-semgrep-lock/proposal.md:32-33, .npm-audit-ignore.yaml:1-4, src/devops_cli/config/constants.py:5415-5418] - How does the change handle the risk that a root
osv-scanner.tomldoes not apply to subfolders?: osv-scanner readsosv-scanner.tomlin the directory of each lockfile it scans and nowhere above it. After chore(tools): remove devops install-tools and tools.lock #4363, the only lockfile that osv-scanner audits is the rootpackage-lock.jsonof build(npm): make openspec and style-dictionary devDependencies #6409;uv.lockis audited byuv audit, which reads no osv-scanner config. One rootosv-scanner.tomlcovers the root lockfile. A future subfolder lockfile gets its ownosv-scanner.tomlbeside it. (best practice) [sources: src/devops_cli/security/osv_scanner.py:297, src/devops_cli/config/constants.py:5396-5404, tests/security/test_review_tool_runs.py:393-405, docs/SELF_IMPROVEMENT.md:699]- Chosen: One config beside each lockfile. The tool reads the config of the lockfile's own directory, and the only osv-scanner lockfile is at the root.
- Rejected: Root config for subfolders. A root config does not apply to a subfolder, and a test asserts that osv-scanner finds no config above the lockfile.
- Which committed files state the custom ignore behavior, and what must the change update?: The
ci-dependency-auditspec states it in its purpose, in the npm ignore requirement and in the root lockfile requirement.SECURITY.mdstates it in step 1 of A Finding with No Fix.docs/ROUTINE_TASKS.mdstates it in the methodology, the command, the ignore-entry line and the failure row.docs/SDLC.mdnamesnpm auditfor the root lockfile. The change replaces each withosv-scanner.tomlandosv-scanner, and adds the spec delta that the archive applies. [sources: openspec/specs/ci-dependency-audit/spec.md:4, openspec/specs/ci-dependency-audit/spec.md:9, openspec/specs/ci-dependency-audit/spec.md:38, SECURITY.md:81, docs/ROUTINE_TASKS.md:188-192, docs/ROUTINE_TASKS.md:305, docs/SDLC.md:25] - Which reader does the audit row use for osv-scanner?: Add
BIN_OSV_SCANNERto_FAILURE_READERSwith a reader that returnsVULNERABLEfor exit code 1 andNOT_RUNfor any other non-zero exit code. osv-scanner exits 0 when it finds nothing, and its native config filters an active[[IgnoredVulns]]entry before the exit status, so the audit keeps no filter of its own. (best practice) [sources: openspec/changes/archive/2026-11-18-3988-audit-tools-lock-advisories/design.md:17, src/devops_cli/core/dependency_audit.py:189-203]- Chosen: An osv-scanner reader. It tells a finding from an audit that could not run, as the archive design of fix(deps): check the tools lock requirement files for advisories #3988 did.
- Rejected: Every non-zero exit is a finding. A missing binary or a network failure would pass as a vulnerability and hide an audit that could not run.
- Rejected: Every non-zero exit is not run. A finding would never fail the row.
- What command does the audit row run for the root lockfile?:
osv-scanner scan source --lockfile package-lock.json, built inconfig/commands.pyasbuild_osv_audit_cmd. The v2 form is the one thatbuild_osv_scan_cmdalready uses; the olderosv-scanner --lockfile package-lock.json:<path>form of fix(deps): check the tools lock requirement files for advisories #3988 is gone. The command runs online, asuv auditand the formernpm auditdid, and the exit code alone gives the verdict. (best practice) [sources: src/devops_cli/config/commands.py:138-158, src/devops_cli/config/commands.py:108-124, openspec/changes/archive/2026-11-18-3988-audit-tools-lock-advisories/design.md:13]- Chosen: A small
build_osv_audit_cmd. It gives the audit row the v2 scan form and the lockfile it needs, with no review-only flags. - Rejected: Reuse
build_osv_scan_cmd. It adds--offline,--all-packagesand--all-vulnsfor a review, which needs a fetched database and a JSON report that the audit does not read. - Rejected: The v1
osv-scanner --lockfile package-lock.json:<path>form. The repository runs osv-scanner v2, whosescan source --lockfileformbuild_osv_scan_cmdalready uses.
- Chosen: A small
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 19, 2026
Both work on the audit ignore mechanism, but 6204 adds a specific ignore entry while this candidate deletes the custom ignore system in favour of osv-scanner.toml.devops-cli-service commentedon Nov 19, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies and Watched files in the section Proposed design of the body.
devops-cli-service commentedon Nov 22, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.
devops-cli-service commentedon Nov 23, 2026
Released in v0.203.4: https://github.com/dan-petty/devops-cli/releases/tag/v0.203.4