Repository navigation
generate-cve-json: warn when a credit line joins several names by comma - #1741
Conversation
potiuk
left a comment
There was a problem hiding this comment.
Thanks for picking up #1737, @srijavuppala, and for the clear write-up of why this warns rather than splits. The heuristic is a reasonable start; the main point is where the signal lands, since the operator it is meant for never sees stderr.
flagging a single-line value with two or more name-like comma-separated parts in needs_decision (or normalisation_changes) (tools/cve-tool-vulnogram/generate-cve-json/src/generate_cve_json/cve_json.py:733)
Suggest flagging a single-line value with two or more name-like comma-separated parts in
needs_decision(ornormalisation_changes) so the operator splits it before the push.
print(
f"warning: credit line {line!r} looks like {name_like} names "
...
file=sys.stderr,
)
The skills that run the generator act on its --report-json file only: security-issue-sync (apply-and-push.md:268-272) and security-cve-allocate (tracker-updates.md:58) route a non-empty normalisation_changes, missing_required or needs_decision through outcomes/cve-json-fallback.md, and nothing reads stderr. So the operator the issue is about never sees this warning. Record it in the report instead. needs_decision makes the tool exit 2 with no record, which is too strong for a heuristic, so a non-blocking entry fits: write_report keeps to field names, line numbers and kinds, never body text, so the entry would be something like {field: "Reporter credited as", line: N, kind: "joined-credits"}. Then cve-json-fallback.md needs a line telling the skill to show it to the user.
Smaller observations
tools/cve-tool-vulnogram/generate-cve-json/src/generate_cve_json/cve_json.py— Theprekjob fails becausecheck-family-pluginsregenerates the plugin's vendored copy,plugins/magpie-security-tools/tools/cve-tool-vulnogram/generate-cve-json/src/generate_cve_json/cve_json.py, which the PR did not commit.prek run check-family-plugins --all-filesneeds no network; run it and commit the regenerated file. On the localuvtrouble in the test plan:exclude-newer = "7 days"needs a recentuv, so upgradinguvshould stop it re-resolvinguv.lock.- See inline comments on
tools/cve-tool-vulnogram/generate-cve-json/src/generate_cve_json/cve_json.py:769,tools/cve-tool-vulnogram/generate-cve-json/src/generate_cve_json/cve_json.py:704.
This review was drafted by an AI-assisted tool and
confirmed by an Apache Magpie maintainer. The findings
below are observations, not blockers; an Apache Magpie
maintainer — a real person — will take the next look at the
PR. If you think a finding is mis-applied, please reply on
the PR and a maintainer will weigh in.More on how Apache Magpie handles maintainer review:
Contributing guide.
potiuk
left a comment
There was a problem hiding this comment.
needs fixes r=that I pointed out
|
Hi Jarek,
Thanks for the detailed feedback and suggestions. I will address these
items and update the PR accordingly.
Best regards,
Srija Vuppala
…On Sat, Oct 31, 2026 at 2:19 PM, Jarek Potiuk ***@***.***> wrote:
***@***.**** requested changes on this pull request.
needs fixes r=that I pointed out
—
Reply to this email directly, view it on GitHub
<#1741?email_source=notifications&email_token=AQHQO44LYM36JG3P6WJQ3ND5WZJMXA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTKNZSGQ4TMNZYHE42M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#pullrequestreview-5724967899>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQHQO46J7G5XUTX5R7NLKFT5WZJMXAVCNFSNUABGKJSXA33TNF2G64TZHMYTEMRTHA4TIOJWG45US43TOVSTWNJZGQZDINRVGQ3TTILWAI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
`parse_credits_from_field` splits the "Reporter credited as" field on newlines only, so the documented `Full Name, Affiliation` shape stays one credit. That same rule silently swallows "Name A, Name B, Name C" into one credit too, with no warning, because a comma cannot simply be split on without breaking the affiliation case. Add a heuristic check: when a line's comma-separated parts contain two or more that read as a person's name (capitalised multi-word, no affiliation-ish word), print a warning naming the line and suggesting each person go on their own line. Parsing itself does not change; the line is still carried through as one credit, so an operator who means "name + affiliation" can ignore the warning. Generated-by: Claude Sonnet 5
a0ca353 to
7264459
Compare
|
I rebased this onto |
The stderr warning never reached the operator: the skills act only on --report-json. It also ran inside a parser called several times per generation, so one line warned repeatedly. - Check each credit field once in main(), and keep parse_credits_from_field pure. - Add a non-blocking joined-credits entry to normalisation_changes, with the field and line number and no body text. - Tell cve-json-fallback to show the entry to the user as a possible false alarm, since a multi-word company reads like a name. - Cover the Red Hat, Trend Micro and Palo Alto Networks lines in tests. Generated-by: Claude Opus 5
potiuk
left a comment
There was a problem hiding this comment.
Thanks for this, and for the patience. I've pushed a fixup on top of your commit so this can land now, instead of asking for another round.
cve_json.py: the check now runs once per field inmain(), soparse_credits_from_fieldstays pure and a line is no longer reported several times.cve_json.py: a line that may join names adds a non-blockingjoined-creditsentry tonormalisation_changes, because the skills read--report-jsonand not stderr. The stderr warning stays for anyone running the tool by hand.cve-json-fallback.md: the skill now shows that entry to the user and says it may be a false alarm, since a multi-word company reads like a name.- Tests now cover
Jane Doe, Red Hat,Alice Smith, Trend MicroandBob Lee, Palo Alto Networks, plus the report entry.
Please pull before pushing again.
This review was drafted by an AI-assisted tool and
confirmed by an Apache Magpie maintainer. The maintainer
approving this PR has read the findings and signed off. If
something feels off, please reply on the PR and a maintainer
will follow up.More on how Apache Magpie handles maintainer review:
Contributing guide.
Summary
parse_credits_from_fieldsplits the "Reporter credited as" / "Remediation developer" fields on newlines only (not commas), so a line like"Name A, Name B, Name C"is silently recorded as one joined credit with no warning.warning:to stderr naming the line, so the operator can split it before the push. The documentedFull Name, Affiliationone-comma shape (e.g.Jed Cunningham, Astronomer) is unaffected and does not warn.Type of change
tools/*/withpyproject.toml)Test plan
prek run --all-filespasses — could not verify end-to-end in my sandbox: the whole-workspaceruff/mypy/pytesthooks shell out viauv runacross all 48 members, and in this environment that fails for two reasons unrelated to this change: (1) the localuvversion mis-parses this repo'sexclude-newer = "7 days"and re-resolvesuv.lockon every invocation, which pre-commit reports as "files modified"; (2) one unrelated member's test (skill-token-count) needs to download a tokenizer file fromopenaipublic.blob.core.windows.net, which my sandbox's network policy denies outright (403). I skippedworkspace-ruff-check,workspace-ruff-format,workspace-mypy,workspace-pytestlocally for exactly those reasons (see Notes below) — every otherprekhook ran and passed normally.uv run pytest/ruff check/mypypasses — ran directly againsttools/cve-tool-vulnogram/generate-cve-json:pytest419 passed,ruff checkall checks passed,mypyno issues found in 11 source files. Added 4 new tests covering the warning (joined names, the documented name+affiliation exception, an independent-researcher affiliation phrase, and a plain two-name case).RFC-AI-0004 compliance
None of these rows apply: no new mutation, no new network/host access, no new placeholder-bearing prose, no agentic-override surface, no outbound messages, no privacy-LLM-routed content. This is a local, deterministic heuristic added to an existing pure-function parser.
Linked issues
Fixes #1737
Notes for reviewers
Name, Affiliationshape is intentionally one credit), so this only adds a warning, never changes what's parsed. The name-vs-affiliation heuristic (_looks_like_a_persons_name) is deliberately conservative — a missed warning is harmless (today's unchanged behaviour), so the affiliation-word list errs toward flagging a part as not name-like rather than risk a false "these are N names" claim.SKIP=workspace-ruff-check,workspace-ruff-format,workspace-mypy,workspace-pytest— see Test plan above for why; happy to re-run any of them if there's a way around the sandbox's network/uv constraints that I'm missing.