Skip to content

osv: keep the finding when advisory detail cannot be fetched - #31

Merged
richardmhope merged 7 commits into
mainfrom
claude/codebase-review-refactor-enx4ad
Jul 30, 2026
Merged

osv: keep the finding when advisory detail cannot be fetched#31
richardmhope merged 7 commits into
mainfrom
claude/codebase-review-refactor-enx4ad

Conversation

@richardmhope

Copy link
Copy Markdown
Collaborator

querybatch already said the package is affected; a failed /v1/vulns/{id}
fetch used to drop the hit entirely, presenting an affected package as
clean. The hit now degrades to a skeleton advisory — ID and modified
timestamp, unknown severity, no fix version — which is what the comment
in _fetch_one always claimed happened.

Co-Authored-By: Claude Fable 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01WfR2EG2PFrPXF6cWzzAtPu

claude added 7 commits July 30, 2026 12:27
querybatch already said the package is affected; a failed /v1/vulns/{id}
fetch used to drop the hit entirely, presenting an affected package as
clean. The hit now degrades to a skeleton advisory — ID and modified
timestamp, unknown severity, no fix version — which is what the comment
in _fetch_one always claimed happened.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WfR2EG2PFrPXF6cWzzAtPu
The PyPI key stringified parsed.pre, so rc10 sorted below rc2; epochs
were ignored and a post-release compared equal to its base. All three
feed fixed-version selection and best_match, so a wrong order picks a
wrong upgrade target or denies that one exists.

The key now carries the epoch (0 in the loose path, so the two stay
comparable) and a numeric pre/post/dev suffix in PEP 440 order:
dev < a < b < rc < final < post.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WfR2EG2PFrPXF6cWzzAtPu
package-lock's devOptional flag marks a package that is in the dev tree
and an optional dependency of something that ships — a production
install still gets it. Classifying it dev excluded it from the default
scan, which is the direction this tool must not fail in; it is now
optional, which is scanned by default.

yarn v1 quotes scoped packages in dependency lists ("@babel/core"
"^7.0.0"), and the field pattern could not match a quoted key, so every
@scope/ edge was silently dropped. The code even stripped quotes from a
key the regex could never capture quoted.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WfR2EG2PFrPXF6cWzzAtPu
_apply_management expands an import-scoped BOM through _effective, which
runs _apply_management again — with no guard, a cycle of mutually
importing BOMs recurses until the stack dies, and the _backfill path has
no gather() around it to absorb the RecursionError, so one bad pair of
POMs ended the whole scan. The import path is now threaded through the
recursion and a coordinate already being expanded is skipped; the
versions gathered on the way down still apply.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WfR2EG2PFrPXF6cWzzAtPu
Slicing "==" off a Pipfile constraint read ==2.* as the version "2.*" —
a junk version OSV matches nothing against, so a real advisory range
never fired — and ===2.0.0 as "=2.0.0". Both now go through the same
specifier-based pin rules the requirements parser uses.

uv.lock seeds used setdefault, so a package declared in several extra
groups kept whichever group iterated first: listed under both docs and
gui, the dev-flavoured group could hide an installable extra from the
default scan. Scopes now merge to the most-included value, the same rule
the graph resolver applies.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WfR2EG2PFrPXF6cWzzAtPu
An unquoted "expires = 2026-10-27 00:00:00" arrives as a datetime, which
passes isinstance(value, date) but cannot be compared against a date —
so is_expired raised TypeError at matching time and took the scan down.
It is now truncated to its date.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WfR2EG2PFrPXF6cWzzAtPu
The code pins a bare PackageReference version — matching NuGet's
lowest-applicable-version restore, where the declared version is what a
restore actually installs — but the comment above it still described
bare versions as unpinned ranges.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WfR2EG2PFrPXF6cWzzAtPu
@richardmhope
richardmhope merged commit 4cd3604 into main Jul 30, 2026
8 checks passed
@richardmhope
richardmhope deleted the claude/codebase-review-refactor-enx4ad branch July 30, 2026 12:34
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