devkeys_engineexports a singleevaluate_typed(target, typed)function viawasm-bindgen.- The diff counts correct/incorrect characters, computes accuracy/completion, and returns a JSON-serialisable summary consumed by the web client.
- The web client requires the wasm-pack output (
apps/web/src/wasm/); correctness expectations live in the Rust tests that guard the shared logic.
| Area | Details |
|---|---|
| Diff depth | Track first/second/third attempt states directly in WASM to avoid duplicating logic in JS. |
| Timing hooks | Accept elapsed milliseconds from JS so the engine can calculate WPM deterministically. |
| Error heatmaps | Return per-index error counters to power future visualisations without post-processing. |
| Snapshot compression | Deduplicate consecutive identical ranges before persisting to IndexedDB. |
| Module | Purpose | Notes |
|---|---|---|
| Syntax Tokeniser | Tree-sitter-based parsing for structured analytics and advanced hinting. | Requires shipping grammars + wasm-bindgen wrappers. |
| Adaptive Selector | Seeded RNG and difficulty weighting to surface prompts based on past mistakes. | Depends on richer session history. |
| Pack Validator CLI | Validate JSON packs, lint language fields, and optionally bundle them into signed archives. | Targets contributors and CI. |
| Analytics Engine | Aggregate local history (streaks, heatmaps, export) and power dashboards without touching JS. | Could share code with future desktop builds. |
- AI-assisted mutator: Optional, privacy-preserving prompt mutation built on an external proxy.
- Desktop shell: Tauri or native wrappers for distraction-free practice.
- Worker deployment: Cloudflare Worker in Rust to serve curated packs once federation is required.