diff --git a/AGENTS.md b/AGENTS.md index d559822..dd9f7a1 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -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. diff --git a/REQUIREMENTS.md b/REQUIREMENTS.md index e1f1f95..440ecf5 100644 --- a/REQUIREMENTS.md +++ b/REQUIREMENTS.md @@ -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` where `I` is `Form`, a param type, or `()`. Users rarely reference handles directly; they are consumed by `#[hemx::handler]` for validation.