diff options
| author | Adam Malczewski <[email protected]> | 2026-06-11 12:23:06 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-06-11 12:23:06 +0900 |
| commit | c2b4c05d91fa88b8d02c055a0e15c22abd8e21f3 (patch) | |
| tree | 3f7c2feddbe697a79abd952bb80ed0e01dac0a7a /tasks.md | |
| parent | f6b45507210e04e9884256b0132900640de4334b (diff) | |
| download | dispatch-c2b4c05d91fa88b8d02c055a0e15c22abd8e21f3.tar.gz dispatch-c2b4c05d91fa88b8d02c055a0e15c22abd8e21f3.zip | |
feat(cache-warming): per-conversation prompt-cache warming + warm() service
Backend-driven warming targeting whatever provider a conversation uses (incl. the
external Claude provider-anthropic). Core engine + on/off + last-cache-% done;
interval-as-view-control pending a ui-contract NumberField (surface-system gap).
Mechanism:
- kernel: expose HostAPI.emit (typed bus event emit; counterpart of on)
- session-orchestrator: turnStarted/turnSettled event hooks (conversationId/cwd/model);
warm() service (cacheWarmHandle) reusing the real-turn assembly (byte-identical prefix,
provider-agnostic), refuses mid-turn, never persists/emits, returns Usage
- cache-warming (new ext): per-conversation timers (arm on settle, cancel on start,
in-flight invalidation), calls warm(), pct=round(clamp(cacheRead/input,0,1)*100),
persists {enabled,intervalMs} (default on/240s), registers a controls surface
- host-bin: register cache-warming; transport-http: HostAPI stub +emit (fan-out)
Honors old-code invariants. 760 vitest + 109 bun = 869 tests; tsc -b EXIT 0; biome clean.
Diffstat (limited to 'tasks.md')
| -rw-r--r-- | tasks.md | 27 |
1 files changed, 26 insertions, 1 deletions
@@ -5,7 +5,7 @@ > Keep this lean and current; do not let it re-accrete a step-by-step changelog. ## Status (current) -`tsc -b` EXIT 0 · biome clean · **734 vitest + 109 bun = 843 tests**. +`tsc -b` EXIT 0 · biome clean · **760 vitest + 109 bun = 869 tests**. Built and verified live (full-fidelity: every feature is a manifest-loaded extension through the host): @@ -140,6 +140,31 @@ no summary but still loadable. Glossary: added `skill`, `skill summary`, `tools `tsc -b` EXIT 0, biome clean. (End-to-end load_skill via a real LLM turn not yet exercised — unit/integration tests cover the filter rewrite + live read.) +## Cache warming (core DONE; control surface PARTIAL) +User-gated calls: target the external **Claude** provider (`../claude` provider-anthropic, loaded via +`DISPATCH_EXTERNAL_EXTENSIONS`); warm-assembly lives in **session-orchestrator** (`warm()` reuses the +real turn's assembly → byte-identical prefix, provider-agnostic); **surface system** for controls; +**per-conversation** controls; interval default 4 min, free value. Old-code invariants honored +(primary-model/full-prefix via reuse; refuse mid-turn; never persist/emit; in-flight invalidation; +arm-on-settle/cancel-on-start; `pct = round(clamp(cacheRead/input,0,1)*100)`). +- **Mechanism (2nd use of bus hooks; first event-hook emit):** + - [x] **kernel** — exposed `HostAPI.emit` (delegates to bus.emit), counterpart of `on`. + - [x] **session-orchestrator** — `turnStarted`/`turnSettled` event hooks (carry conversationId/cwd/ + modelName) emitted per turn; `warm()` service (`cacheWarmHandle`) reusing assembly, refusing + mid-turn, never persisting/emitting; returns Usage. + - [x] **cache-warming** (new ext) — per-conversation timers (arm/cancel/in-flight token), + calls `warm()`, computes `lastPct`, persists `{enabled,intervalMs}` (default on/240s) in + host.storage; registers a controls Surface. 19 tests. + - [x] **host-bin** — registered cache-warming; **transport-http** HostAPI stub fixed for `emit`. +- **Live-verified:** full-graph `tsc -b` EXIT 0, biome clean (boot smoke + live Claude warm pending + a restart with the cache-warming ext loaded). +- **OPEN — surface-system limits (CR from cache-warming):** the surface system has (a) NO + per-conversation context (surface reflects most-recently-active conversation; invoke carries + conversationId), and (b) NO numeric-input field kind, so the **interval ("set time to refresh") + control is not yet a view input** — only the on/off toggle + last-cache-% stat render. Honoring + per-conversation controls + free-value interval needs a `NumberField` in `ui-contract` + + per-conversation surface scoping (+ FE courier). Decision pending. + ## Open items - **`prefix.fingerprint` / `warm|real` cache-bust attributes (deferred):** decoupled from dedup by the content-addressed decision; also gated on cache-warming being |
