Brandon Schneider
|
bdc98e2a0e
|
feat(lean): port pist_trace_classify motif scoring to Semantics.PIST.Motif
Ports the motif scoring surface from pist_trace_classify_mcp.py (lines 136–149)
into a provable Lean module:
score = frequency / max(library_size, 1) + (0.3 if tactic_family matches)
New module: Semantics.PIST.Motif (201 lines)
§1 familyMatchBonus constant (ofRatio 3 10 = 19660 raw)
§2 MotifInputs, baseScore, motifScore
§3 MotifCandidate record, mkCandidate constructor
§4 rankMotifs / topKMotifs (mergeSort desc, motifId tie-break)
§5 8 executable #eval witnesses with -- expect: annotations
§6 6 proved invariants:
motifScore_bonus_pos (decide)
motifScore_match_ge_base_witness (decide, concrete)
motifScore_zero_freq_base (simp)
motifScore_zero_freq_no_match (simp)
motifScore_zero_freq_match_witness (decide, concrete)
rankMotifs_match_beats_no_match (native_decide — mergeSort sort witness)
Full workspace build: 3570 jobs, 0 errors.
pist_trace_classify_mcp.py PARTIAL BOUNDARY updated: motif score + rank order
now explicitly point to Semantics.PIST.Motif as authoritative.
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:45:07 -05:00 |
|
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 |
|
Brandon Schneider
|
f9b5ac25fb
|
fix(lean+shim): enforce lean-coding rules across audit surface
## Lean fixes
- RRCLogogramProjection.lean: replace `native_decide` → `decide` in 5
compiler-surface theorem witnesses (semantic_tear_projects_after_repair,
semantic_tear_does_not_merge, semantic_tear_uses_quarantine_lane,
unrepaired_tear_does_not_project, ordinary_logogram_projects_and_merges).
All 5 pass under `decide`; no logic change.
- PistSimulation.lean: add `-- expect: <value>` to every `#eval`/`#eval!`
block across §6–§11 (~104 annotation lines). Document 8 undocumented
`ofRawInt` magic integers in fixtureSpectralWindow (10.0, 20.0, 100.0,
40.0, 20.0, 10.0, 5.0, 5.0 × 65536).
- DynamicCanal.lean: add `-- expect:` to all 15 #eval witness blocks in
§17 (fixed-point constructors, DIAT encoding, coarse-graining tests).
- MISignal.lean: add `-- expect: 131072` to both #eval witnesses.
- Functions/BracketedCalculus.lean: add `-- expect: 327680` to #eval.
- AVMIsa/Emit.lean, RRC/Emit.lean, RRC/ReceiptDensity.lean, ReceiptCore.lean:
previously-staged `-- expect:` additions (from prior session) carried
forward in this commit.
## Python shim fixes
- Add `# PARTIAL BOUNDARY: contains domain logic; not a provable surface.
Port to Lean/RRC before treating as authoritative.` to 9 shim files:
pist_trace_classify_mcp.py, genus0_sphere_shell_demo.py,
routing_benchmark.py, route_repair_v14a.py, pist_prove_and_classify.py,
label_canary_theorems.py, validate_rrc_predictions.py,
pist_receipt_density_injector.py, rrc_pist_shape_alignment.py.
## Build baseline
lake build Compiler → 3311 jobs, 0 errors
lake build → 3567 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:17:40 -05:00 |
|
Brandon Schneider
|
02f1c928d7
|
refactor(rds): consolidate 14 psycopg2 connect patterns into shared rds_connect module
Creates 4-Infrastructure/shim/rds_connect.py with a single connect_rds()
function that resolves connection parameters in priority order:
1. explicit kwargs
2. DATABASE_URL env var (postgres://user:pass@host:port/dbname?sslmode=...)
3. individual RDS_* env vars (RDS_HOST, RDS_PORT, RDS_USER, etc.)
4. built-in defaults
Auth resolution (when password is empty or RDS_IAM=1):
1. RDS_IAM_TOKEN env var (pre-computed)
2. boto3 SDK generate_db_auth_token (preferred)
3. subprocess aws rds generate-db-auth-token (fallback)
4. RDS_PASSWORD env var (non-IAM)
Replaces 8 connection pattern variants across 14 active shims:
- subprocess + RDS_IAM_TOKEN fallback: pist_trace_classify_mcp, joint_classifier,
pist_prove_and_classify, ingest_57_flexures
- boto3 SDK: ene_wiki_body_reingest, ene_migrate_and_tag, dataset_ingest_rds
- subprocess + RDS_PASSWORD: batch_embed_artifacts, sync_wiki_to_rds, seed_flexure_dataset
- RDS_IAM_AUTH: pist_classify
- bashrc parsed: credential_loader
v1.4a benchmark confirmed at 100% after refactor.
|
2026-05-26 15:09:34 -05:00 |
|
Brandon Schneider
|
721a6c620c
|
feat(pist): pist_trace_classify MCP tool — classify proof traces against 57-theorem flexure library
- MCP server: pist-trace-classify (Python, stdio JSON-RPC)
- Accepts trace_path or inline trace_json
- Computes full v2 spectral features from transition matrix
- Queries ene.flexure_patterns for nearest motifs
- Returns predictions: proof_status, tactic_family, joint_label
- Calibration: 'experimental' — 57 samples, 89.5% LOOCV
- Registered as MCP server in opencode.json
- 57 flexures ingested with v2 features (session: a4a0eb20-93fe-413e-8e0b-50334bb778d8)
- 13 motifs in ene.flexure_patterns
|
2026-05-26 11:23:53 -05:00 |
|