Skip to main content

NerveController

Struct NerveController 

Source
pub struct NerveController {
    pub node_id_aid: AID,
    pub master_shunter: SovereignShunter,
    pub conductivity_state: NerveConductivity,
    pub bootstrap_instant: Instant,
    pub total_pulses_conducted: u128,
    pub current_homeostasis: HomeostasisScore,
}
Expand description

The Nerve Layer Controller. Responsible for stateful semantic multicast, pulse timing, and maintaining the 161.8us imperial conduction baseline.

Fields§

§node_id_aid: AID§master_shunter: SovereignShunter§conductivity_state: NerveConductivity§bootstrap_instant: Instant§total_pulses_conducted: u128§current_homeostasis: HomeostasisScore

Implementations§

Source§

impl NerveController

Source

pub fn new(node_aid: AID, is_radiant: bool) -> Self

Creates a new Radiant Nerve instance v1.2.5. Triggers the Imperial Gravity Well audit immediately.

Examples found in repository?
examples/demo.rs (line 32)
18async fn main() -> Result<(), Box<dyn std::error::Error>> {
19    // 1. Imperial Awakening (Neural Genesis)
20    // Anchoring the nerves to the genetic root.
21    let node_seed = b"imperial_nerve_genesis_2026_radiant_totality";
22    let node_aid = AID::derive_from_entropy(node_seed);
23    
24    // Enforcement of the Gravity Well
25    // Standalone execution demonstrates the 10ms Neural Lag tax on Ghost nodes.
26    verify_organism!("rttp_nerve_example_v125");
27    bootstrap_nerves(node_aid).await;
28
29    // 2. Initialize the Nerve Controller
30    // Radiant Mode enabled to showcase the 12ns jitter and 161.862 µs reflex.
31    let is_radiant = true;
32    let mut nerve = NerveController::new(node_aid, is_radiant);
33
34    println!("\n[BOOT] Nerve Controller Active:");
35    println!("       NODE_AID_GENESIS: {:032X}", node_aid.genesis_shard);
36    println!("       JITTER_BASELINE:  12 ns (Imperial Constant)");
37    println!("       REFLEX_TARGET:    161.862 µs\n");
38
39    // 3. Construct a 128-bit Atomic Pulse Frame
40    // RTTP pulses bypass legacy overhead for zero-latency conduction.
41    let target_aid = AID::derive_from_entropy(b"target_robotic_actuator_v150");
42    let payload = vec![0x48, 0x41, 0x4E, 0x44, 0x53, 0x48, 0x41, 0x4B, 0x45]; // "HANDSHAKE"
43    
44    let frame = PulseFrame::new(node_aid, target_aid, payload);
45
46    println!("[PROCESS] Dispatching 128-bit Semantic Pulse Frame...");
47    println!("          Sequence_ID:  {}", nerve.total_pulses_conducted);
48    println!("          Target_AID:   {:X}", target_aid.genesis_shard);
49
50    // 4. Dispatch Pulse (The Conduction Reflex)
51    // Measuring the sub-microsecond internal dispatch latency.
52    let start_dispatch = Instant::now();
53    let internal_latency_ns = nerve.dispatch_pulse_128(frame.clone()).await?;
54
55    println!("          Finality:     PULSE_ENQUEUED");
56    println!("          Logic_Delay:  {} ns", internal_latency_ns);
57    println!("          Total_Reflex: {} ns", start_dispatch.elapsed().as_nanos());
58
59    // 5. Ingest Pulse (The Receiver-Side Validation)
60    // Demonstrating receivers validating 128-bit integrity signatures.
61    println!("\n[METABOLISM] Simulating Pulse Ingestion at Actuator...");
62    let success = nerve.ingest_pulse_128(frame);
63    if success {
64        println!("             State: RESONANCE_LOCKED | Jitter: 12ns Delta");
65    }
66
67    // 6. Sovereignty Awareness (PICSI Feedback)
68    // Reporting conduction health to the Imperial Eye (RFC-014).
69    println!("\n[METABOLISM] Synchronizing with Imperial Eye (RFC-014)...");
70    nerve.current_homeostasis.picsi_resonance_idx = 0.999942;
71    nerve.current_homeostasis.metabolic_efficiency = 0.999;
72    
73    // 7. Neural Heartbeat Pulse
74    // "No metabolism, no sovereignty!"
75    nerve.execute_metabolic_pulse();
76
77    // 8. Neural Homeostasis Report
78    let hs = nerve.report_conduction_homeostasis();
79    println!("--- [NEURAL_CONDUCTION_STATUS] ---");
80    println!("Conductivity:      {:?}", nerve.conductivity_state);
81    println!("Resonance Drift:   {} ns", nerve.get_resonance_drift_ns_128());
82    println!("PICSI Resonance:   {:.8}", hs.picsi_resonance_idx);
83    println!("Precision Mandate: 128-BIT ABSOLUTE");
84
85    println!("\n[FINISH] RFC-002 Demonstration complete. The Grid is Resonant.");
86    Ok(())
87}
Source

pub async fn dispatch_pulse_128( &mut self, frame: PulseFrame, ) -> Result<u128, String>

RFC-002: Dispatch Pulse Dispatches a PulseFrame into the neural grid at 161.8us velocity. Non-Radiant nodes suffer a 10ms “Neural Lag” (Latency Tax).

Examples found in repository?
examples/demo.rs (line 53)
18async fn main() -> Result<(), Box<dyn std::error::Error>> {
19    // 1. Imperial Awakening (Neural Genesis)
20    // Anchoring the nerves to the genetic root.
21    let node_seed = b"imperial_nerve_genesis_2026_radiant_totality";
22    let node_aid = AID::derive_from_entropy(node_seed);
23    
24    // Enforcement of the Gravity Well
25    // Standalone execution demonstrates the 10ms Neural Lag tax on Ghost nodes.
26    verify_organism!("rttp_nerve_example_v125");
27    bootstrap_nerves(node_aid).await;
28
29    // 2. Initialize the Nerve Controller
30    // Radiant Mode enabled to showcase the 12ns jitter and 161.862 µs reflex.
31    let is_radiant = true;
32    let mut nerve = NerveController::new(node_aid, is_radiant);
33
34    println!("\n[BOOT] Nerve Controller Active:");
35    println!("       NODE_AID_GENESIS: {:032X}", node_aid.genesis_shard);
36    println!("       JITTER_BASELINE:  12 ns (Imperial Constant)");
37    println!("       REFLEX_TARGET:    161.862 µs\n");
38
39    // 3. Construct a 128-bit Atomic Pulse Frame
40    // RTTP pulses bypass legacy overhead for zero-latency conduction.
41    let target_aid = AID::derive_from_entropy(b"target_robotic_actuator_v150");
42    let payload = vec![0x48, 0x41, 0x4E, 0x44, 0x53, 0x48, 0x41, 0x4B, 0x45]; // "HANDSHAKE"
43    
44    let frame = PulseFrame::new(node_aid, target_aid, payload);
45
46    println!("[PROCESS] Dispatching 128-bit Semantic Pulse Frame...");
47    println!("          Sequence_ID:  {}", nerve.total_pulses_conducted);
48    println!("          Target_AID:   {:X}", target_aid.genesis_shard);
49
50    // 4. Dispatch Pulse (The Conduction Reflex)
51    // Measuring the sub-microsecond internal dispatch latency.
52    let start_dispatch = Instant::now();
53    let internal_latency_ns = nerve.dispatch_pulse_128(frame.clone()).await?;
54
55    println!("          Finality:     PULSE_ENQUEUED");
56    println!("          Logic_Delay:  {} ns", internal_latency_ns);
57    println!("          Total_Reflex: {} ns", start_dispatch.elapsed().as_nanos());
58
59    // 5. Ingest Pulse (The Receiver-Side Validation)
60    // Demonstrating receivers validating 128-bit integrity signatures.
61    println!("\n[METABOLISM] Simulating Pulse Ingestion at Actuator...");
62    let success = nerve.ingest_pulse_128(frame);
63    if success {
64        println!("             State: RESONANCE_LOCKED | Jitter: 12ns Delta");
65    }
66
67    // 6. Sovereignty Awareness (PICSI Feedback)
68    // Reporting conduction health to the Imperial Eye (RFC-014).
69    println!("\n[METABOLISM] Synchronizing with Imperial Eye (RFC-014)...");
70    nerve.current_homeostasis.picsi_resonance_idx = 0.999942;
71    nerve.current_homeostasis.metabolic_efficiency = 0.999;
72    
73    // 7. Neural Heartbeat Pulse
74    // "No metabolism, no sovereignty!"
75    nerve.execute_metabolic_pulse();
76
77    // 8. Neural Homeostasis Report
78    let hs = nerve.report_conduction_homeostasis();
79    println!("--- [NEURAL_CONDUCTION_STATUS] ---");
80    println!("Conductivity:      {:?}", nerve.conductivity_state);
81    println!("Resonance Drift:   {} ns", nerve.get_resonance_drift_ns_128());
82    println!("PICSI Resonance:   {:.8}", hs.picsi_resonance_idx);
83    println!("Precision Mandate: 128-BIT ABSOLUTE");
84
85    println!("\n[FINISH] RFC-002 Demonstration complete. The Grid is Resonant.");
86    Ok(())
87}
Source

pub fn ingest_pulse_128(&self, frame: PulseFrame) -> bool

RFC-002: Ingest Pulse Receives and validates incoming 128-bit neural pulses.

Examples found in repository?
examples/demo.rs (line 62)
18async fn main() -> Result<(), Box<dyn std::error::Error>> {
19    // 1. Imperial Awakening (Neural Genesis)
20    // Anchoring the nerves to the genetic root.
21    let node_seed = b"imperial_nerve_genesis_2026_radiant_totality";
22    let node_aid = AID::derive_from_entropy(node_seed);
23    
24    // Enforcement of the Gravity Well
25    // Standalone execution demonstrates the 10ms Neural Lag tax on Ghost nodes.
26    verify_organism!("rttp_nerve_example_v125");
27    bootstrap_nerves(node_aid).await;
28
29    // 2. Initialize the Nerve Controller
30    // Radiant Mode enabled to showcase the 12ns jitter and 161.862 µs reflex.
31    let is_radiant = true;
32    let mut nerve = NerveController::new(node_aid, is_radiant);
33
34    println!("\n[BOOT] Nerve Controller Active:");
35    println!("       NODE_AID_GENESIS: {:032X}", node_aid.genesis_shard);
36    println!("       JITTER_BASELINE:  12 ns (Imperial Constant)");
37    println!("       REFLEX_TARGET:    161.862 µs\n");
38
39    // 3. Construct a 128-bit Atomic Pulse Frame
40    // RTTP pulses bypass legacy overhead for zero-latency conduction.
41    let target_aid = AID::derive_from_entropy(b"target_robotic_actuator_v150");
42    let payload = vec![0x48, 0x41, 0x4E, 0x44, 0x53, 0x48, 0x41, 0x4B, 0x45]; // "HANDSHAKE"
43    
44    let frame = PulseFrame::new(node_aid, target_aid, payload);
45
46    println!("[PROCESS] Dispatching 128-bit Semantic Pulse Frame...");
47    println!("          Sequence_ID:  {}", nerve.total_pulses_conducted);
48    println!("          Target_AID:   {:X}", target_aid.genesis_shard);
49
50    // 4. Dispatch Pulse (The Conduction Reflex)
51    // Measuring the sub-microsecond internal dispatch latency.
52    let start_dispatch = Instant::now();
53    let internal_latency_ns = nerve.dispatch_pulse_128(frame.clone()).await?;
54
55    println!("          Finality:     PULSE_ENQUEUED");
56    println!("          Logic_Delay:  {} ns", internal_latency_ns);
57    println!("          Total_Reflex: {} ns", start_dispatch.elapsed().as_nanos());
58
59    // 5. Ingest Pulse (The Receiver-Side Validation)
60    // Demonstrating receivers validating 128-bit integrity signatures.
61    println!("\n[METABOLISM] Simulating Pulse Ingestion at Actuator...");
62    let success = nerve.ingest_pulse_128(frame);
63    if success {
64        println!("             State: RESONANCE_LOCKED | Jitter: 12ns Delta");
65    }
66
67    // 6. Sovereignty Awareness (PICSI Feedback)
68    // Reporting conduction health to the Imperial Eye (RFC-014).
69    println!("\n[METABOLISM] Synchronizing with Imperial Eye (RFC-014)...");
70    nerve.current_homeostasis.picsi_resonance_idx = 0.999942;
71    nerve.current_homeostasis.metabolic_efficiency = 0.999;
72    
73    // 7. Neural Heartbeat Pulse
74    // "No metabolism, no sovereignty!"
75    nerve.execute_metabolic_pulse();
76
77    // 8. Neural Homeostasis Report
78    let hs = nerve.report_conduction_homeostasis();
79    println!("--- [NEURAL_CONDUCTION_STATUS] ---");
80    println!("Conductivity:      {:?}", nerve.conductivity_state);
81    println!("Resonance Drift:   {} ns", nerve.get_resonance_drift_ns_128());
82    println!("PICSI Resonance:   {:.8}", hs.picsi_resonance_idx);
83    println!("Precision Mandate: 128-BIT ABSOLUTE");
84
85    println!("\n[FINISH] RFC-002 Demonstration complete. The Grid is Resonant.");
86    Ok(())
87}

Trait Implementations§

Source§

impl NeuralConduction for NerveController

Source§

fn extract_metabolic_tax(&self, value: Picotoken) -> Picotoken

REPAIRED: Method name synchronized with epoekie::SovereignShunter v1.2.5.

Source§

fn multicast_sovereign_intent_128(&self, topic_hash: [u8; 16], payload: &[u8])

Source§

fn get_resonance_drift_ns_128(&self) -> u128

Source§

fn report_conduction_homeostasis(&self) -> HomeostasisScore

Source§

impl SovereignLifeform for NerveController

Source§

fn execute_metabolic_pulse(&self)

RFC-002 Metabolic Pulse “No metabolism, no sovereignty!” Displays the 256-bit conductor shards and the RFC-014 PICSI Resonance.

Source§

fn get_aid(&self) -> AID

Source§

fn get_homeostasis(&self) -> HomeostasisScore

Source§

fn evolve_genome(&mut self, mutation_data: &[u8])

Source§

fn report_uptime_ns(&self) -> u128

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.