One binary. Zero JSON on hot path. &BindSpace borrows, not HTTP.
Internal operations between ladybug-rs, crewai-rust, n8n-rs, and neo4j-rs
must never serialize. They share one process, one memory space. The blackboard
borrow pattern (&self for reads, &mut self for writes) replaces all
inter-crate HTTP/JSON/REST/Arrow Flight communication.
JSON/REST endpoints exist ONLY for external consumers (dashboards, third-party integrations). They are exhaust, not engine.
neo4j-rs is being redesigned as a Cypher parser that emits BindSpace operations directly — not a database, not a service, a query language compiler. Like the CISC→RISC transition: stop translating, start executing.
Branch: deprecate/pr127-128-json-hydrate
Merged from: main @ e2dfd54
URL: #129
| File | Lines | Description |
|---|---|---|
server_hydrate_block.rs |
406 | Extracted handler code from src/bin/server.rs |
README.md |
— | Rationale, salvage notes |
Removed handlers:
fn handle_qualia_hydrate()— POST/api/v1/qualia/hydrate(~240 lines)fn handle_qualia_writeback()— POST/api/v1/qualia/write-back(~100 lines)fn text_to_container()— hash-based Container from message textfn text_to_dn()— hash-based PackedDn from message text (3-level DN)fn serde_json_escape()— JSON string escaper (only used by hydrate response)
Removed from DbState struct:
qualia_graph: ContainerGraph— DN-keyed graph for qualia opsself_dims: SelfDimensions— mutable self-model persistence- Corresponding initializers in
DbState::new()
Removed route entries:
("POST", "/api/v1/qualia/hydrate") => handle_qualia_hydrate(...)("POST", "/api/v1/qualia/write-back") => handle_qualia_writeback(...)- Comment line:
// Qualia substrate endpoints (holy grail pipeline)
Removed imports (hydrate-only):
use ladybug::container::{Container, CONTAINER_BITS};→ removed entirely (Container unused elsewhere)use ladybug::container::adjacency::PackedDn;use ladybug::container::graph::ContainerGraph;use ladybug::container::record::CogRecord;use ladybug::container::geometry::ContainerGeometry;use ladybug::qualia::texture::GraphMetrics;use ladybug::qualia::agent_state::{AgentState, PresenceMode, SelfDimensions};use ladybug::qualia::felt_parse::{GhostEcho, GhostType};use ladybug::qualia::volition::CouncilWeights;use ladybug::qualia::{felt_walk, volitional_cycle, harvest_ghosts};use ladybug_contract::nars::TruthValue as ContractTruthValue;use ladybug::cognitive::RungLevel;
NOT touched:
- PR #126 (
felt_parse.rs,agent_state.rs) — real substrate work, stays - All
/api/v1/graph/*endpoints — unchanged - UDP bitpacked Hamming handler — unchanged
- All existing tests — unchanged
- JSON forbidden on internal hot path.
serde_json::to_stringbetween crates in the same binary = bug.reqwest::post()between crates in the same binary = bug. text_to_dn()is hash soup.DefaultHasheron message text produces meaningless DN positions. SPOQ requires DN paths to encode perspective (semantic viewpoint in the tree), not hash collisions.- Hollow pipeline. PR #127 constructed
FeltPath { choices: vec![] }andVolitionalAgenda { acts: vec![] }— empty structs pretending to be computed state. PR #128 improved by callingfelt_walk()but assigned ghost types viamatch i % 8(cycling through types by index = random noise). - Wrong paradigm. Assumed crewai-rust calls ladybug-rs via HTTP POST.
Correct: one binary,
&BindSpaceborrow.
AgentState::compute()integration pattern (PR #126 has it natively)- The route: message → qualia state → preamble for LLM prompt. But as
&Container → &Container, notJSON → JSON. - INTEGRATION_SPEC Layer A concept (preamble for system prompt injection)
Branch: deprecate/pr19-container-dto
Merged from: main @ 83b80e1
URL: AdaWorldAPI/neo4j-rs#20
| File | Lines | Description |
|---|---|---|
fingerprint.rs |
333 | ContainerDto — reimplements ladybug_contract::Container |
ladybug_module/mod.rs |
450 | LadybugBackend struct + StorageBackend impl |
ladybug_module/procedures.rs |
308 | CALL ladybug.* procedure dispatch |
README.md |
— | Rationale, salvage notes |
-#[cfg(feature = "ladybug")]
-pub mod ladybug;
+// DEPRECATED: moved to .deprecated/pr19_container_dto/
+// #[cfg(feature = "ladybug")]
+// pub mod ladybug; // → .deprecated/pr19_container_dto/ladybug_module/Comment added to StorageConfig::Ladybug variant:
- /// ladybug-rs local storage
+ /// ladybug-rs local storage (DEPRECATED: module moved to .deprecated/)The Ladybug variant stays in the enum behind #[cfg(feature = "ladybug")] —
it won't compile unless the feature is explicitly enabled, which nobody does.
Cargo.toml unchanged — ladybug feature flag preserved for the RISC rewrite.
NOT touched:
src/cypher/(parser, lexer, AST) — the parser is the keepersrc/execution/— will be rewritten but stays for nowsrc/storage/memory.rs— MemoryBackend stays as test oraclesrc/model/— Neo4j value types staysrc/chess.rs— feature-gated, has its owncfg(feature = "ladybug")block- All tests
ContainerDtoduplicatesladybug_contract::Container. 333 lines reimplementingxor(),hamming(),similarity(),random(),popcount(). In one-binary model,use ladybug::container::Containerdirectly. Zero copy.- 9-layer CISC translation. Cypher → parser → planner → executor →
StorageBackend dispatch → LadybugBackend →
id_to_addrHashMap → BindSpace → reconstruct Neo4jRow. RISC: parser → BindSpace call → done. PropertyMapside-HashMap.node_props: HashMap<NodeId, PropertyMap>stores original strings alongside fingerprints. In SPOQ model, properties live in DN tree as Container values at path positions.NodeId ↔ AddrBiMap. Neo4j uses sequential u64 IDs, BindSpace uses prefix:slot addressing. The bridge adds a HashMap lookup per operation. In RISC model, Cypher variables bind directly toPackedDnaddresses.
- CALL procedures surface (
ladybug.search,ladybug.bind,ladybug.similarity,ladybug.truth,ladybug.revise,ladybug.spine,ladybug.dn.navigate). These become native query semantics, not extension procedures. - Verb resolution via Surface 0x07 — correct pattern, keep it.
- NARS truth revision on relationship creation — the idea that
create_relationshipis evidence accumulation is right.
pub struct CypherEngine {
parser: CypherParser, // keep — good parser
}
impl CypherEngine {
pub fn query<'a>(&self, space: &'a BindSpace, cypher: &str) -> QueryResult<'a> {
let ast = self.parser.parse(cypher);
execute_ast(space, &ast) // MATCH → traverse(), WHERE → hamming filter
}
pub fn mutate(&self, space: &mut BindSpace, cypher: &str) -> MutationResult {
let ast = self.parser.parse(cypher);
execute_mutations(space, &ast) // CREATE → write(), SET → revise()
}
}Branch: deprecate/pr20-21-json-service
Merged from: master @ 60428ff
URL: AdaWorldAPI/n8n-rs#22
| Destination | Source | Lines | Description |
|---|---|---|---|
.deprecated/pr20_json_workflow/autopoiesis.json |
n8n-rust/workflows/autopoiesis.json |
~200 | JSON workflow template with service discovery env vars |
.deprecated/pr20_json_workflow/README.md |
— | — | Rationale |
.deprecated/pr21_service_contracts/COGNITIVE_WORKFLOW_CONTRACTS.md |
docs/COGNITIVE_WORKFLOW_CONTRACTS.md |
1,147 | Arrow Flight RPC contracts between services |
.deprecated/pr21_service_contracts/README.md |
— | — | Rationale |
n8n-rust/workflows/autopoiesis.jsondocs/COGNITIVE_WORKFLOW_CONTRACTS.md
docs/AUTOPOIESIS_SPEC.md— the Maturana & Varela model is sound. Q-value routing, MUL as immune system, organizational closure. Theory stays.docs/INTEGRATION_EXECUTION_PLAN.md— 5-phase execution plan stays.docs/COMPATIBILITY_REPORT.md— stays.- All Rust source — unchanged.
- JSON workflow uses service URLs.
ADA_URL,CREWAI_URL,LADYBUG_URLenvironment variables for HTTP calls between components. One binary = direct function calls. - Arrow Flight RPC contracts. Defines gRPC surfaces between n8n-rs and
ladybug-rs. In one-binary model, these become
&selfmethod calls on shared substrate.
- The autopoiesis workflow sequence: sovereignty check → felt assessment → body scan → visceral composite → qualia modulation → hook evaluation → state persistence → dream check. Rewrite as a Rust function chain, not JSON nodes.
FreeWillPipeline7-step evaluation (type/scope/reversibility/evidence/ satisfaction/rate-limit/RBAC)TopologyChangeenum: PruneEdge, GrowEdge, DeactivateNode, Replicate- Q-value routing with MUL-modulated epsilon-greedy
Branch: deprecate/pr27-review-doc
Merged from: main @ 28faa74
URL: AdaWorldAPI/crewai-rust#29
| File | Lines | Description |
|---|---|---|
ROADMAP_REVIEW.md |
1,632 | Cross-ecosystem roadmap review with 22 recommendations |
README.md |
— | Rationale |
docs/ROADMAP_REVIEW.md
docs/INTEGRATION_PLAN_SCHEMA_CHANGES.md— schema plan is sound ✅docs/STRATEGY_INTEGRATION_PLAN.md— strategy stays ✅docs/AGENT_MUL_CONTRACTS.md— staysdocs/AGENT_ORCHESTRATION_SPEC.md— staysdocs/INTEGRATION_EXECUTION_PLAN.md— stays- All Rust source — unchanged.
- Analysis document, not code — belongs in docs repo.
- References neo4j-rs extensively — wrong repo for this content.
- Many recommendations superseded by SPOQ/RISC architectural shift.
- StorageBackend trait analysis (well-designed integration seam assessment)
- Effort estimate validation table (realistic LOC/time estimates)
- Risk #9: BindNode AoS→SoA refactor blocks Phase 4
- Risk #10: fingerprint 156→157 word split (silent corruption)
- Risk #11: CogRecord 256-word redesign changes integration surface
- No
serde_jsonon internal hot path. If you seeserde_json::to_stringorserde_json::from_strbetween crates in the same binary, reject the PR. - No
reqwest::post()between crates in the same binary. If two crates share aCargo.tomlworkspace, they communicate via borrows. - No DTO types that duplicate
ladybug-contract.Container,CogRecord,PackedDn,TruthValue— use directly, never reimplement. - No
HashMap<NodeId, PropertyMap>side storage. Properties live in the DN tree as Containers at path positions. - neo4j-rs = Cypher parser + BindSpace caller. No executor, no StorageBackend trait, no intermediate Row representation.
| Repo | Rust LOC (approx) | Key surviving components |
|---|---|---|
| ladybug-rs | ~25,000 | BindSpace, Container, SPO Crystal, AVX engine, qualia stack (felt_parse, agent_state, texture, reflection, volition, mul_bridge, dream_bridge), server.rs (graph endpoints + UDP) |
| neo4j-rs | ~5,000 | Cypher parser/lexer/AST, MemoryBackend (test oracle), model types, execution engine (to be rewritten) |
| n8n-rs | ~4,800 | Unified executor, workflow engine, cognitive layer stack, LanceDB/Arrow Flight (feature-gated) |
| crewai-rust | ~60,000 | MetaOrchestrator, Triune persona, flow engine, memory layers, RAG, interface gateway, contract bridge |