Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
14 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions migrations/0017_decision_snapshots.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
-- #281: link each agent action back to the context snapshot that drove it
ALTER TABLE agent_actions ADD COLUMN decision_snapshot_id TEXT;

-- #282: provenance fields on context snapshots so decisions are replayable
ALTER TABLE agent_context_snapshots ADD COLUMN actor_login TEXT;
ALTER TABLE agent_context_snapshots ADD COLUMN decision_pack_generated_at TEXT;
ALTER TABLE agent_context_snapshots ADD COLUMN confidence_level TEXT;
ALTER TABLE agent_context_snapshots ADD COLUMN freshness_at_decision TEXT;
ALTER TABLE agent_context_snapshots ADD COLUMN upstream_ruleset_id TEXT;

-- #284: counterfactual reasoning attached to each action
ALTER TABLE agent_actions ADD COLUMN alternatives_considered_json TEXT NOT NULL DEFAULT '[]';
ALTER TABLE agent_actions ADD COLUMN counterfactual_reasons_json TEXT NOT NULL DEFAULT '[]';

-- Indexes for snapshot replay lookup (#285)
CREATE INDEX agent_actions_snapshot_idx ON agent_actions (decision_snapshot_id, created_at);
CREATE INDEX agent_context_snapshots_actor_idx ON agent_context_snapshots (actor_login, created_at);
Loading