Add FileMap to SARIF for metadata conversion#356
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a build failure caused by the interaction between PR #343 (which changed metadata to use 1D locations instead of 2D) and PR #290 (which added SARIF output format support). The changes adapt the SARIF output functionality to work with the new 1D location metadata by adding a FileMap parameter to convert 1D byte offsets to 2D line/column positions.
Changes:
- Updated SARIF output functions to accept a
Map Strata.Uri Lean.FileMapparameter for converting 1D positions to 2D - Modified the main verification entry point to create and pass the files map when generating SARIF output
- Updated all tests to use the new API and adjusted test expectations to match the 1D-to-2D conversion behavior
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| Strata/Languages/Core/SarifOutput.lean | Added files parameter to extractLocation, vcResultToSarifResult, and vcResultsToSarif functions; changed from file2dRange to fileRange and added 1D-to-2D position conversion using FileMap.toPosition |
| StrataTest/Languages/Core/SarifOutputTests.lean | Updated test helpers to create FileMap and files map; updated all test calls to pass the files parameter; adjusted test expectations to reflect 1D-to-2D conversion (e.g., offset 0 → line 1, column 0) |
| StrataVerify.lean | Created a files map containing the input file's FileMap and passed it to vcResultsToSarif when generating SARIF output |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
aqjune-aws
approved these changes
Jan 29, 2026
shigoel
approved these changes
Jan 29, 2026
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.
This fixes a build failure after PRs #343 and #290 crossed in the air.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.