Persist workflow artifacts and auto-run migrations

This commit is contained in:
Codex
2026-05-13 23:34:14 +08:00
parent ba9f24086a
commit 84cbd0a8c4
9 changed files with 301 additions and 14 deletions
@@ -0,0 +1,17 @@
create table if not exists decision_assistant_workflow_history (
id bigserial primary key,
profile_key varchar(64) not null default 'local_operator',
instrument_id bigint not null,
current_session varchar(32),
next_phase varchar(32),
next_artifact_kind varchar(64),
snapshot_signature varchar(128) not null,
payload jsonb not null default '{}'::jsonb,
created_ts timestamptz not null default now()
);
create index if not exists idx_decision_assistant_workflow_history_instrument_ts
on decision_assistant_workflow_history (instrument_id, created_ts desc);
create index if not exists idx_decision_assistant_workflow_history_signature
on decision_assistant_workflow_history (instrument_id, snapshot_signature);