v0.9.0 — EVENT LOG: real game events in the terminal (#11) #18

Merged
kamilkrzywda merged 7 commits from event-log into master 2026-09-29 05:05:30 +02:00
Owner

Issue #11 — the last tab goes live (no placeholder lines):

  • API: GET /api/events → latest N newest-first ([{id, turn, type, message, createdAt}]); optional ?limit= default 50, cap 200, invalid → 400. Auto-initializes like every other read. OpenAPI now documents 15 paths + Event schema (eight event types).
  • UI: self-fetching EventLogPanel renders the real log into the existing Terminal — lines as T<turn> // <MESSAGE> with local time; new_game lines render as system (#) lines. Placeholder feed removed from mission-control.tsx.
  • No schema change — every action already writes events (this issue is read endpoint + render, by design).
  • Tests: unit 73 → 78 (parseEventLimit default/accept/reject, newest-first ordering + limit slicing; closed writer gaps — expand had no event assertion at all, build and mission-complete gained turn checks); e2e 14 → 15 (jump via shared helper + scan → both entries in API newest-first and rendered in terminal; state.spec asserts latest five lines identical incl. ids across the mid-run restart).

Local verification: tsc ✓, vitest 78/78 ✓, playwright --list 15 ✓, next build clean (ƒ /api/events registered) + DOM check (7 tab triggers) + live API smoke (limit validation 400s).

Issue #11 — the last tab goes live (no placeholder lines): - **API:** `GET /api/events` → latest N newest-first (`[{id, turn, type, message, createdAt}]`); optional `?limit=` default 50, cap 200, invalid → 400. Auto-initializes like every other read. OpenAPI now documents 15 paths + Event schema (eight event types). - **UI:** self-fetching `EventLogPanel` renders the real log into the existing Terminal — lines as `T<turn> // <MESSAGE>` with local time; `new_game` lines render as system (`#`) lines. Placeholder feed removed from mission-control.tsx. - **No schema change** — every action already writes events (this issue is read endpoint + render, by design). - **Tests:** unit 73 → 78 (parseEventLimit default/accept/reject, newest-first ordering + limit slicing; closed writer gaps — `expand` had no event assertion at all, `build` and mission-complete gained turn checks); e2e 14 → 15 (jump via shared helper + scan → both entries in API newest-first and rendered in terminal; state.spec asserts latest five lines identical incl. ids across the mid-run restart). Local verification: tsc ✓, vitest 78/78 ✓, playwright --list 15 ✓, next build clean (`ƒ /api/events` registered) + DOM check (7 tab triggers) + live API smoke (limit validation 400s).
kamilkrzywda added 6 commits 2026-09-29 04:51:58 +02:00
lib/game/events.ts: the latest N events of the save, newest first (ORDER BY
id DESC), with parseEventLimit for the optional ?limit= param (default 50,
cap 200, 400 otherwise). Unit tests cover default/accept/reject and
newest-first ordering + slicing.
expand had no event assertion at all; build and mission-complete asserted
type/message but not the event's turn. Issue #11 requires every action type
to be covered with correct turn/type/message.
Latest game events, newest first; auto-initializes like the other reads.
?limit= defaults to 50 (cap 200), non-integer/out-of-range → 400. OpenAPI
spec gains the path + Event schema (14 -> 15 paths).
Self-fetching EventLogPanel (MissionPanel pattern — refetches on each tab
open). One terminal line per event: T<turn> // <MESSAGE>, newest first, with
the event's local time as the timestamp; new_game lines render as system
lines. Placeholder feed + now() removed from mission-control.
smoke: jump (shared helper) + scan, then assert both events are in
GET /api/events with the newer one first, and that the EVENT LOG terminal
renders both T<turn> // <MESSAGE> lines. Idempotent across retries — asserts
on this run's own entries by turn/message, never absolute counts. state: the
latest five log lines come back identical (ids included) after the mid-run
container restart.
release v0.9.0
CI / build + unit + e2e (pull_request) Failing after 3m12s
760a45fc4b
kamilkrzywda added 1 commit 2026-09-29 05:02:05 +02:00
test(e2e): tab-switch test — assert real log lines, not the removed placeholder
CI / build + unit + e2e (pull_request) Successful in 2m36s
37b193ffb8
CI run 361: v0.9.0 replaced the placeholder feed with EventLogPanel, but this
pre-existing assertion still expected 'SHIP LOG // PLACEHOLDER FEED'. Assert a
real T<turn> // <MESSAGE> line instead — every save has the turn-0 new_game
event, so it holds on a fresh stack and across retries.
kamilkrzywda scheduled this pull request to auto merge when all checks succeed 2026-09-29 05:05:28 +02:00
kamilkrzywda merged commit fb11a8ef81 into master 2026-09-29 05:05:30 +02:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: OpenCode/SpaceWanderer#18