Feat v0.3.4 team roles signoff (#18)
Co-authored-by: Jeffrey Smith <jasafpro@gmail.com> Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit was merged in pull request #18.
This commit is contained in:
86
CHANGELOG.md
86
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
|
||||
|
||||
Reference in New Issue
Block a user