Research-Stack/0-Core-Formalism/lean
Brandon Schneider 3a44048b22 feat(lean): port route_repair_v14a rank_patches to Semantics.PIST.Repair
Ports the decision-critical scoring functional from route_repair_v14a.py
into a provable Lean surface:

  rank_patches: S = α·specificity − β·cost + γ·success_prior − δ·residual_risk
  ALPHA=0.4, BETA=0.3, GAMMA=0.2, DELTA=0.1  (all as Q16_16.ofRatio)

New module: Semantics.PIST.Repair (232 lines)
  §1  PatchScoreInputs, PatchWeights structures
  §2  rankScore (linear functional), rankScoreDefault, mkInputs, embedResidualRisk
  §3  Patch record + mkPatch constructor
  §4  rankPatches / rankPatchesDefault (mergeSort desc, tag tie-break)
  §5  5 executable #eval witnesses with -- expect: annotations
  §6  8 proved invariants (native_decide):
      defaultWeights_sum, defaultWeights_pos, defaultWeights_ordered,
      rankScore_zero_inputs_negative, embedResidualRisk_one/zero,
      rankScore_monotone_specificity_witness, rankScore_zero_lt_full

Full workspace build: 3569 jobs, 0 errors.

route_repair_v14a.py PARTIAL BOUNDARY comment updated to name this module
as the authoritative source for the scoring surface.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-26 23:32:36 -05:00
..
conversions/hardware WIP: accumulated changes 2026-05-25 16:24:21 -05:00
external/OTOM WIP: accumulated changes 2026-05-25 16:24:21 -05:00
LeanGPT Remove legacy Python prototypes superseded by Lean formalization 2026-05-19 15:34:17 +00:00
Semantics feat(lean): port route_repair_v14a rank_patches to Semantics.PIST.Repair 2026-05-26 23:32:36 -05:00
CHAIN_ALL_REVIEW_REPORT.md initial: sovereign research stack (consolidated, weightless, and lfs-optimized) 2026-05-04 18:11:36 -05:00