Skip to content

Dedup aliased advisories and promote sourceStatus warnings - #43

Merged
jlitola merged 1 commit into
mainfrom
overjoyed-dumpling
Apr 28, 2026
Merged

Dedup aliased advisories and promote sourceStatus warnings#43
jlitola merged 1 commit into
mainfrom
overjoyed-dumpling

Conversation

@jlitola

@jlitola jlitola commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Two CLI-side mitigations for backend issues surfaced during the 2026-04-28 production evaluation. Both transforms live in src/shared/ and are exercised by the existing CLI/MCP parity tests.

  • pkg_vulns alias-cluster dedup — collapses GHSA + RUSTSEC entries that report the same CVE (most visibly on Crates) into one canonical advisory per cluster. Unions clusters over id ∪ aliases[], picks the canonical via severity-bearing → GHSA over RUSTSEC → lex tiebreaker, reports the maximum severity across non-withdrawn members. summary.total and summary.bySeverity are recomputed from the deduped list. Live: crates:openssl@0.10.30 collapses from 25 → 15 advisories with bySeverity reconciling to the new total.
  • search warnings promotion — surfaces a top-level warnings: string[] derived from noteworthy sourceStatus entries (incompatible/ignored query features or filters, lifecycle anomalies, free-form notes). Parser warnings are folded in on completed and incomplete payloads so the text-v1 warnings: preamble shows both. Live: search "parse kind:function" --in npm:zod --source docs --json now emits the warning instead of returning silently empty.

Both are scoped to be removed once the backend handles dedup and warning surfacing upstream — pointers and rationale recorded inline in docs/implementation/tools.md.

Reviewed by code-reviewer + codex-reviewer in parallel; ten findings addressed in-place (severity-max gated on withdrawnAt, strict modifiedAt semantics, delete over explicit-undefined, parser-warnings symmetry across all three payload paths, JSDoc accuracy).

Test plan

  • bun test (1476 pass, 0 fail)
  • bun run build (clean)
  • Live smoke: githits pkg vulns crates:openssl@0.10.30 --json returns 15 advisories with bySeverity summing to total
  • Live smoke: githits search "parse kind:function" --in npm:zod --source docs --json returns top-level warnings[] with the dropped-source notice
  • CI parity tests pass on monorepo CI

🤖 Generated with Claude Code

Production evaluation surfaced two backend issues hurting agent
usefulness on `pkg_vulns` and `search`. These client-side mitigations
land ahead of the upstream fix so MCP consumers see correct counts and
visible execution warnings today.

`pkg_vulns` now collapses alias-clustered advisories — most visibly
GHSA + RUSTSEC pairs on Crates that report the same CVE twice. The
shared envelope builder unions clusters over `id ∪ aliases[]`, picks
one canonical per cluster (severity-bearing first, then GHSA over
RUSTSEC, then lexicographic id), and reports the maximum severity
across non-withdrawn members. `summary.total` and `summary.bySeverity`
are recomputed from the deduped list. Live: openssl@0.10.30 collapses
from 25 to 15 advisories with bySeverity reconciling to the new total.

`search` now surfaces a top-level `warnings: string[]` derived from
noteworthy `sourceStatus` entries (incompatible/ignored query features
or filters, lifecycle anomalies, free-form notes). Parser warnings are
folded into the same array on completed and incomplete payloads so the
text-v1 `warnings:` preamble shows both. Live: a docs-only query with a
`kind:` qualifier now reports the dropped source instead of returning
silently empty.

Both transforms live in `src/shared/` and are exercised by the existing
parity tests; they will be removed once the backend handles dedup and
warning surfacing upstream (see notes in `docs/implementation/tools.md`).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jlitola
jlitola merged commit 06c3d64 into main Apr 28, 2026
3 checks passed
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