Skip to content

Say when a merged patch is not ready yet, and define the free tier - #2220

Merged
Mikola Lysenko (mikolalysenko) merged 5 commits into
mainfrom
fix/free-tier-copy
Nov 24, 2026
Merged

Mikola Lysenko (mikolalysenko) merged 5 commits into
mainfrom
fix/free-tier-copy

Conversation

@mikolalysenko

@mikolalysenko Mikola Lysenko (mikolalysenko) commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

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 scan told 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.2 has two critical advisories, each with a free patch, and no merged patch yet. An anonymous socket-patch scan --dry-run before:

  CRITICAL  crypto-js@3.1.2  CVE-2026-71851  1 unpatched

Would patch 1 package, fixing 1 vulnerability (1 critical).
Would save about 2 hours of engineering time (1 package upgrade at ~2 hours).
1 vulnerability would be left to patch (50%): 1 needs a package upgrade.

After:

  CRITICAL  crypto-js@3.1.2  CVE-2026-71851  1 unpatched

Would patch 1 package, fixing 1 vulnerability (1 critical).
Would save about 2 hours of engineering time (1 package upgrade at ~2 hours).
1 vulnerability would be left to patch (50%): 1 awaits a merged patch.
1 merged patch is not ready yet: Socket is still processing it.
Run `socket-patch scan` again later to apply it.

On a terminal (80 columns, a real run of a project with six patched packages, no token):

✔ Patched 6 packages, fixing 9 vulnerabilities (8 critical, 1 high) in 0.9s.
✔ Verified: 9 of 9 exploits blocked, 705 of 705 package tests passing.
  Saved about 12 hours of engineering time (6 package upgrades at ~2 hours each).
  3 vulnerabilities left to patch (25%): 2 await a merged patch, 1 needs a paid Socket plan.
  2 merged patches are not ready yet: Socket is still processing them.
  Run `socket-patch scan` again later to apply them.
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━  75% patched
Upgrade to a paid Socket plan to access all patches: https://socket.dev/pricing

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 as await a merged patch, and the next two lines say the merged patch is not ready yet and what to do. --verbose names them under the row (waiting on a merged patch: CVE-2023-46233). --json lists them as packages[].mergePendingIds, an additive key beside unfixedIds.

  • get, every mode. The same two lines under the patch it selected, with one line per waiting package between them. --json carries one merged_patch_pending warning per package.

    1 merged patch is not ready yet: Socket is still processing it.
      pkg:npm/crypto-js@3.1.2: CVE-2023-46233 unpatched until then
    Run `socket-patch scan` again later to apply it.
    
  • 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 as needs 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:

  • An advisory only a paid patch fixes needs a paid plan, for an account without paid access.
  • An advisory only a patch the selection filter withholds fixes is not waiting. The filter says it needs no fix, and prefers the patch that leaves it out even once a merged one exists.
  • Nothing is waiting when a patch that fixes them all is on offer and the run selected another.
  • A patch is judged by the advisories it names (its GHSA ids, or its CVEs when it names none), so a merged patch that lists one CVE alias fewer than a single patch is still the merged patch.
  • Without paid access only critical patches count toward a pending merge. seroval@1.3.2 shows 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> and get <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> and scan see every patch of the package.
  • The CLI cannot tell a merged patch that is being built from one that will not be built. It says "still processing" for both.

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

  • Unit: 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 --verbose rows, merge_pending_names_what_waits_on_a_merged_patch for get.
  • Integration: the hosted, agent and vendored render tests pin the new closing lines, the --verbose line and mergePendingIds. The selection-filter test pins an empty mergePendingIds when the filter passes over a published merged patch.
  • Local run of the whole socket-patch-cli suite on the first two commits: every test binary passed except e2e_vendor_cargo_build, whose two old-toolchain tests fail on this machine with Bad CPU type in executable (an x86_64 toolchain on Apple silicon). After the review fixes: the unit tests and the scan, get, selection-policy and get/scan in-process suites pass.
  • Checked on a pseudo-terminal at 80, 100 and 120 columns (dry run, real run, --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 for scan, 178 for get), and the lesser free patch above was promised a merged patch.
  • Checked by hand against the live patch service, with no token and with a token: crypto-js@3.1.2 (scan --dry-run, --verbose, --json, and get pkg:npm/crypto-js@3.1.2 --dry-run in human and --json form), and vm2@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 high on 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 in get, get naming an advisory the installed variant's patch fixes, a variant without its merged patch told to upgrade, the selectionRequired exception missing from the contract, and the new contract section sitting in the middle of the ranking text.

🤖 Generated with Claude Code

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>
@mikolalysenko
Mikola Lysenko (mikolalysenko) marked this pull request as ready for review November 24, 2026 16:43
@cursor

cursor Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes advisory classification and user-facing scan/get output plus additive JSON fields; logic errors could mislead users about paid vs pending-merge state, but patch application paths are unchanged.

Overview
Clarifies what counts as free (all critical patches, including merged critical bundles) in the README and docs, and stops mislabeling advisories that are only covered by a not-yet-published merged patch as needing a package upgrade.

scan and get now infer “waiting on a merged patch” when downloadable single patches collectively fix more advisories than the selected patch, but no offered patch fixes them all together. Human output splits remaining issues into merged patch pending, paid plan, upgrade, and other buckets; --verbose rows group unpatched ids by reason; closing totals add a “merged patch not ready yet” line. get emits matching notes and merged_patch_pending warnings in --json.

scan --json adds additive packages[].mergePendingIds alongside unfixedIds, with coverage logic in discovery/report (needs_paid vs merge-pending). Contract and e2e/unit tests are updated for the new messaging and JSON fields. Patch selection and apply behavior are unchanged—later scans still move to the merged patch when it appears.

Reviewed by Cursor Bugbot for commit 39ebf73. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ 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>
Merged via the queue into main with commit 66fe484 Nov 24, 2026
50 checks passed
@mikolalysenko
Mikola Lysenko (mikolalysenko) deleted the fix/free-tier-copy branch November 24, 2026 17:29
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.

2 participants