docs(requirements): split form source rows
Add explicit northstar ring fields to form requirements and split form domain/parser obligations without changing behavior. req: form/001 req: form/002 req: form/003 req: form/004 req: form/005 req: form/006 req: form/007 req: form/008
This commit is contained in:
+13
-7
@@ -442,24 +442,30 @@ resources. Concrete runtime targets are addressed through `ResourceRef`
|
||||
## form
|
||||
|
||||
### req: form/001
|
||||
001 Forms are source of truth in HTML. hemplate Surface exports form shape (controls, names, required, types). hemx checks compatibility with Rust `Form<T>` types through user-authored `#[hemx::form("...")]` domain structs and generated form metadata. No auto-generated structs; domain types (e.g. `Email`) are first-class. The Surface describes; Rust owns; hemx checks.
|
||||
0 001 Forms are source of truth in HTML. hemplate Surface exports form shape (controls, names, required, types). hemx checks Rust `Form<T>` compatibility through user-authored `#[hemx::form("...")]` domain structs and generated form metadata. [north_star]
|
||||
|
||||
### req: form/007
|
||||
0 007 Form support generates no domain structs. Domain types such as `Email` are user-authored and first-class; the Surface describes, Rust owns, and hemx checks. [north_star]
|
||||
|
||||
### req: form/002
|
||||
002 The handle id is carried as `__h` in POST `application/x-www-form-urlencoded`. A JSON body is allowed at the integration boundary (`application/json`) only if the handler accepts it; core uses form encoding.
|
||||
0 002 The handle id is carried as `__h` in POST `application/x-www-form-urlencoded`. A JSON body is allowed at the integration boundary (`application/json`) only if the handler accepts it; core uses form encoding. [north_star]
|
||||
|
||||
### req: form/003
|
||||
003 Handler receives `form: Form<CreateTodo>`. Validation errors target `(FormId, field_name)` or generated control ids. The runtime maps them to originating form controls via control ids derived from Surface `NodeId`, not via slot ids.
|
||||
0 003 Handler receives `form: Form<CreateTodo>`. Validation errors target `(FormId, field_name)` or generated control ids. The runtime maps them to originating form controls via control ids derived from Surface `NodeId`, not via slot ids. [north_star]
|
||||
|
||||
### req: form/004
|
||||
004 Form compatibility checks validate field presence, optionality, multiplicity, and parser availability. Parser availability means the submitted value type implements `hemx::FormValue` (blanket-provided for `FromStr`, or explicitly implemented for custom parsers). Domain validation remains Rust logic (`TryFrom`, custom validators, or handler code).
|
||||
0 004 Form compatibility checks validate field presence, optionality, multiplicity, and parser availability. [north_star]
|
||||
|
||||
### req: form/008
|
||||
0 008 Parser availability means the submitted value type implements `hemx::FormValue`, via `FromStr` blanket support or explicit custom parsers. Domain validation remains Rust logic (`TryFrom`, custom validators, or handler code). [north_star]
|
||||
|
||||
### req: form/005
|
||||
005 HTML control facts are lower bounds, not complete domain semantics.
|
||||
0 005 HTML control facts are lower bounds, not complete domain semantics.
|
||||
`type="email"` may require a Rust `Email` parser, but hemplate never defines
|
||||
what a valid business email is.
|
||||
what a valid business email is. [north_star]
|
||||
|
||||
### req: form/006
|
||||
006 Generated diagnostics distinguish structure errors from validation errors: missing field / wrong optionality are compile-time issues; invalid submitted values are runtime form errors.
|
||||
0 006 Generated diagnostics distinguish structure errors from validation errors: missing field / wrong optionality are compile-time issues; invalid submitted values are runtime form errors. [north_star]
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user