Commit graph

22 commits

Author SHA1 Message Date
4da68e1a19 docs: update AGENTS.md for SpherionTwinPrime module + add spherion_twin_prime.py shim
AGENTS.md: added SpherionTwinPrime architecture section, updated Burgers energy dissipation to parametric form.

spherion_twin_prime.py (20KB): priority-queue walk with polarity energy tuning.

Build: 8598 jobs, 0 errors.
2026-06-16 23:38:51 -05:00
cfb83cf038 feat(lean): close sidon_weight_bound + deepseek v4 flash harness
sidon_weight_bound: corrected RHS from invalid sigma7(2N)/120 to
sum_{s=2}^{2N} convolutionRHS(s). Proof uses Finset.single_le_sum +
Sidon injectivity (Finset.sum_image) + E8 convolution identity.

All 5 E8 Sidon theorems now closed (0 sorries in §§9-13).

New: deepseek_v4_flash_lean_harness.py — sorry-resolution harness
targeting local llama.cpp DeepSeek V4 Flash endpoint. Scans .lean
files, sends theorem context to LLM, inserts generated proofs,
verifies with lake build, emits receipts.

Build: 3583 jobs, 0 errors (lake build)
2026-06-16 17:37:00 -05:00
475f6319ea chore(repo): push local 768-commit branch state onto clean remote baseline
This squashes all local history (768 commits) onto the scrubbed PR #90
baseline. Individual commits were lost during filter-repo corruption;
the working tree content is preserved intact.

Build: N/A (working tree state only)
2026-06-15 22:46:50 -05:00
Devin AI
0639eae30a chore(consolidation): integrate E8Sidon stack (PRs #79 #80 #81 #89) into one PR
Squash the four overlapping feature branches into a single change set against
main, eliminating cross-PR merge conflicts and the duplicated CI-fix scripts.

What this brings in (merge order #79 -> #80 -> #81 -> #89):
- #79 refactor(infra): shared utilities (4-Infrastructure/lib/*: q16, hashing,
  jsonl, fraction_utils) + the scripts/math-first/* validators that the
  math-check CI requires.
- #80 feat(lean): Semantics.E8Sidon (1025 lines) -- Eisenstein coefficient
  identity E4^2 = E8 and the Sidon framework. E4_sq_eq_E8_coeff is fully proved
  (all Fourier-coefficient extraction machine-checked); the single residual gap
  is pinned to E4_sq_eq_E8_qExpansion (Mathlib lacks the valence formula /
  dim M8 = 1). 4 sorries + 1 axiom (e8_additive_completeness), all TODO(lean-port).
- #81 refactor(lean): Float-free FixedPoint core (integer-only sqrt/log2/expNeg).
  E8Sidon.lean kept at #80's final 1025-line version (the #81 intermediate
  438-line copy was overridden by merge order).
- #89 feat(lean): Semantics.RRC.PolyFactorIdentity -- short-sleeve polynomial
  detection at the zerocopy limb boundary; now imports Semantics.E8Sidon for
  sigma3/sigma7/convolutionLHS (single source of truth) instead of inlining them.

Conflict resolution:
- flake.nix -> canonical rs-surface removal (Garnix shutdown).
- scripts/math-first/* -> byte-identical across branches, clean.
- .cursorrules / AGENTS.md -> unified; baselines + sorry inventory refreshed.

Verification:
- lake build (default aggregator): 3573 jobs, 0 errors.
- lake build Semantics.RRC.PolyFactorIdentity (E8Sidon + FixedPoint + PolyFactor):
  3655 jobs, 0 errors. Witnesses verified (sigma7 4 = 16513, convolutionLHS 6 = 2350).
- Python tests: 68/68 pass.

Note: the "Workers Builds: researchstack" check is a preexisting external
Cloudflare build unrelated to this change (no branch touches 4-Infrastructure/cloudflare/).

Build: 3573 jobs (default), 3655 jobs (narrow), 0 errors
Co-Authored-By: Allaun Silverfox <bigdataiscoming+9i37y6j2@protonmail.com>
2026-06-16 02:01:31 +00:00
Brandon Schneider
c64e4f15eb docs: update AGENTS.md — BraidDiatCodec shim + bridge modules
4-Infrastructure: add braid_diat_codec.py to stack-solidification anchors
Semantics: document BraidSpherionBridge admits (IntNodeToPhaseVec linearity, receipt_correspondence)
2026-05-30 13:30:55 -05:00
Brandon Schneider
d51f854516 feat(lean): BraidDiatCodec — chirality/MMR/braid residual codec
BraidField.lean fixes:
- MMR.append: fix termination with named rec + termination_by mmr
- burdenCost: replace Nat.abs → Int.ofNat + manual abs via Nat.preadJoin
- SpherionState: add Inhabited instance (was blocking BraidDiatCodec)
- PISTField: add Inhabited instance

BraidDiatCodec.lean (new):
- ChiralityDIAT: 2-bit chirality + 62-bit DIAT slot (encode/decode + roundtrip proof)
- MountainPacked: height(8)+apex(48)+base_count(8)+bases; fromMountain/toMountain
- BraidResidualPacked: 5 Q0_2 fields × 2 bits; bracket_roundtrip theorem
- BraidDiatFrame: 256-bit fixed header + variable mountain list; encode/decode

Codec layers the mountains-on-mountain stack:
  Layer 1: Chirality-DIAT slot address (spatial hierarchy + anti-correlation prod)
  Layer 2: Mountain pack (height/apex/base, self-similar inner MMR)
  Layer 3: Braid residual (Q0_2 crossing residuals, 10 bits/crossing)
  Layer 4: Complete frame (SpherionState × BraidReceipt → frame → back)

Build: 3560 jobs, 0 errors (lake build)

AGENTS.md: updated blessed surface + codec documentation
2026-05-30 02:51:30 -05:00
Brandon Schneider
cb24bbbc9d fix(lean): resolve Q16_16 obstruction in det_self_inverse
Restructured the det_self_inverse theorem in AdjugateMatrix.lean into det_self_inverse_approx and det_self_inverse_exact to account for fixed-point division/multiplication truncation errors. Proved the updated build in Semantics.

Build: 3571 jobs, 0 errors (lake build)
2026-05-28 17:46:53 -05:00
Brandon Schneider
fd8871a23e fix(infra): configure sparkle build script to support system path fallback
Resolve issue where build_sparkle_tangnano9k.sh failed to locate nextpnr-himbaechel by checking the system PATH when local folder tools/ is empty.

Build: 3571 jobs, 0 errors (lake build)
2026-05-28 15:03:17 -05:00
Brandon Schneider
31b2f1f66f feat(infra): compile and SRAM-flash UART beacon with reset bypass
Synthesized and placed-and-routed the UART beacon design on Tang Nano 9K with physical reset bypassed (rst_n_internal = 1'b1). Programmed the SRAM using openFPGALoader (CRC check: Success). Verified the physical UART blockage due to BL702 bridge firmware limitations via local probe, confirming the virtual serial route (virtual://q16-pty) as the active verification path. Updated scoped AGENTS.md files with the latest hardware status and Lean build baselines.

Build: 3313 jobs, 0 errors (lake build)
2026-05-28 14:10:46 -05:00
Brandon Schneider
e203a5215e feat(hardware): Emergency Boot Witness reference implementation
Add compiling Lean modules and Python shim for the Geometry Emergency
Boot Witness specification (graphene supercapacitor geometric encoding).

Lean modules (Semantics.Hardware.EmergencyBoot.*):
- EmergencyBootTypes: HexCoord, CapClass, OpticalPath, VoltageDifferential,
  GrapheneMemristor, HybridOpticalPath, material properties
- EmergencyBootState: PowerState, SolarPowerState, ScanState, seed assembly,
  emergency boot state machine with 6502 calculator efficiency targets
- EmergencyBootShell: Command opcodes, status byte encoding, process
  definitions, executeCommand dispatch

All use Q16_16 fixed-point arithmetic (no Float in compute paths).
Verified theorems: utilizationWithinBounds, powerFailureMonotonic,
commandOpcode_roundTrip.

Python shim (4-Infrastructure/hardware/emergency_boot/):
- EmergencyBootEngine simulating FPGA geometric scan and seed extraction
- Demo CLI showing power failure → self-powered calculator mode →
  geometric scan → seed assembly flow

Build: 3302 jobs, 0 errors (narrow target), 3313 jobs, 0 errors (Compiler)

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

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-27 23:00:39 -05:00
Brandon Schneider
b8299e209f feat(fixedpoint): prove mul_mono_left/right; fix SSMS t2 arg
FixedPoint.lean:
- mul_mono_left: proved via Int.mul_le_mul_of_nonneg_right + Int.ediv_le_ediv
  with explicit hpos : 0 < q16Scale proof (not synthesized by norm_num)
- mul_mono_right: proved via Int.mul_le_mul_of_nonneg_left + same pattern
- abs_triangle: reverted to admit — q16Clamp applies Int.abs internally making
  sign analysis non-trivial; needs case split on sign of (a*b)/q16Scale

SSMS.lean:
- t2 (line 617): corrected first arg from cT i - cT j to Q16_16.abs (cT i - cT j)
  to match available hcand hypothesis
- t1 (line 606-614): fixed admit in inner proof with proper h_diff_nonneg +
  lt_of_ge_of_le chain using h_aciBound_nonneg
- AGENTS.md: updated status — mul_mono_left/right are proved, abs_triangle is the
  critical remaining blocker for aciPreservedByMlgruStep

Build: 3313 jobs, 0 errors (lake build)
2026-05-27 17:12:38 -05:00
Brandon Schneider
efe8c14973 refactor(ssms): clean f_eps/omf_eps proof; restructure ko_preserves_hyperbola_approx
- SSMS: remove redundant conflicting sub-proofs in f_eps/omf_eps; streamline
  with single H2 + h2 + omega chain
- HyperbolicStateSurface: replace trivial identity ko_preserves_hyperbola_approx
  with proper TODO(lean-port) admitting the full bound-propagation chain for
  sqrt error; AGENTS.md updated accordingly
- AGENTS.md: update aciPreservedByMlgruStep status to reflect mul_mono_left
  as critical remaining blocker

Build: 3313 jobs, 0 errors (lake build)
2026-05-27 16:49:05 -05:00
Brandon Schneider
09913f9791 chore(lean): stub 6 Q16_16 arithmetic lemmas with TODO(lean-port)
FixedPoint.lean: add stubs for abs_triangle, sub_eq_add_neg,
mul_mono_left/right, add_le_add, abs_nonneg, abs_mul_le.
All blocked by the same core issue: calc/rw/omega fail on
ofRawInt-projected Int arithmetic after unfold mul/add/abs/neg.
The pattern that works in PistSimulation (unfold + Int.ediv_le_ediv
+ ofRawInt_toInt_eq_clamp + q16Clamp_monotone) fails here
because the goal structures differ.

Known-working pattern to finalize:
  1. unfold the Q16_16 op
  2. have h2 := raw Int inequality (Int.mul_le_mul_of_nonneg_*)
  3. have hdiv := Int.ediv_le_ediv (by norm_num) h2
  4. rw [ofRawInt_toInt_eq_clamp, ofRawInt_toInt_eq_clamp]
  5. exact q16Clamp_monotone _ _ hdiv

AGENTS.md: document 6 new TODO(lean-port) items in Pending Proof Work.

Build: 3313 jobs, 0 errors (lake build Compiler)
2026-05-27 16:35:53 -05:00
Brandon Schneider
55d2cf897b docs(semantics): clarify remaining proof-boundary work in AGENTS.md
Body:
- ko_preserves_hyperbola_approx: document the new explicit premise
  (onHyperbolaApprox (forwardStep s Δu) Q16_16.epsilon at line 69)
- aciPreservedByMlgruStep: document the new explicit premise (hBlendACI
  at lines 545-548)
- both retain their TODO(lean-port) tags for the arithmetic lemmas
  (sqrt error bound / triangle inequality + mul monotonicity)

Build: 3313 jobs, 0 errors (lake build Compiler)
2026-05-27 15:22:10 -05:00
Brandon Schneider
e028758f9c fix(lean): discharge q16 proof-boundary sorries
Remove three active sorries by tightening the QFactor lawfulness gate and making the HyperbolicStateSurface and SSMS Q16_16 proof boundaries explicit premises instead of hidden obligations.

Build: 3571 jobs, 0 errors (lake build)
2026-05-27 15:13:54 -05:00
Brandon Schneider
ede983168c feat(lean): complete goldenContractionEnergyDecrease proof + PIST predictions pipeline v2
- PistSimulation.lean: proven goldenContractionEnergyDecrease (no sorry)
  7 supporting lemmas, h_u'_nonneg + h_pt hypothesis, fold induction
- Connectors.lean: restored zeroIsVoid theorem with Q16_16 proof
- CanonSerialization.lean: removed dead theorem, documented blocker
- FixedPointBridge.lean: eliminated Float from compute paths

PIST predictions pipeline:
- pist_matrix_builder.py: reproducible matrix-only builder (SHA256)
- build_pist_matrices_278.py: generates PIST/Matrices278.lean
- PIST/Classify.lean: classifyProxy/classifyExact stubs (v2 surface)
- PIST/Matrices278.lean: 250-entry matrix HashMap
- build_corpus278.py: reads predictions artifact, uses classify*
- Pipeline contract documented in root AGENTS.md

Cleanup:
- Archived 5 orphan pist_* shims, 5 old route_repair variants
- Quarantined PIST/Repair.lean (no external callers)
- Created 4 opencode agents for remaining TODO items

Build: PistSimulation 3309, Compiler 3313, Full 3571 (0 errors)
2026-05-27 12:40:16 -05:00
Brandon Schneider
3044f36df7 docs(agents): project-wide AGENTS.md audit — cross-refs, baseline, contracts
Actions taken from 5-agent audit sweep (audit date 2026-05-26):

AGENTS.md / docs sync:
- root AGENTS.md: add scripts/qc-flag and lean_expert_agent to Nested Contracts
- All 6 nested AGENTS.md files: append Cross-References section pointing to
  root for Post-Interaction Workflow, Programming Choice Flow, Do Not Sweep,
  Git Remote Hygiene (Lean, Infra, text-to-cad, docs, qc-flag, lean_expert_agent)
- 6-Documentation/docs/AGENTS.md: cross-ref also lists AVMIsa.Emit sole output
  boundary and Compiler surface blessing

Lean build baseline:
- 0-Core-Formalism/lean/Semantics/AGENTS.md: update blessed Compiler Surface
  header to commit 49f0dfb3; correct job count to 3311 (lake build Compiler)

ARCHITECTURE.md:
- §7 repo table: add RRC.Emit, AVMIsa.Emit, RRC.Corpus278 to Lean/Semantics entry
- New §7.1 Compiler Surface: documents 3-root pipeline and sole output boundary
- §4 Data Flow: annotate output with AVMIsa.Emit sole-boundary note

TODO_MAP.md:
- Phase A6: add 3 new Lean deliverables (Corpus278, RRC.Emit, AVMIsa.Emit);
  update status/result with Compiler build baseline; refine next action

Build: Compiler 3311 jobs, 0 errors (no Lean changes).

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

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-26 22:34:46 -05:00
Brandon Schneider
0a70ba80fe docs(agents): post-interaction workflow + Compiler surface update
Root AGENTS.md:
- Add §Post-Interaction Workflow: mandatory steps after every agent session
  that changes code — update AGENTS.md, verify build, commit, check tree
  cleanliness. Explicit trigger conditions (file edits, lake build, arch
  decisions, new TODO/quarantine). Does NOT trigger for read-only sessions.
- Update AVM glossary entry: ISA is live; AVM is sole output boundary for
  RRC receipts; describe AVMIsa.Emit / RRC.Emit / RRC.Corpus278 roles.

Semantics/AGENTS.md:
- Replace stale Blessed Compiler Surface section with current state (commit
  3f923e2c, 3567 jobs, 3 roots: RRC.Emit, AVMIsa.Emit, RRC.Corpus278)
- Document AVM-sole-output-boundary architecture with ASCII data-flow diagram
- Document 278-corpus current state: (278, 0, 278) — correct and honest
- Document 5 generator fields for EN9wiki page generation
- Document build_corpus278.py regeneration command and Python/Lean role split

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

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-26 22:25:26 -05:00
Brandon Schneider
95e6cef58d chore(lean): consolidate Compiler surface + goldenContractionEnergyDecrease fix
- lakefile.toml: add Compiler lean_lib with 5 blessed roots
  (Semantics.RRC.Emit, Semantics.AVMIsa.Emit, Semantics.AVMIsa.Run,
  Semantics.ReceiptCore, Semantics.RRCLogogramProjection);
  defaultTargets = ["Semantics", "Compiler"]
- PistSimulation.lean: restore goldenContractionEnergyDecrease theorem body
  (was commented out as TODO forward-ref to arrayKineticEnergy); moved to
  after burgersPhiEnergyStep where all dependencies are in scope;
  proof stub retained with sorry + TODO(lean-port) comment
- AGENTS.md: document blessed Compiler surface, Goal A receipt shape,
  quarantine table, pending proof work, and key Lean 4.30 API notes

Build: 3566 jobs, 0 errors (lake build)

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

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-05-26 22:05:46 -05:00
Brandon Schneider
fd863af6fd Expand devcontainer with full Python stack, add MCP servers (Notion/AWS), strengthen Lean theorems
- .devcontainer/Dockerfile: add PostgreSQL client libs, OpenSSL/libffi headers, gfortran/BLAS for scipy, rclone; install full Python dependency set (boto3, psycopg2-binary, fastapi, uvicorn, notion-client, httpx, pytest, numpy, scipy, etc.) in uv-managed venv; add rclone S3 gateway init script as ENTRYPOINT
- .devcontainer/devcontainer.json: switch from build to pre-built image (localhost/research
2026-05-19 01:52:14 -05:00
Brandon Schneider
cb96c6bed2 Update repository agent operating contracts 2026-05-11 22:48:54 -05:00
Brandon Schneider
29f9b78b6d Stage stack solidification source slice 2026-05-11 22:08:10 -05:00