Feat v0.3.3 public entry background jobs (#17)
Some checks failed
CI/CD / detect-changes (push) Successful in 21s
CI/CD / test-frontend (push) Has been skipped
CI/CD / test-go-pg (push) Failing after 2m24s
CI/CD / test-sqlite (push) Successful in 2m54s
CI/CD / build-and-deploy (push) Has been skipped

Co-authored-by: Jeffrey Smith <jasafpro@gmail.com>
Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit was merged in pull request #17.
This commit is contained in:
2026-03-27 23:07:55 +00:00
committed by xcaliber
parent ab28e4b784
commit dba718b914
14 changed files with 743 additions and 40 deletions

View File

@@ -2,6 +2,27 @@
All notable changes to Switchboard Core are documented here.
## v0.3.3 — Public Entry + Background Jobs
### Added
- **Public workflow entry**: Unauthenticated routes for anonymous workflow
participation. `POST /api/v1/public/workflows/:id/start` creates an instance
with `started_by = "public:<uuid>"` and returns an entry token.
`GET .../resume/:token` and `POST .../advance/:token` allow continuation.
Only stages with `audience = "public"` can be advanced anonymously.
- **SLA scanner**: Background goroutine (5-minute interval) checks active
instances against per-stage `sla_seconds`. Fires `workflow.sla_breach` event
on first breach, marks `sla_breached: true` in instance metadata (idempotent).
- **Staleness sweep**: New `staleness_timeout_hours` column on `workflows`.
Scanner marks instances as `stale` when `updated_at` exceeds the threshold,
cancels open assignments, fires `workflow.stale` event.
- **New store methods**: `ListActiveInstances()`, `MarkInstanceStale()`.
- **New events**: `workflow.sla_breach`, `workflow.stale`.
- **3 new store tests**: MarkStale, ListActive, StalenessTimeoutHours round-trip.
---
## v0.3.0 — Workflow Schema Redesign
### Changed