Files
Agent-System/deploy/postgres/goose/00074_2026-09-26-swboot-controlled-executions.sql
T
weichen 83561682eb feat(swboot): wire SWBOOT-10 controlled patch executor (fail-closed)
DB-backed repo_path_allowlist reader (deny-all until admin seeds), per-prefix
admin test_commands (goose 00075), execution evidence table (goose 00074),
isolated git-worktree patch executor with command allowlist/time/output caps
and failure-stops evidence; controlled_patch creation/preview unlocked only
with an allowlisted repo binding (projectworkflow gate + catalog flag);
creator-only server endpoints for bindings/executions; merge/push/deploy stay
behind a typed separate-authorization boundary. Module boundary: app->swboot
composition import registered.
2026-09-26 00:56:59 +00:00

30 lines
1.2 KiB
SQL

-- +goose Up
-- SWBOOT-10: controlled patch execution records. The executor never merges,
-- pushes or deploys; rows are audit evidence for patch/test candidates only.
CREATE TABLE IF NOT EXISTS swboot_controlled_executions (
id BIGSERIAL PRIMARY KEY,
project_id BIGINT NOT NULL REFERENCES projects(id) ON DELETE CASCADE,
requested_by BIGINT REFERENCES users(id) ON DELETE SET NULL,
repo_path TEXT NOT NULL,
base_ref TEXT NOT NULL DEFAULT '',
worktree_path TEXT NOT NULL DEFAULT '',
branch TEXT NOT NULL DEFAULT '',
status TEXT NOT NULL DEFAULT 'pending',
patches_applied INT NOT NULL DEFAULT 0,
files_json JSONB NOT NULL DEFAULT '[]'::jsonb,
commands_json JSONB NOT NULL DEFAULT '[]'::jsonb,
error TEXT NOT NULL DEFAULT '',
started_at TIMESTAMPTZ NOT NULL DEFAULT now(),
finished_at TIMESTAMPTZ,
CONSTRAINT chk_swboot_exec_status
CHECK (status IN ('pending', 'succeeded', 'failed'))
);
CREATE INDEX IF NOT EXISTS idx_swboot_exec_project
ON swboot_controlled_executions (project_id, started_at DESC);
-- +goose Down
-- record retention: do not drop evidence tables
SELECT 1;