From 934b3df309066e657e65935cdb822991bc672659 Mon Sep 17 00:00:00 2001 From: Jeffrey Smith Date: Sat, 28 Mar 2026 00:56:44 +0000 Subject: [PATCH] =?UTF-8?q?Bump=20VERSION=20to=200.3.4,=20add=20changelog?= =?UTF-8?q?=20entries=20for=20v0.3.1=E2=80=93v0.3.4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 (1M context) --- CHANGELOG.md | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++ VERSION | 2 +- 2 files changed, 87 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c215a41..d1fec80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,55 @@ All notable changes to Switchboard Core are documented here. +## v0.3.4 — Team Roles + Multi-party Validation + +### Added + +- **Custom team roles**: Removed `CHECK (role IN ('admin','member'))` constraint + from `team_members` (both Postgres and SQLite). Custom roles are stored in + `teams.settings["roles"]` as a JSON array. Builtins `admin` and `member` are + always present. +- **Team roles API**: `GET /api/v1/teams/:teamId/roles` returns configured roles. + `PUT /api/v1/teams/:teamId/roles` replaces the roles array (builtins enforced). +- **Role-based stage assignment**: `stage_config.required_role` restricts which + team members can claim an assignment. `CheckClaimRole` verifies the user's team + membership role before allowing claim; rolls back on mismatch (403). +- **Multi-party sign-off**: New `workflow_signoffs` table with + `UNIQUE(instance_id, stage, user_id)` preventing double-signing. + `StageConfig.validation` supports `required_approvals`, `required_role`, and + `reject_action` (cancel or reroute to named stage). +- **Validation gate**: `advanceInternal` blocks stage advancement until the + required number of approvals is met. Rejections trigger cancel or reroute + based on `reject_action`. +- **`Engine.SubmitSignoff`**: Records approval/rejection, enforces signoff role + if configured, emits `workflow.signoff` event. +- **Signoff HTTP API**: `POST /api/v1/instances/:iid/signoffs` (submit), + `GET /api/v1/instances/:iid/signoffs` (list current stage signoffs). + Team-scoped mirrors at `/api/v1/teams/:teamId/instances/:iid/signoffs`. +- **New events**: `workflow.signoff`, `workflow.rejected`. +- **Frontend — Members page**: Dynamic role selects populated from team roles API. + "Manage Roles" panel for adding/removing custom roles inline. +- **Frontend — Stage editor**: "Required Role (claim)" dropdown and "Multi-party + Validation" section (required approvals, signoff role, on reject action) appear + when a team is selected for the stage. +- **Frontend — Monitor tab**: Signoff panel with approve/reject buttons, comment + field, and approval progress display. +- **3 new store tests**: CreateSignoff (with UNIQUE constraint check), + ListSignoffs (ordering), CountSignoffs (decision filter). 20 total, all passing. +- **Design doc**: `docs/DESIGN-EXTENSION-LIFECYCLE.md` — permanent vs PoC + packages, graduation criteria, explicit install model. +- **Design doc**: `docs/DESIGN-TRIGGER-COMPOSITION.md` — triggers/schedules can + start workflows, workflows emit events, no circular invocation. + +### Changed + +- `addMemberRequest` and `updateMemberRequest` binding relaxed from + `oneof=admin member` to `required,min=1,max=50` with application-level + validation against the team's configured roles. +- `TruncateAll` test helper updated to include `workflow_signoffs`. + +--- + ## v0.3.3 — Public Entry + Background Jobs ### Added @@ -23,6 +72,43 @@ All notable changes to Switchboard Core are documented here. --- +## v0.3.2 — Workflow Engine + +### Added + +- **Stage execution engine**: `server/workflow/engine.go` — `Start`, `Advance` + (with `branch_rules` conditional routing), and `Cancel` operations. Merges + `stage_data` across stages, creates assignments, emits lifecycle events. +- **Automated stage handler**: `server/workflow/automated.go` — fires Starlark + hook, auto-advances on success, cycle guard (max 10 consecutive automated + stages). +- **Instance HTTP API**: Start, GetInstance, Advance, Cancel, ListInstances. + Team-scoped mirrors under `/api/v1/teams/:teamId/workflows/`. +- **Assignment HTTP API**: Claim, Unclaim, Complete, Cancel, ListByTeam, + ListMine. Claimer identity verification on unclaim/complete. +- **Starlark module expansion**: `workflow.get_instance()`, + `workflow.list_instances()` (read-only). +- **14 store tests** covering all 15 v0.3.1 methods (instance + assignment + CRUD). All passing. + +--- + +## v0.3.1 — Instance Assignment + +### Added + +- **`workflow_instances` table**: Tracks workflow execution state — + `workflow_version`, `current_stage`, `stage_data`, `status`, `entry_token`. +- **`workflow_assignments` table**: Per-stage queue for instance assignments — + `instance_id`, `stage`, `team_id`, `assigned_to`, `status`, `review_data`. + Optimistic claim locking via status transition. +- **15 new store methods**: Full CRUD for instances (Create, Get, GetByToken, + Update, List, AdvanceStage, Complete, Cancel) and assignments (Create, Claim, + Unclaim, Complete, Cancel, ListByTeam, ListByInstance, ListByUser). +- **New events**: `workflow.started`, `workflow.cancelled`, `workflow.error`. + +--- + ## v0.3.0 — Workflow Schema Redesign ### Changed diff --git a/VERSION b/VERSION index 0d91a54..42045ac 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.3.0 +0.3.4