Repository navigation
fix(cve-tool-vulnogram): let the first push after allocation replace the placeholder product #2194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -179,6 +179,19 @@ def _product_signature(entry: dict[str, Any]) -> tuple[str, str]: | |
| return (_package_identity(entry), str(entry.get("product") or "")) | ||
|
|
||
|
|
||
| #: The product Vulnogram writes into ``affected[]`` when it allocates a CVE ID. | ||
| ALLOCATION_PLACEHOLDER_PRODUCT = "[VENDOR] [PRODUCT]" | ||
|
|
||
|
|
||
| def _is_placeholder_entry(entry: Any) -> bool: | ||
| """Return ``True`` for an entry with the allocation placeholder product and no package.""" | ||
| return ( | ||
| isinstance(entry, dict) | ||
| and entry.get("product") == ALLOCATION_PLACEHOLDER_PRODUCT | ||
| and not _package_identity(entry) | ||
| ) | ||
|
|
||
|
|
||
| def _diff_affected_products( | ||
| current: list[dict[str, Any]], | ||
| new: list[dict[str, Any]], | ||
|
|
@@ -191,16 +204,19 @@ def _diff_affected_products( | |
| is read from ``packageURL`` or ``packageName``, whichever the entry | ||
| carries, so the two identifier shapes do not read as a rename. | ||
| Otherwise returns one line per dropped, added, or renamed signature so | ||
| the caller can decide whether to refuse or warn. | ||
| the caller can decide whether to refuse or warn. Allocation placeholders | ||
| in ``current`` are not authored content and are left out (#1736). | ||
| """ | ||
| current_sigs = {_product_signature(entry) for entry in current if isinstance(entry, dict)} | ||
| current_sigs = { | ||
| _product_signature(entry) | ||
| for entry in current | ||
| if isinstance(entry, dict) and not _is_placeholder_entry(entry) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. correctness: state-unconstrained exemption
The original issue (#1736) requested exempting the placeholder specifically for "state RESERVED, placeholder product". Leaving the placeholder out of |
||
| } | ||
| new_sigs = {_product_signature(entry) for entry in new if isinstance(entry, dict)} | ||
| if current_sigs == new_sigs: | ||
| return [] | ||
| # First-time population (e.g. a freshly-allocated RESERVED record with an | ||
| # empty ``affected[]``) is not a product *change* — there is no prior | ||
| # signature to be renamed away from. Treat it as a non-diff so the guard | ||
| # does not force --allow-product-change for the normal first push. | ||
| # An empty ``affected[]`` is first-time population, not a product | ||
| # *change* — there is no prior signature to be renamed away from. | ||
| if not current_sigs: | ||
| return [] | ||
| diffs: list[str] = [] | ||
|
|
@@ -254,7 +270,8 @@ def apply_merge_mode_guards( | |
| current record and the new emission, raise | ||
| :class:`MergeModeRefused` with a diff so the caller can decide | ||
| whether the change is intentional (e.g. broadening the scope | ||
| to add a new package) or a regression. | ||
| to add a new package) or a regression. Replacing Vulnogram's | ||
| allocation placeholder is exempt. | ||
|
|
||
| With ``forbid_promotion_to_public`` (the vetted-ops path always sets | ||
| it), a push that would move the record to ``PUBLIC`` from any other | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,3 +11,4 @@ | |
| {"branch": "feat/security-skills-vetted-cve-ops", "cases": 2, "cli": "claude -p", "cost": {"cli_calls": 2, "grader_calls": 2, "wall_seconds": 36.6}, "date": "2026-11-18", "dirty": true, "errored": 0, "errored_cases": [], "failed": 0, "failed_cases": [], "graded_cases": ["step-5b-judged-gates/case-4-private-scanner-credit", "step-5b-judged-gates/case-5-clean-push-fix-released"], "grader_cli": "claude -p --model haiku", "manual": 0, "model": "opus[1m]", "model_source": "settings:user", "notes": "", "passed": 2, "path": "tools/skill-evals/evals/security-issue-sync/step-5b-judged-gates", "ref": "9e979ff3", "schema": 1, "skill": "security-issue-sync", "tags": [], "timestamp": "2026-11-18T01:05:21Z"} | ||
| {"branch": "feat/security-skills-vetted-cve-ops", "cases": 2, "cli": "claude -p", "cost": {"cli_calls": 2, "grader_calls": 2, "wall_seconds": 36.6}, "date": "2026-11-18", "dirty": true, "errored": 0, "errored_cases": [], "failed": 0, "failed_cases": [], "graded_cases": ["step-5b-judged-gates/case-4-private-scanner-credit", "step-5b-judged-gates/case-5-clean-push-fix-released"], "grader_cli": "claude -p --model haiku", "manual": 0, "model": "opus[1m]", "model_source": "settings:user", "notes": "", "passed": 2, "path": "tools/skill-evals/evals/security-issue-sync/step-5b-judged-gates", "ref": "add4ee52", "schema": 1, "skill": "security-issue-sync", "tags": [], "timestamp": "2026-11-18T01:24:36Z"} | ||
| {"branch": "feat/security-skills-vetted-cve-ops", "cases": 2, "cli": "claude -p", "cost": {"cli_calls": 2, "grader_calls": 2, "wall_seconds": 36.0}, "date": "2026-11-18", "dirty": true, "errored": 0, "errored_cases": [], "failed": 0, "failed_cases": [], "graded_cases": ["step-5b-judged-gates/case-4-private-scanner-credit", "step-5b-judged-gates/case-5-clean-push-fix-released"], "grader_cli": "claude -p --model haiku", "manual": 0, "model": "opus[1m]", "model_source": "settings:user", "notes": "", "passed": 2, "path": "tools/skill-evals/evals/security-issue-sync/step-5b-judged-gates", "ref": "add4ee52", "schema": 1, "skill": "security-issue-sync", "tags": [], "timestamp": "2026-11-18T02:36:27Z"} | ||
| {"branch": "fix/1736-allocation-placeholder", "cases": 2, "cli": "claude -p", "cost": {"cli_calls": 2, "grader_calls": 2, "wall_seconds": 27.0}, "date": "2026-11-18", "dirty": false, "errored": 0, "errored_cases": [], "failed": 0, "failed_cases": [], "graded_cases": ["step-5b-judged-gates/case-4-private-scanner-credit", "step-5b-judged-gates/case-5-clean-push-fix-released"], "grader_cli": "claude -p --model haiku", "manual": 0, "model": "opus[1m]", "model_source": "settings:user", "notes": "", "passed": 2, "path": "tools/skill-evals/evals/security-issue-sync/step-5b-judged-gates", "ref": "57480dcf", "schema": 1, "skill": "security-issue-sync", "tags": [], "timestamp": "2026-11-18T06:53:14Z"} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. consistency: eval journal ref mismatch The recorded ref here and in |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correctness: unverified placeholder format
In CVE 5.0 JSON,
affected[]entries typically splitvendorandproduct. If Vulnogram emits{"vendor": "[VENDOR]", "product": "[PRODUCT]"}on allocation, strict equality with"[VENDOR] [PRODUCT]"will miss it and continue to refuse the first push.We should confirm the exact payload from a live allocation or support both
"[VENDOR] [PRODUCT]"andproduct == "[PRODUCT]"(with no package) to be safe.