Skip to content

fix(watchlist): vendor and product_id are the vendor source's, as inventory.py meant - #62

Closed
maksimtech wants to merge 1 commit into
feat/the-database-ranks-by-priorityfrom
fix/vendor-and-product-are-the-vendor-sources
Closed

maksimtech wants to merge 1 commit into
feat/the-database-ranks-by-priorityfrom
fix/vendor-and-product-are-the-vendor-sources

Conversation

@maksimtech

Copy link
Copy Markdown
Owner

Correction to PR-01a (#58, merged): I misread the design in my own reconstruction of it. Stacked on #61; it goes after #59 → #60 → #61.

What was wrong

inventory.py named the watchlist columns before they existed: vendor, product_id, installed_version, channel and cpe. There, a vendor source is a feed that answers by version (Chrome's, Edge's, MSRC, Mozilla's), and product_id is the product it needs ("chrome", "Edge"). The CPE is the other route, "NVD by CPE".

In #58, docs/DESIGN.md §5.1 and set_installed filled vendor and product_id with the CPE's vendor and product. The inventory import (PR-01c) would then have written a vendor source over the CPE's vendor, or the other way round. No release contains #58, so there is no installed database to migrate.

What changes

  • The CPE's vendor and product are read from cpe when the scan needs them (WatchEntry.cpe_vendor, cpe_product, installed()), not stored.
  • set_source(name, vendor=, product_id=, channel=) records the vendor source a person confirmed, for the import to call. It never adds a name.
  • docs/DESIGN.md §5.1 says which column is which, why there are two routes, and that until today the table was misread.

Tests (strict TDD)

  • tests/test_vendor_source_columns.py, 5 tests: a CPE does not fill the source columns; source and CPE side by side; a source alone is not judgeable; a CPE without a version is not judgeable; set_source never adds a name.
  • Two existing assertions encoded the misreading (entry.vendor == "notepad-plus-plus"). They now check cpe_vendor / installed().
  • Seen failing first. The mutants that swap source and product, put vendor back into set_installed, or drop the version from installed() are killed.
  • Full suite: 2216 passed; ruff and mypy clean.

🤖 Generated with Claude Code

…entory.py meant

inventory.py named the watchlist columns before they existed: vendor,
product_id, installed_version, channel, cpe. There a vendor source is a
feed that answers by version (Chrome's, Edge's, MSRC, Mozilla's) and
product_id is the product it needs; NVD by CPE is the other route. #58
filled vendor and product_id with the CPE's fields instead - a misreading
of the design it rebuilt - which would have had the inventory import
write one over the other. No release carried it.

- The CPE's vendor and product are read from `cpe` (WatchEntry.cpe_vendor,
  cpe_product, installed()), not stored.
- set_source records the vendor source, product and channel a person
  confirmed, for the import to call; it never adds a name.
- DESIGN.md section 5.1 says which column is which, and why.

Tests first, seen failing; the mutants that swap source and product or
drop the version from installed() are killed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@maksimtech

Copy link
Copy Markdown
Owner Author

Folded into #64, which now targets main with every commit of the stack: one review, one merge, no conflicts from squash merges.

@maksimtech maksimtech closed this Oct 17, 2026
@maksimtech
maksimtech deleted the fix/vendor-and-product-are-the-vendor-sources branch October 17, 2026 20:50
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.

1 participant