The scale mechanism for mapping findings to the master-control corpus (~13.6k), which carries no CWE — so we map by similarity + grounded judgment (Vul-RAG style), not a CWE-LUT.
Pieces
ControlIndex — embeds each control's requirement text; nearest(region_embedding, k) returns the top-K controls by cosine.
SemanticControlChecker — retrieve top-K → judge each with the grounded judge → ground → control_refs. The region → controls direction is what scales: the LLM judges a handful of candidates, not 13.6k, and every survivor is still anchored to real code by the grounding gate.
Integration into the scan (build the index from the master-controls catalog, embed each finding's region, stamp master-control refs) + the live test wait for breakpilot #129 (the master-controls OSCAL export) to deploy.
Testing
clippy -D warnings + cargo fmt --all --check + CI test cmd (302 + 52 + 4 + 27) green.
## What
The scale mechanism for mapping findings to the **master-control corpus (~13.6k)**, which carries **no CWE** — so we map by *similarity + grounded judgment* (Vul-RAG style), not a CWE-LUT.
## Pieces
- **`ControlIndex`** — embeds each control's requirement text; `nearest(region_embedding, k)` returns the top-K controls by cosine.
- **`SemanticControlChecker`** — retrieve top-K → judge each with the grounded judge → ground → `control_refs`. The `region → controls` direction is what scales: the LLM judges a handful of candidates, not 13.6k, and every survivor is still anchored to real code by the grounding gate.
Reuses the existing judge + grounding gate. Stub-tested (cosine ranking, retrieve→ground, ungrounded-dropped).
## Not yet wired
Integration into the scan (build the index from the master-controls catalog, embed each finding's region, stamp master-control refs) + the live test wait for **breakpilot #129** (the master-controls OSCAL export) to deploy.
## Testing
`clippy -D warnings` + `cargo fmt --all --check` + CI test cmd (**302 + 52 + 4 + 27**) green.
The scale mechanism for the master-control corpus (which carries no CWE to LUT
on): ControlIndex embeds each control's requirement text and returns the top-K
nearest to a code region (cosine); SemanticControlChecker retrieves those K,
judges each with the grounded judge, and grounds the verdicts -> control_refs.
The region->control direction (vs the CWE-LUT's finding->control) is what scales
to ~13.6k: the LLM only ever judges a handful of retrieved candidates, and every
survivor is still anchored to real code by the grounding gate. Reuses judge +
ground gate. Stub-tested (cosine ranking, retrieve->ground, ungrounded dropped).
Not yet wired into the scan (needs the master-controls catalog live, breakpilot #129).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Wires the semantic mapping into a callable scan pass:
- OscalControlsProvider: token-based fetch refactor + load_master_controls()
(pulls ?framework=master-controls)
- semantic_stamp_findings(): build the ControlIndex from the master-controls
catalog, then per finding embed its code region, retrieve the top-K nearest
master controls, grounded-judge confirm, and stamp the confirmed ids onto
control_refs (alongside the CRA CWE-LUT refs).
Opt-in — the orchestrator doesn't auto-run it, and it rebuilds the corpus index
per call (production should cache it). Live-verifiable once breakpilot #129 deploys.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
sharang
merged commit f516ecf3b5 into main2026-07-21 10:50:22 +00:00
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.
What
The scale mechanism for mapping findings to the master-control corpus (~13.6k), which carries no CWE — so we map by similarity + grounded judgment (Vul-RAG style), not a CWE-LUT.
Pieces
ControlIndex— embeds each control's requirement text;nearest(region_embedding, k)returns the top-K controls by cosine.SemanticControlChecker— retrieve top-K → judge each with the grounded judge → ground →control_refs. Theregion → controlsdirection is what scales: the LLM judges a handful of candidates, not 13.6k, and every survivor is still anchored to real code by the grounding gate.Reuses the existing judge + grounding gate. Stub-tested (cosine ranking, retrieve→ground, ungrounded-dropped).
Not yet wired
Integration into the scan (build the index from the master-controls catalog, embed each finding's region, stamp master-control refs) + the live test wait for breakpilot #129 (the master-controls OSCAL export) to deploy.
Testing
clippy -D warnings+cargo fmt --all --check+ CI test cmd (302 + 52 + 4 + 27) green.