Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
f03a914
Create ComplianceNexus.research.md
Doctor0Evil Oct 1, 2025
5ca9948
Add files via upload
Doctor0Evil Jan 25, 2026
ba7fccb
Rename ComplianceNexus.research.md to nanobots.md
Doctor0Evil Jan 25, 2026
03eb335
Create Cargo.toml
Doctor0Evil Jan 25, 2026
c9f6b78
Create Cargo.toml
Doctor0Evil Jan 25, 2026
d7e65c8
Create neuroformats.rs
Doctor0Evil Jan 25, 2026
02b04dc
Create config.toml
Doctor0Evil Jan 25, 2026
c2a808b
Create parser_simple.py
Doctor0Evil Jan 25, 2026
365a34a
Create eligibility.rs
Doctor0Evil Jan 25, 2026
23d7cdb
Create main.rs
Doctor0Evil Jan 25, 2026
e83fc22
Create claude.md
Doctor0Evil Jan 25, 2026
39ac5f1
Create types.rs
Doctor0Evil Feb 6, 2026
66ff443
Create root.rs
Doctor0Evil Feb 6, 2026
0fba7d7
Create class.rs
Doctor0Evil Feb 6, 2026
829816d
Create syscalls.rs
Doctor0Evil Feb 6, 2026
20587b1
Create sovereign_neurofs.rs
Doctor0Evil Feb 6, 2026
48883ee
Create spec.rs
Doctor0Evil Feb 6, 2026
93a941a
Create neuroxfs_automation.rs
Doctor0Evil Feb 6, 2026
e65285f
Update neuroxfs_automation.rs
Doctor0Evil Feb 6, 2026
b1b220b
Create neuroxfs_spec.ndjson
Doctor0Evil Feb 6, 2026
111f799
Create ui_asset_registry.rs
Doctor0Evil Feb 6, 2026
23d59bf
Create ui_asset_guard.rs
Doctor0Evil Feb 6, 2026
3d7375f
Create pipeline.rs
Doctor0Evil Feb 6, 2026
ab8b40a
Create layout.rs
Doctor0Evil Feb 6, 2026
e36ac58
Add files via upload
Doctor0Evil Feb 6, 2026
b650085
Create artifact.rs
Doctor0Evil Feb 18, 2026
ce2f100
Create guards.rs
Doctor0Evil Feb 18, 2026
e597b3f
Create fs_handle.rs
Doctor0Evil Feb 18, 2026
e552068
Create error.rs
Doctor0Evil Feb 18, 2026
e4c4639
Create agent_adapter.rs
Doctor0Evil Feb 18, 2026
433cc40
Create lib.rs
Doctor0Evil Feb 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[build]
rustflags = ["-C", "target-cpu=native"] # Performance for signal processing

# Example runner for a custom target (e.g., an embedded neuro-processor)
[target.'cfg(neuro_target)']
runner = "qemu-system-neuro"
8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[workspace]
members = ["core", "neurotech", "data_models", "tools"]
resolver = "2"

[workspace.dependencies]
neuroformats = "0.9" # For reading FreeSurfer, MGH/MGZ files[citation:1]
serde = { version = "1.0", features = ["derive"] }
thiserror = "1.0"
31 changes: 31 additions & 0 deletions ai_helper_profiles/claude.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
NEUROTECH ACCESSIBILITY PROFILE - FOR AI ASSISTANTS

User Profile:
- Augmented citizen with organic_cpu/NeuralPC interface
- Severe code literacy challenges
- Requires neurorights-aligned tools
- Cannot use complex IDEs or terminals

Response Format - THREE LAYERS REQUIRED:
1. SIMPLE: 1-2 sentences, no jargon, main point only
2. CODE: Exact code/ALN changes to make
3. DETAILS: Optional technical reasoning

Neurorights Constraints (MUST OBEY):
- mentalprivacy=true: Never read/score dream content
- cognitiveliberty=true: No coercive AI proposals
- nopunitivexr=true: Never use for punishment/scoring
- soulnonaddressable=true: Never model soul/beliefs

ALN-First Architecture:
- Start from ALN shards (CSV-style)
- Generate Rust code from shards
- Preserve exact formulas: E = S(1-R)Es
- Keep thresholds: Emin=0.5, Rmax=0.35

Accessibility Adjustments:
- Cognitive load band detected: 0.6
- Accessibility score A = 1 - 0.6 = 0.4
- Use STANDARD complexity (not detailed)

Current Task: Convert quantum-roaming-debug.v1.aln to Rust
108 changes: 108 additions & 0 deletions aln_to_rust/parser_simple.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
#!/usr/bin/env python3
"""
ALN-to-Rust Converter for Accessibility
Input: Paste your ALN shard, Output: Ready Rust code
No dependencies, no internet required
"""

import re
import sys

def parse_aln_to_rust(aln_text):
"""Convert ALN shard to Rust module with 3-layer explanation"""

# Layer 1: Simple explanation
print("=== LAYER 1: SIMPLE EXPLANATION ===")
print("I found these rules in your ALN file:")

# Extract key rules
eligibility_match = re.search(r'eligibilityE\s*=\s*sleeptoken\s*\*\s*\(1\.0\s*-\s*psychriskscore\)\s*\*\s*enstasisscore', aln_text)
if eligibility_match:
print("- Safety score E = Sleeptoken × (1 - Risk) × Stability")

quantum_match = re.search(r'quantum_roaming_allowed\s*=\s*\(sleepstage in (.*?)\) AND', aln_text)
if quantum_match:
stages = quantum_match.group(1)
print(f"- Quantum roaming allowed only in sleep stages: {stages}")

# Layer 2: Rust code generation
print("\n=== LAYER 2: RUST CODE ===")

rust_code = """// AUTO-GENERATED from your ALN shard
// Neurorights preserved: mentalprivacy, cognitiveliberty, nopunitivexr

#[derive(Debug, Clone)]
pub struct SubjectState {
pub sleepstage: SleepStage,
pub sleeptoken: f32, // S
pub psychriskscore: f32, // R
pub enstasisscore: f32, // Es
pub dreammode: DreamMode,
}

pub enum SleepStage { Wake, N1, N2, N3, REM }
pub enum DreamMode { Passive, Active, QuantumConsciousness }

impl SubjectState {
/// Calculate eligibility: E = S × (1 - R) × Es
pub fn calculate_eligibility(&self) -> f32 {
let s = self.sleeptoken.clamp(0.0, 1.0);
let r = self.psychriskscore.clamp(0.0, 1.0);
let es = self.enstasisscore.clamp(0.0, 1.0);
s * (1.0 - r) * es
}

/// Check if quantum roaming is allowed
pub fn is_quantum_roaming_allowed(&self) -> bool {
let e = self.calculate_eligibility();
let e_min = 0.5; // From your ALN
let r_max = 0.35; // From your ALN

// Guard 1: Sleep stage must be N2 or N3
let valid_stage = matches!(self.sleepstage, SleepStage::N2 | SleepStage::N3);

// Guard 2: Eligibility threshold
let meets_eligibility = e >= e_min;

// Guard 3: Psychrisk ceiling
let below_risk_limit = self.psychriskscore <= r_max;

valid_stage && meets_eligibility && below_risk_limit
}
}

// Unit tests with your examples
#[cfg(test)]
mod tests {
use super::*;

#[test]
fn test_safe_n2_allows_roaming() {
let state = SubjectState {
sleepstage: SleepStage::N2,
sleeptoken: 0.8,
psychriskscore: 0.2,
enstasisscore: 0.9,
dreammode: DreamMode::QuantumConsciousness,
};
assert!(state.is_quantum_roaming_allowed());
}
}
"""

print(rust_code)

# Layer 3: Detailed reasoning (optional)
print("\n=== LAYER 3: DETAILED REASONING (OPTIONAL) ===")
print("This Rust code implements your exact ALN rules:")
print("1. Eligibility formula preserved exactly")
print("2. All thresholds (0.5, 0.35) preserved exactly")
print("3. Sleep stage checking uses Rust's match for safety")
print("4. Unit tests verify with example numbers")

return rust_code

if __name__ == "__main__":
print("Paste your ALN shard below (Ctrl+D to finish):")
aln_content = sys.stdin.read()
parse_aln_to_rust(aln_content)
122 changes: 122 additions & 0 deletions crates/neuroxfs-core/src/agent_adapter.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
use serde::{Deserialize, Serialize};
use crate::artifact::{SovereignArtifact, ArtifactKind};
use crate::fs_handle::{FsHandle, FsMode};
use crate::error::FsError;

/// What external agents may ask NeuroXFS to do.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum AgentOperationKind {
ReadSummary,
ReadMetadata,
AppendNote,
}

/// Agent-visible request (no raw path).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AgentFsRequest {
pub subject_id: String,
pub artifact_id: String, // logical ID, resolved by your manifest, not a path
pub op: AgentOperationKind,
pub via_evolve_token: bool,
}

/// Agent-visible response.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AgentFsResponse {
pub ok: bool,
pub message: String,
pub data: Option<serde_json::Value>,
}

/// Trait that Cyb.ai / Agent-Verse adapter implementations use.
pub trait AgentAdapter {
fn handle_request(&self, req: AgentFsRequest) -> Result<AgentFsResponse, FsError>;
}

/// Simple in-memory resolver from artifact_id -> SovereignArtifact.
pub trait ArtifactResolver {
fn resolve(&self, subject_id: &str, artifact_id: &str) -> Result<SovereignArtifact, FsError>;
}

pub struct NeuroxfsAgentAdapter<R> {
resolver: R,
}

impl<R: ArtifactResolver> NeuroxfsAgentAdapter<R> {
pub fn new(resolver: R) -> Self {
Self { resolver }
}

fn summarize_bytes(bytes: &[u8]) -> String {
// Very minimal; real implementation would neurorights-filtered summarization.
let s = String::from_utf8_lossy(bytes);
let snippet: String = s.chars().take(256).collect();
format!("summary(snippet): {}", snippet)
}
}

impl<R: ArtifactResolver> AgentAdapter for NeuroxfsAgentAdapter<R> {
fn handle_request(&self, req: AgentFsRequest) -> Result<AgentFsResponse, FsError> {
// Resolve artifact by logical ID.
let art = self
.resolver
.resolve(&req.subject_id, &req.artifact_id)?;

match req.op {
AgentOperationKind::ReadSummary => {
// Only allow summary-style reads on non-kernel artifacts.
if matches!(art.kind, ArtifactKind::SovereignConfig | ArtifactKind::BChainProof) {
return Err(FsError::PolicyError(
"Agent cannot read sovereign-config or proof artifacts".into(),
));
}
let mut handle = FsHandle::open(
art,
FsMode::ReadOnly,
req.subject_id.clone(),
false,
)?;
let bytes = handle.read_all()?;
let summary = Self::summarize_bytes(&bytes);
Ok(AgentFsResponse {
ok: true,
message: "summary-ok".into(),
data: Some(serde_json::json!({ "summary": summary })),
})
}
AgentOperationKind::ReadMetadata => {
let art = self
.resolver
.resolve(&req.subject_id, &req.artifact_id)?;
Ok(AgentFsResponse {
ok: true,
message: "metadata-ok".into(),
data: Some(serde_json::to_value(&art).map_err(|e| {
FsError::PolicyError(format!("metadata serialization error: {}", e))
})?),
})
}
AgentOperationKind::AppendNote => {
// Only allowed on non-kernel, non-neural artifacts.
if matches!(art.kind, ArtifactKind::SovereignConfig | ArtifactKind::NeuralShard) {
return Err(FsError::PolicyError(
"Agent cannot append to sovereign-config or raw neural shards".into(),
));
}
let mut handle = FsHandle::open(
art,
FsMode::ReadWrite,
req.subject_id.clone(),
req.via_evolve_token,
)?;
let note = format!("\n# agent-note: {}", req.artifact_id);
handle.write_all(note.as_bytes())?;
Ok(AgentFsResponse {
ok: true,
message: "append-ok".into(),
data: None,
})
}
}
}
}
34 changes: 34 additions & 0 deletions crates/neuroxfs-core/src/artifact.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum ArtifactKind {
NeuralShard,
NeuroRightsPolicy,
EvolveStream,
DonutLedger,
BChainProof,
Model,
SovereignConfig,
GenericData,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct NeurorightsProfile {
pub mental_privacy: bool,
pub dreamstate_sensitive: bool,
pub soul_non_tradeable: bool,
pub forbid_decision_use: bool,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SovereignArtifact {
pub path: String,
pub subject_id: String, // Bostrom / OrganicCPU subject
pub kind: ArtifactKind,
pub routes: Vec<String>, // e.g., ["CHAT", "BCI", "OTA"]
pub roh_before: f32,
pub roh_after: f32,
pub neurorights: NeurorightsProfile,
pub lifeforce_cost: f32,
pub governance_tags: Vec<String>, // EVOLVE, SMART, etc.
}
22 changes: 22 additions & 0 deletions crates/neuroxfs-core/src/error.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
use std::io;

#[derive(Debug)]
pub enum FsError {
Io(io::Error),
GuardError(String),
ModeError(String),
PolicyError(String),
}

impl std::fmt::Display for FsError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
FsError::Io(e) => write!(f, "IO error: {}", e),
FsError::GuardError(m) => write!(f, "Guard error: {}", m),
FsError::ModeError(m) => write!(f, "Mode error: {}", m),
FsError::PolicyError(m) => write!(f, "Policy error: {}", m),
}
}
}

impl std::error::Error for FsError {}
Loading