feat(workflows): bind owner triggers to exact signed revisions

Reconcile the complete Node A observable behavior onto current main without carrying its historical merge topology.

Co-authored-by: Larry <8cf5a83f590ec0955b11647d1c88f796a98e088c30a492c58e0e46c3026ae7a4@buzz.block.builderlab.xyz>
Signed-off-by: Logan Johnson <loganj@squareup.com>
This commit is contained in:
Logan Johnson
2026-08-25 22:27:01 -04:00
committed by Larry
parent 01c87a350b
commit 08020bebca
20 changed files with 1486 additions and 229 deletions

View File

@@ -368,6 +368,11 @@ CREATE TABLE workflows (
channel_id UUID,
definition JSONB NOT NULL,
definition_hash BYTEA NOT NULL,
-- Exact owner-signed kind:30620 revision that materialized this row.
-- Nullable only for pre-0033 rows; revision-bound execution fails closed until re-saved.
definition_event_id BYTEA CHECK (
definition_event_id IS NULL OR octet_length(definition_event_id) = 32
),
status workflow_status NOT NULL DEFAULT 'active',
enabled BOOLEAN NOT NULL DEFAULT TRUE,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
@@ -388,6 +393,9 @@ CREATE TABLE workflow_runs (
community_id UUID NOT NULL REFERENCES communities(id),
id UUID NOT NULL DEFAULT gen_random_uuid(),
workflow_id UUID NOT NULL,
definition_event_id BYTEA CHECK (
definition_event_id IS NULL OR octet_length(definition_event_id) = 32
),
status run_status NOT NULL DEFAULT 'pending',
trigger_event_id BYTEA,
current_step INT NOT NULL DEFAULT 0,