Repository navigation
Include package changes in JSON reports - #403
Open
John-David Dalton (jdalton) wants to merge 1 commit into
Open
John-David Dalton (jdalton) wants to merge 1 commit into
John-David Dalton (jdalton) wants to merge 1 commit into
Conversation
Expose classified package snapshots and raw scores to JSON consumers. Preserve existing output fields and document version-pairing limits. Assisted-by: Codex:GPT-6
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
LLM Description written by Codex:GPT-6
JSON consumers can read package changes and scores without parsing console output.
new_packages,updated_packages,removed_packages, andreplaced_packages.Why?
The CLI already classifies these package changes but omits them from standard Socket JSON. Exposing the retained lists makes them available to CI integrations. Updated and replaced versions remain separate snapshots; this change does not infer version pairs.
Builds on #402 in the #396 → #398 → #399 → #402 stack.
Validation
40 focused tests pass, including real Core/SDK requests against the approved local HTTP fixture. Scoped Ruff and formatting checks pass. Independent source review found no blocking issues.
Public Changelog
Include package changes and scores in standard Socket JSON reports.
Note
Low Risk
Additive JSON fields with empty defaults for full-scan and no-run; no changes to alert blocking, scan APIs, or authentication.
Overview
Standard Socket JSON (
--enable-json) now exposes classified dependency changes as four additive arrays:new_packages,updated_packages,removed_packages, andreplaced_packages.build_socket_json_reportserializes eachPurlvia_serialize_package_change, preserving existing package metadata, order, raw API scores (or{}when absent), and deep-copying so JSON mutation does not alter in-memory diff state. Alert selection (--strict-blocking) still only affectsnew_alerts; package lists are unchanged.Full-scan inventory, no-run (
NO_DIFF_RAN), and non-diff paths keep all four arrays empty (inventory indiff.packagesis not promoted into change lists). Docs note direct-deps-by-default scope, separate updated/replaced snapshots (nopreviousVersion), and that strict JSON consumers may reject new keys.Reviewed by Cursor Bugbot for commit c397151. Configure here.