refactor(corpus-seeded-mechanisms): apply review round 2 suggestions

- variant_search.search_tree skips a malformed store row with a
  variants_store_row_invalid degradation instead of aborting the scan;
  a hit on a demoted or flowless overlay record is never merged (test).
- seed.pair_lessons is the one shape derivation shared by the exporter
  and leave-one-out; labels pass line and sink together; pairs without a
  labeled function are reported as no_labeled_function.
- config parses [variants].max_mechanisms with the shared int helper.
- regress.candidate.hotspot_from_finding is the one zero-score hotspot
  helper for forced inventory and variant findings.
- design synced (SearchResult, hits_to_findings summaries, candidate.py).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01T7XD7x5KonMdmGRkp63EQG
This commit is contained in:
Marius Ciepluch
2026-09-05 14:55:00 +02:00
co-authored by Claude Fable 5.1
parent a767ba80b4
commit 8f444051f2
6 changed files with 105 additions and 34 deletions
+7 -2
View File
@@ -99,19 +99,24 @@ def _hotspot_for_finding(finding: StaticFinding, hotspots: Sequence[Hotspot]) ->
return None
def _hotspot_from_forced_finding(finding: StaticFinding) -> Hotspot:
def hotspot_from_finding(finding: StaticFinding, *, rationale: str) -> Hotspot:
"""A zero-score hotspot wrapping one finding: forced sev-5 inventory or a variant of a known mechanism."""
return Hotspot(
path=finding.path,
function_name=finding.function_name,
score=0.0,
band="low",
signals={},
rationale="forced reachable severity-5 inventory",
rationale=rationale,
test_hint=None,
inventory_finding_ids=(finding.finding_id,),
)
def _hotspot_from_forced_finding(finding: StaticFinding) -> Hotspot:
return hotspot_from_finding(finding, rationale="forced reachable severity-5 inventory")
class RegressionRunner:
"""Run a snippet in the sandbox only after the structural safety check passes."""