ohwow 0.5.1 → 0.5.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,47 @@
1
+ -- Enhance deliverables: make task_id nullable (for chat deliverables),
2
+ -- add session_id (link to orchestrator chat), add auto_created flag.
3
+
4
+ -- @statement
5
+ CREATE TABLE IF NOT EXISTS agent_workforce_deliverables_new (
6
+ id TEXT PRIMARY KEY DEFAULT (lower(hex(randomblob(16)))),
7
+ workspace_id TEXT NOT NULL,
8
+ task_id TEXT REFERENCES agent_workforce_tasks(id),
9
+ agent_id TEXT,
10
+ session_id TEXT,
11
+ deliverable_type TEXT NOT NULL,
12
+ provider TEXT,
13
+ title TEXT NOT NULL,
14
+ content TEXT NOT NULL,
15
+ status TEXT NOT NULL DEFAULT 'pending_review',
16
+ delivery_result TEXT,
17
+ delivered_at TEXT,
18
+ reviewed_by TEXT,
19
+ reviewed_at TEXT,
20
+ rejection_reason TEXT,
21
+ retry_of_deliverable_id TEXT,
22
+ auto_created INTEGER DEFAULT 0,
23
+ created_at TEXT DEFAULT (datetime('now')),
24
+ updated_at TEXT DEFAULT (datetime('now'))
25
+ );
26
+
27
+ -- @statement
28
+ INSERT INTO agent_workforce_deliverables_new (
29
+ id, workspace_id, task_id, agent_id, session_id,
30
+ deliverable_type, provider, title, content, status,
31
+ delivery_result, delivered_at, reviewed_by, reviewed_at,
32
+ rejection_reason, retry_of_deliverable_id, auto_created,
33
+ created_at, updated_at
34
+ )
35
+ SELECT
36
+ id, workspace_id, task_id, agent_id, NULL,
37
+ deliverable_type, provider, title, content, status,
38
+ delivery_result, delivered_at, reviewed_by, reviewed_at,
39
+ rejection_reason, retry_of_deliverable_id, 0,
40
+ created_at, updated_at
41
+ FROM agent_workforce_deliverables;
42
+
43
+ -- @statement
44
+ DROP TABLE agent_workforce_deliverables;
45
+
46
+ -- @statement
47
+ ALTER TABLE agent_workforce_deliverables_new RENAME TO agent_workforce_deliverables;
@@ -0,0 +1,16 @@
1
+ -- Recovery audit log for structured self-recovery.
2
+ -- Tracks error categories, recovery actions, and outcomes for learning.
3
+
4
+ CREATE TABLE IF NOT EXISTS recovery_audit_log (
5
+ id TEXT PRIMARY KEY DEFAULT (lower(hex(randomblob(16)))),
6
+ workspace_id TEXT NOT NULL,
7
+ category TEXT NOT NULL,
8
+ tool_name TEXT,
9
+ error_message TEXT NOT NULL,
10
+ recovery_action TEXT NOT NULL,
11
+ recovered INTEGER NOT NULL DEFAULT 0,
12
+ duration_ms INTEGER NOT NULL DEFAULT 0,
13
+ created_at TEXT NOT NULL DEFAULT (datetime('now'))
14
+ );
15
+
16
+ CREATE INDEX IF NOT EXISTS idx_recovery_audit_workspace ON recovery_audit_log(workspace_id, created_at);
@@ -0,0 +1,63 @@
1
+ -- Co-Evolution: CORAL-style parallel multi-agent iteration
2
+ -- Multiple agents iterate on the same deliverable in parallel rounds,
3
+ -- building on each other's attempts via lineage tracking.
4
+
5
+ -- 1. Evolution runs
6
+ CREATE TABLE IF NOT EXISTS agent_workforce_evolution_runs (
7
+ id TEXT PRIMARY KEY DEFAULT (lower(hex(randomblob(16)))),
8
+ workspace_id TEXT NOT NULL,
9
+ objective TEXT NOT NULL,
10
+ evaluation_criteria TEXT NOT NULL DEFAULT '[]', -- JSON array
11
+ evaluation_mode TEXT NOT NULL DEFAULT 'llm'
12
+ CHECK (evaluation_mode IN ('llm', 'deterministic', 'hybrid')),
13
+ agent_ids TEXT NOT NULL DEFAULT '[]', -- JSON array of agent IDs
14
+ max_rounds INTEGER NOT NULL DEFAULT 5,
15
+ budget_cents INTEGER,
16
+ status TEXT NOT NULL DEFAULT 'pending'
17
+ CHECK (status IN ('pending', 'running', 'paused', 'completed', 'failed', 'cancelled')),
18
+ current_round INTEGER NOT NULL DEFAULT 0,
19
+ best_attempt_id TEXT,
20
+ best_score REAL,
21
+ total_cost_cents INTEGER NOT NULL DEFAULT 0,
22
+ total_attempts INTEGER NOT NULL DEFAULT 0,
23
+ diversity_log TEXT NOT NULL DEFAULT '[]', -- JSON array
24
+ started_at TEXT,
25
+ completed_at TEXT,
26
+ stopped_reason TEXT,
27
+ created_at TEXT DEFAULT (datetime('now'))
28
+ );
29
+
30
+ CREATE INDEX IF NOT EXISTS idx_evolution_runs_workspace
31
+ ON agent_workforce_evolution_runs(workspace_id);
32
+ CREATE INDEX IF NOT EXISTS idx_evolution_runs_status
33
+ ON agent_workforce_evolution_runs(workspace_id, status);
34
+
35
+ -- 2. Evolution attempts
36
+ CREATE TABLE IF NOT EXISTS agent_workforce_evolution_attempts (
37
+ id TEXT PRIMARY KEY DEFAULT (lower(hex(randomblob(16)))),
38
+ run_id TEXT NOT NULL REFERENCES agent_workforce_evolution_runs(id) ON DELETE CASCADE,
39
+ workspace_id TEXT NOT NULL,
40
+ round INTEGER NOT NULL,
41
+ agent_id TEXT NOT NULL,
42
+ parent_attempt_id TEXT REFERENCES agent_workforce_evolution_attempts(id) ON DELETE SET NULL,
43
+ parent_agent_id TEXT,
44
+ task_id TEXT,
45
+ deliverable TEXT,
46
+ strategy_summary TEXT,
47
+ score REAL,
48
+ score_breakdown TEXT, -- JSON object
49
+ truth_score INTEGER,
50
+ cost_cents INTEGER NOT NULL DEFAULT 0,
51
+ duration_ms INTEGER,
52
+ status TEXT NOT NULL DEFAULT 'pending'
53
+ CHECK (status IN ('pending', 'running', 'completed', 'failed', 'skipped')),
54
+ error TEXT,
55
+ created_at TEXT DEFAULT (datetime('now'))
56
+ );
57
+
58
+ CREATE INDEX IF NOT EXISTS idx_evo_attempts_run
59
+ ON agent_workforce_evolution_attempts(run_id, round, score DESC);
60
+ CREATE INDEX IF NOT EXISTS idx_evo_attempts_agent
61
+ ON agent_workforce_evolution_attempts(agent_id, created_at DESC);
62
+ CREATE INDEX IF NOT EXISTS idx_evo_attempts_lineage
63
+ ON agent_workforce_evolution_attempts(parent_attempt_id);
@@ -0,0 +1,17 @@
1
+ -- =====================================================================
2
+ -- 086: Add paused column to agent_workforce_agents
3
+ --
4
+ -- Aligns local runtime with cloud schema (cloud migration 322).
5
+ -- Cloud replaced the status column with a paused boolean.
6
+ -- Local keeps status for internal execution tracking (working/idle)
7
+ -- but adds paused as the user-controlled kill switch.
8
+ -- =====================================================================
9
+
10
+ -- @statement
11
+ ALTER TABLE agent_workforce_agents ADD COLUMN paused INTEGER NOT NULL DEFAULT 0;
12
+
13
+ -- @statement
14
+ UPDATE agent_workforce_agents SET paused = 1 WHERE status = 'paused';
15
+
16
+ -- @statement
17
+ CREATE INDEX IF NOT EXISTS idx_agents_paused ON agent_workforce_agents(paused) WHERE paused = 1;