docs(work): map testing and editor northstars

Add repo-local northstars and ready slices for testing strategy, LSP/editor completion, and hemplate highlighting boundaries.
This commit is contained in:
slhx agent
2026-06-25 22:20:50 +02:00
parent edc65be7b6
commit df0fabd4fb
15 changed files with 622 additions and 0 deletions
@@ -0,0 +1,41 @@
---
id: SLICE-0001
type: slice
status: ready
parent: NS-0001
title: Lock fast focused and full verification tiers
refs:
- REQUIREMENTS.md
- README.md
- AGENTS.md
- hemx-xtask/src/main.rs
---
## Objective
Make the verification ladder executable and documented so contributors know when to run fast crate tests, `html-examples-smoke`, and the full xtask authority wrapper.
## Authority
`README.md`, `AGENTS.md`, and `REQUIREMENTS.md` `test/004`, `test/006`, `test/015`, and `test/016` already define the tier boundary and full local timeout expectation.
## Close when
- README/agent guidance names fast crate tests, focused browser smoke, and full xtask authority separately.
- `cargo run -p hemx-xtask -- test` remains the full wrapper rather than being bypassed by an undocumented shard.
- Any shard split is deterministic and documented under the xtask wrapper.
## Verification
- `cargo run -p hemx-xtask -- html-examples-smoke`
- `cargo run -p hemx-xtask -- test`
- `redgate health --strict`
## Non-goals
- Do not add a new test harness outside xtask.
- Do not split the full wrapper unless the measured runtime exceeds the budget.
## Evidence
The current full wrapper has passed locally within the documented 10 minute budget; this slice preserves that authority and makes future splitting explicit only when needed.
@@ -0,0 +1,40 @@
---
id: SLICE-0002
type: slice
status: ready
parent: NS-0001
title: Keep html_examples browser smoke as runtime confidence proof
refs:
- REQUIREMENTS.md
- hemx-xtask/src/main.rs
- examples/html_examples/README.md
- examples/html_examples/src/main.rs
---
## Objective
Keep `html-examples-smoke` as the repo-owned browser proof for no-reload dynamic interactions, revealed fallback, interval triggers, and the htmx-equivalent gallery behaviors.
## Authority
`REQUIREMENTS.md` `test/006`, `test/013`, `test/014`, `convention/005`, `convention/014`, and `examples/012` constrain the smoke: no `/tmp` scripts, no navigation/reload fallback, and deterministic browser coverage.
## Close when
- The smoke covers click-to-edit, edit-row, inline validation, active search, delete row, lazy load, click-to-load, infinite/reveal, progress interval, value select, reset input, and revealed fallback without IntersectionObserver.
- The no-navigation/no-reload guard wraps dynamic interactions.
- Failures identify the named smoke path.
## Verification
- `cargo test -p hemx-xtask`
- `cargo run -p hemx-xtask -- html-examples-smoke`
## Non-goals
- Do not add Playwright, Selenium, or a second browser runner without a separate decision.
- Do not move smoke scripts to `/tmp` or untracked files.
## Evidence
`hemx-xtask/src/main.rs` owns the CDP-driven smoke command and inline smoke scripts.
@@ -0,0 +1,40 @@
---
id: SLICE-0003
type: slice
status: ready
parent: NS-0001
title: Protect keyed collection regressions with generated-resource assertions
refs:
- REQUIREMENTS.md
- examples/html_examples/src/main.rs
- hemx-test/src/lib.rs
---
## Objective
Make keyed list regressions easy to catch without raw selector or raw effect coupling: tests should assert generated resource behavior for remove, replace, and append paths.
## Authority
`REQUIREMENTS.md` `list/006`, `test/008`, `test/009`, `test/010`, and `test/017` constrain keyed collection behavior and test diagnostics.
## Close when
- Filtered keyed collections are tested for removing filtered-out keys, replacing retained keys, and appending newly visible keys.
- Assertions use generated resource helpers or `hemx_test` inspection adapters, not raw runtime ids as app-facing API.
- Failure messages name generated resources where practical.
## Verification
- `cargo test -p hemx-html-examples`
- `cargo test -p hemx-test --test inspector`
- `cargo run -p hemx-xtask -- html-examples-smoke`
## Non-goals
- Do not add app authoring APIs for selectors or raw runtime ids.
- Do not test private runtime payload layout unless the slice changes wire semantics.
## Evidence
The active-search example and `hemx_test` helpers already provide anchors for this regression boundary.
@@ -0,0 +1,40 @@
---
id: SLICE-0004
type: slice
status: ready
parent: NS-0001
title: Keep requirement and test governance aligned
refs:
- REQUIREMENTS.md
- AGENTS.md
- redgate
---
## Objective
Keep behavior-changing test work tied to checkable requirements without turning redgate cleanup into unrelated product scope.
## Authority
`AGENTS.md` requires reading and updating `REQUIREMENTS.md` when behavior changes, citing relevant `req:` IDs, and running redgate commands when requirements change.
## Close when
- Behavior-changing test slices cite the requirements they constrain.
- Requirement-only maintenance is separated from behavior implementation.
- `redgate health --strict` and `redgate lint` are green for the changed scope.
## Verification
- `redgate health --strict`
- `redgate lint`
- Relevant behavior test from the implementation slice.
## Non-goals
- Do not add citation-only padding.
- Do not make redgate adoption or formatting the product payoff.
## Evidence
The repo already uses `REQUIREMENTS.md`, redgate, and `req:` citations as durable governance authority.
@@ -0,0 +1,43 @@
---
id: SLICE-0005
type: slice
status: ready
parent: NS-0002
title: Prove LSP diagnostics parity with hemx-build
refs:
- REQUIREMENTS.md
- docs/diagnostics.md
- docs/editor-support.md
- hemx-lsp/src/main.rs
- hemx-build/src/lib.rs
---
## Objective
Make LSP diagnostics a faithful editor transport for `hemx-build` diagnostics across open, change, save, close, and CLI file checks.
## Authority
`docs/diagnostics.md` and `REQUIREMENTS.md` `diagnostics/004`, `diagnostics/005`, and `check/001` require editor overlays to share compiler authority and preserve useful spans.
## Close when
- A focused LSP test opens an invalid `.heml` document and observes the same diagnostic code/severity/range as the `hemx-lsp diagnostics FILE.heml` path.
- `didChange` updates diagnostics from in-memory text.
- `didSave` with and without text uses the documented source of truth.
- `didClose` clears diagnostics.
## Verification
- `cargo test -p hemx-lsp`
- `cargo run -p hemx-lsp -- diagnostics <fixture>.heml`
- `cargo check --workspace` if public LSP/build types change.
## Non-goals
- Do not implement a second `.heml` parser in the LSP.
- Do not add provider-specific VS Code/Neovim behavior in this slice.
## Evidence
`hemx-lsp/src/main.rs` already has diagnostics CLI and LSP publish paths that can be covered with protocol tests.
@@ -0,0 +1,40 @@
---
id: SLICE-0006
type: slice
status: ready
parent: NS-0002
title: Complete context-aware hemplate completions
refs:
- REQUIREMENTS.md
- docs/editor-support.md
- docs/hemplate-syntax.md
- hemx-lsp/src/main.rs
---
## Objective
Make completion useful for the real hemplate surface: directives, dynamic attributes, and `data-hemx-*` facts should complete in context without inventing syntax.
## Authority
`docs/hemplate-syntax.md` defines the public syntax; `docs/editor-support.md` and `REQUIREMENTS.md` `diagnostics/006` require completions to support that surface while remaining subordinate to build validation.
## Close when
- Completion items cover `h-if`, `h-for`, `h-key`, `h-match`, `h-case`, `{+ +}`, `{+= =+}`, `+attr`, and known `data-hemx-*` authoring facts.
- Tests prove context filters: directive completions in tag attributes, snippet/text completions in text positions, and no irrelevant completions inside quoted Rust expressions.
- Completion docs/details point to the existing syntax docs rather than new invented rules.
## Verification
- `cargo test -p hemx-lsp`
- Manual check if needed: request `textDocument/completion` against a fixture through the LSP test harness.
## Non-goals
- Do not add Rust type inference or project-wide symbol completion in this slice.
- Do not make completion acceptance a build authority.
## Evidence
`hemx-lsp/src/main.rs` already exposes `completionProvider` and `hemplate_completion_items` anchors.
@@ -0,0 +1,39 @@
---
id: SLICE-0007
type: slice
status: ready
parent: NS-0002
title: Complete hover help for documented hemplate facts
refs:
- REQUIREMENTS.md
- docs/editor-support.md
- docs/hemplate-syntax.md
- hemx-lsp/src/main.rs
---
## Objective
Make hover explain the real `.heml` facts that contributors see in templates without turning hover into a tutorial or alternative spec.
## Authority
`docs/hemplate-syntax.md` defines the facts; `REQUIREMENTS.md` `diagnostics/007` and `diagnostics/008` constrain hover and editor behavior.
## Close when
- Hover covers escaped/trusted text, dynamic attributes, control-flow directives, generated targets, forms, handles, roots, and keyed slots.
- Hover content is short and points back to the documented syntax authority.
- Hover tests assert range-sensitive behavior and no hover for unrelated HTML text where normal editor tooling owns the answer.
## Verification
- `cargo test -p hemx-lsp`
## Non-goals
- Do not duplicate `docs/hemplate-syntax.md` wholesale in source strings.
- Do not include provider-specific Markdown rendering assumptions.
## Evidence
`hemx-lsp/src/main.rs` already exposes `hoverProvider` and `hemplate_hover` anchors.
@@ -0,0 +1,41 @@
---
id: SLICE-0008
type: slice
status: ready
parent: NS-0002
title: Surface cross-file facts without replacing build validation
refs:
- REQUIREMENTS.md
- docs/editor-support.md
- docs/diagnostics.md
- hemx-build/src/lib.rs
- hemx-lsp/src/main.rs
---
## Objective
Define and prove the handoff between editor-visible template facts and `cargo check`/`hemx-build` completeness checks for template/handler references.
## Authority
`REQUIREMENTS.md` `check/001`, `check/003`, `diagnostics/004`, and `diagnostics/005` require cross-file references visible to build validation to fail at `cargo check` with useful spans, while editor overlays remain optional glue.
## Close when
- A test fixture demonstrates a template/handler reference that editor diagnostics can surface and `cargo check`/build validation also rejects.
- The LSP path reports useful spans without becoming the global source of truth.
- Global completeness boundaries remain component-scoped unless mount/tests are needed.
## Verification
- `cargo test -p hemx-lsp`
- `cargo check --workspace` or a focused compile-fail/build fixture when build validation changes.
## Non-goals
- Do not make the LSP own Rust type checking.
- Do not create a persistent project index unless a later slice proves it is required.
## Evidence
`docs/diagnostics.md` and `hemx-build` diagnostics define the authority boundary that editor support must reflect.
@@ -0,0 +1,39 @@
---
id: SLICE-0009
type: slice
status: ready
parent: NS-0002
title: Harden LSP protocol behavior
refs:
- hemx-lsp/src/main.rs
- docs/editor-support.md
- REQUIREMENTS.md
---
## Objective
Make `hemx-lsp` predictable as an LSP server: initialize capabilities, document sync, completion, hover, diagnostics, shutdown, and unknown request errors should have focused protocol tests.
## Authority
`hemx-lsp/src/main.rs` implements the protocol loop; `docs/editor-support.md` names the editor-facing command surface.
## Close when
- Tests cover `initialize`, `didOpen`, `didChange`, `didSave`, `didClose`, `completion`, `hover`, `shutdown`, and unknown requests.
- The tests assert JSON-RPC framing and response IDs, not just helper functions.
- The server keeps normal HTML/tree-sitter tooling assumptions and does not add editor-provider policy.
## Verification
- `cargo test -p hemx-lsp`
- `cargo run -p hemx-lsp -- help`
## Non-goals
- Do not add async runtime or background watchers unless protocol tests prove sync IO is insufficient.
- Do not publish editor extensions in this slice.
## Evidence
The current LSP loop is small and testable through in-memory readers/writers.
@@ -0,0 +1,39 @@
---
id: SLICE-0010
type: slice
status: ready
parent: NS-0003
title: Define repo-owned hemplate highlighting boundary
refs:
- docs/editor-support.md
- docs/hemplate-syntax.md
- REQUIREMENTS.md
---
## Objective
Turn "tree-sitter highlighting for hemplate" into a bounded repo-owned contract: HTML stays the base grammar, hemplate overlay tokens are documented, and validation remains with `hemx-build`/`hemx-lsp`.
## Authority
`docs/editor-support.md` says normal HTML/tree-sitter tooling remains in use; `docs/hemplate-syntax.md` names the small overlay; `REQUIREMENTS.md` forbids a second template language or custom editor framework.
## Close when
- A highlighting boundary doc or work artifact lists the token classes the repo owns: escaped/trusted text delimiters, dynamic attribute prefix, `h-*` directives, and `data-hemx-*` facts.
- It explicitly excludes diagnostics, completion, hover, formatting, Rust expression parsing, and build validation from highlighting authority.
- It names what can be tested in-repo without editor package publishing.
## Verification
- `work check` for the slice contract now.
- Later implementation: a repo-owned fixture/query test command, or a manual editor smoke if no automated query runner exists yet.
## Non-goals
- Do not introduce a new parser for `hemx-build`.
- Do not publish or install editor packages.
## Evidence
The docs already establish `.heml` as HTML plus a small overlay; this slice makes that boundary executable before writing queries.
@@ -0,0 +1,39 @@
---
id: SLICE-0011
type: slice
status: ready
parent: NS-0003
title: Add hemplate highlighting fixtures and query tests
refs:
- docs/hemplate-syntax.md
- docs/editor-support.md
- REQUIREMENTS.md
---
## Objective
Create repo-owned highlighting fixtures that prove documented hemplate syntax receives stable captures while ordinary HTML remains handled by existing HTML tooling.
## Authority
`docs/hemplate-syntax.md` is the syntax authority; `docs/editor-support.md` says highlighting is HTML first with hemx overlays.
## Close when
- Fixtures cover text insertion, trusted HTML insertion, dynamic attributes, `h-if`, `h-for`, `h-key`, `h-match`, `h-case`, `data-hemx-root`, `data-hemx-slot`, `data-hemx-form`, and `data-hemx-handle`.
- Tests or golden outputs verify capture names for those tokens.
- The test path is repo-owned and does not require publishing a VS Code/Cursor/Neovim package.
## Verification
- Preferred future command: a repo-owned tree-sitter/query fixture test, once the crate/tool location is chosen.
- Until then, manual proof must name the exact editor/query runner and fixture.
## Non-goals
- Do not parse Rust expressions inside `{+ +}` beyond highlighting delimiters/expression region.
- Do not make highlights responsible for diagnostics or completion.
## Evidence
The fixture list maps directly to the documented syntax surface.
@@ -0,0 +1,38 @@
---
id: SLICE-0012
type: slice
status: blocked
parent: NS-0003
title: Package editor highlighting integrations
refs:
- docs/editor-support.md
- README.md
---
## Objective
Ship `.heml` highlighting into specific editors only after repo-owned syntax/query behavior exists and release authority is explicit.
## Authority
`docs/editor-support.md` names VS Code, Cursor, and Neovim setup, but current repo authority does not grant external marketplace/package publishing from this work-graph mapping goal.
## Close when
- The target editor/provider is named.
- The package owner, signing/publishing credentials, and release process are explicit.
- The provider package consumes repo-owned query/fixture facts rather than becoming a separate syntax authority.
## Verification
- Provider-specific install/manual smoke, named by the future implementation slice.
- Repo-owned query fixture tests from `SLICE-0011` remain green.
## Non-goals
- Do not publish marketplace packages or mutate external editor registries under the current authority.
- Do not fork syntax behavior per editor.
## Evidence
This is intentionally blocked by missing external release authority, not by an implementation guess.