Gate 4 has been scanning a file set it INHERITED from a vendor default rather
than one this repo chose, and the difference is invisible in the gate output.
Measured 2026-08-11 on the PINNED CI engine (opengrep v1.22.0 CLI on Linux,
exactly the build reusable-quality.yml installs), controlled detector, one
variable changed at a time:
src/inline.go db.Query(fmt.Sprintf(...)) -> FIRES
tests/inline.go byte-identical to the line above -> SILENT
`paths.skipped` reported `none` while it happened, so nothing in the gate output
revealed it, and pointing the scanner directly at a test path does not override
it. The dropped set, enumerated with one identical vulnerable file per candidate
path: `*_test.go` at ANY depth, plus the `test/` and `tests/` directories.
The engine abandons the built-in template as soon as ANY `.semgrepignore`
exists, so shipping this file restores the test tree.
EFFECT ON THIS REPO, using its own gate-4 scan paths (backend frontend):
211 files scanned before, 211 after (+0), 0 findings either way.
BOTH-STATES PROOF, run against this repo's own curated ruleset:
the same `eval()` file in src/ and under tests/
with this .semgrepignore -> BOTH fire, gate exit 1
with it removed (control) -> src/ fires, tests/ INVISIBLE
a clean `ast.literal_eval` file -> silent, gate exit 0
The control is the load-bearing half: a probe that is silent in the broken state
measures nothing, so the hole is demonstrated rather than asserted.
No exclusion was added to make any finding go away -- the finding count is
unchanged. Every directory entry ships both the root-anchored and the nested
form, because a bare `**/x/` does NOT match a root-level `x/` and fails open
with no warning (measured with a positive control).
Companion control-plane change -- the copyable template plus a non-blocking
gate-4 warning for callers with no explicit scan set:
Prekzursil/quality-zero-platform#289.
What this is
Gate 4 (SAST) has been scanning a file set it inherited from a vendor default, not one this repo chose — and the difference is invisible in the gate output. This ships an explicit
.semgrepignoreso the scanned set becomes a deliberate, reviewable decision.Measured on the pinned CI engine — opengrep v1.22.0 CLI on Linux, exactly the build
reusable-quality.ymlinstalls — with a controlled detector and one variable changed at a time. Confidence: almost certain (90-99%).The hole
src/inline.godb.Query(fmt.Sprintf(...))tests/inline.gopaths.scannedlisted 3 of 4 files andpaths.skippedreportednone— nothing in the gate output says a test tree was dropped. Pointing the scanner directly attests/returnspaths.scanned: [], so an explicit path argument does not override it either.Enumerated precisely, the built-in template drops
*_test.goat any depth, plus thetest/andtests/directories. Python/TS test filenames (test_app.py,app_test.py,conftest.py,app.test.ts,app.spec.ts,__tests__/) are not dropped — only the two directories. The engine abandons the built-in template as soon as any.semgrepignoreexists, so shipping this file is the whole fix.Effect on this repo, using its own gate-4 scan paths (
backend frontend)No change today: 211 files scanned before and after, 0 findings either way.
Nothing under those paths currently matches
*_test.goor atest//tests/directory, so this file is a no-op against the tree as it stands. It is still worth landing: it makes the scanned set a deliberate choice, so the first test directory added here gets scanned instead of being silently dropped — and it removes the dependence on a vendor default nobody picked.Both-states proof, against this repo's own curated ruleset
The same
eval()file placed insrc/and undertests/:The control is the load-bearing half: a probe that is silent in the broken state measures nothing, so the hole is demonstrated rather than asserted.
Scope discipline
**/x/does not match a root-levelx/and fails open with no warning — measured with a positive control (**/vendor/left a root-levelvendor/pkg/b.goscanned;vendor/excluded both trees).test//tests/", so the hole cannot be quietly reopened.Related
Control-plane companion — the copyable template plus a non-blocking gate-4 warning for any caller with no explicit scan set: Prekzursil/quality-zero-platform#289. That PR also records, in
known-issues/QZ-SAST-001.yml, a second measured gate-4 gap: the curated rules match SQL-injection syntax only, so the same bug written through a local variable escapes them. The obviousmode: taintfix was withdrawn after it produced 58 false positives across momentstudio and Reframe; the entry carries the evidence and the settling experiment.