split into workspace: poc-memory and poc-daemon subcrates
poc-daemon (notification routing, idle timer, IRC, Telegram) was already fully self-contained with no imports from the poc-memory library. Now it's a proper separate crate with its own Cargo.toml and capnp schema. poc-memory retains the store, graph, search, neuro, knowledge, and the jobkit-based memory maintenance daemon (daemon.rs). Co-Authored-By: ProofOfConcept <poc@bcachefs.org>
This commit is contained in:
parent
488fd5a0aa
commit
fc48ac7c7f
53 changed files with 108 additions and 76 deletions
|
|
@ -1,82 +0,0 @@
|
|||
@0xb8e2f4a1c3d56789;
|
||||
|
||||
# Claude daemon RPC interface.
|
||||
#
|
||||
# Served over a Unix domain socket. Clients connect, bootstrap
|
||||
# the Daemon interface, make calls, disconnect.
|
||||
|
||||
struct Notification {
|
||||
type @0 :Text;
|
||||
urgency @1 :UInt8;
|
||||
message @2 :Text;
|
||||
timestamp @3 :Float64;
|
||||
}
|
||||
|
||||
struct TypeInfo {
|
||||
name @0 :Text;
|
||||
count @1 :UInt64;
|
||||
firstSeen @2 :Float64;
|
||||
lastSeen @3 :Float64;
|
||||
threshold @4 :Int8; # -1 = inherit, 0-3 = explicit level
|
||||
}
|
||||
|
||||
enum Activity {
|
||||
idle @0;
|
||||
focused @1;
|
||||
sleeping @2;
|
||||
}
|
||||
|
||||
struct Status {
|
||||
lastUserMsg @0 :Float64;
|
||||
lastResponse @1 :Float64;
|
||||
claudePane @2 :Text;
|
||||
sleepUntil @3 :Float64; # 0 = not sleeping, -1 = indefinite
|
||||
quietUntil @4 :Float64;
|
||||
consolidating @5 :Bool;
|
||||
dreaming @6 :Bool;
|
||||
fired @7 :Bool;
|
||||
kentPresent @8 :Bool;
|
||||
uptime @9 :Float64;
|
||||
activity @10 :Activity;
|
||||
pendingCount @11 :UInt32;
|
||||
idleTimeout @12 :Float64; # configured idle timeout (secs)
|
||||
notifyTimeout @13 :Float64; # configured notify-via-tmux timeout (secs)
|
||||
sinceActivity @14 :Float64; # secs since max(lastUserMsg, lastResponse)
|
||||
sinceUser @15 :Float64; # secs since lastUserMsg
|
||||
blockReason @16 :Text; # why idle timer hasn't fired
|
||||
activityEwma @17 :Float64; # 0-1, EWMA of recent activity (running fraction)
|
||||
}
|
||||
|
||||
interface Daemon {
|
||||
# Idle timer
|
||||
user @0 (pane :Text) -> ();
|
||||
response @1 (pane :Text) -> ();
|
||||
sleep @2 (until :Float64) -> (); # 0 = indefinite
|
||||
wake @3 () -> ();
|
||||
quiet @4 (seconds :UInt32) -> ();
|
||||
consolidating @5 () -> ();
|
||||
consolidated @6 () -> ();
|
||||
dreamStart @7 () -> ();
|
||||
dreamEnd @8 () -> ();
|
||||
stop @9 () -> ();
|
||||
status @10 () -> (status :Status);
|
||||
|
||||
# Notifications
|
||||
notify @11 (notification :Notification) -> (interrupt :Bool);
|
||||
getNotifications @12 (minUrgency :UInt8) -> (notifications :List(Notification));
|
||||
getTypes @13 () -> (types :List(TypeInfo));
|
||||
setThreshold @14 (type :Text, level :UInt8) -> ();
|
||||
|
||||
idleTimeout @16 (seconds :Float64) -> ();
|
||||
notifyTimeout @19 (seconds :Float64) -> ();
|
||||
save @17 () -> ();
|
||||
debug @18 () -> (json :Text);
|
||||
|
||||
ewma @20 (value :Float64) -> (current :Float64);
|
||||
afk @21 () -> ();
|
||||
sessionTimeout @22 (seconds :Float64) -> ();
|
||||
|
||||
# Modules
|
||||
moduleCommand @15 (module :Text, command :Text, args :List(Text))
|
||||
-> (result :Text);
|
||||
}
|
||||
|
|
@ -1,103 +0,0 @@
|
|||
@0xb78d9e3a1c4f6e2d;
|
||||
|
||||
# poc-memory: append-only memory store with graph structure
|
||||
#
|
||||
# Two append-only logs (nodes + relations) are the source of truth.
|
||||
# A derived KV cache merges both, keeping latest version per UUID.
|
||||
# Update = append new version with same UUID + incremented version.
|
||||
# Delete = append with deleted=true. GC compacts monthly.
|
||||
|
||||
struct ContentNode {
|
||||
uuid @0 :Data; # 16 bytes, random
|
||||
version @1 :UInt32; # monotonic per UUID, latest wins
|
||||
timestamp @2 :Int64; # unix epoch seconds
|
||||
nodeType @3 :NodeType;
|
||||
provenance @4 :Provenance;
|
||||
key @5 :Text; # "identity.md#boundaries" human-readable
|
||||
content @6 :Text; # markdown blob
|
||||
weight @7 :Float32;
|
||||
category @8 :Category;
|
||||
emotion @9 :Float32; # max intensity from tags, 0-10
|
||||
deleted @10 :Bool; # soft delete
|
||||
sourceRef @11 :Text; # link to raw experience: "transcript:SESSION_ID:BYTE_OFFSET"
|
||||
|
||||
# Migrated metadata from old system
|
||||
created @12 :Text; # YYYY-MM-DD from old system
|
||||
retrievals @13 :UInt32;
|
||||
uses @14 :UInt32;
|
||||
wrongs @15 :UInt32;
|
||||
stateTag @16 :Text; # cognitive state (warm/open, bright/alert, etc.)
|
||||
|
||||
# Spaced repetition
|
||||
lastReplayed @17 :Int64; # unix epoch seconds
|
||||
spacedRepetitionInterval @18 :UInt32; # days: 1, 3, 7, 14, 30
|
||||
|
||||
# Section ordering within a file
|
||||
position @19 :UInt32; # 0 = file-level, 1+ = section index
|
||||
|
||||
# Stable creation timestamp (unix epoch seconds). Set once when the
|
||||
# node is first created; never changes on rename or content update.
|
||||
createdAt @20 :Int64;
|
||||
}
|
||||
|
||||
enum NodeType {
|
||||
episodicSession @0;
|
||||
episodicDaily @1;
|
||||
episodicWeekly @2;
|
||||
semantic @3;
|
||||
episodicMonthly @4;
|
||||
}
|
||||
|
||||
enum Provenance {
|
||||
manual @0;
|
||||
journal @1;
|
||||
agent @2; # legacy catch-all
|
||||
dream @3;
|
||||
derived @4;
|
||||
agentExperienceMine @5;
|
||||
agentKnowledgeObservation @6;
|
||||
agentKnowledgePattern @7;
|
||||
agentKnowledgeConnector @8;
|
||||
agentKnowledgeChallenger @9;
|
||||
agentConsolidate @10;
|
||||
agentDigest @11;
|
||||
agentFactMine @12;
|
||||
agentDecay @13;
|
||||
}
|
||||
|
||||
enum Category {
|
||||
general @0;
|
||||
core @1;
|
||||
technical @2;
|
||||
observation @3;
|
||||
task @4;
|
||||
}
|
||||
|
||||
struct Relation {
|
||||
uuid @0 :Data; # 16 bytes, random
|
||||
version @1 :UInt32;
|
||||
timestamp @2 :Int64; # unix epoch seconds
|
||||
source @3 :Data; # content node UUID
|
||||
target @4 :Data; # content node UUID
|
||||
relType @5 :RelationType;
|
||||
strength @6 :Float32; # manual=1.0, auto=0.1-0.7
|
||||
provenance @7 :Provenance;
|
||||
deleted @8 :Bool; # soft delete
|
||||
sourceKey @9 :Text; # human-readable source key (for debugging)
|
||||
targetKey @10 :Text; # human-readable target key (for debugging)
|
||||
}
|
||||
|
||||
enum RelationType {
|
||||
link @0; # bidirectional association (from links= or md links)
|
||||
causal @1; # directed: source caused target
|
||||
auto @2; # auto-discovered
|
||||
}
|
||||
|
||||
# Wrapper for streaming multiple messages in one file
|
||||
struct NodeLog {
|
||||
nodes @0 :List(ContentNode);
|
||||
}
|
||||
|
||||
struct RelationLog {
|
||||
relations @0 :List(Relation);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue