Skip to content

fix: encode SARIF file locations without losing filename identity - #19

Open
aolingge wants to merge 1 commit into
mainfrom
codex/sarif-file-locations-20261011
Open

aolingge wants to merge 1 commit into
mainfrom
codex/sarif-file-locations-20261011

Conversation

@aolingge

Copy link
Copy Markdown
Owner

SARIF locations from scan, prompt-lint and text-audit used raw filesystem paths. A filename containing # or ? could be interpreted as a fragment/query, literal percent sequences could change identity, and Unicode, spaces or native Windows paths were not valid URI references. SARIF 2.1.0 sections 3.10.1–3.10.4 specify URI-valued locations.

Use Node's pathToFileURL for native absolute paths and encode individual relative path segments while keeping separators and case. Apply the same small helper to all three emitters; ordinary repository-relative locations remain unchanged. Other report formats, findings, line numbers, schemas and exit behavior are unchanged.

Validation: 11 watched regression failures now pass across all three renderers and actual prompt/text CLI inputs, including Unicode, spaces, #, ?, literal %25, first-segment colons and native absolute file-URI roundtrips. Actual Node 20.20.2 and 24.19.0 each pass all 48 tests, lint, typecheck, build and smoke; fresh whole-branch review clear. No new dependencies, provider uploads or package release. External SARIF import has not been tested.

This branch has not been deployed

No deployments
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.

1 participant