Feat v0.3.0 workflow schema (#14)
All checks were successful
CI/CD / detect-changes (push) Successful in 4s
CI/CD / test-frontend (push) Successful in 5s
CI/CD / test-go-pg (push) Successful in 2m23s
CI/CD / test-sqlite (push) Successful in 2m42s
CI/CD / build-and-deploy (push) Successful in 1m28s

Co-authored-by: Jeffrey Smith <jasafpro@gmail.com>
Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit was merged in pull request #14.
This commit is contained in:
2026-03-27 17:52:29 +00:00
committed by xcaliber
parent 8580e1d93e
commit 965885a8f7
16 changed files with 414 additions and 161 deletions

View File

@@ -2,6 +2,43 @@
All notable changes to Switchboard Core are documented here.
## v0.3.0 — Workflow Schema Redesign
### Changed
- **`workflow_stages` schema modernized**: Dropped chat-era columns (`persona_id`,
`history_mode`). Renamed `transition_rules``stage_config`. Updated
`stage_mode` CHECK from `(form_only, form_chat, review, custom)` to
`(form, review, delegated, automated)`.
- **New stage fields**: Added `audience` (team | public | system), `stage_type`
(simple | dynamic | automated), `starlark_hook` (package_id:entry_point),
and `branch_rules` (JSONB array of routing conditions).
- **Routing engine**: `ResolveNextStage` now reads `branch_rules` (flat array)
instead of `transition_rules.conditions` (nested object). Cleaner separation
between routing rules and stage config.
- **Hook handler**: `FireOnAdvanceHook` reads from `stage_config` instead of
`transition_rules`. Renamed `channelID` parameter to `instanceID`.
- **Stage CRUD validation**: New fields validated on create/update. `delegated`
mode requires `surface_pkg_id`. `dynamic`/`automated` stage_type requires
`starlark_hook`.
- **Package export/import**: Updated to use new field names. Workflow packages
now include `audience`, `stage_type`, `starlark_hook`, `branch_rules`,
`stage_config`.
- **Starlark workflow module**: Stage dicts now include `audience` and
`stage_type` keys. Removed `history_mode` and `persona_id`.
- **Frontend stage editor**: Both admin and team-admin surfaces updated with
new mode values, audience selector, stage type selector, and conditional
Starlark hook input. Fixed pre-existing bug in admin workflows.js where
`STAGE_MODES` still contained `chat_only`.
### Removed
- `persona_id` column from `workflow_stages` (personas are extension concerns)
- `history_mode` column from `workflow_stages` (chat-era context management)
- `StageModeCustom`, `StageModeFormOnly`, `StageModeFormChat` Go constants
---
## v0.2.9 — Builtin Extension Retirement
### Changed