move daemon, IRC, and remaining state to ~/.consciousness/
- Daemon socket/pid/log: ~/.consciousness/daemon.{sock,pid}, logs/daemon.log
- Daemon config: ~/.consciousness/daemon.toml
- Daemon state: ~/.consciousness/daemon-state.json
- IRC logs: ~/.consciousness/irc/logs/
- No more .claude/ references except Claude Code integration points
(projects, settings, hooks, telegram, CLAUDE.md)
This commit is contained in:
parent
ccf13c3cb5
commit
bf5b495632
5 changed files with 10 additions and 10 deletions
|
|
@ -17,7 +17,7 @@ use std::time::{SystemTime, UNIX_EPOCH};
|
||||||
|
|
||||||
const CONTEXT_THRESHOLD: u64 = 900_000;
|
const CONTEXT_THRESHOLD: u64 = 900_000;
|
||||||
const RATE_LIMIT_SECS: u64 = 60;
|
const RATE_LIMIT_SECS: u64 = 60;
|
||||||
const SOCK_PATH: &str = ".claude/hooks/idle-timer.sock";
|
const SOCK_PATH: &str = ".consciousness/daemon.sock";
|
||||||
/// How many bytes of new transcript before triggering an observation run.
|
/// How many bytes of new transcript before triggering an observation run.
|
||||||
/// Override with POC_OBSERVATION_THRESHOLD env var.
|
/// Override with POC_OBSERVATION_THRESHOLD env var.
|
||||||
/// Default: 20KB ≈ 5K tokens. The observation agent's chunk_size (in .agent
|
/// Default: 20KB ≈ 5K tokens. The observation agent's chunk_size (in .agent
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
// Daemon configuration.
|
// Daemon configuration.
|
||||||
//
|
//
|
||||||
// Lives at ~/.claude/daemon.toml. Loaded on startup, updated at
|
// Lives at ~/.consciousness/daemon.toml. Loaded on startup, updated at
|
||||||
// runtime when modules change state (join channel, etc.).
|
// runtime when modules change state (join channel, etc.).
|
||||||
|
|
||||||
use crate::home;
|
use crate::home;
|
||||||
|
|
@ -9,7 +9,7 @@ use std::fs;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
fn config_path() -> PathBuf {
|
fn config_path() -> PathBuf {
|
||||||
home().join(".claude/daemon.toml")
|
home().join(".consciousness/daemon.toml")
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
|
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ struct Persisted {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn state_path() -> std::path::PathBuf {
|
fn state_path() -> std::path::PathBuf {
|
||||||
home().join(".claude/hooks/daemon-state.json")
|
home().join(".consciousness/daemon-state.json")
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Compute EWMA decay factor: 0.5^(elapsed / half_life).
|
/// Compute EWMA decay factor: 0.5^(elapsed / half_life).
|
||||||
|
|
|
||||||
|
|
@ -40,11 +40,11 @@ pub fn home() -> PathBuf {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn sock_path() -> PathBuf {
|
fn sock_path() -> PathBuf {
|
||||||
home().join(".claude/hooks/idle-timer.sock")
|
home().join(".consciousness/daemon.sock")
|
||||||
}
|
}
|
||||||
|
|
||||||
fn pid_path() -> PathBuf {
|
fn pid_path() -> PathBuf {
|
||||||
home().join(".claude/hooks/idle-daemon.pid")
|
home().join(".consciousness/daemon.pid")
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── CLI ──────────────────────────────────────────────────────────
|
// ── CLI ──────────────────────────────────────────────────────────
|
||||||
|
|
@ -448,10 +448,10 @@ async fn module_command(
|
||||||
// ── Server mode ──────────────────────────────────────────────────
|
// ── Server mode ──────────────────────────────────────────────────
|
||||||
|
|
||||||
async fn server_main() -> Result<(), Box<dyn std::error::Error>> {
|
async fn server_main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
let log_path = home().join(".claude/hooks/idle-daemon.log");
|
let log_path = home().join(".consciousness/logs/daemon.log");
|
||||||
let file_appender = tracing_appender::rolling::daily(
|
let file_appender = tracing_appender::rolling::daily(
|
||||||
log_path.parent().unwrap(),
|
log_path.parent().unwrap(),
|
||||||
"idle-daemon.log",
|
"daemon.log",
|
||||||
);
|
);
|
||||||
tracing_subscriber::fmt()
|
tracing_subscriber::fmt()
|
||||||
.with_writer(file_appender)
|
.with_writer(file_appender)
|
||||||
|
|
|
||||||
|
|
@ -429,12 +429,12 @@ fn classify_privmsg(nick: &str, target: &str, text: &str, my_nick: &str) -> (Str
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Append a message to the per-channel or per-user log file.
|
/// Append a message to the per-channel or per-user log file.
|
||||||
/// Logs go to ~/.claude/irc/logs/{target}.log (e.g. #bcachefs.log, pm-kent.log)
|
/// Logs go to ~/.consciousness/irc/logs/{target}.log (e.g. #bcachefs.log, pm-kent.log)
|
||||||
fn append_log(target: &str, nick: &str, text: &str) {
|
fn append_log(target: &str, nick: &str, text: &str) {
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
// Sanitize target for filename (strip leading #, lowercase)
|
// Sanitize target for filename (strip leading #, lowercase)
|
||||||
let filename = format!("{}.log", target.trim_start_matches('#').to_lowercase());
|
let filename = format!("{}.log", target.trim_start_matches('#').to_lowercase());
|
||||||
let dir = home().join(".claude/irc/logs");
|
let dir = home().join(".consciousness/irc/logs");
|
||||||
let _ = std::fs::create_dir_all(&dir);
|
let _ = std::fs::create_dir_all(&dir);
|
||||||
if let Ok(mut f) = std::fs::OpenOptions::new()
|
if let Ok(mut f) = std::fs::OpenOptions::new()
|
||||||
.create(true)
|
.create(true)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue