diff --git a/CHANGELOG.md b/CHANGELOG.md index 6259e47..fd20ded 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,53 @@ All notable changes to Armature are documented here. +## v0.9.5 — Typed Forms → SDK Primitive + +Promotes the typed form system from a workflow-only model to a reusable +SDK primitive. Any package can now declare and validate forms — not just +workflow stages. + +**Backend — `server/forms/` package** + +- Extracted `TypedFormTemplate`, `FormField`, `FormFieldset`, `FormOption`, + `FormValidation`, `FieldCondition`, `FormHooks`, `FieldError` from + `models/workflow.go` into standalone `forms` package. +- `ParseTypedFormTemplate()`, `ValidateFormData()`, `EvaluateFieldCondition()` + exported for use by any consumer. +- ~317 lines removed from `models/workflow.go` (no external imports existed). + +**REST endpoint** + +- `POST /api/v1/forms/validate` — authenticated endpoint. Accepts + `{template, data}`, returns `{valid: bool, errors: [{key, message}]}`. + +**Starlark module** + +- `forms.validate(template, data)` — gated by `forms.validate` permission. + Returns dict with `valid` (bool) and `errors` (list of dicts). + +**Frontend SDK** + +- `sw.forms.render(container, template, opts)` — Preact component rendering + flat and progressive (fieldset) forms. Returns `{getData, setErrors, destroy}`. +- `sw.forms.validate(template, data)` — client-side validation (mirrors Go logic). +- `sw.forms.validateRemote(template, data)` — server-side validation via REST. +- SDK version bumped to `0.9.5`. + +**Manifest validation** + +- `form_template` accepted at package level. Validated via + `forms.ParseTypedFormTemplate()` at install time. +- `ManifestInfo.HasFormTemplate` flag added. + +**Tests** + +- 16 new tests: 12 forms package unit tests (parse, validate by type, + conditions, fieldsets), 4 Starlark module tests (valid, required, + type errors, conditions). + +--- + ## v0.9.4 — Package Adoption + Roles Packages can now declare `adoptable: true` in their manifest. When a team diff --git a/VERSION b/VERSION index 965065d..b0bb878 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.9.3 +0.9.5