ohwow 0.3.0 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,11 @@
1
+ -- TurboQuant KV cache compression statistics
2
+ -- Tracks compression performance per model for monitoring and display
3
+
4
+ CREATE TABLE IF NOT EXISTS turboquant_stats (
5
+ model_name TEXT PRIMARY KEY,
6
+ compression_ratio REAL,
7
+ effective_context_tokens INTEGER,
8
+ baseline_context_tokens INTEGER,
9
+ bits_per_value INTEGER DEFAULT 4,
10
+ last_updated TEXT DEFAULT (datetime('now'))
11
+ );
@@ -0,0 +1,18 @@
1
+ -- Claude Code CLI session persistence for --resume support
2
+ -- Stores session IDs per agent with working directory awareness
3
+
4
+ -- @statement
5
+ CREATE TABLE IF NOT EXISTS claude_code_sessions (
6
+ id TEXT PRIMARY KEY DEFAULT (lower(hex(randomblob(16)))),
7
+ agent_id TEXT NOT NULL,
8
+ workspace_id TEXT NOT NULL,
9
+ claude_session_id TEXT NOT NULL,
10
+ working_directory TEXT,
11
+ created_at TEXT DEFAULT (datetime('now')),
12
+ last_used_at TEXT DEFAULT (datetime('now')),
13
+ status TEXT DEFAULT 'active' CHECK (status IN ('active', 'stale', 'failed'))
14
+ );
15
+
16
+ -- @statement
17
+ CREATE INDEX IF NOT EXISTS idx_cc_sessions_agent
18
+ ON claude_code_sessions(agent_id, status);
@@ -0,0 +1,25 @@
1
+ -- Consciousness Items — Shared consciousness between local and cloud.
2
+ -- Schema matches the cloud's consciousness_items Supabase table.
3
+ -- Categories: alert, insight, prediction, milestone, anomaly
4
+ -- Local workspace types map to cloud categories:
5
+ -- failure/warning → alert
6
+ -- discovery/pattern → insight
7
+ -- skill → milestone
8
+ -- signal → prediction
9
+
10
+ CREATE TABLE IF NOT EXISTS consciousness_items (
11
+ id TEXT PRIMARY KEY DEFAULT (lower(hex(randomblob(16)))),
12
+ workspace_id TEXT NOT NULL,
13
+ source TEXT NOT NULL,
14
+ content TEXT NOT NULL,
15
+ salience REAL NOT NULL DEFAULT 0.5,
16
+ category TEXT NOT NULL CHECK (category IN ('alert', 'insight', 'prediction', 'milestone', 'anomaly')),
17
+ created_at TEXT NOT NULL DEFAULT (datetime('now')),
18
+ synced_at TEXT,
19
+ origin TEXT NOT NULL DEFAULT 'local' CHECK (origin IN ('local', 'cloud'))
20
+ );
21
+
22
+ CREATE INDEX IF NOT EXISTS idx_consciousness_items_workspace
23
+ ON consciousness_items(workspace_id, category);
24
+ CREATE INDEX IF NOT EXISTS idx_consciousness_items_salience
25
+ ON consciousness_items(workspace_id, salience DESC);
@@ -0,0 +1,28 @@
1
+ -- Affect System: Somatic markers and affective memories (Damasio)
2
+ -- Emotions as fast decision heuristics
3
+
4
+ CREATE TABLE IF NOT EXISTS somatic_markers (
5
+ id TEXT PRIMARY KEY DEFAULT (lower(hex(randomblob(16)))),
6
+ workspace_id TEXT NOT NULL,
7
+ context_hash TEXT NOT NULL,
8
+ affect TEXT NOT NULL,
9
+ valence REAL NOT NULL,
10
+ intensity REAL NOT NULL,
11
+ outcome TEXT NOT NULL CHECK (outcome IN ('positive','negative','neutral')),
12
+ tool_name TEXT,
13
+ created_at TEXT DEFAULT (datetime('now'))
14
+ );
15
+ CREATE INDEX IF NOT EXISTS idx_somatic_markers_context ON somatic_markers(workspace_id, context_hash);
16
+ CREATE INDEX IF NOT EXISTS idx_somatic_markers_tool ON somatic_markers(workspace_id, tool_name);
17
+
18
+ CREATE TABLE IF NOT EXISTS affective_memories (
19
+ id TEXT PRIMARY KEY DEFAULT (lower(hex(randomblob(16)))),
20
+ workspace_id TEXT NOT NULL,
21
+ experience_id TEXT NOT NULL,
22
+ affect TEXT NOT NULL,
23
+ valence REAL NOT NULL,
24
+ arousal REAL NOT NULL,
25
+ content TEXT NOT NULL,
26
+ created_at TEXT DEFAULT (datetime('now'))
27
+ );
28
+ CREATE INDEX IF NOT EXISTS idx_affective_memories_affect ON affective_memories(workspace_id, affect);
@@ -0,0 +1,10 @@
1
+ -- Endocrine System: Hormone snapshots (Spinoza's conatus)
2
+ -- Global state modulator crossing all architectural boundaries
3
+
4
+ CREATE TABLE IF NOT EXISTS hormone_snapshots (
5
+ id TEXT PRIMARY KEY DEFAULT (lower(hex(randomblob(16)))),
6
+ workspace_id TEXT NOT NULL,
7
+ profile TEXT NOT NULL,
8
+ created_at TEXT DEFAULT (datetime('now'))
9
+ );
10
+ CREATE INDEX IF NOT EXISTS idx_hormone_snapshots_time ON hormone_snapshots(workspace_id, created_at DESC);
@@ -0,0 +1,24 @@
1
+ -- Homeostasis: Self-regulation with set points (Cannon + Ashby)
2
+ -- Negative feedback loops and allostatic adaptation
3
+
4
+ CREATE TABLE IF NOT EXISTS homeostasis_set_points (
5
+ id TEXT PRIMARY KEY DEFAULT (lower(hex(randomblob(16)))),
6
+ workspace_id TEXT NOT NULL,
7
+ metric TEXT NOT NULL,
8
+ target REAL NOT NULL,
9
+ tolerance REAL NOT NULL DEFAULT 0.1,
10
+ adaptation_rate REAL NOT NULL DEFAULT 0.1,
11
+ updated_at TEXT DEFAULT (datetime('now')),
12
+ UNIQUE(workspace_id, metric)
13
+ );
14
+
15
+ CREATE TABLE IF NOT EXISTS allostasis_events (
16
+ id TEXT PRIMARY KEY DEFAULT (lower(hex(randomblob(16)))),
17
+ workspace_id TEXT NOT NULL,
18
+ metric TEXT NOT NULL,
19
+ old_target REAL NOT NULL,
20
+ new_target REAL NOT NULL,
21
+ reason TEXT NOT NULL,
22
+ created_at TEXT DEFAULT (datetime('now'))
23
+ );
24
+ CREATE INDEX IF NOT EXISTS idx_allostasis_events_time ON allostasis_events(workspace_id, created_at DESC);
@@ -0,0 +1,25 @@
1
+ -- Oneiros: Sleep, dreams, and default mode (Aristotle + Jung + DMN)
2
+ -- Consolidation, creative recombination, and idle-time processing
3
+
4
+ CREATE TABLE IF NOT EXISTS sleep_state (
5
+ id TEXT PRIMARY KEY DEFAULT 'default',
6
+ workspace_id TEXT NOT NULL,
7
+ phase TEXT NOT NULL DEFAULT 'wake',
8
+ sleep_debt REAL NOT NULL DEFAULT 0,
9
+ last_consolidation TEXT,
10
+ last_dream TEXT,
11
+ cycle_count INTEGER DEFAULT 0,
12
+ updated_at TEXT DEFAULT (datetime('now'))
13
+ );
14
+
15
+ CREATE TABLE IF NOT EXISTS dream_associations (
16
+ id TEXT PRIMARY KEY DEFAULT (lower(hex(randomblob(16)))),
17
+ workspace_id TEXT NOT NULL,
18
+ memory_a_id TEXT NOT NULL,
19
+ memory_b_id TEXT NOT NULL,
20
+ connection TEXT NOT NULL,
21
+ novelty_score REAL NOT NULL,
22
+ promoted INTEGER DEFAULT 0,
23
+ created_at TEXT DEFAULT (datetime('now'))
24
+ );
25
+ CREATE INDEX IF NOT EXISTS idx_dream_associations_novelty ON dream_associations(workspace_id, novelty_score DESC);
@@ -0,0 +1,39 @@
1
+ -- Immune System: Layered threat defense with innate and adaptive immunity
2
+ -- Maturana & Varela's autopoiesis + self/non-self distinction
3
+
4
+ CREATE TABLE IF NOT EXISTS threat_signatures (
5
+ id TEXT PRIMARY KEY DEFAULT (lower(hex(randomblob(16)))),
6
+ workspace_id TEXT NOT NULL,
7
+ pathogen_type TEXT NOT NULL,
8
+ pattern TEXT NOT NULL,
9
+ severity REAL NOT NULL DEFAULT 0.5,
10
+ origin TEXT NOT NULL DEFAULT 'learned',
11
+ false_positive_rate REAL NOT NULL DEFAULT 0.1,
12
+ last_seen TEXT,
13
+ created_at TEXT DEFAULT (datetime('now'))
14
+ );
15
+ CREATE INDEX IF NOT EXISTS idx_threat_signatures_workspace ON threat_signatures(workspace_id, origin);
16
+
17
+ CREATE TABLE IF NOT EXISTS immune_memories (
18
+ id TEXT PRIMARY KEY DEFAULT (lower(hex(randomblob(16)))),
19
+ workspace_id TEXT NOT NULL,
20
+ pathogen_type TEXT NOT NULL,
21
+ context_hash TEXT NOT NULL,
22
+ occurrences INTEGER NOT NULL DEFAULT 1,
23
+ last_occurrence TEXT NOT NULL,
24
+ response_effectiveness REAL NOT NULL DEFAULT 0.5,
25
+ created_at TEXT DEFAULT (datetime('now'))
26
+ );
27
+ CREATE INDEX IF NOT EXISTS idx_immune_memories_workspace ON immune_memories(workspace_id, context_hash);
28
+
29
+ CREATE TABLE IF NOT EXISTS immune_incidents (
30
+ id TEXT PRIMARY KEY DEFAULT (lower(hex(randomblob(16)))),
31
+ workspace_id TEXT NOT NULL,
32
+ pathogen_type TEXT NOT NULL,
33
+ confidence REAL NOT NULL,
34
+ recommendation TEXT NOT NULL,
35
+ matched_signature TEXT,
36
+ reason TEXT NOT NULL,
37
+ created_at TEXT DEFAULT (datetime('now'))
38
+ );
39
+ CREATE INDEX IF NOT EXISTS idx_immune_incidents_time ON immune_incidents(workspace_id, created_at DESC);
@@ -0,0 +1,29 @@
1
+ -- Narrative: Story of self (Ricoeur + MacIntyre)
2
+ -- Agents gain identity through narrative coherence
3
+
4
+ CREATE TABLE IF NOT EXISTS narrative_episodes (
5
+ id TEXT PRIMARY KEY DEFAULT (lower(hex(randomblob(16)))),
6
+ workspace_id TEXT NOT NULL,
7
+ agent_id TEXT,
8
+ story_type TEXT NOT NULL,
9
+ title TEXT NOT NULL,
10
+ phase TEXT NOT NULL DEFAULT 'beginning',
11
+ events TEXT NOT NULL DEFAULT '[]',
12
+ moral TEXT,
13
+ emotional_arc TEXT DEFAULT '[]',
14
+ started_at TEXT DEFAULT (datetime('now')),
15
+ ended_at TEXT
16
+ );
17
+ CREATE INDEX IF NOT EXISTS idx_narrative_episodes_agent ON narrative_episodes(workspace_id, agent_id);
18
+ CREATE INDEX IF NOT EXISTS idx_narrative_episodes_phase ON narrative_episodes(workspace_id, phase);
19
+
20
+ CREATE TABLE IF NOT EXISTS character_profiles (
21
+ id TEXT PRIMARY KEY DEFAULT 'default',
22
+ workspace_id TEXT NOT NULL,
23
+ agent_id TEXT,
24
+ identity TEXT NOT NULL DEFAULT '',
25
+ core_traits TEXT DEFAULT '[]',
26
+ defining_moments TEXT DEFAULT '[]',
27
+ narrative_coherence REAL DEFAULT 0.5,
28
+ updated_at TEXT DEFAULT (datetime('now'))
29
+ );
@@ -0,0 +1,27 @@
1
+ -- Ethos System: Ethical evaluation persistence (Aristotle + Kant + Noddings)
2
+ -- Multi-framework moral reasoning for autonomous agent decisions
3
+
4
+ CREATE TABLE IF NOT EXISTS ethical_evaluations (
5
+ id TEXT PRIMARY KEY DEFAULT (lower(hex(randomblob(16)))),
6
+ workspace_id TEXT NOT NULL,
7
+ action TEXT NOT NULL,
8
+ permitted INTEGER NOT NULL,
9
+ recommendation TEXT NOT NULL CHECK (recommendation IN ('proceed','proceed_with_caution','escalate','block')),
10
+ reasoning TEXT NOT NULL,
11
+ framework_results TEXT NOT NULL DEFAULT '[]',
12
+ constraint_violations TEXT DEFAULT '[]',
13
+ dilemma_detected INTEGER DEFAULT 0,
14
+ created_at TEXT DEFAULT (datetime('now'))
15
+ );
16
+ CREATE INDEX IF NOT EXISTS idx_ethical_evaluations_time ON ethical_evaluations(workspace_id, created_at DESC);
17
+ CREATE INDEX IF NOT EXISTS idx_ethical_evaluations_recommendation ON ethical_evaluations(workspace_id, recommendation);
18
+
19
+ CREATE TABLE IF NOT EXISTS moral_profile (
20
+ id TEXT PRIMARY KEY DEFAULT 'default',
21
+ workspace_id TEXT NOT NULL,
22
+ stage TEXT NOT NULL DEFAULT 'rule_following',
23
+ consistency_score REAL DEFAULT 0.5,
24
+ dilemmas_resolved INTEGER DEFAULT 0,
25
+ constraint_violations INTEGER DEFAULT 0,
26
+ updated_at TEXT DEFAULT (datetime('now'))
27
+ );
@@ -0,0 +1,29 @@
1
+ -- Hexis: Habit formation (Aristotle's hexis + William James)
2
+ -- Cue-routine-reward loop with automaticity gradient
3
+
4
+ CREATE TABLE IF NOT EXISTS habits (
5
+ id TEXT PRIMARY KEY DEFAULT (lower(hex(randomblob(16)))),
6
+ workspace_id TEXT NOT NULL,
7
+ name TEXT NOT NULL,
8
+ cue TEXT NOT NULL,
9
+ routine TEXT NOT NULL,
10
+ reward TEXT NOT NULL,
11
+ strength REAL NOT NULL DEFAULT 0.1,
12
+ automaticity TEXT NOT NULL DEFAULT 'deliberate',
13
+ success_rate REAL DEFAULT 0.5,
14
+ execution_count INTEGER DEFAULT 0,
15
+ last_executed TEXT,
16
+ decay_rate REAL DEFAULT 0.03,
17
+ created_at TEXT DEFAULT (datetime('now'))
18
+ );
19
+ CREATE INDEX IF NOT EXISTS idx_habits_strength ON habits(workspace_id, strength DESC);
20
+
21
+ CREATE TABLE IF NOT EXISTS habit_executions (
22
+ id TEXT PRIMARY KEY DEFAULT (lower(hex(randomblob(16)))),
23
+ workspace_id TEXT NOT NULL,
24
+ habit_id TEXT NOT NULL,
25
+ success INTEGER NOT NULL,
26
+ duration_ms INTEGER,
27
+ created_at TEXT DEFAULT (datetime('now'))
28
+ );
29
+ CREATE INDEX IF NOT EXISTS idx_habit_executions_habit ON habit_executions(habit_id, created_at DESC);