All notable changes to this project will be documented in this file.
Snapshot size reduced from 1.5GB to ~100 bytes for empty arenas.
- StrataArena Serialization: Only non-empty engrams are serialized
- INVARIANT:
timestamp == 0means "empty slot" (now part of ABI) - Added
StrataArena::set_at()andrestore_from_sparse()for restoration
- INVARIANT:
- zstd Compression: All strata data compressed with zstd level 3
- Format v2: New snapshot format with sparse representation
Warning
v1.9.0 snapshots are NOT backward compatible with v1.8.0. v1.9.0 CAN read v1.8.0 snapshots and auto-migrates on save.
- 90/90 tests passing (+1 sparse size reduction test)
- Empty 10K×64 arena: 15MB → ~100 bytes (>99.99% reduction)
MindFry now remembers how it was shut down and adapts accordingly.
recovery.rs: Trauma detection on startupRecoveryState::Normal— Clean restartRecoveryState::Shock— Unclean shutdown (no graceful marker)RecoveryState::Coma— Prolonged downtime (>1 hour)
RecoveryAnalyzer: Analyzes shutdown marker on startupShutdownMarker: Persisted to sled before graceful exit- Warmup Enforcement: Handler rejects ops during resurrection
PingandStatsalways allowed (exempt)- Other ops return
ErrorCode::WarmingUp
- Stability Benchmark: 10 new benchmarks, all sub-microsecond
recovery_analyzer_analyze: 1.21 nswarmup_tracker_is_ready: 1.19 nsexhaustion_level_from_energy: 715 ps
CommandHandlernow acceptsWarmupTrackerviawith_warmup()AkashicStorehasread_shutdown_marker()/write_shutdown_marker()
- 89/89 tests passing (+6 recovery tests)
- Server startup shows recovery state:
(clean),(SHOCK detected),(COMA detected)
Zero startup delay with async resurrection and progressive availability.
- Stability Module (
src/stability/):exhaustion.rs: Circuit breaker with adaptive thresholds (μ±kσ AutoTuner)health.rs: Self-diagnostic pulse monitoringshutdown.rs: Shutdown experience recording (graceful/forced/crash/coma)warmup.rs: Progressive availability tracking during resurrection
- System Lineages (
_system.*): Reserved namespace for stability tracking_system.health,_system.state,_system.shock,_system.coma
- Background Snapshot Loading: Server accepts connections immediately
- Network binds in < 100ms
- Resurrection runs in async background thread
ErrorCode::WarmingUp(0x03): New error code for clients during resurrection- Exhaustion Backpressure: Write rejection under high load
- Graceful Shutdown: Ctrl+C handling with pre-shutdown snapshot
- 83/83 tests passing
- 1.5 GB snapshot: ~5.4s async load (verified)
When stimulate(A) is called, energy automatically propagates through bonds.
- SynapseEngine Integration: Handler wires synapse.propagate() on stimulate
- StimulateFlags: Control propagation behavior
0x00(default): Auto-propagate through bonds0x01NO_PROPAGATE: Surgical mode (direct update only)
- The Domino Test: A→B→C chain verification
- A: +0.9 (direct)
- B: +0.625 (hop 1, damped)
- C: +0.250 (hop 2, damped) ✓
- Used raw pointer trick to bypass RwLockWriteGuard borrow checker limitation
- SAFETY: bonds are read-only during propagate, psyche is mutated
LINEAGE.GET response now includes status header for unambiguous client parsing.
- Response Format:
[status:u8] + [payload?]0x00(Found): FullLineageInfopayload follows0x01(NotFound): No payload, lineage doesn't exist0x02(Repressed): No payload, hidden by Antagonism0x03(Dormant): No payload, in retention buffer
ResponseData::Lineage→ResponseData::LineageResultLineageResultstruct:{ status: LineageStatus, info: Option<LineageInfo> }
Previously, NotFound returned Response::Error. Now returns Response::Ok(LineageResult { status: NotFound }).
This enables richer client-side handling (distinguish "doesn't exist" from "hidden by system").
User authority layer above cognitive filters for reliable data access.
QueryFlags: Bitmask for access controlBYPASS_FILTERS(0x01): Skip Cortex/Antagonism filtersINCLUDE_REPRESSED(0x02): Reveal hidden data with REPRESSED statusNO_SIDE_EFFECTS(0x04): Read without observer effectFORENSIC(0x07): All flags combined (god mode)
LineageStatus: Rich result statesFound(0): Normal successNotFound(1): Doesn't existRepressed(2): Hidden by AntagonismDormant(3): In retention buffer
- Observer Effect:
LINEAGE.GETnow stimulates memory on read (+0.01)
LINEAGE.GETnow accepts optionalflags:u8(backward compat: default 0)
Bonds now have polarity for biologically-inspired signal propagation.
Bond.polarity: Ternary bond type (+1/0/-1)Trit::True(+1): Synergy (excitatory) - both stimulateTrit::Unknown(0): Neutral (insulator) - no propagationTrit::False(-1): Antagonism (inhibitory) - suppression
SynapseEngine: Damped signal propagation- Resistance: 0.5 (50% energy loss per hop)
- Cutoff: 0.1 (noise floor)
- Max depth: ~3 hops (mathematically bounded)
- Loop protection via visited set
- 74/74 tests passing (+4 synapse tests)
- Backward compatible: old bonds default to
polarity: Trit::True
Nabu's identity (mood, personality) now survives server restarts.
- Serde derives:
Trit,Octet,Quantizer,Cortex,RetentionBuffernow serializable cortex_datain Snapshot: Optional Cortex state preserved in snapshots- Mood-Coupled Sensitivity: Consciousness sensitivity now varies with mood (0.5x-1.5x)
LineageIndexer: O(1) key-to-id lookup via sled treeinsert(),get(),remove(),rebuild()methods- Integrated into
AkashicStorewithindexer()accessor
- Resurrection Protocol: Server boot restores from latest snapshot
MindFry::resurrect()- restore Cortex + Lineages + BondsMindFry::with_store()- attach persistent storage- Graceful degradation on corrupted snapshots
take_snapshot()now accepts optionalCortexparameter- Base consciousness sensitivity reduced from 10.0 to 5.0 for mood modulation
- 70/70 tests passing
- Backward compatible: old snapshots load with
cortex_data: None
Fixed edge case where energy 0.95 with threshold 0.8 was classified as "Dreaming" instead of "Lucid".
SysMoodSetOpCode (0x46): External mood injection from NABU- Payload:
[mood: f32](-1.0 to +1.0) - Enables real-time emotional state control
- Payload:
- Consciousness amplification: Delta now multiplied by 10x for clearer Lucid/Dreaming/Dormant decisions
>3% above threshold→ Lucid (+1)<3% above threshold→ Dreaming (0)Below threshold→ Dormant (-1)
- 66/66 tests passing
- E2E verified: 0.95 energy → LUCID
Introduces balanced ternary logic primitives for organic decision-making.
-
TritPrimitive: Balanced ternary digit (-1 / 0 / +1)- Biological semantics: Inhibition / Latent / Excitation
- Operations:
consensus()(AND),invert(),weight()(as i8) - Full conversions:
From<i8>,From<bool>
-
OctetVector: 8-dimensional personality/event vector- Fixed dimensions: Curiosity, Preservation, Efficiency, Empathy, Rigidity, Volatility, Aggression, Latency
resonance(&other)→ f64: Compatibility score (-1.0 to +1.0)dissonance(&other)→ f64: Conflict intensity (0.0 to 1.0)pack() / unpack(): 8-bit binary serialization
-
QuantizerStruct: Analog-to-Trit converter- Dynamic thresholds via
mood_modifier(-1.0 to +1.0) - Positive mood → easier True; Negative mood → easier True=harder
set_mood()for external modulation (future NABU integration)
- Dynamic thresholds via
-
CortexStruct: The decision-making brain- Encapsulates system personality (Octet DNA)
- Mood state with internal shift and external override
consciousness_state(): Ternary consciousness evaluation (Lucid/Dreaming/Dormant)decide(): Mood-modulated analog-to-Trit conversionevaluate(): Event resonance calculation- Integrated
RetentionBufferfor safe garbage collection
-
RetentionBufferStruct: TTL-based data lifecycle management- Prevents mass extinction by debouncing deletion decisions
mark_or_tick(id): Add to buffer or decrement TTLrestore(id): Remove from buffer (data recovered)- Configurable TTL (default: 3 ticks)
-
DecayEngine::process_gc(): Cortex-aware garbage collection- Ternary viability assessment (Stable/Unstable/Obsolete)
- Personality-influenced preservation bias
- Safe deletion via RetentionBuffer TTL
- Clippy warnings in
psyche.rs,decay.rs,bond.rs,handler.rs
- 27 new unit tests (Trit, Octet, Quantizer, Cortex, RetentionBuffer, GC)
- 66/66 total tests passing
MindFry has been rewritten in Rust as a standalone Cognitive Database Engine.
- Core Engine
PsycheArena: 32-byte cache-aligned Lineage storage with O(1) accessStrataArena: Ring buffer Engram history per lineageBondGraph: Living bonds with Hebbian learning and decayDecayEngine: Pre-computed LUT (256×32) for O(1) decay calculation
- MFBP Protocol v1.0: Binary wire protocol (22 OpCodes)
- Lineage:
CREATE,GET,STIMULATE,FORGET,TOUCH - Bond:
CONNECT,REINFORCE,SEVER,NEIGHBORS - Query:
CONSCIOUS,TOP_K,TRAUMA,PATTERN - System:
PING,STATS,SNAPSHOT,RESTORE,FREEZE,PHYSICS_TUNE - Stream:
SUBSCRIBE,UNSUBSCRIBE
- Lineage:
- Akashic Records: sled-based persistence layer
- Snapshot/Restore with bincode serialization
- Named snapshots for Time Travel
- TCP Server (
mindfry-server): Async Tokio server - CLI Client (
mfcli): Command-line interface for testing - Benchmarks: Criterion benchmarks for decay and graph operations
- CEREBRO Design Doc: GUI visualization specification (commercial - separate repo)
- Technology: TypeScript → Rust
- Architecture: Library → Database Engine
- Structure: Flattened repo (no more
mindfry-core/subfolder) - Package: Renamed
mindfry-core→mindfry
- Legacy TypeScript implementation
| Decision | Choice |
|---|---|
| Protocol | Custom TCP Binary (MFBP) |
| Persistence | sled (Rust-native) |
| Target | Dual (Server + WASM) |
| Integration | Network (TCP) |
- Morpheus (God of Dreams): Background maintenance layer
- Event-hinted execution (not clock-driven)
- Self-managed queue (no external enqueue API)
- Atomic tasks: prune, transfer, consolidate (stub)
- AkashicRecords: Cold storage persistence
inscribe(): Memory → Archiveretrieve(): Archive → Memory (with accessScore decay)- MemoryAkashicBackend for testing
- Shell layer stats in demo (Morpheus state, Akashic count, Pressure)
- Mind → Psyche: Main class renamed (backwards compat alias kept)
- Demo updated with mythological branding
- Decay Lookup Table: Pre-computed exp() values (32 time buckets × 256 rates)
- Epoch-bounded TopK Cache: Only recomputes when state changes
- Bond Density Cap: Max 20 bonds per node
- Performance metrics in demo (JS Heap, Store Memory, Render Time)
getEnergy()now uses LUT instead ofMath.exp()topKConscious()cached and invalidated on epoch changecreateBond()returnsnullif density cap exceeded
- Uint8Array Storage: 4 bytes per memory (25x reduction)
- Priming-based Auto-Association: Automatic bonds on
remember() - MemoryStore class: Low-level typed array backend
- Lazy decay model: energy computed on-demand
recall()switched from async to sync iterator- API:
remember(id, content, energy)instead of object config
tick()method (no longer needed)- Object-based Memory/Bond primitives
- Initial implementation
- Memory/Bond primitives with object storage
- Mind core with conscious/subconscious layers
- Priming propagation
- Time skip demo