semgrep prefixes a rule's id with its config's directory relative to its working directory. Our packs are staged in the temp directory, so stored ids looked like tmp.cra-ai-20-csharp-xxe. The scanner now stores the bare id of our rules (semgrep::bare_rule_id, matched against the ids in the bundled packs). Ids that aren't ours are left unchanged.
Fingerprints
rule_idis part of the semgrep fingerprint. The scanner hashes the bare id behind a fixed tmp. prefix (semgrep::fingerprint), which is exactly what prod stored. As a result:
stored findings keep their fingerprint, and with it their triage, status and tracker issues (the issue search goes by fingerprint first);
a rescan of an unchanged tree finds nothing new (tested against Mongo in tests/finding_migrations.rs and as a unit test in semgrep.rs);
the fingerprint no longer depends on TMPDIR or the working directory.
Migration (at agent start, idempotent)
finding_migrations::migrate_stored_findings runs for every tenant before interrupted scans are resumed:
semgrep findings: the rule_id prefix is removed. A fingerprint computed from an older prefix (tmp.compliance-cra-semgrep.<id>) moves to the one a scan computes now, unless another row already holds it.
control-check findings: title and description are spelled with umlauts.
A second run changes nothing.
Umlauts
The CRA catalog spells umlauts out. Titles and statement prose are corrected when the catalog is loaded (OscalDocument::restore_umlauts). It uses a word list, not a rule, so "aktuell", "neue", "Quelle" and "Prozess" stay as they are. Prod runs snapshot-only from the snapshot it was seeded with (copy-if-absent), so the fix has to work at load time. The shipped snapshot is corrected as well.
Not changed: tracker issues that already exist keep their old titles. The catalog upstream in breakpilot-compliance still spells umlauts out.
Closes #463.
## Rule ids
semgrep prefixes a rule's id with its config's directory relative to its working directory. Our packs are staged in the temp directory, so stored ids looked like `tmp.cra-ai-20-csharp-xxe`. The scanner now stores the bare id of our rules (`semgrep::bare_rule_id`, matched against the ids in the bundled packs). Ids that aren't ours are left unchanged.
## Fingerprints
`rule_id` **is** part of the semgrep fingerprint. The scanner hashes the bare id behind a fixed `tmp.` prefix (`semgrep::fingerprint`), which is exactly what prod stored. As a result:
- stored findings keep their fingerprint, and with it their triage, status and tracker issues (the issue search goes by fingerprint first);
- a rescan of an unchanged tree finds nothing new (tested against Mongo in `tests/finding_migrations.rs` and as a unit test in `semgrep.rs`);
- the fingerprint no longer depends on `TMPDIR` or the working directory.
## Migration (at agent start, idempotent)
`finding_migrations::migrate_stored_findings` runs for every tenant before interrupted scans are resumed:
- semgrep findings: the `rule_id` prefix is removed. A fingerprint computed from an older prefix (`tmp.compliance-cra-semgrep.<id>`) moves to the one a scan computes now, unless another row already holds it.
- control-check findings: title and description are spelled with umlauts.
A second run changes nothing.
## Umlauts
The CRA catalog spells umlauts out. Titles and statement prose are corrected when the catalog is loaded (`OscalDocument::restore_umlauts`). It uses a word list, not a rule, so "aktuell", "neue", "Quelle" and "Prozess" stay as they are. Prod runs snapshot-only from the snapshot it was seeded with (copy-if-absent), so the fix has to work at load time. The shipped snapshot is corrected as well.
Not changed: tracker issues that already exist keep their old titles. The catalog upstream in breakpilot-compliance still spells umlauts out.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
semgrep prefixes a rule's id with its config's directory, relative to its
working directory; our packs are staged in the temp directory, so findings
showed rule ids like tmp.cra-ai-20-csharp-xxe. The scanner now stores the
bare id of our rules. The fingerprint keeps hashing the id with the fixed
"tmp." prefix it was stored with, so findings already stored keep their
fingerprint, triage, status and tracker issues, and a rescan finds nothing
new; the prefix no longer depends on where the temp directory is.
The CRA catalog spells umlauts out ("Integritaetspruefung"). Its titles and
statement prose are now spelled right when the catalog is loaded, from a
word list (a rule would break "aktuell", "neue", "Quelle"). Prod serves the
snapshot it was seeded with, so the fix cannot rely on the corrected
shipped snapshot alone; that one is corrected too.
At start the agent rewrites stored findings once (idempotent): semgrep
rule ids lose their prefix (fingerprints from an older prefix move to what
a scan computes, unless taken), and control-check titles and descriptions
get their umlauts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #463.
Rule ids
semgrep prefixes a rule's id with its config's directory relative to its working directory. Our packs are staged in the temp directory, so stored ids looked like
tmp.cra-ai-20-csharp-xxe. The scanner now stores the bare id of our rules (semgrep::bare_rule_id, matched against the ids in the bundled packs). Ids that aren't ours are left unchanged.Fingerprints
rule_idis part of the semgrep fingerprint. The scanner hashes the bare id behind a fixedtmp.prefix (semgrep::fingerprint), which is exactly what prod stored. As a result:tests/finding_migrations.rsand as a unit test insemgrep.rs);TMPDIRor the working directory.Migration (at agent start, idempotent)
finding_migrations::migrate_stored_findingsruns for every tenant before interrupted scans are resumed:rule_idprefix is removed. A fingerprint computed from an older prefix (tmp.compliance-cra-semgrep.<id>) moves to the one a scan computes now, unless another row already holds it.A second run changes nothing.
Umlauts
The CRA catalog spells umlauts out. Titles and statement prose are corrected when the catalog is loaded (
OscalDocument::restore_umlauts). It uses a word list, not a rule, so "aktuell", "neue", "Quelle" and "Prozess" stay as they are. Prod runs snapshot-only from the snapshot it was seeded with (copy-if-absent), so the fix has to work at load time. The shipped snapshot is corrected as well.Not changed: tracker issues that already exist keep their old titles. The catalog upstream in breakpilot-compliance still spells umlauts out.
🤖 Generated with Claude Code
https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
semgrep prefixes a rule's id with its config's directory, relative to its working directory; our packs are staged in the temp directory, so findings showed rule ids like tmp.cra-ai-20-csharp-xxe. The scanner now stores the bare id of our rules. The fingerprint keeps hashing the id with the fixed "tmp." prefix it was stored with, so findings already stored keep their fingerprint, triage, status and tracker issues, and a rescan finds nothing new; the prefix no longer depends on where the temp directory is. The CRA catalog spells umlauts out ("Integritaetspruefung"). Its titles and statement prose are now spelled right when the catalog is loaded, from a word list (a rule would break "aktuell", "neue", "Quelle"). Prod serves the snapshot it was seeded with, so the fix cannot rely on the corrected shipped snapshot alone; that one is corrected too. At start the agent rewrites stored findings once (idempotent): semgrep rule ids lose their prefix (fingerprints from an older prefix move to what a scan computes, unless taken), and control-check titles and descriptions get their umlauts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsBa1973a5663to20e68b6d3f