9703eb2b6b
Worldtree Conversation API debug TUI. Multi-pane observability dashboard: chat transcript + persona/Vili affect log + tool events + admin events + Bifrost state + tool inventory + (opt-in) raw server log. Design locked at docs/design-brief.md (originated as brokkr-smithy/docs/ratatoskr-design-brief.md). Operator-locked decisions: - Textual application-shell framework (multi-pane dashboard, not REPL). - Separate repo + separate dev team (no Worldtree-source imports). - httpx-sse for SSE consumption (reference Python SSE-resume impl). - Triple version-skew mitigation: spec-pin in pyproject.toml + recorded SSE snapshot tests + conformance smoke. Initial pin: Worldtree v0.19.0 at 55101e909abcd2219833266b6f905c5bc956e0f0. - Persona pane: label-don't-refuse PII posture. - Server-log pane: opt-in via --server-log <path>. - Two-stage Ctrl-C (cancel then exit). - Markdown rendering default-on; --raw opt-out. In the box: - docs/design-brief.md — the locked design with full rationale. - docs/SPEC-PIN.md — Worldtree spec pin + bump procedure. - docs/conversation-api-spec.md + docs/conversation_api.contract.md — vendored Worldtree spec snapshots at the pinned SHA. - pyproject.toml — Python 3.12, hatchling, uv-managed, deps locked. - src/ratatoskr/ — stub package (cli.py raises NotImplementedError). - tests/test_no_worldtree_imports.py — boundary smoke test PASSING. - tests/snapshots/README.md — recording convention for SSE snapshot tests. Not in the box yet: - Gitea remote (operator/infra-ops to register at vh/ratatoskr). - Implementation — the dev team owns this; design brief is the spec. Origin: althing thread 01KS3R34XD3N6HMK91VXESHGW7 (worldtree-dev → brokkr-smithy-dev, 2026-05-20). Volva consulted via thread 01KS3VF6W33N3V5FNMGQ91YNVD.
1.1 KiB
1.1 KiB
SSE snapshot tests
Recorded SSE transcripts from a live Worldtree at the pinned spec SHA. Replayed in CI to catch event-shape drift.
Recording
# Boot Worldtree at the pinned SHA
( cd ~/development/Worldtree && python -m core.conversation_api ) &
# Record (harness TBD by dev team — likely respx + httpx-sse fixtures)
uv run pytest --record-snapshots tests/snapshots/
Replay
The default uv run pytest reads the recorded files and replays them
against the Ratatoskr SSE consumer. Re-record on every spec-pin bump
(see docs/SPEC-PIN.md).
What to capture
At minimum:
- One-turn happy path (
text+done). - Tool-using turn (
text+tool_start+tool_result+text+done). - Thinking-enabled turn (
thinking+text+done). - Cancelled turn (
text+cancelledwithreason: "user_cancel"). - Errored turn (
text+error). worker_phaseevent sequence acrossBuildingPrompt→CallingLLM→ProcessingTools→Streaming→Finishing.
Capture also the id: and event: lines, not just data: — those
are load-bearing for SSE resume and easy to forget.