Plan status → COMPLETE, all 8 tasks/44 steps checked. Roadmap: Narrator pipeline
✅, Client HTTP loop promoted to ▶ next.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- call_log._default_write: swallow any exception from the default file/
stdout sink and report to stderr, so a log-write failure (disk full,
bad permissions, misconfigured CALL_LOG_PATH) never turns a successful
narration into a 500 (charter §13). Injected write= sinks (used by
tests) are left to surface their own errors.
- ollama_client.chat: catch ValueError alongside httpx.HTTPError in the
retry loop so a 200 response with a non-JSON body (JSONDecodeError is
a ValueError subclass) counts as a failed attempt and falls through to
ModelError after the one retry, instead of escaping chat() uncaught
(charter §12 — one retry, then ModelError, nothing else escapes).
- main.py: update stale docstrings — /dm/narrate is now fully wired
(routing + model call + logging); the other four roles remain stubs.
Regression tests added for both fixes (TDD: watched RED, then GREEN).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
/dm/narrate now makes a real Ollama call (Task 7). The role-endpoint
loop tests in test_endpoints.py had no mock, so every default pytest
run was silently hitting a live Ollama instance on localhost:11434 —
breaking the hermetic-suite constraint. Add an autouse fixture that
stubs narrate.ollama_client.chat and narrate.call_log.record so all
five endpoints stay hermetic; assertions (200 on valid, 422 on
invalid) are unchanged.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Client-side GDScript engine that constructs the canon log at new-game
(origin + world + character creation) and maintains its invariants turn
to turn. Headless GUT-tested logic layer (48 tests): typed RefCounted
model with invariants-in-the-model, Luck-centric GameState, ContentDB
mirroring the api id-resolver, NewGame.construct, and a pure §12 tag
extractor. Binds to the Plan A canon log contract.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Whole-branch review flagged that NewGame.construct validated class and
origin refs but not player.name. The canon-log schema requires
player.name with minLength:1, so a missing/blank name previously
returned ok:true and produced a log the API would reject with 422.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Also configure GUT to not treat push_error() as a test failure
(client/.gutconfig.json: failure_error_types = [engine, gut]).
The brief's LogPlayer/Quest setters intentionally push_error() on
rejected input; GUT's default failure_error_types includes
push_error, which would fail test_player_rejects_unknown_class and
test_quest_status_enum despite their assertions passing.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The client half of the canon log contract: typed RefCounted model with
invariants-in-the-model, Luck-centric game state, new-game construction
from origin+world+creation, turn-to-turn mutators, and a pure regex tag
extractor. Headless GUT-tested logic layer; UI/HTTP/save-load deferred.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- canon_log.py: stringify jsonschema error-path segments before sorting so a
future schema mixing array indices and object keys can't TypeError (#1)
- main.py: RequestValidationError handler reshapes pydantic body failures into
the same {"detail": {"canon_log_errors": [...]}} envelope as schema failures,
so the client parses ONE 422 shape (#2a) + tests
- pytest.ini: filter the starlette/httpx TestClient deprecation → pristine output (#4)
- docs/canon-log.md: living contract for the client (Plan B) — schemas, the §7
boundary, the unified error envelope, per-role injection (#3)
Full suite 26 passing, 0 warnings.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
JSON Schema contract for canon log + origin seeds (single source of truth),
validator module, POC deserter origin + minimal world fixtures with
id-resolution, canon-log validation wired into all five role endpoints
(422 on invalid), and schemas bundled into the Docker image with a passing
runtime smoke test. Full suite 25 passing.
Plan A of two: the JSON Schema contract, authored POC fixtures (deserter
origin + minimal world), and the api's runtime validation of every canon log
(422 on invalid, enforcing the §7 luck boundary). Five TDD tasks, all runnable
with pytest + Docker in-repo. Plan B (GDScript client construction/maintenance)
deferred until we're in Godot.
Plan: docs/superpowers/plans/2026-07-09-canon-log-contract-and-api-validation.md
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Design spec for the §11 canon log, plus origin seeds as thin initial-state
overlays over a single static world. Three layers (world content / origin seed /
runtime canon log), the in/out boundary (numeric Luck never enters the AI
payload, §7), field-level schemas, new-game construction order, turn-to-turn
maintenance, and JSON storage validated on both client and api.
Folds content/npcs and content/quests under content/world/; adds
content/world/{locations,items} and content/origins. fallback/ kept outside
world/ (authored prose, not id-referenced).
Spec: docs/superpowers/specs/2026-07-09-canon-log-schema-design.md
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Long-lived master + dev; all non-doc work on branches off dev; doc-only
edits go straight to dev; human owns the dev->master merge and pushes
master; Claude pushes only dev, only after a --no-ff merge.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
These are Claude Code session/state files, not project code. They were
swept into the first commit; remove from the index (kept on disk) and
ignore going forward so they stop dirtying status.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add a Docker-based FastAPI proxy skeleton (charter §4) for parity across
dev / homelab VPS / fly.io, plus root .gitignore for Godot 4.7 and Python.
- api/Dockerfile: python:3.12-slim, non-root, PORT-aware CMD
- api/app/main.py: /health + five role endpoint stubs (§4)
- api/requirements.txt: fastapi/uvicorn/httpx/pydantic, pinned
- docker-compose.yml: local dev with live reload
- api/fly.toml: prod deploy stub with /health check
- api/.env.example: key lives in the proxy, never the client (§4)
- .gitignore: ignores .env, whitelists .env.example
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>