Research-Stack/0-Core-Formalism/lean/Semantics/ExtensionScaffold
Devin AI 0c9efac330 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
..
Compression chore(consolidation): integrate E8Sidon stack (PRs #79 #80 #81 #89) into one PR 2026-06-16 02:01:31 +00:00
Decoherence initial: sovereign research stack (consolidated, weightless, and lfs-optimized) 2026-05-04 18:11:36 -05:00
ENE Expand devcontainer with full Python stack, add MCP servers (Notion/AWS), strengthen Lean theorems 2026-05-19 01:52:14 -05:00
Physics WIP: accumulated changes 2026-05-25 16:24:21 -05:00
Seed initial: sovereign research stack (consolidated, weightless, and lfs-optimized) 2026-05-04 18:11:36 -05:00
Temporal Expand devcontainer with full Python stack, add MCP servers (Notion/AWS), strengthen Lean theorems 2026-05-19 01:52:14 -05:00
Thermodynamics initial: sovereign research stack (consolidated, weightless, and lfs-optimized) 2026-05-04 18:11:36 -05:00
Topology Expand devcontainer with full Python stack, add MCP servers (Notion/AWS), strengthen Lean theorems 2026-05-19 01:52:14 -05:00
MissingProofsTest.lean initial: sovereign research stack (consolidated, weightless, and lfs-optimized) 2026-05-04 18:11:36 -05:00
README.md initial: sovereign research stack (consolidated, weightless, and lfs-optimized) 2026-05-04 18:11:36 -05:00

ExtensionScaffold

Pattern: Research extensions that extend the core Semantics library.

Rule: Core (Semantics/) remains tight. Extensions live here until proven essential.

Derivation Pipeline

Core (Semantics/)
├── Invariants          (surfaceInvariant, localExpansionInvariant)
├── Admissibility       (CausalStatus.admissible, SensorDetection.admissible)
└── Preservation/Collapse  (collapseProne, .collapsed variants across domains)

    ↓ (extends)

Extension Kernel
└── Temporal/TemporalVariantIndex.lean  (generic TVI framework — testing branch)

    ↓ (adapts)

Extension Adapters
└── Temporal/SpikeSync.lean             (neural spike network)
└── (planned: history/decoherence)

    ↗ (may promote if passes all 3 criteria)

Core (future — if irreducible, cross-domain, stable)

Purpose

This scaffold holds:

  • Special regimes — Unusual physical conditions not yet canonical
  • Experimental metaphors — Productive analogies being tested
  • Domain-specific constructions — Vertical applications
  • Candidate metrics — Measures not yet fully stabilized
  • Rich examples — Patterns that may later be promoted into core

Structure

ExtensionScaffold/
├── Thermodynamics/         # Energy/entropy extensions
│   └── ThroatPhysics.lean  # Metastable wormhole maintenance
├── Topology/               # Geometric structure extensions
│   └── PlasmaTopology.lean # Regime classification for plasmas
├── Temporal/               # Time-variant systems
├── Decoherence/            # Branching histories alignment
├── Transmission/           # Horizon/boundary information flow
├── SemanticPrimes/         # Prime-based semantic encoding
├── Narrative/              # Graph OS ancestry structures
└── Dynamics/               # Special kernels, phonons, repair

Promotion Criteria

An extension moves to core only when it passes all three:

1. Irreducibility

You cannot explain the rest of the model without it.

2. Cross-domain reuse

It appears in multiple unrelated cases, not just one favorite example.

3. Stability under revision

It survives multiple rewrites without changing its meaning much.


Old criteria (deprecated): Required by bind, hardware target needs it, cost function depends on it, build fails without it.

Current Extensions

Extension Category Status TVI Kernel
Temporal/TemporalVariantIndex.lean Time-variant Base kernel — generic TVI framework
Decoherence/HistoryTvi.lean Branching histories Active — decoherent history TVI adapter Uses kernel
Temporal/SpikeSync.lean Time-variant Active — neural spike network TVI adapter Uses kernel
Thermodynamics/ThroatPhysics.lean Special regimes Reference — metastable wormhole thermodynamics ⏸️ Standalone
Topology/PlasmaTopology.lean Domain-specific Reference — plasma regime classification ⏸️ Standalone

Architecture Boundaries

ENE (Endless Node Edges) — What It Is NOT

To keep the architecture clean, ENE does NOT:

Compute Store
Compute TVI Store TVI results
Perform spike syncing Record sync outcomes
Perform temporal alignment Document alignment
Decide system actions (PTOS) Witness PTOS decisions
Act as driver Maintain audit trail

ENE is the record, not the computation.

Stack Layering

┌─────────────────┐
│  Driver Layer   │  ExtensionScaffold/Temporal/SpikeSync.lean
│  (computes TVI, │  ExtensionScaffold/Decoherence/HistoryTvi.lean
│   sync, etc.)   │
└────────┬────────┘
         ↓
┌─────────────────┐
│      PTOS       │  Semantics/Prohibited.lean
│  (decides what  │  Semantics/Constitution.lean
│   to do)        │
└────────┬────────┘
         ↓
┌─────────────────┐
│      ENE        │  Semantics/Graph.lean
│  (records what  │  Semantics/Witness.lean
│   is true and   │  Semantics/Evolution.lean
│   how)          │
└─────────────────┘

One-Line Definition

ENE is a typed, witness-backed semantic graph with enforced admissibility, lawful traversal, and fully auditable evolution.

Verification Results

Core build: 43 jobs, zero warnings

TVI Kernel test: Two independent domains (history + spikes) successfully:

  • Import TemporalVariantIndex kernel
  • Map domain objects to TemporalProfile
  • Compute TviVector via fromProfiles
  • Check admissibility via admissible
  • Expose same 4 failure axes: timing, rate, pattern, collapse

Kernel adapters:

  • HistoryTvi.lean: 2 theorems + 4 #eval witnesses
  • SpikeSync.lean: 1 theorem + 4 #eval witnesses

Planned Categories

Category Scope Candidate Content
Temporal/ Time-variant subclass systems Temporal variants, clock domains
Decoherence/ Branching histories Many-worlds alignment, collapse models
Transmission/ Horizon information flow Boundary transmission, holographic principles
SemanticPrimes/ Prime-based encoding Semantic primes, invariant roots
Narrative/ Graph OS structures ENE layer, story graphs, ancestry
Dynamics/ Repair and phonons Special kernels, phonon structures, repair dynamics

Rejected Approaches

File Reason Location
HumanManifold.lean Fatally flawed approach /data/archive/HumanManifold.lean.REJECTED_FATALLY_FLAWED

Usage

Extensions are not imported by Semantics.lean. They may:

  • Import from core
  • Be imported by other extensions
  • Be promoted individually

Build

Extensions are not built by default:

# Build core only (default)
lake build

# Build with extensions (when needed)
lake build +ExtensionScaffold.Thermodynamics.ThroatPhysics

Note: Files here are preserved for reference. Promotion requires human sign-off per AGENTS.md.