Repository navigation
Conversation
FILE_OF resolves a partial-analysis notice's file from its message text when
the notice carries no location, and the main invocation's notices carry none.
The syntax/lexical pattern required a capital S, but Semgrep writes "Other
syntax error" with a lower-case s. That notice yielded no uri and the file was
dropped from the coverage count. A dropped file reads clean, which is the
silent-clean class the list exists to close.
Measured on the SDL Hercules-390 sweep (2026-11-29): 424 file-partial notices,
1 unattributed, machdep.h ("Other syntax error at line machdep.h:1: Failure:
found invalid inline assembler statement as expression"). The tree's count
moves 233 -> 234 files read only in part, 222 -> 223 syntax-error.
The descriptor id already matched FILE_PARTIAL_IDS. The reason was known and
the file was not. Only the text pattern was case-sensitive. A case-insensitive
flag fixes it without touching the capitalised form, and both directions are
pinned by a test.
Refs: cw-hercules-scan-20261129 F6
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.
The fault
FILE_OFinmonitor/sarif-read.mjsresolves a partial-analysis notice's file from its message text when the notice carries no location, and the main invocation's notices carry none. The syntax/lexical pattern required a capitalS:/^(?:Other )?(?:Syntax|Lexical) error at line (.+?):\d+:/Semgrep writes
Other syntax errorwith a lower-cases. The pattern did not match, the notice yielded no uri, andfileNoticereturned null. The file was dropped from the coverage count entirely.That is the silent-clean class the list exists to close: a file read only in part, reported as nothing at all.
Measured
On the SDL Hercules-390 sweep (
cw-hercules-scan-20261129, develop @ 8ab5c3f1):The one unattributed notice was
machdep.h:The descriptor id already matched
FILE_PARTIAL_IDS, so the reason was known and the file was not. Only the text pattern was case-sensitive.The fix
A case-insensitive flag on that one pattern. The capitalised form still matches, and both directions are pinned by a test.
Tests
monitor/test/unit-sarif-read-partial-analysis.test.mjs— 10/10, including two new cases (lower-case resolves, capitalised still resolves)monitor/test/unit-sarif-read-*.test.mjs+sarif-partial-and-copies,sarif-read-degraded,sarif-read,one-sarif-reader— 193/193bin/test/semgrep-retry.test.mjs— 56/56Relation to #22
#22 copies files the JSON
errors[]names and the notices omit into the SARIF, which masks this symptom when--jsonis passed. It does not fix it: a SARIF-only run has no JSON, and the notice is still dropped. This is the underlying defect in the reader.Refs: cw-hercules-scan-20261129 F6