Research-Stack/4-Infrastructure/shim
Brandon Schneider 8ee3d431d2 feat(lean): port pist_trace_classify_mcp spectral logic to Semantics.PIST.Spectral
## New module: Semantics.PIST.Spectral

Ports the two domain-logic functions from pist_trace_classify_mcp.py
that were previously executing in unverified Python:

### classify_tactic_from_name → classifyTacticFromName
- `TacticFamily` inductive (rewrite, normalization, arithmetic, induction,
  algebraic, case_analysis, discharge, reflexivity, unknown)
- Pure string-lookup; 5 executable witnesses confirm all branches.

### compute_spectral → computeSpectral
- `isqrt` — integer Newton's method for floor(√n); 4 witnesses.
- `powerIteration` — Q16_16 fixed-point dominant eigenvalue via power
  iteration with Rayleigh quotient; identity-matrix witness = 65536.
- `SpectralProfile` structure — 10 fields (matrix_size, rank,
  spectral_gap, density, trace_val, frobenius_norm, laplacian_zero_count,
  adjacency_eigenvalue_max, laplacian_eigenvalue_max, singular_value_max).
- `computeSpectral` — symmetrize → lap → powerIteration → shift-deflation
  for second eigenvalue → AᵀA for singular value; 3 witnesses on 2×2 fixture.

No Float in any compute path. All magic constants documented with formulas.

## Other changes
- Semantics.lean: add `import Semantics.PIST.Spectral`
- AgenticOrchestration.lean:163: expand bare `-- TODO(lean-port):` label
- pist_trace_classify_mcp.py: update PARTIAL BOUNDARY comment to name
  the Lean module that now owns spectral logic

## Build baseline
  lake build Compiler → 3311 jobs, 0 errors

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:25:50 -05:00
..
authentik_agent_manager WIP: accumulated changes 2026-05-25 16:24:21 -05:00
lake_compile_bridge style(compile-bridge): format GPU verifier 2026-05-20 18:46:49 -05:00
netwatch WIP: accumulated changes 2026-05-25 16:24:21 -05:00
tang9k_ipc_worker WIP: accumulated changes 2026-05-25 16:24:21 -05:00
batch_embed_artifacts.py refactor(rds): consolidate 14 psycopg2 connect patterns into shared rds_connect module 2026-05-26 15:09:34 -05:00
beaver_mask_freshness_negative_controls.py Stage stack solidification source slice 2026-05-11 22:08:10 -05:00
build_corpus278.py feat(rrc): 278-equation corpus — AVM sole output boundary, RRC classifier feeds it 2026-05-26 22:23:56 -05:00
clean_rrc_pist_validation.py feat(pist): add RRC PIST validation report cleaner 2026-05-26 15:38:07 -05:00
combined_theorems.py feat(pist): scaled Tier 2B batch — 21/64 theorems, RRCShape 71.4% 2026-05-26 10:34:32 -05:00
compare_tier1_vs_tier2.py feat(pist): Tier 2 beats Tier 1 on 5/6 independent targets 2026-05-26 09:57:10 -05:00
credential_loader.py refactor(rds): consolidate 14 psycopg2 connect patterns into shared rds_connect module 2026-05-26 15:09:34 -05:00
dataset_ingest_rds.py refactor(rds): consolidate 14 psycopg2 connect patterns into shared rds_connect module 2026-05-26 15:09:34 -05:00
decompose_tier2b_traces.py feat(pist): Tier 2B spectral decomposition — first real proof-path spectra 2026-05-26 03:08:05 -05:00
ene_migrate_and_tag.py cleanup(ene): remove hardcoded schema path, drop inline schema fallback, add legacy shim strip receipt 2026-05-26 16:22:40 -05:00
ene_substrate_schema.sql Expand devcontainer with full Python stack, add MCP servers (Notion/AWS), strengthen Lean theorems 2026-05-19 01:52:14 -05:00
ene_wiki_body_reingest.py refactor(rds): consolidate 14 psycopg2 connect patterns into shared rds_connect module 2026-05-26 15:09:34 -05:00
failure_flexure_bank.py feat(pist): Route-Repair v1.1 — 60 failure flexures ingested, obstruction-type voting 2026-05-26 12:17:42 -05:00
genus0_sphere_shell_demo.py fix(lean+shim): enforce lean-coding rules across audit surface 2026-05-26 23:17:40 -05:00
gpu_fpga_ipc_symbol_surface.py WIP: accumulated changes 2026-05-25 16:24:21 -05:00
hutter_jxl_starfield_eigenprobe.py Stage JXL starfield replay slice 2026-05-11 22:08:44 -05:00
hutter_jxl_starfield_replay_verify.py Stage JXL starfield replay slice 2026-05-11 22:08:44 -05:00
ingest_57_flexures.py refactor(rds): consolidate 14 psycopg2 connect patterns into shared rds_connect module 2026-05-26 15:09:34 -05:00
ingest_flexure_joints.py feat(pist): flexure features v2 — full spectral profile per joint 2026-05-26 11:00:31 -05:00
joint_classifier.py refactor(rds): consolidate 14 psycopg2 connect patterns into shared rds_connect module 2026-05-26 15:09:34 -05:00
label_canary_theorems.py fix(lean+shim): enforce lean-coding rules across audit surface 2026-05-26 23:17:40 -05:00
lean_trace_bridge.py feat(pist): Tier 2 trace bridge — tactic-level goal transitions 2026-05-26 02:28:16 -05:00
lean_trace_bridge_v2.py feat(pist): 57/64 theorem batch — 89.5% proof status LOOCV 2026-05-26 11:20:17 -05:00
Modelfile.gemma-physics-math Track remaining source and documentation inventory 2026-05-11 22:18:31 -05:00
pist_canary_batch.py feat(pist): canary batch — 42 real Lean theorems through full pipeline 2026-05-26 02:09:08 -05:00
pist_classify.py refactor(rds): consolidate 14 psycopg2 connect patterns into shared rds_connect module 2026-05-26 15:09:34 -05:00
pist_enrich_and_train.py chore(infra): stage pist canary labeling and training shims + flexure report 2026-05-26 22:32:13 -05:00
pist_prove_and_classify.py fix(lean+shim): enforce lean-coding rules across audit surface 2026-05-26 23:17:40 -05:00
pist_receipt_density_injector.py fix(lean+shim): enforce lean-coding rules across audit surface 2026-05-26 23:17:40 -05:00
pist_route_repair.py feat(pist): Route-Repair Loop v1 — 11% recovery rate 2026-05-26 11:38:01 -05:00
pist_trace_classify_mcp.py feat(lean): port pist_trace_classify_mcp spectral logic to Semantics.PIST.Spectral 2026-05-26 23:25:50 -05:00
pist_trace_decompose.py feat(pist): Tier 2 trace canary — 24 multi-tactic Lean theorems 2026-05-26 02:37:22 -05:00
pist_train.py feat(pist): validation + calibration harness 2026-05-26 01:49:21 -05:00
pist_train_ground_truth.py chore(infra): stage pist canary labeling and training shims + flexure report 2026-05-26 22:32:13 -05:00
rds_connect.py refactor(rds): consolidate 14 psycopg2 connect patterns into shared rds_connect module 2026-05-26 15:09:34 -05:00
route_repair_v11.py feat(pist): Route-Repair v1.1 — 60 failure flexures ingested, obstruction-type voting 2026-05-26 12:17:42 -05:00
route_repair_v12.py feat(pist): Route-Repair v1.2 — 36% recovery from 0% 2026-05-26 12:38:17 -05:00
route_repair_v13a.py feat(pist): Route-Repair v1.3a — PIST-NUVMAP database-backed ranking 2026-05-26 12:49:29 -05:00
route_repair_v13b.py feat(pist): v1.4a — 100% recovery across 35 theorems 2026-05-26 14:03:59 -05:00
route_repair_v14.py feat(pist): Route-Repair v1.4 — 71% recovery 2026-05-26 13:09:37 -05:00
route_repair_v14a.py fix(lean+shim): enforce lean-coding rules across audit surface 2026-05-26 23:17:40 -05:00
routing_benchmark.py fix(lean+shim): enforce lean-coding rules across audit surface 2026-05-26 23:17:40 -05:00
rrc_pist_shape_alignment.py fix(lean+shim): enforce lean-coding rules across audit surface 2026-05-26 23:17:40 -05:00
run_scaled_trace.py feat(pist): scaled Tier 2B batch — 21/64 theorems, RRCShape 71.4% 2026-05-26 10:34:32 -05:00
run_trace_canary.py feat(pist): Tier 2 trace canary — 24 multi-tactic Lean theorems 2026-05-26 02:37:22 -05:00
run_trace_v2_canary.py feat(pist): Tier 2B — instrumented trace bridge with real transition matrices 2026-05-26 02:56:46 -05:00
seed_flexure_dataset.py refactor(rds): consolidate 14 psycopg2 connect patterns into shared rds_connect module 2026-05-26 15:09:34 -05:00
stack_fail_closure_register.py Stage stack solidification source slice 2026-05-11 22:08:10 -05:00
stack_solidification_audit.py Stage stack solidification source slice 2026-05-11 22:08:10 -05:00
sync_wiki_to_rds.py refactor(rds): consolidate 14 psycopg2 connect patterns into shared rds_connect module 2026-05-26 15:09:34 -05:00
tang9k_uart_beacon_probe.py Stage stack solidification source slice 2026-05-11 22:08:10 -05:00
test_pist_receipt_density_injector.py test(pist): add receipt-density injector regression harness 2026-05-26 15:16:40 -05:00
trace_canary_theorems.py feat(pist): Tier 2 trace canary — 24 multi-tactic Lean theorems 2026-05-26 02:37:22 -05:00
validate_receipt_density_sidecar.py feat(pist): add receipt-density sidecar readback validator 2026-05-26 15:18:11 -05:00
validate_rrc_predictions.py fix(lean+shim): enforce lean-coding rules across audit surface 2026-05-26 23:17:40 -05:00