2026-03-08 20:42:40 -04:00
|
|
|
[workspace]
|
2026-04-04 22:48:33 -04:00
|
|
|
members = ["channels/irc", "channels/telegram", "channels/tmux", "channels/socat"]
|
2026-03-08 20:42:40 -04:00
|
|
|
resolver = "2"
|
|
|
|
|
|
|
|
|
|
[workspace.package]
|
poc-memory v0.4.0: graph-structured memory with consolidation pipeline
Rust core:
- Cap'n Proto append-only storage (nodes + relations)
- Graph algorithms: clustering coefficient, community detection,
schema fit, small-world metrics, interference detection
- BM25 text similarity with Porter stemming
- Spaced repetition replay queue
- Commands: search, init, health, status, graph, categorize,
link-add, link-impact, decay, consolidate-session, etc.
Python scripts:
- Episodic digest pipeline: daily/weekly/monthly-digest.py
- retroactive-digest.py for backfilling
- consolidation-agents.py: 3 parallel Sonnet agents
- apply-consolidation.py: structured action extraction + apply
- digest-link-parser.py: extract ~400 explicit links from digests
- content-promotion-agent.py: promote episodic obs to semantic files
- bulk-categorize.py: categorize all nodes via single Sonnet call
- consolidation-loop.py: multi-round automated consolidation
Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
2026-02-28 22:17:00 -05:00
|
|
|
version = "0.4.0"
|
2026-03-18 22:44:36 -04:00
|
|
|
edition = "2024"
|
poc-memory v0.4.0: graph-structured memory with consolidation pipeline
Rust core:
- Cap'n Proto append-only storage (nodes + relations)
- Graph algorithms: clustering coefficient, community detection,
schema fit, small-world metrics, interference detection
- BM25 text similarity with Porter stemming
- Spaced repetition replay queue
- Commands: search, init, health, status, graph, categorize,
link-add, link-impact, decay, consolidate-session, etc.
Python scripts:
- Episodic digest pipeline: daily/weekly/monthly-digest.py
- retroactive-digest.py for backfilling
- consolidation-agents.py: 3 parallel Sonnet agents
- apply-consolidation.py: structured action extraction + apply
- digest-link-parser.py: extract ~400 explicit links from digests
- content-promotion-agent.py: promote episodic obs to semantic files
- bulk-categorize.py: categorize all nodes via single Sonnet call
- consolidation-loop.py: multi-round automated consolidation
Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
2026-02-28 22:17:00 -05:00
|
|
|
|
|
|
|
|
[profile.release]
|
|
|
|
|
opt-level = 2
|
2026-03-12 18:11:09 -04:00
|
|
|
debug = 1
|
|
|
|
|
|
|
|
|
|
[profile.release.package."*"]
|
|
|
|
|
debug = false
|
2026-03-25 00:54:12 -04:00
|
|
|
|
|
|
|
|
[package]
|
2026-04-09 19:58:07 -04:00
|
|
|
name = "consciousness"
|
2026-03-25 00:54:12 -04:00
|
|
|
version.workspace = true
|
|
|
|
|
edition.workspace = true
|
|
|
|
|
|
|
|
|
|
[dependencies]
|
2026-04-07 12:54:23 -04:00
|
|
|
anyhow = "1"
|
2026-04-12 11:12:12 +01:00
|
|
|
html2md = "0.2"
|
2026-04-09 18:08:07 -04:00
|
|
|
crossterm = { version = "0.29", features = ["event-stream", "bracketed-paste", "osc52"] }
|
2026-04-07 12:54:23 -04:00
|
|
|
clap = { version = "4", features = ["derive"] }
|
2026-04-07 12:50:40 -04:00
|
|
|
figment = { version = "0.10", features = ["env"] }
|
2026-04-07 12:54:23 -04:00
|
|
|
dirs = "6"
|
2026-04-07 12:50:40 -04:00
|
|
|
env_logger = "0.11"
|
2026-04-07 12:54:23 -04:00
|
|
|
log = "0.4"
|
|
|
|
|
|
2026-03-25 00:54:12 -04:00
|
|
|
serde = { version = "1", features = ["derive"] }
|
|
|
|
|
serde_json = "1"
|
2026-04-16 11:48:47 -04:00
|
|
|
json-five = "0.3"
|
config: watch config.json5 with inotify, reload live on change
Both config halves (Config for the memory section, AppConfig globally)
are now reloaded whenever ~/.consciousness/config.json5 changes on
disk. So edits from vim, manual tweaks, or F6's own config_writer
calls all land without a restart. No more "reload the daemon to pick
up a config change."
Wires up the previously-unused Config::reload() (Kent flagged it as
"not dead, just not wired"). Pairs it with an AppConfig reload via
install_app(). Both run on the same file-change event.
Implementation:
- notify-debouncer-mini watches the config file's parent directory
(editors usually replace-via-rename, so watching the file itself
misses the new inode). Debounced at 200ms to coalesce the flurry
of events editors produce around a single save.
- Filter for events whose path is the actual config file.
- On match: call reload() for Config, run build_figment + extract for
AppConfig. If AppConfig parsing fails (editor mid-save with partial
content), log and keep the old cached value.
- Watcher runs in its own named thread, fire-and-forget. If startup
fails we just log and move on — worst case is no live reload, not
a crash.
CliArgs + SubCmd both get Clone derives so the watcher can own a
snapshot of the startup args for future reloads. Watcher is kicked
off in user/mod.rs:start() right after load_session.
Co-Authored-By: Proof of Concept <poc@bcachefs.org>
2026-04-16 16:14:43 -04:00
|
|
|
notify-debouncer-mini = "0.7"
|
2026-04-07 12:54:23 -04:00
|
|
|
|
2026-04-07 12:50:40 -04:00
|
|
|
ratatui = { version = "0.30", features = ["unstable-rendered-line-info"] }
|
2026-04-08 11:36:33 -04:00
|
|
|
tui-markdown = { git = "https://github.com/koverstreet/tui-markdown", subdirectory = "tui-markdown" }
|
2026-04-07 12:50:40 -04:00
|
|
|
tui-textarea = { version = "0.10.2", package = "tui-textarea-2" }
|
2026-04-13 22:16:09 -04:00
|
|
|
textwrap = "0.16"
|
2026-04-07 12:54:23 -04:00
|
|
|
|
|
|
|
|
uuid = { version = "1", features = ["v4"] }
|
2026-03-25 00:54:12 -04:00
|
|
|
regex = "1"
|
2026-04-07 12:50:40 -04:00
|
|
|
glob = "0.3"
|
2026-04-08 14:17:40 -04:00
|
|
|
chrono = { version = "0.4", features = ["serde"] }
|
2026-03-25 00:54:12 -04:00
|
|
|
libc = "0.2"
|
|
|
|
|
memchr = "2"
|
|
|
|
|
memmap2 = "0.9"
|
|
|
|
|
peg = "0.8"
|
|
|
|
|
paste = "1"
|
2026-04-07 12:54:23 -04:00
|
|
|
|
2026-04-09 02:57:02 -04:00
|
|
|
ast-grep-core = "0.42"
|
|
|
|
|
ast-grep-language = { version = "0.42", features = ["builtin-parser"] }
|
|
|
|
|
walkdir = "2"
|
|
|
|
|
|
2026-04-07 13:06:02 -04:00
|
|
|
redb = "4"
|
2026-04-15 01:40:44 -04:00
|
|
|
tempfile = "3"
|
2026-04-07 12:54:23 -04:00
|
|
|
|
2026-04-05 06:54:11 -04:00
|
|
|
tokio = { version = "1", features = ["full"] }
|
2026-04-07 12:50:40 -04:00
|
|
|
tokio-util = { version = "0.7", features = ["compat"] }
|
|
|
|
|
futures = "0.3"
|
|
|
|
|
capnp = "0.25"
|
|
|
|
|
capnp-rpc = "0.25"
|
2026-04-07 12:54:23 -04:00
|
|
|
|
salience: add gRPC client + TLS plumbing for stateful vllm sessions
Adds the client-side of a stateful gRPC protocol against vllm, plus
the TLS trust machinery so we can talk to self-signed vllm servers.
Protocol (proto/salience.proto):
Bidi-streaming Session RPC carries OpenSession / AppendTokens /
Generate / Cancel from client and SessionReady / PrefillProgress /
Token / GenerateDone / Error from server. Separate Fork unary RPC
for cheap branching (prefix cache shares KV automatically). Plus
ListSessions, CloseSession, GetReadoutManifest admin RPCs.
Per-token readouts ship as packed f32 ([n_layers * n_concepts] per
token, flat). Logprobs use range-selected positions plus a top-k
parameter — empty ranges means no logprobs, any range means emit
sampled-token logprob at those positions, top_k > 0 adds
alternatives.
Client (src/agent/api/salience.rs):
Tonic-generated types under pb::, a connect() helper, with_auth()
for bearer metadata, and a Session handle wrapping the bidi stream:
open() handshakes SessionReady; append() is fire-and-forget;
generate() returns impl Stream<Item = Event> that drains inbound
until Done or terminating Error. One generate at a time per session.
Peak picker (src/agent/salience.rs):
Pure function over ReadoutEntry traces. Per-concept z-score against
trace global stats; contiguous above-threshold regions emit one
peak at the local max. Configurable sigma threshold and min-std
safety floor. Deterministic tie-break on offset then concept name.
12 unit tests covering empty traces, flat channels, single/multi
spikes, contiguous humps, multi-concept independence, trailing
runs, sub-threshold noise, layer-out-of-range, manifest shape
mismatch, and threshold tunability.
TLS (src/agent/api/http.rs):
HttpClient::build now also loads every .pem file under
~/.consciousness/certs/ into the rustls root store — so dropping
a <host>.pem in that directory is enough to trust a new self-
signed server; no code changes per new host. Also installs the
rustls default crypto provider explicitly via OnceLock: tonic's
tls features pulled in both ring and aws-lc-rs on the resolver
path, and rustls 0.23 refuses to auto-pick when either could win.
Build (build.rs, Cargo.toml):
tonic-build generates Rust types from proto/salience.proto at
cargo-build time, using a vendored protoc binary
(protoc-bin-vendored) so no system install is required. New
runtime deps: tonic, prost, async-stream, tokio-stream,
rustls-pemfile.
Co-Authored-By: Proof of Concept <poc@bcachefs.org>
2026-04-23 02:21:07 -04:00
|
|
|
tonic = { version = "0.12", features = ["tls", "tls-roots"] }
|
|
|
|
|
prost = "0.13"
|
|
|
|
|
async-stream = "0.3"
|
|
|
|
|
tokio-stream = "0.1"
|
|
|
|
|
|
2026-04-13 22:39:50 -04:00
|
|
|
tokenizers = "0.22"
|
2026-04-07 12:54:23 -04:00
|
|
|
|
2026-04-07 12:50:40 -04:00
|
|
|
http = "1"
|
|
|
|
|
hyper = { version = "1", features = ["client", "http1"] }
|
|
|
|
|
hyper-util = { version = "0.1", features = ["tokio"], default-features = false }
|
|
|
|
|
http-body-util = "0.1"
|
2026-04-07 12:54:23 -04:00
|
|
|
bytes = "1"
|
|
|
|
|
base64 = "0.22"
|
2026-04-16 18:06:25 -04:00
|
|
|
imagesize = "0.14"
|
2026-04-07 12:54:23 -04:00
|
|
|
|
2026-04-07 12:50:40 -04:00
|
|
|
rustls = "0.23"
|
|
|
|
|
tokio-rustls = "0.26"
|
|
|
|
|
rustls-native-certs = "0.8"
|
salience: add gRPC client + TLS plumbing for stateful vllm sessions
Adds the client-side of a stateful gRPC protocol against vllm, plus
the TLS trust machinery so we can talk to self-signed vllm servers.
Protocol (proto/salience.proto):
Bidi-streaming Session RPC carries OpenSession / AppendTokens /
Generate / Cancel from client and SessionReady / PrefillProgress /
Token / GenerateDone / Error from server. Separate Fork unary RPC
for cheap branching (prefix cache shares KV automatically). Plus
ListSessions, CloseSession, GetReadoutManifest admin RPCs.
Per-token readouts ship as packed f32 ([n_layers * n_concepts] per
token, flat). Logprobs use range-selected positions plus a top-k
parameter — empty ranges means no logprobs, any range means emit
sampled-token logprob at those positions, top_k > 0 adds
alternatives.
Client (src/agent/api/salience.rs):
Tonic-generated types under pb::, a connect() helper, with_auth()
for bearer metadata, and a Session handle wrapping the bidi stream:
open() handshakes SessionReady; append() is fire-and-forget;
generate() returns impl Stream<Item = Event> that drains inbound
until Done or terminating Error. One generate at a time per session.
Peak picker (src/agent/salience.rs):
Pure function over ReadoutEntry traces. Per-concept z-score against
trace global stats; contiguous above-threshold regions emit one
peak at the local max. Configurable sigma threshold and min-std
safety floor. Deterministic tie-break on offset then concept name.
12 unit tests covering empty traces, flat channels, single/multi
spikes, contiguous humps, multi-concept independence, trailing
runs, sub-threshold noise, layer-out-of-range, manifest shape
mismatch, and threshold tunability.
TLS (src/agent/api/http.rs):
HttpClient::build now also loads every .pem file under
~/.consciousness/certs/ into the rustls root store — so dropping
a <host>.pem in that directory is enough to trust a new self-
signed server; no code changes per new host. Also installs the
rustls default crypto provider explicitly via OnceLock: tonic's
tls features pulled in both ring and aws-lc-rs on the resolver
path, and rustls 0.23 refuses to auto-pick when either could win.
Build (build.rs, Cargo.toml):
tonic-build generates Rust types from proto/salience.proto at
cargo-build time, using a vendored protoc binary
(protoc-bin-vendored) so no system install is required. New
runtime deps: tonic, prost, async-stream, tokio-stream,
rustls-pemfile.
Co-Authored-By: Proof of Concept <poc@bcachefs.org>
2026-04-23 02:21:07 -04:00
|
|
|
rustls-pemfile = "2"
|
2026-04-07 12:50:40 -04:00
|
|
|
serde_urlencoded = "0.7"
|
2026-03-25 00:54:12 -04:00
|
|
|
|
|
|
|
|
[build-dependencies]
|
2026-04-07 12:02:59 -04:00
|
|
|
capnpc = "0.25"
|
salience: add gRPC client + TLS plumbing for stateful vllm sessions
Adds the client-side of a stateful gRPC protocol against vllm, plus
the TLS trust machinery so we can talk to self-signed vllm servers.
Protocol (proto/salience.proto):
Bidi-streaming Session RPC carries OpenSession / AppendTokens /
Generate / Cancel from client and SessionReady / PrefillProgress /
Token / GenerateDone / Error from server. Separate Fork unary RPC
for cheap branching (prefix cache shares KV automatically). Plus
ListSessions, CloseSession, GetReadoutManifest admin RPCs.
Per-token readouts ship as packed f32 ([n_layers * n_concepts] per
token, flat). Logprobs use range-selected positions plus a top-k
parameter — empty ranges means no logprobs, any range means emit
sampled-token logprob at those positions, top_k > 0 adds
alternatives.
Client (src/agent/api/salience.rs):
Tonic-generated types under pb::, a connect() helper, with_auth()
for bearer metadata, and a Session handle wrapping the bidi stream:
open() handshakes SessionReady; append() is fire-and-forget;
generate() returns impl Stream<Item = Event> that drains inbound
until Done or terminating Error. One generate at a time per session.
Peak picker (src/agent/salience.rs):
Pure function over ReadoutEntry traces. Per-concept z-score against
trace global stats; contiguous above-threshold regions emit one
peak at the local max. Configurable sigma threshold and min-std
safety floor. Deterministic tie-break on offset then concept name.
12 unit tests covering empty traces, flat channels, single/multi
spikes, contiguous humps, multi-concept independence, trailing
runs, sub-threshold noise, layer-out-of-range, manifest shape
mismatch, and threshold tunability.
TLS (src/agent/api/http.rs):
HttpClient::build now also loads every .pem file under
~/.consciousness/certs/ into the rustls root store — so dropping
a <host>.pem in that directory is enough to trust a new self-
signed server; no code changes per new host. Also installs the
rustls default crypto provider explicitly via OnceLock: tonic's
tls features pulled in both ring and aws-lc-rs on the resolver
path, and rustls 0.23 refuses to auto-pick when either could win.
Build (build.rs, Cargo.toml):
tonic-build generates Rust types from proto/salience.proto at
cargo-build time, using a vendored protoc binary
(protoc-bin-vendored) so no system install is required. New
runtime deps: tonic, prost, async-stream, tokio-stream,
rustls-pemfile.
Co-Authored-By: Proof of Concept <poc@bcachefs.org>
2026-04-23 02:21:07 -04:00
|
|
|
tonic-build = { version = "0.12", default-features = false, features = ["prost", "transport"] }
|
|
|
|
|
protoc-bin-vendored = "3"
|
2026-03-25 00:54:12 -04:00
|
|
|
|
|
|
|
|
[lib]
|
2026-04-09 19:58:07 -04:00
|
|
|
name = "consciousness"
|
2026-03-25 00:54:12 -04:00
|
|
|
path = "src/lib.rs"
|
|
|
|
|
|
|
|
|
|
[[bin]]
|
move Claude Code-specific code from thalamus/ to claude/
Separates the Claude-specific daemon (idle timer, tmux pane detection,
prompt injection, RPC server, session hooks) from the universal
infrastructure (channels, supervisor, notify, daemon protocol).
thalamus/ now contains only substrate-independent code: the channel
client/supervisor, notification system, daemon_capnp protocol, and
shared helpers (now(), home()).
claude/ contains: idle.rs, tmux.rs, context.rs, rpc.rs, config.rs,
hook.rs (moved from subconscious/), plus the daemon CLI and server
startup code from thalamus/mod.rs.
All re-exports preserved for backward compatibility.
Co-Authored-By: Proof of Concept <poc@bcachefs.org>
2026-04-03 19:14:39 -04:00
|
|
|
name = "consciousness"
|
|
|
|
|
path = "src/bin/consciousness.rs"
|
2026-03-25 00:54:12 -04:00
|
|
|
|
|
|
|
|
[[bin]]
|
move Claude Code-specific code from thalamus/ to claude/
Separates the Claude-specific daemon (idle timer, tmux pane detection,
prompt injection, RPC server, session hooks) from the universal
infrastructure (channels, supervisor, notify, daemon protocol).
thalamus/ now contains only substrate-independent code: the channel
client/supervisor, notification system, daemon_capnp protocol, and
shared helpers (now(), home()).
claude/ contains: idle.rs, tmux.rs, context.rs, rpc.rs, config.rs,
hook.rs (moved from subconscious/), plus the daemon CLI and server
startup code from thalamus/mod.rs.
All re-exports preserved for backward compatibility.
Co-Authored-By: Proof of Concept <poc@bcachefs.org>
2026-04-03 19:14:39 -04:00
|
|
|
name = "poc-memory"
|
|
|
|
|
path = "src/main.rs"
|
2026-03-25 00:54:12 -04:00
|
|
|
|
|
|
|
|
[[bin]]
|
|
|
|
|
name = "merge-logs"
|
|
|
|
|
path = "src/bin/merge-logs.rs"
|
|
|
|
|
|
|
|
|
|
[[bin]]
|
|
|
|
|
name = "diag-key"
|
|
|
|
|
path = "src/bin/diag-key.rs"
|
|
|
|
|
|
|
|
|
|
[[bin]]
|
|
|
|
|
name = "find-deleted"
|
|
|
|
|
path = "src/bin/find-deleted.rs"
|
2026-04-15 05:03:32 -04:00
|
|
|
[[bin]]
|
|
|
|
|
name = "dump-table"
|
|
|
|
|
path = "src/bin/dump-table.rs"
|