Repository navigation
Say when a merged patch is not ready yet, and define the free tier - #2220
Conversation
One patch is applied per package version. When a package version has several advisories, Socket publishes a merged patch that fixes them together (the critical ones in the free tier, all of them in the paid tier), after the single patches it combines. Until then a run applies the top-ranked single patch, and `scan` told the user the other advisories "need a package upgrade". They don't: the merged patch is on its way. A package is waiting on a merged patch when the patches the account can download name more advisories between them than any one of them does. - `scan` counts those advisories as "waiting on a merged patch" in its closing line and adds "Merged patch not ready yet for N packages: Socket is still processing it. Run `socket-patch scan` again later to apply it." `--verbose` names them under the row, and `--json` lists them as `packages[].mergePendingIds` (additive). - `get` prints the same note under the patch it selected, and `--json` carries a `merged_patch_pending` warning per package. - An advisory left on a patched package that only a paid patch fixes now counts as "needs a paid Socket plan", like the advisories of a package whose every patch is paid, instead of "needs a package upgrade". Nothing else changes: the run applies the same patch and exits as before, and a later run moves the package to the merged patch once it is published. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The docs said "free patches" without saying what they are. The free tier includes every patch for a critical vulnerability, merged patches included: the merged patch that combines a package version's critical fixes is free. Patches for the other severities need a paid plan. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Review of the merged-patch reporting found cases where it said the wrong thing: - An advisory named only by a selected patch's own record counted as "needs a paid Socket plan", for accounts with paid access too. Only the advisories of patches the account cannot download count now. - Under a selection filter, an advisory the filter says needs no fix was reported as waiting on a merged patch. The filter prefers the patch that leaves it out even once a merged one exists, so the run promised a patch it would never apply. Patches the filter withholds no longer count toward a pending merge. - A published merged patch that lists one CVE alias fewer than a single patch does read as "not ready yet" forever. A patch is judged by the advisories it names (its GHSA ids, or its CVEs when it names none), as the ranking's advisory count does. - A package whose wheel has its merged patch and whose sdist does not was told to upgrade. It is waiting on the sdist's merged patch. - `get` counted each release variant of one package as a package, and could name an advisory the installed variant's patch fixes. It folds variants into one package and names only what every variant leaves. The contract section on tiers and pending merges moves to the end of "Which patch gets selected", and says that an agent-mode `get --json` that stops at `selectionRequired` carries no pending-merge warning. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
PR SummaryMedium Risk Overview
Reviewed by Cursor Bugbot for commit 39ebf73. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 39ebf73. Configure here.
…es to the paid tier
Seen on a real terminal, the line about a merged patch that is not ready
was 130 columns wide and `get`'s was 178, so both wrapped.
- `scan` says it in two short lines under the count: "2 merged patches
are not ready yet: Socket is still processing them." and, dim where
color is on, "Run `socket-patch scan` again later to apply them." The
count is bold yellow like the count of what is left. The reason in the
line above reads "2 await a merged patch", so a dry run with that one
reason fits 80 columns.
- `get` prints the same two lines with one line per waiting package
between them (" pkg:npm/crypto-js@3.1.2: CVE-2023-46233 unpatched
until then"), the first five packages and then a count.
The same run showed a wrong promise. The catalog holds free patches for
advisories that are not critical, published before the tiers were
drawn. The free tier's merged patch combines a package version's
critical fixes and never includes those, so for an account without paid
access their advisories now need a paid plan instead of waiting on a
merged patch that would not come.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

Summary
Two things about how the CLI talks about the free tier.
1. It says when a merged patch is not ready yet. One patch is applied per package version. When a package version has several advisories, Socket publishes a merged patch that fixes them together: one for the critical advisories (free) and one for all of them (paid). A merged patch is published after the single patches it combines. Until then a run applies the top-ranked single patch, and
scantold the user that the other advisories "need a package upgrade". They don't. The merged patch is on its way.2. It defines the free tier. The README and the docs said "free patches" without saying what those are. They now say: every patch for a critical vulnerability, merged patches included.
What changes
crypto-js@3.1.2has two critical advisories, each with a free patch, and no merged patch yet. An anonymoussocket-patch scan --dry-runbefore:After:
On a terminal (80 columns, a real run of a project with six patched packages, no token):
The two new lines are short on purpose: neither wraps an 80-column terminal. Where color is on, the count is bold yellow like the count of what is left, and the
Run ...line is dim.scan, every mode. The closing line counts those advisories asawait a merged patch, and the next two lines say the merged patch is not ready yet and what to do.--verbosenames them under the row (waiting on a merged patch: CVE-2023-46233).--jsonlists them aspackages[].mergePendingIds, an additive key besideunfixedIds.get, every mode. The same two lines under the patch it selected, with one line per waiting package between them.--jsoncarries onemerged_patch_pendingwarning per package.Advisories only the paid tier fixes. One left on a patched package now counts as
needs a paid Socket plan, like the advisories of a package whose every patch is paid. It used to count asneeds a package upgrade. That covers an advisory only a paid patch fixes, and, for an account without paid access, one only a free patch that is not critical fixes: the catalog holds such patches from before the tiers were drawn, and the free tier's merged patch (critical fixes only) never includes them.Nothing else changes. The run applies the same patch and exits as before. A later run moves the package to the merged patch once it is published, because it outranks the single patch on advisory count.
How the CLI knows
The patch service does not announce a merged patch that is on its way, so the CLI reads it off the offers. A package is waiting on a merged patch when the patches the run could take (the ones the account can download, less the ones its selection filter withholds) fix more advisories between them than the selected patch does, and none the run passed over fixes them all. The advisories the selected patch leaves, and another such patch names, are the ones waiting.
It never promises a merged patch a later run would not apply:
seroval@1.3.2shows why: its free merged patch for two critical advisories is published, beside an older free patch for a high. Nothing free will ever combine the three, so the high needs a paid plan and is not "waiting".Two limits follow from reading the offers:
get <CVE>,get <GHSA>andget <uuid>see only the patches that name the identifier, so they report a pending merge only when those patches show one.get <purl>,get <name>andscansee every patch of the package.Docs
README.md,docs/configuration.md: a "Free and paid patches" section with the tier table and what a merged patch is.docs/usage.md: the example output, and a table of the four reasons an advisory is left to patch.CLI_CONTRACT.md: the rows, the closing lines,mergePendingIds,merged_patch_pending, and a new section "Free and paid patches, and merged patches that are not ready".Tests
advisory_coverage_names_what_waits_on_a_merged_patch(free and paid access, a published merged patch, a partly merged patch, a recorded patch that is no longer offered),advisory_coverage_promises_no_merged_patch_the_filter_would_pass_over,advisory_coverage_judges_a_merged_patch_by_its_advisories,advisory_coverage_waits_for_the_variant_without_a_merged_patch,closing_says_a_merged_patch_is_not_ready_yet, the--verboserows,merge_pending_names_what_waits_on_a_merged_patchforget.--verboseline andmergePendingIds. The selection-filter test pins an emptymergePendingIdswhen the filter passes over a published merged patch.socket-patch-clisuite on the first two commits: every test binary passed excepte2e_vendor_cargo_build, whose two old-toolchain tests fail on this machine withBad CPU type in executable(an x86_64 toolchain on Apple silicon). After the review fixes: the unit tests and thescan,get, selection-policy andget/scanin-process suites pass.--verbose,get), with color and glyphs on, and piped. That is where the two findings of the fourth commit came from: the first wording wrapped (130 columns forscan, 178 forget), and the lesser free patch above was promised a merged patch.crypto-js@3.1.2(scan --dry-run,--verbose,--json, andget pkg:npm/crypto-js@3.1.2 --dry-runin human and--jsonform), andvm2@3.11.2, whose free merged patch for its three critical advisories is published (no token: nothing left; with paid access: the fourth advisory is waiting on the merged patch of all four).Review
/code-review highon the first two commits raised eight findings. All are fixed in the third commit: a false "needs a paid Socket plan" for ids only the selected patch's record names, a pending merge promised for an advisory the selection filter says needs no fix, a published merged patch read as pending when CVE aliases differ, release variants counted as separate packages inget,getnaming an advisory the installed variant's patch fixes, a variant without its merged patch told to upgrade, theselectionRequiredexception missing from the contract, and the new contract section sitting in the middle of the ranking text.🤖 Generated with Claude Code