2.2 KiB
2.2 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec |
|---|---|---|---|---|---|---|
| 01-workflow-contract-and-validation | Add and validate the workflow session-settings contract | done | 1 | plan.md | ../../specs/tasks/requirements/workflow-session-settings.md |
Task 01: Add and Validate the Workflow Session-settings Contract
Acceptance
- Backend and frontend workflow action types represent
configure_sessionrules without provider-specific fields. - One shared backend validator covers create, update, and import and rejects duplicate actions/families, invalid operations or payloads, empty
setrules, and coexistence withagent_profile_id. - Valid rules survive snapshot, export, and import byte-for-byte at the semantic JSON level without agent-profile matching.
- Existing workflows without the action retain their current behavior and serialized shape.
TDD sequence
- Add failing model/import/controller tests for the accepted and rejected shapes.
- Add typed parsing/validation helpers and call them from every persistence boundary.
- Add the frontend discriminated union and serialization tests.
- Refactor duplicate validation logic only after the focused tests pass.
Verification
cd apps/backend && go test ./internal/workflow/models ./internal/workflow/controller ./internal/workflow/service
cd apps && pnpm --filter @kandev/web test -- --run lib/types lib/api/domains/workflow-api
Files likely touched
apps/backend/internal/workflow/models/models.goapps/backend/internal/workflow/models/export.goapps/backend/internal/workflow/models/export_test.goapps/backend/internal/workflow/controller/controller.go- Related workflow controller/service tests
apps/web/lib/types/workflow-actions.tsapps/web/lib/types/http.ts- Related frontend workflow serialization tests
Dependencies
None.
Inputs
- Spec sections
Data model,API surface, andPersistence guarantees. - Existing
OnEnterAction, workflow-step create/update, and import validation paths.
Output contract
Report the final typed rule shape, all persistence boundaries using the validator, import/export behavior, files changed, tests run, and any compatibility concern.