consciousness/src/lib.rs
ProofOfConcept 96e573f2e5 Delete similarity module, rewrite module, and all text-similarity code
Text cosine similarity was being used as a crutch for operations
the graph structure should handle: interference detection, orphan
linking, triangle closing, hub differentiation. These are all
graph-structural operations that the agents (linker, extractor)
handle with actual semantic understanding.

Removed: similarity.rs (stemming + cosine), rewrite.rs (orphan
linking, triangle closing, hub differentiation), detect_interference,
and all CLI commands and consolidation steps that used them.

-794 lines.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
2026-04-10 15:44:10 -04:00

84 lines
2.2 KiB
Rust

// consciousness — unified crate for memory, agents, and subconscious processes
//
// thought/ — shared cognitive substrate (tools, context, memory ops)
// hippocampus/ — memory storage, retrieval, consolidation
// subconscious/ — autonomous agents (reflect, surface, consolidate, ...)
// user/ — interactive agent (TUI, tools, API clients)
/// Debug logging macro — writes to ~/.consciousness/logs/debug.log
#[macro_export]
macro_rules! dbglog {
($($arg:tt)*) => {{
use std::io::Write;
let log_dir = std::path::PathBuf::from(
std::env::var("HOME").unwrap_or_else(|_| "/tmp".to_string()))
.join(".consciousness/logs");
let _ = std::fs::create_dir_all(&log_dir);
if let Ok(mut f) = std::fs::OpenOptions::new()
.create(true).append(true)
.open(log_dir.join("debug.log"))
{
let _ = writeln!(f, $($arg)*);
}
}};
}
// User interface (TUI, CLI)
pub mod user;
// Cognitive layer (session state machine, DMN, identity)
pub mod mind;
// Shared cognitive infrastructure — used by both agent and subconscious
pub mod agent;
// Memory graph
pub mod hippocampus;
// Autonomous agents
pub mod subconscious;
// Unified configuration
pub mod config;
// Session state
pub mod session;
// Shared utilities
pub mod util;
// CLI handlers
pub mod cli;
// TUI for memory-search
// tui moved to src/user/tui/ (consciousness binary screens)
// Thalamus — universal notification routing and channel infrastructure
pub mod thalamus;
// Re-export at crate root — capnp codegen emits `crate::daemon_capnp::` paths
pub use thalamus::daemon_capnp;
// Generated capnp bindings
pub mod memory_capnp {
include!(concat!(env!("OUT_DIR"), "/schema/memory_capnp.rs"));
}
pub mod channel_capnp {
include!(concat!(env!("OUT_DIR"), "/schema/channel_capnp.rs"));
}
// Re-exports — all existing crate::X paths keep working
pub use hippocampus::{
store, graph, lookups, cursor, query,
spectral, neuro, counters,
transcript, memory,
};
pub use hippocampus::query::engine as search;
pub use hippocampus::query::parser as query_parser;
pub use subconscious as agents;
pub use subconscious::{
audit, consolidate,
digest,
};