Skip to content

fix: sort machine-readable output by code unit - #432

Merged
vibgrate-team merged 7 commits into
mainfrom
cursor/locale-independent-sort-788f
Oct 11, 2026
Merged

vibgrate-team merged 7 commits into
mainfrom
cursor/locale-independent-sort-788f

Conversation

@vibgrate-team

@vibgrate-team vibgrate-team commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Bare localeCompare follows LANG and LC_ALL, so machine-readable output could change order between machines. Sorts that shape vg scan JSON, SARIF and vg sbom output now use one shared UTF-16 code-unit comparator, the same ordering the JUnit report already used.

This covers dependency rows, vulnerability packages and advisory ids, license-parse findings, coded and skipped-path warnings, SBOM component keys and project lists, reachability and duplicate/phantom dependency lists, and architecture-gate findings.

The same inputs now produce the same bytes on every locale. Flask still sorts before flask, and Swedish collation no longer moves Äpfel relative to zebra.

Related issues

Closes #410
Closes #417

Checklist

  • pnpm test passes
  • pnpm lint is clean
  • pnpm typecheck is clean
  • Docs updated where behavior changed
  • Determinism preserved
  • No proprietary or internal references
  • Commits use Conventional Commits and are signed off

How to verify

pnpm test
pnpm lint
pnpm typecheck

cursoragent and others added 7 commits October 10, 2026 12:01
Bare localeCompare follows LANG/LC_ALL, so the same names can reorder
(Estonian collates zod before tslib). Scan JSON, SARIF, SBOM export,
and coded warnings now share compareCodeUnit.

Signed-off-by: Cursor Agent <cursoragent@cursor.com>

Co-authored-by: vibgrate-team <vibgrate-team@users.noreply.github.com>
Compare string keys in scan JSON, SARIF, and SBOM by code unit so LANG
and LC_ALL do not change those documents.

Signed-off-by: Cursor Agent <cursoragent@cursor.com>

Co-authored-by: vibgrate-team <vibgrate-team@users.noreply.github.com>
Signed-off-by: Cursor Agent <cursoragent@cursor.com>

# Conflicts:
#	CHANGELOG.md

Co-authored-by: vibgrate-team <vibgrate-team@users.noreply.github.com>
Signed-off-by: Cursor Agent <cursoragent@cursor.com>

# Conflicts:
#	src/core-open/run-core-scan.ts
#	src/reporting/commands/sbom.ts

Co-authored-by: vibgrate-team <vibgrate-team@users.noreply.github.com>
Co-authored-by: vibgrate-team <vibgrate-team@users.noreply.github.com>
Vendored files under src/core-open carry the vendor header and no tests.
Keeping +build metadata stays covered by the scanner and SBOM test.

Signed-off-by: Cursor Agent <cursoragent@cursor.com>

Co-authored-by: vibgrate-team <vibgrate-team@users.noreply.github.com>
@vibgrate-team
vibgrate-team merged commit e0b2a96 into main Oct 11, 2026
1 check 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

2 participants