docs(requirements): split codegen helper surface
Split the oversized codegen/002 row into helper surface, string-key id, generated-command, and form-target requirements. req: codegen/002 req: codegen/007 req: codegen/008 req: codegen/009
This commit is contained in:
@@ -30,7 +30,7 @@ Keep it stable. Prefer pointers to canonical sources over copied structure, file
|
||||
## Requirements-first TDD
|
||||
|
||||
- Write requirements as desired behavior, not as a snapshot of current behavior.
|
||||
- Keep each requirement row to one checkable obligation; split oversized examples, escape hatches, or negative cases into separate IDs.
|
||||
- Keep each requirement row to one checkable obligation; split oversized examples, escape hatches, or negative cases into separate stable IDs while preserving the original ID's main intent.
|
||||
- First split intent into broad error classes: what can go wrong, and what outcome must hold.
|
||||
- Test the largest risky classes before narrow examples.
|
||||
- Add adversarial tests for malformed, hostile, ambiguous, missing, duplicated, and boundary inputs.
|
||||
|
||||
+10
-1
@@ -274,7 +274,16 @@ a `data-*` handle param is statically known or runtime-extracted.
|
||||
001 `hemx_build` generates three artifacts from the generic Surface IR: (a) `hemx.generated.rs` containing ergonomic resource modules (`slots`, `targets`, `handles`, `forms`, `atoms`), (b) `hemx.syms` for proc-macro validation, (c) runtime id-lowering tables. `hemx_build` interprets tool-specific conventions (`data-hemx-*`, `h-for`, `h-key`, form controls) from the Surface. [north_star]
|
||||
|
||||
### req: codegen/002
|
||||
002 Generated view modules expose ergonomic root-level target objects and commands that hide render/lower details: text slots provide `set(text)`, singleton partial slots provide `replace(view)`/`clear()`, keyed collection slots provide `append(view)`, `prepend(view)`, `replace(view)`, `remove(key_or_view)`, and forms provide `clear()`/`clear(field)`/`focus(field)`. String-keyed target objects accept displayable domain ids without caller-side `.to_string()` noise. Commands return `impl IntoEffect`, compose in plain Rust, preserve generated lowering, and fail to generate when the template lacks enough facts to infer the slot, key, form, or renderable view type.
|
||||
002 Generated view modules expose ergonomic root-level target objects and commands that hide render/lower details for text, partial, and keyed collection slots. [north_star]
|
||||
|
||||
### req: codegen/009
|
||||
009 Generated form targets provide `clear()`, `clear(field)`, and `focus(field)` commands. [north_star]
|
||||
|
||||
### req: codegen/007
|
||||
007 String-keyed generated target objects accept displayable domain ids without caller-side `.to_string()` noise. [north_star]
|
||||
|
||||
### req: codegen/008
|
||||
008 Generated commands return `impl IntoEffect`, compose in plain Rust, preserve generated lowering, and fail to generate when the template lacks facts needed to infer the slot, key, form, or renderable view type. [north_star]
|
||||
|
||||
### req: codegen/003
|
||||
003 Generated module `handles` exports typed constants: `Handle<I>` where `I` is `Form<T>`, a param type, or `()`. Users rarely reference handles directly; they are consumed by `#[hemx::handler]` for validation.
|
||||
|
||||
Reference in New Issue
Block a user