Research-Stack/1-Distributed-Systems/ene/src/lib.rs
Brandon Schneider 6679908f7b fix(arch): enforce Lean-first hierarchy across project — remove all secondary-Lean language
Project-wide sweep to find and fix every place Lean was treated as secondary,
optional, or subordinate to Python/Rust. The invariant: Lean is the source of
truth. Python and Rust are extraction targets only; they contain no logic, no
invariant checks, no decisions.

Changes:

1-Distributed-Systems/ene/src/lib.rs
  - CRITICAL: Remove 'Rust is the canonical implementation language for
    operational components' — replace with correct extraction-target framing

1-Distributed-Systems/agents/claw/README.md
  - Remove 'canonical implementation lives in rust/' and 'source of truth is
    ultraworkers/claw-code' blanket claims — scope to CLI binary only;
    add Research Stack domain-logic note (Lean is source of truth per AGENTS.md)
  - 'canonical Rust workspace' → 'Rust workspace (I/O extraction target)'

1-Distributed-Systems/agents/claw/src/Tool.py
  - 'Python-first porting summary' → 'Lean-to-Python extraction summary'

1-Distributed-Systems/agents/claw/src/projectOnboardingState.py
  - python_first: bool = True → lean_first: bool = True (Lean always leads)

6-Documentation/docs/specs/ENE_MEMORY_ATLAS_SPEC.md
  - CRITICAL: 'Python first (reference) ... Lean-formal next' → correct order:
    Lean specification first, Python extraction shim, Verilog hardware extraction

6-Documentation/docs/recovered/geocognition_equation_types_map.mmd
  - 'Lean owns logic; Rust owns boundary' → 'Lean owns all logic and decisions;
    Rust is boundary shim only'

6-Documentation/docs/semantics/HYPER_DIMENSIONAL_PHYSICS_INTRO.md
  - 'Python implementation ... Lean formalization' → 'Lean specification (source
    of truth) ... Python extraction shim'

6-Documentation/docs/geometry/GEOMETRY_TAXONOMY_FOR_NLOCAL_ADAPTATION.md
  - 'reference specification for the Python implementation' → 'source of truth;
    Python is an extraction shim against this spec'

6-Documentation/docs/protocols/TM_MCP_SPECIFICATION.md
  - 'Python reference implementation' → 'Python extraction shim' (×2)

5-Applications/scripts/snn/README.md
  - 'deterministic Python reference' → 'Python extraction shim / golden-vector
    harness'; add TODO(lean-port) note; RTL must match 'Python shim (pending
    Lean golden vector)' not 'Python reference'

6-Documentation/docs/METAPROBE_APPROACH.md
  - 'DeltaGCLCompression.lean — Lean implementation / scripts/delta_gcl_encoder.py
    — Python reference implementation' → Lean is source of truth / Python is
    extraction shim

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:40:03 -05:00

54 lines
1.7 KiB
Rust

//! ENE Distributed Node — Rust Rewrite
//!
//! Replaces legacy Python: ene_distributed_node.py, debug_credentials.py,
//! direct_swarm_probe.py, ingest_keys_to_ene.py, migrate_credentials.py,
//! propagate_ssh_keys.py
//!
//! Per AGENTS.md: Lean is the source of truth. Rust is an extraction target
//! for operational I/O components. Python shims are deprecated in favour of Rust,
//! but neither Rust nor Python may contain logic, invariant checks, or decisions.
pub mod config;
pub mod credentials;
pub mod gossip;
pub mod health;
pub mod mesh;
pub mod node;
pub mod replication;
pub mod swarm;
use thiserror::Error;
/// Top-level ENE error type
#[derive(Error, Debug)]
pub enum EneError {
#[error("Credential error: {0}")]
Credential(String),
#[error("Mesh error: {0}")]
Mesh(String),
#[error("Replication error: {0}")]
Replication(String),
#[error("Gossip error: {0}")]
Gossip(String),
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
#[error("Serialization error: {0}")]
Serialization(#[from] serde_json::Error),
}
pub type EneResult<T> = Result<T, EneError>;
/// Node identifier using Sidon labels (powers of 2 for 8 strands)
pub type NodeId = u128;
/// Q16_16 fixed-point timestamp for cross-substrate determinism
pub type Q16_16Timestamp = u64;
/// Receipt hash for validation
pub type ReceiptHash = [u8; 32];
// Mesh consensus is delegated to the `mesh` module (self-healing topology),
// `gossip` module (delta GCL gossip diffusion), and `replication` module
// (auto-replication). Full Byzantine consensus (Raft/Paxos-style) is not
// yet implemented — `mesh::heal_topology` provides the minimum viable mesh
// maintenance for current deployment scale.