22
33Complete DDL for the Oak CI SQLite database at ` .oak/ci/activities.db ` .
44
5- Current schema version: ** 6 **
5+ Current schema version: ** 8 **
66
77## memory_observations
88
@@ -29,12 +29,13 @@ CREATE TABLE IF NOT EXISTS memory_observations (
2929 resolved_at TEXT , -- ISO timestamp of resolution
3030 superseded_by TEXT , -- Observation ID that supersedes this
3131 session_origin_type TEXT , -- planning | investigation | implementation | mixed
32+ origin_type TEXT DEFAULT ' auto_extracted' , -- auto_extracted | agent_created
3233 FOREIGN KEY (session_id) REFERENCES sessions(id),
3334 FOREIGN KEY (prompt_batch_id) REFERENCES prompt_batches(id)
3435);
3536```
3637
37- ** Key indexes:** ` idx_memory_observations_embedded ` , ` idx_memory_observations_session ` , ` idx_memory_observations_hash ` , ` idx_memory_observations_type ` , ` idx_memory_observations_context ` , ` idx_memory_observations_created ` , ` idx_memory_observations_type_created ` , ` idx_memory_observations_source_machine ` , ` idx_memory_observations_status ` , ` idx_memory_observations_resolved_by ` , ` idx_memory_observations_origin_type `
38+ ** Key indexes:** ` idx_memory_observations_embedded ` , ` idx_memory_observations_session ` , ` idx_memory_observations_hash ` , ` idx_memory_observations_origin_type ` , ` idx_memory_observations_type ` , ` idx_memory_observations_context ` , ` idx_memory_observations_created ` , ` idx_memory_observations_type_created ` , ` idx_memory_observations_source_machine ` , ` idx_memory_observations_status ` , ` idx_memory_observations_resolved_by ` , ` idx_memory_observations_origin_type `
3839
3940## sessions
4041
@@ -275,6 +276,33 @@ CREATE TABLE IF NOT EXISTS resolution_events (
275276
276277** Key indexes:** ` idx_resolution_events_observation ` , ` idx_resolution_events_source_machine ` , ` idx_resolution_events_applied ` , ` idx_resolution_events_epoch ` , ` idx_resolution_events_content_hash `
277278
279+ ## governance_audit_events
280+
281+ ``` sql
282+ CREATE TABLE IF NOT EXISTS governance_audit_events (
283+ id INTEGER PRIMARY KEY AUTOINCREMENT,
284+ session_id TEXT NOT NULL ,
285+ agent TEXT NOT NULL ,
286+ tool_name TEXT NOT NULL ,
287+ tool_use_id TEXT ,
288+ tool_category TEXT ,
289+ rule_id TEXT ,
290+ rule_description TEXT ,
291+ action TEXT NOT NULL ,
292+ reason TEXT ,
293+ matched_pattern TEXT ,
294+ tool_input_summary TEXT ,
295+ enforcement_mode TEXT NOT NULL ,
296+ created_at TEXT NOT NULL ,
297+ created_at_epoch INTEGER NOT NULL ,
298+ evaluation_ms INTEGER ,
299+ source_machine_id TEXT ,
300+ FOREIGN KEY (session_id) REFERENCES sessions(id)
301+ );
302+ ```
303+
304+ ** Key indexes:** ` idx_gov_audit_session ` , ` idx_gov_audit_action ` , ` idx_gov_audit_created ` , ` idx_gov_audit_tool ` , ` idx_gov_audit_rule `
305+
278306## Full-Text Search Tables (FTS5)
279307
280308### memories_fts
0 commit comments