GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(scan): stop the false [UPDATE] nag for equal-or-older batch-ranked patches by mikolalysenko · Pull Request #162 · SocketDev/socket-patch

Conversation

@mikolalysenko

@mikolalysenko Mikola Lysenko (mikolalysenko) commented Aug 12, 2026 •
edited by cursor Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

Problem

After vendoring a patch, re-running scan --mode vendored perpetually reports an [UPDATE] / updates[] entry pointing at a patch that is the SAME or OLDER than the one already vendored — a permanent false nag (confirmed in prod on pip + poetry legs for urllib3).

detect_updates (crates/socket-patch-cli/src/commands/scan/discovery.rs:248, pre-fix) flagged an update whenever the top-ranked batch candidate's UUID differed from the recorded one. The candidate is chosen by api::ranking::cmp_batch_infos, but batch endpoint responses omit publishedAt (see ranking.rs:176 and rank_batch_info at ranking.rs:143, which parse an absent date to epoch 0). With severity and merge-coverage tied and the date meaningless, ranking falls through to the arbitrary UUID tiebreak — so an equal-or-older sibling patch can be crowned "top candidate" and flagged as a newer update.

Fix

In detect_updates (crates/socket-patch-cli/src/commands/scan/discovery.rs):

  • (a) Same UUID as recorded → never an update (short-circuit, discovery.rs:249).
  • (b) When the recorded patch is still among the offered patches, only surface an update if the candidate GENUINELY supersedes it — new helper candidate_supersedes (discovery.rs:~271) requires a strictly-better MEANINGFUL axis: worse severity, greater merge coverage, or a real, strictly-greater publishedAt. A missing date parses to None (via the existing RFC-2822 api::date::parse_timestamp_secs) and is never treated as newer, so an equal-or-older patch is never surfaced.
  • If the recorded patch is no longer offered at all, ages are uncomparable, so the different currently-available candidate is still flagged (unchanged behavior; also the only thing a manifest-only record can produce).

Note: a strictly-newer sibling can only out-rank the applied patch when the batch actually supplies dates; with dates absent the newest is the applied one and apply (the richer by-package shape) keeps it, so detect_updates and apply stay consistent. Missed (not false) updates only until the endpoint emits publishedAt.

Test

crates/socket-patch-cli/src/commands/scan/discovery.rs — hermetic unit tests alongside the existing detect_updates tests:

  • detect_updates_no_nag_when_applied_patch_still_offered_and_batch_omits_dates — core regression: applied uuid-b re-listed with sibling uuid-a (sorts first), no dates → NO update. Verified RED before / GREEN after (temporarily disabling the guard makes it panic with "an equal-or-older sibling with no real date must not be an update").
  • detect_updates_still_flags_a_higher_severity_candidate_offered_alongside_applied — over-suppression guard: a CRITICAL sibling still flags.
  • detect_updates_flags_a_genuinely_newer_candidate_when_batch_supplies_dates — over-suppression guard: a strictly-newer sibling (real dates) still flags.

cargo test -p socket-patch-cli --lib discovery:: → 23 passed, 0 failed. cargo build -p socket-patch-cli and cargo clippy -p socket-patch-cli clean. All pre-existing detect_updates tests unchanged and green.

Scope

Single-file change to scan/discovery.rs. No API/type changes; reuses public api::ranking::{severity_order, merged_coverage} and api::date::parse_timestamp_secs. Kills sweep findings false-update-nag-older-uuid, false-update-flag-batch-ranking; touches K11. No cross-dependencies with the other parallel bug fixes.

🤖 Generated with Claude Code


Note

Low Risk
Scan update detection only; no API or manifest schema changes; guarded by focused unit tests.

Overview
detect_updates no longer treats every batch top-ranked candidate with a different UUID as an update. When the manifest’s applied patch is still in the batch response, an update is reported only if that candidate genuinely supersedes the applied patch via candidate_supersedes: strictly worse severity, broader merge coverage, or a real, strictly greater publishedAt (missing dates do not count).

This stops perpetual [UPDATE] / updates[] noise when batch responses omit dates and cmp_batch_infos picks a sibling on UUID tiebreak alone. If the recorded patch is no longer offered, behavior is unchanged—a different available UUID still flags an update.

Unit tests cover the no-nag regression, higher-severity updates, and genuinely newer siblings when dates are present.

Reviewed by Cursor Bugbot for commit 221d5d2. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mikolalysenko
Mikola Lysenko (mikolalysenko) enabled auto-merge (squash) August 12, 2026 23:41
@mikolalysenko @claude
fix(scan): stop nagging updates for equal-or-older batch-ranked patches
87348d0
`detect_updates` flagged an `[UPDATE]` (and a JSON `updates[]` entry)
whenever the top-ranked batch candidate differed from the recorded patch.
Batch responses omit `publishedAt`, so `cmp_batch_infos` collapses to the
arbitrary uuid tiebreak and can crown an equal-or-older sibling as the
"top" candidate — perpetually nagging a vendored project with a patch no
newer than the one already committed.

Now, when the applied patch is still among the offered patches, only
surface an update if the candidate genuinely supersedes it on a meaningful
axis (severity, merge coverage, or a real strictly-greater publish date).
Missing dates parse to `None` and are never treated as newer, so an
equal-or-older patch is never surfaced. Recency parsing stays on the
existing RFC-2822-aware `api::date` helper.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@mikolalysenko
Mikola Lysenko (mikolalysenko) force-pushed the fix/false-update-nag-batch-ranking branch from 221d5d2 to 87348d0 Compare August 13, 2026 18:44
Wenxin-Jiang
Wenxin Jiang (Wenxin-Jiang) approved these changes Aug 13, 2026
View reviewed changes
@mikolalysenko
Mikola Lysenko (mikolalysenko) merged commit 098ad3d into main Aug 13, 2026
62 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@mikolalysenko
Mikola Lysenko (mikolalysenko) deleted the fix/false-update-nag-batch-ranking branch August 13, 2026 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Wenxin-Jiang Wenxin Jiang (Wenxin-Jiang) Wenxin-Jiang approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@mikolalysenko @Wenxin-Jiang
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.