Repository navigation
Description
Problem or Motivation
A short DNS failure of api.osv.dev stops a gate command. pyproject.toml turns on uv's malware-check preview feature, and the devcontainer sets UV_MALWARE_CHECK=1. Twice on 2026-11-11/12 in the devcontainer, uv stopped with:
error: Malware check failed due to an error from OSV
cause: Request failed after 3 retries
cause: failed to lookup address information: Try again
uv run devops ci test <files>stopped before pytest started.- The pre-commit hook
ast-grep scan(it startsuv run) failed, sogit commitfailed.
The same command passed again a minute later, and getent hosts api.osv.dev resolved. The host was under high load (load average about 55 on 16 CPUs).
Proposed Solution & Architectural Design
- Find in the uv documentation and source how the malware check treats a lookup error, and whether a setting makes uv retry longer or report the error as a warning for a command that installs nothing new.
- If uv has such a setting, set it in
[tool.uv]. If not, keep the check in the rows that install packages and report the limit upstream.
Acceptance: a test or a recorded run shows that a DNS error of OSV during uv run of an already-synced environment does not stop the gate row, or the item records the upstream issue.
Target Subsystem
CI gate (devops ci) and the pre-commit hooks.
Existing Tool Considered
uv's own malware check (preview). No new tool. Cost: about 10,000 tokens and 1 hour to check and set.
Dependencies
None.
Alternatives check of 2026-11-14: in-use.
The repository already uses this tool.
Tool: astral-sh/uv (https://github.com/astral-sh/uv), Apache-2.0, last activity 2026-11-14, maintained.
Proposed design
Problem statement
A short DNS failure of api.osv.dev stops uv run before a gate command starts. uv has no setting that turns the malware-check lookup error into a warning or lengthens the retry. The change sets UV_MALWARE_CHECK=0 in the check-only gate rows, the pre-commit hooks and the interactive shells, and keeps it at 1 in the steps that install packages, so the check still runs where a package can arrive.
Acceptance criteria
Requirement: Pre-commit check hooks disable the malware check
Each pre-commit hook that starts uv run and installs no package SHALL set UV_MALWARE_CHECK to 0 in its hook env.
Scenario: Check hook environment
- WHEN the test reads the
envof theast-grep-scan,ast-grep-test,openspec-gate,devops-ci-pre-pushanddevops-ci-workflows-pre-pushhooks in.pre-commit-config.yaml - THEN each hook's
envmapsUV_MALWARE_CHECKto0.
Requirement: Gate check rows disable the malware check
Each devops ci row that installs no package SHALL run its command with UV_MALWARE_CHECK set to 0.
Scenario: Gate row environment
- WHEN the test plans
devops ci --check --only lintand reads the environment of each planned request - THEN each request's environment maps
UV_MALWARE_CHECKto0.
Requirement: Interactive shells disable the malware check
Every interactive shell configuration of this repository SHALL set UV_MALWARE_CHECK to 0.
Scenario: Devcontainer and agent shell environment
- WHEN the test reads
containerEnvof.devcontainer/image/devcontainer.json, theenvof.claude/settings.json, the rendereddevcontainer.json.j2andclaude_settings.json.j2, and theUV_MALWARE_CHECKexample indocs/DEVCONTAINER_USAGE.md - THEN each sets
UV_MALWARE_CHECKto0.
Requirement: Install steps keep the malware check on
Each step that installs packages SHALL set UV_MALWARE_CHECK to 1.
Scenario: CI sync and post-create install
- WHEN the test reads the
Synchronize dependenciesstep of.github/actions/setup-toolchain/action.yml, thepostCreateCommandof.devcontainer/devcontainer.json, and the renderedpostCreateCommandofdevcontainer.json.j2 - THEN each sets
UV_MALWARE_CHECKto1.
Requirement: A failed OSV lookup does not stop a gate row
A gate row SHALL exit 0 when the OSV lookup fails and the environment is already synced.
Scenario: OSV lookup failure
- WHEN a stub
uvthat prints the OSV lookup error and exits 2 unlessUV_MALWARE_CHECKis0runs theast-grep-scanhook entry - THEN the hook entry exits 0.
Requirement: The uv limit is recorded
pyproject.toml SHALL record beside [tool.uv] that uv has no setting to downgrade an OSV lookup error to a warning or to lengthen the retry.
Scenario: Recorded limit
- WHEN the test reads the
[tool.uv]section ofpyproject.toml - THEN a comment names the missing setting and the reason for the switch, and
preview-featuresstill holdsmalware-check.
Requirement: The knowledge base records the split
The uv knowledge base SHALL state that install steps set UV_MALWARE_CHECK=1 and interactive shells set 0.
Scenario: Knowledge base guidance
- WHEN the test reads
src/devops_cli/ai/knowledge_base/it_domains/tools/uv.mdandsrc/devops_cli/ai/knowledge_base/it_domains/topics/modern_python_runtime_and_ecosystem.md - THEN both name the split between install steps and interactive shells.
Existing Tool Considered
uv (astral-sh/uv, Apache-2.0, maintained, already in use). It runs the OSV malware check and exposes the [tool.uv] / UV_MALWARE_CHECK switch. It lacks a documented setting that turns an OSV lookup error into a warning, and it lacks a way to lengthen the retry window; an already-synced uv run still aborts before the command starts. No other tool covers the need. The issue estimates about 10,000 tokens and 1 hour to check and set.
Key questions
- Where does the OSV lookup error stop the command?: It stops the environment sync that
uv runperforms before it starts the command. The repository injects--preview-features malware-checkinto everyuvcommand, so the pre-commit hook and the gate rows start uv with the check on, and the error appears beforedevopsor pytest starts. The uv README (fetched 2026-11-15) confirms thatuv runruns a command in the project environment. [sources: src/devops_cli/core/process.py:728, .pre-commit-config.yaml:70, src/devops_cli/commands/ci.py:245, pyproject.toml:327, .devcontainer/image/devcontainer.json:45, https://github.com/astral-sh/uv] - Does
UV_MALWARE_CHECK=0disable the check while the preview feature stays on?: Yes. The repository already usesUV_MALWARE_CHECKas the switch: the devcontainer and agent settings set it to1, and the subprocess environment passes it through to the child. The preview feature stays listed in[tool.uv], so a value of0turns the check off for that command without removing the feature. [sources: .devcontainer/image/devcontainer.json:45, .claude/settings.json:14, src/devops_cli/commands/install_tools.py:255, openspec/specs/subprocess-environment/spec.md:314, pyproject.toml:327] - How do the gate rows stop failing on a short OSV DNS failure when uv has no warning or retry setting?: Set
UV_MALWARE_CHECK=0in the check-only gate rows, the pre-commit hooks and the interactive shells, and set it to1in every step that installs packages. (best practice) [sources: .pre-commit-config.yaml:70, src/devops_cli/core/process.py:728, .devcontainer/image/devcontainer.json:45, .github/actions/setup-toolchain/action.yml:69, src/devops_cli/ai/knowledge_base/it_domains/tools/uv.md:82, https://github.com/astral-sh/uv]- Chosen: Switch the check off in the check-only rows, hooks and shells. The failure happens in the
uv runthat starts the command, so a row-only environment cannot help; installs keep the check explicitly. - Rejected: Set the variable only in the
devops cirow environment. The reported failures happen in the outeruv runbeforedevopsstarts, so the row environment is never read. - Rejected: Wait for an upstream warning or retry setting. The gate stays broken until uv ships the setting, and no such setting is documented.
- Rejected: Retry the whole command after a failure. The error comes before the command starts, so each retry pays the retry delay again and hides the cause.
- Rejected: Run the gate commands with
uv run --no-sync. It skips every sync, so a stale environment runs with missing packages; the switch keeps the sync.
- Chosen: Switch the check off in the check-only rows, hooks and shells. The failure happens in the
- Which steps keep the malware check on?: The steps that install packages: the
uv syncstep of.github/actions/setup-toolchain/action.yml, thepostCreateCommandthat runsuv tool install pre-committhroughdevops devcontainer post-create, and the Dockerfile'suv sync. (best practice) [sources: .github/actions/setup-toolchain/action.yml:69, .devcontainer/devcontainer.json:13, src/devops_cli/commands/devcontainer.py:709, src/devops_cli/templates/devcontainer.json.j2:110, pyproject.toml:327]- Rejected: All steps. The check-only rows keep the hard stop that the issue reports.
- Rejected: No steps. It loses the protection that the preview feature gives.
- Chosen: Only the steps that install packages. The check runs where a package can arrive, and a check-only row never waits on the lookup.
- Where does the repository record the uv limit?: In a comment beside
[tool.uv]inpyproject.toml. (best practice) [sources: pyproject.toml:326, pyproject.toml:327]- Chosen: A comment in
pyproject.toml. The setting and its reason stay in one place that the reader of the setting opens. - Rejected: A new docs page. One note does not need a page of its own.
- Rejected: An ADR. The switch is a configuration choice of one command, not an architecture decision.
- Chosen: A comment in
- Where do the interactive shells get
UV_MALWARE_CHECK=0?: In the container environment of.devcontainer/image/devcontainer.json, in.claude/settings.json, and in the matching templatesdevcontainer.json.j2andclaude_settings.json.j2, with the docs example updated to match. (best practice) [sources: .devcontainer/image/devcontainer.json:45, .claude/settings.json:14, src/devops_cli/templates/devcontainer.json.j2:56, src/devops_cli/templates/claude_settings.json.j2:14, docs/DEVCONTAINER_USAGE.md:100]- Chosen: Set it in the checked-in shell configs and their templates. The shell inherits the value, so the outer
uv runthat startsdevopspasses; the templates keep a scaffolded repository on the same setting. - Rejected: Set it only in
.devcontainer/devcontainer.jsonremoteEnv. The agent shell reads.claude/settings.json, and the image metadata and the template would still set1. - Rejected: Keep
1in the shell and fix only the rows and hooks. The reported failures happen in the outeruv runbeforedevopsstarts, so the shell keeps the hard stop.
- Chosen: Set it in the checked-in shell configs and their templates. The shell inherits the value, so the outer
- How does the knowledge base stay consistent with the switch?: Update the two uv guidance lines to state the split: install steps set
UV_MALWARE_CHECK=1, and interactive shells set0. (best practice) [sources: src/devops_cli/ai/knowledge_base/it_domains/tools/uv.md:82, src/devops_cli/ai/knowledge_base/it_domains/topics/modern_python_runtime_and_ecosystem.md:96]- Chosen: Update the knowledge base lines. The current lines say to keep
1in developer environments, which contradicts the shell setting; the split keeps the install protection and explains the shell. - Rejected: Leave the knowledge base lines. They would tell an agent to set
1in the shell, undoing the fix.
- Chosen: Update the knowledge base lines. The current lines say to keep
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 12, 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.(ci)scope of the title gives the scope.The failure blocks commits and CI runs but is intermittent and self-resolves within a minute.It blocks local commits and CI runs when the OSV endpoint is unreachable, but only for a short window.The body estimates about one hour to investigate uv settings and apply a config change or file an upstream issue.devops cifrom one check table #843, which asks for a different change.Both items involve the uv malware-check feature in the CI gate, but #843 consolidates check definitions while the candidate fixes a DNS error that stops the gate.devops-cli-service commentedon Nov 12, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
The error blocks the gate and git commit at random, but a retry passes and a workaround exists.Developers lose time when a transient OSV lookup error stops the gate and a commit, but the effect is intermittent.The body estimates about 1 hour and 10,000 tokens to check the uv setting and set it in pyproject.toml.devops cifrom one check table #843, which asks for a different change.Both items touch the gate check argv that inserts the uv malware-check preview feature, but #843 changes how one check table feeds GitHub CI and this item changes how a lookup error is handled.dan-petty commentedon Nov 12, 2026
One more occurrence on 2026-11-12: the pre-commit hook
ast-grep scanfailed withMalware check failed due to an error from OSVduringgit commitof an OpenSpec archive commit. The load average was about 45 on 16 CPUs. The same commit passed at the next try, about one minute later.dan-petty commentedon Nov 12, 2026
Seen again on 2026-11-12 in an agent worktree. Two
uv runcalls failed beforedevopsstarted:uv run devops openspec checkanduv run devops ci test <files>. Each printederror: Malware check failed due to an error from OSV, with the causefailed to lookup address information: Try again, and exited 2. A second try of each call passed some minutes later. The DNS name of the OSV API resolved during the same period.devops-cli-service commentedon Nov 14, 2026
Alternatives check: in-use
Reason: The searches returned no other tool or documented setting that covers this: the only relevant tool is uv itself, whose preview malware check is what performs the OSV lookup and what the issue already names as in use. uv provides the check and its
[tool.uv]/UV_MALWARE_CHECKswitch, but no searched evidence shows a setting that downgrades a transient OSV lookup/DNS failure to a warning or extends retries for a command that installs nothing new, which is exactly the missing part.The repository already uses this tool.
Tool: astral-sh/uv (https://github.com/astral-sh/uv)
Covers:
[tool.uv]) and the environment (UV_MALWARE_CHECK), so the gate rows share one settinguv run/ sync path the gate rows useLacks:
uv runstill aborts before the command starts when the OSV lookup fails, so the gate row and the pre-commit hook still failTools considered:
Searches run:
Sources:
Checked on 2026-11-14. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 15, 2026
Status set to Ready at ca62d6a (see proposed design in issue body).
Moved to new items: #5899.
test(ci): Expect the gate-row malware switch in the plans (#4881)
devops-cli-service commentedon Nov 18, 2026
Released in v0.176.1: https://github.com/dan-petty/devops-cli/releases/tag/v0.176.1
devops-cli-service commentedon Nov 18, 2026
Live since 2026-11-18 14:16 UTC