You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Prove the UwUChat memory client against its documented contract with a fake fetch #197
UwUChatMemoryStore (src/memory/uwuchat.ts) implements the MemoryStore interface but throws UwUChatMemoryError: not implemented — awaiting AIRunner endpoint until UWUCHAT_BASE_URL is set. The endpoint contract lives in the module header / memory docs, but there is no fake-server contract test proving the harness client honors it, so when the AIRunner endpoints arrive there is nothing to verify against — and today nobody can tell client bugs from missing-server.
Architecture (independent solution)
Prove the client against the documented contract with an injected fake fetch (the class already accepts fetchImpl):
Add src/memory/__tests__/ coverage using a fake fetchImpl that implements the documented /api/v1/harness/memory shapes: store fact, recall, session summary round-trips. Assert request URLs, Authorization: Bearer header when UWUCHAT_TOKEN set, and response parsing.
Assert the unconfigured path still throws the typed error (not a generic fetch failure).
If the documented contract and the client's expectations disagree, fix the docs or the client in this change and say which — do not invent new endpoints.
Scope / non-goals
No AIRunner server implementation (different repo), no endpoint redesign, no making this store the default anywhere.
Acceptance
Fake-server round-trip tests pass for fact store + recall + summary.
Unconfigured store errors with UwUChatMemoryError naming the missing env.
docs memory contract and client agree (diff stated in PR).
docs/memory-uwuchat-contract.md (NEW: documents the AIRunner HTTP contract the client already implements — §1 endpoint table, §2 per-endpoint shapes, §4 error shape; written FROM the client behavior in src/memory/uwuchat.ts:30-239, so client and docs agree by construction — no diff to state)
All 11 uwuchat tests passed (9 existing + 404 status + malformed-JSON typed error)
All 6 uwuchat-contract tests passed
Boot check
npx tsc --noEmit: clean.
Request assertions: URLs (/api/v1/harness/memory/record-fact, /facts?project=, /query-recall, /summaries?), Authorization: Bearer header when token set, absent when unconfigured.
UwUChatMemoryError naming the missing env on unconfigured use; non-2xx carries status; invalid JSON → typed error, no partial writes, no unhandled throw.
Full npm test: FAILS at pre-existing src/campaigncontrol/__tests__/repair-known-v2-cli.test.ts — identical failure on clean HEAD, unrelated.
Residual risk / notes
The §3 endpoints absent from the client (record-chunk, query-context, record-feedback, record-session-outcome, recognize-entity, submit-turn) are documented in the contract doc as not-yet-implemented; the client returns the typed unconfigured/not-implemented error for any use requiring a server, which the fake-fetch layer cannot reach.
Full-repo check-architecture gate was already red on clean HEAD (154 NEW findings pre-existing); this change adds none naming uwuchat files.
Activity
w4ffl35 commentedon Dec 5, 2026
Issue 197 — Closing Report
Files changed
Baseline (before)
Baseline (after)
Boot check
npx tsc --noEmit: clean./api/v1/harness/memory/record-fact,/facts?project=,/query-recall,/summaries?),Authorization: Bearerheader when token set, absent when unconfigured.UwUChatMemoryErrornaming the missing env on unconfigured use; non-2xx carriesstatus; invalid JSON → typed error, no partial writes, no unhandled throw.npm test: FAILS at pre-existingsrc/campaigncontrol/__tests__/repair-known-v2-cli.test.ts— identical failure on clean HEAD, unrelated.Residual risk / notes
PR: #203
Merge pull request #203 from Capsize-Games/issues/w14-2026-12-05