1
0
Fork 0
Commit graph

1089 commits

Author SHA1 Message Date
a32e492b62 docs: add v0.12.10 changelog entry 2026-10-19 13:05:30 -04:00
3d73aee193 fix(ai-compose): one prose output contract for every field prompt
Rich text fields received the plugin's richText system prompt, which
demanded lexical JSON and a blog layout of [paragraph]/[heading] markers,
next to an instruction asking for plain prose. The model answered by
arguing about the conflict, and that argument was saved into the field.
Text fields had the mirror problem: a prose instruction sent over a
transport that forced JSON.

Every field now asks for plain prose and nothing else, and the handler
assembles the JSON the Compose client already parses:

- src/lib/ai/composeSystem.ts owns the shared rules, keeps only the
  plugin's [[[BLOCK_<n>]]] echo instruction for richText, and wraps prose
  into lexical JSON or a single field value.
- payload.config.ts routes every wrappable schema through
  generatePlainText; streamObject stays only as the fallback for shapes
  prose cannot fill, such as a hasMany array.
- Truncated output reaches the client again (finish_reason length was
  swallowed on the prose path).

Adds tests/int/ai-compose-system.int.spec.ts (10 cases) and picks up the
generated payload-types.ts drift for the model field description.
2026-10-19 13:03:33 -04:00
d82e8057ba fix(docker): keep runner as the final stage, move runner-arena above it
Coolify builds Main Website without --target (dockerfile_target_build is
null), so Docker takes the LAST stage as the web image. The previous
commit appended runner-arena at the end, and the resulting auto-deploy
(16:33) built the arena image for the web app; it failed its health
check and Coolify kept the old container, so prod never went down.

Reorder: base -> prod-deps -> builder -> runner-arena -> runner (last).
Adds a warning comment at the runner stage so future stages are never
appended after it. The arena service sets an explicit build target.
2026-10-19 12:39:06 -04:00
394db6dfa1 feat(arena): websocket match replication for Ordnance Disposal
Adds a dedicated Node 22 + ws arena server (src/arena) that owns live
Ordnance Disposal matches: drift-corrected 20Hz tick loop with capped
catch-up and tick-drift logging, per-socket snapshot fan-out, 30s jose
ticket auth, and awards via the idempotent results callback route.

Client gains a transport abstraction (transport.ts): WsTransport first
when NEXT_PUBLIC_ARENA_URL is baked into the bundle, HttpTransport
(today's actions + SSE + guarded poll, behavior unchanged) as automatic
fallback after two connection failures or a 5s setup timeout; absent
env var means pure HTTP (kill switch / rollback path). Next actions
proxy the match lifecycle to the arena when ARENA_SECRET +
ARENA_INTERNAL_URL are set; the in-process registry stays untouched as
the default backend.

Deploy wiring: runner-arena Dockerfile target, compose service, env
docs, DEPLOYMENT.md checklist. Tests: arena module suite (19), live
server WS suite (3), prediction harness ws-grade latency scenario.
2026-10-19 12:27:17 -04:00
70378b23e8 v0.12.9 - period-first minigame boards, configurable Compose model 2026-10-19 12:19:47 -04:00
3655e61247 docs: add v0.12.9 changelog entry 2026-10-19 12:18:16 -04:00
5e4ecd455b docs(minigames): note period-primary game pages with collapsed all-time boards 2026-10-19 12:14:58 -04:00
923831ba82 feat(minigames): make period standings the primary board on game pages
The six period-scored game pages (flappy, eod, opord, radio,
qualification, call-for-fire) now render their current-period
PeriodStandingsCard directly under the game board, in the slot the
lifetime board used to occupy. Each game's all-time leaderboard moves
below it into a collapsed AllTimeLeaderboard disclosure (shadcn
Collapsible) that expands on click, so period standings are centered and
primary and the lifetime board is opt-in.

PeriodStandingsCard drops its period/all-time toggle and keeps the
current period only, now with the presence line the pages previously
omitted. The old "Anchored period standings" heading and card block are
removed from the six page.tsx files. The e2e spec covers the collapsed
all-time section on /minigames/flappy.
2026-10-19 12:14:57 -04:00
15e434998a feat(ai): configure Compose model and label via env
UNSLOTH_MODEL selects the model the Compose plugin calls, and the optional UNSLOTH_MODEL_NAME labels it in the admin (derived from the model id when omitted). The model-id select keeps its stable internal key, a Postgres enum, so switching models needs no schema change.

The seeded per-prompt model value is cleared so the env var applies; an admin can still pin a model on a single prompt row. Migration 20261019_121500_use_env_ai_model drops the column default and clears the seeded value.
2026-10-19 12:13:22 -04:00
958cbe0f19 v0.12.8 - fix AI Compose prompt title and entity context 2026-10-19 11:42:54 -04:00
7c179d3f47 docs: add v0.12.8 changelog entry 2026-10-19 11:42:43 -04:00
88982bfcdf fix(ai): resolve compose title and name the entity in seeded prompts 2026-10-19 11:32:59 -04:00
869d2944b3 v0.12.7 - widescreen page layouts, minigame touch controls 2026-10-19 10:57:23 -04:00
977aa26664 docs: add v0.12.7 changelog entry 2026-10-19 10:57:18 -04:00
c149f07347 fix(ui): unify remaining page caps to 96rem and repair story xl cap
Raise the centered operations, supply-boxes, campaigns, factions and
missions wrappers from max-w-7xl to the same max-w-[96rem] used by the
logistics detail pages so all capped pages share one width.

The story page used xl:max-w-screen-2xl, a utility Tailwind v4 removed,
so that override silently did nothing; swap it for xl:max-w-[96rem],
which restores the intended wider gutter layout on xl screens.
2026-10-19 10:52:04 -04:00
9f05351798 fix(ui): center and widen left-aligned detail pages
Structure, vehicle, resource, shipment, banking, profile and awards
pages capped content at max-w-7xl pinned to the left edge, so all
slack pooled on the right on wide monitors (worse with the sidebar
hidden). Raise the cap to 96rem and center it, matching the existing
mx-auto convention on operations and intelligence pages.
2026-10-19 10:50:35 -04:00
ce682becec feat(minigames): touch controls and responsive board for Bomperator
- Extract pressDir/releaseDir/stopAll edge callbacks; keyboard, D-pad and
  swipes all feed the same held-stack path (prediction, keepalives and the
  pending ledger stay input-source agnostic)
- BomperatorTouchControls: 4-way pad + stop center + plant button on coarse
  pointers, per-button pointer capture for hold-and-plant multi-touch
- Board gestures: dominant-axis swipe sets direction, quick tap stops
- Canvas scales via CSS (w-full h-auto, fixed internal buffer), so prediction
  is viewport-independent; touch-action/overscroll guards on the board
- Harness: backgrounded-tab scenario (4s rAF freeze under prod trace replay)
  proves resume never teleports (teleports=0, maxJump 0.43)
- E2E smoke at 390x844 hasTouch: page loads without horizontal overflow
2026-10-19 10:11:30 -04:00
a72f1bbe03 feat(call-for-fire-versus): resize fleet, add second FOB, charred destroyed cells with burn effect
Command Post becomes a 3x2 rect that flips wide/tall, the Ammo Depot L grows to four cells, the FOB becomes two cells, and a second FOB (Forward Operating Base II) joins the fleet for 16 cells across five structures. Fully destroyed structures now render charred black instead of red, and their cells burn with flame and ember particles for 45 seconds after destruction, driven by a new impact timestamp on each shot.
2026-10-19 09:34:40 -04:00
1d8402236b v0.12.6 - end Ordnance Disposal teleport-back with trace-proven fix 2026-10-18 02:11:30 -04:00
2daca14bd0 docs: add v0.12.6 changelog entry 2026-10-18 02:11:30 -04:00
d3bb69ffbc fix(minigames): end Bomperator teleport-back with trace-proven envelope correction
Root cause: Node event-loop stalls drop the server's setInterval ticks with
no catch-up, so the sim permanently lags wall clock; the old all-inputs-acked
pull let that gap stack past the snap threshold and discharge as an instant
backward teleport (the reported complaint).

- Component: lead-aware correction envelope, trim on every snapshot,
  capped-rate ease (2.5x speed) past 2.5 cells; resets still snap via the
  ack-backwards branch. No latency-precision mechanisms (the v0.12.4 lesson).
- prediction.ts: drop the unused decision-nudge exports.
- Harness: replay recorded production HAR latency
  (tests/fixtures/bomperator-prod-rtt.json), model server tick stalls, add
  per-reconcile jump telemetry. A/B proof under trace+stalls: v0.12.3 policy
  teleports twice (max jump 2.59 cells); envelope policy zero (max 1.10).
2026-10-18 02:11:15 -04:00
2a941c5a5b fix(minigames): resolve the current period before building standings boards
The default ?period=current scope arrives as periodId null, and
buildLeaderboardPayload built the boards before resolving currentPeriod(),
so buildPeriodBoards short-circuited to zero entries: the live period's
board was always empty even while ledger rows existed for it. Resolve the
period first and feed its id into the boards, and cover the default scope
with a real-clock regression test (the suite previously only exercised
explicit period ids).
2026-10-18 02:06:32 -04:00
c5b275f427 v0.12.5 - revert Ordnance Disposal prediction update 2026-10-18 01:41:09 -04:00
bda844ddfc docs: add v0.12.5 changelog entry 2026-10-18 01:41:09 -04:00
a9f047f214 revert(minigames): roll back Bomperator prediction update after prod regression
Reverts 655407a (component + guide). Production HAR showed input POST
TTFB p50 87ms / p90 236ms / max 384ms (server pipeline variance, not
network). The nudges and ghost projection trusted rttAvg too tightly and
glitched under that variance; v0.12.3 behavior is restored.

Kept on purpose: bomperator/prediction.ts and the offline prediction
harness stay as test-only infrastructure for the re-fix, which will be
calibrated against the recorded production latency trace.
2026-10-18 01:40:44 -04:00
7322ee8dd0 v0.12.4 - smooth Ordnance Disposal movement, fix rubberbanding 2026-10-18 01:10:15 -04:00
30db132d7b docs: add v0.12.4 changelog entry 2026-10-18 01:10:15 -04:00
655407ab7d fix(minigames): stop Bomperator teleport-back with envelope correction and decision nudges
- Extract client prediction helpers to bomperator/prediction.ts (predStep/
  predAdvance port, alignDecisionToServer, projectServerPosition)
- Nudge prediction across cell boundaries at turn/stop edges so client and
  server commit to the same rounding decision; ghosts use the server's
  projected placement cell
- Stamp snapshot arrival time; event projections use measured age, reconcile
  estimate keeps the calibrated half-tick bias
- Replace pending-gated pull and instant 2.5-cell snap with a lead-aware
  correction envelope plus capped-rate ease (2.5x speed); resets still snap
  via the ack-backwards branch
- Add offline deterministic prediction harness (real engine + modeled network
  + frame-by-frame reconcile mirror), 9 scenarios incl. rAF stalls and a
  pre/post-fix ghost-mismatch comparison
2026-10-18 01:09:56 -04:00
1eafce4df9 v0.12.3 - double Ordnance Disposal update rate, glide-rest engine fix 2026-10-16 15:25:33 -04:00
fe4e7cc5fb docs: add v0.12.3 changelog entry 2026-10-16 15:25:33 -04:00
76c01d2f3c feat(minigames): run Ordnance Disposal at 20 Hz, fix float-dust glide rest
Halve TICK_MS (100 -> 50) so every snapshot-bound surface (opponents,
explosions, drops) arrives twice as fresh, and double every hardcoded
tick-denominated constant so real-world durations stay identical:
BOMB_FUSE_TICKS 25->50, FLAME_LIFETIME_TICKS 3->6,
SUDDEN_DEATH_INTERVAL_TICKS 40->80, SPAWN_INVULNERABLE_TICKS 10->20.
TPS-derived durations (round timer, countdown, end hold) scale on their
own. Client fuse-blink and flame-fade thresholds are now derived from
the constants instead of hardcoded for 10 Hz.

Fixes a latent engine bug the old rate masked via lucky float rounding:
approach() snapped to the target only when the remaining delta was
<= step exactly, so a multi-tick glide accruing float dust (5.3 + 0.35
= 5.6499999999999995) could overshoot on the final step and park the
technician at 5.999999999999999 forever (isCellCentered accepted it,
Number.isInteger did not). approach() now tolerates step + 1e-6 and the
movement loop snaps resting positions to whole cells, restoring the
documented rest-exactly-on-center invariant at any tick rate.

Docs: registry header and minigames AGENTS.md updated to ~20 Hz; also
corrected stale rate-limit (40/s) and polling (500ms fallback) notes.
2026-10-16 15:25:24 -04:00
d0d2ea0bd2 v0.12.2 - instant charge placement, flight-safe prediction correction 2026-10-16 15:04:29 -04:00
612b6d93df docs: add v0.12.2 changelog entry 2026-10-16 15:04:25 -04:00
99e610e955 feat(minigames): tighten Ordnance Disposal feel, ghost charges and flight-safe correction
Two client-side follow-ups from the first prod playtest of prediction v2:

Reconciliation no longer position-corrects while the latest inputs are still
in flight. In that window the server legitimately trails the local sim (it is
still applying the previous direction), and the previous always-on 20% pull
dragged the sprite backwards on every turn and key release; that drag is what
made movement feel heavy even after prediction landed. Soft correction now
only runs once every sent input is acknowledged and the gap exceeds a 0.4
cell deadzone, pulling the excess; the teleport hard-snap is unchanged.

Dropping a charge now renders an optimistic ghost at the technician's cell
the same frame, mirroring every server rejection rule against the freshest
state. The ghost blocks movement like a real charge (but cannot be kicked),
burns its fuse on the local clock, and is retired per snapshot by a bomb at
its cell, by a fresh bomb owned by our seat (possibly one cell away when the
server trailed the displayed position), or by a 1.2s expiry covering server
rejections.
2026-10-16 15:04:15 -04:00
3bf9de4848 v0.12.1 - instant movement in Ordnance Disposal 2026-10-16 01:45:02 -04:00
9fff1a2d30 docs: add v0.12.1 changelog entry 2026-10-16 01:44:58 -04:00
ad512bde11 test(minigames): cover bomperator input seq guard and snapshot echo
Two registry specs: stale/out-of-order seq posts are ignored while the newest
intent wins, and each seat's last applied seq is echoed in the snapshot.
2026-10-16 01:41:41 -04:00
7935e857af feat(minigames): make Ordnance Disposal movement feel instant
The client rendered the local technician only from server round trips, so
every keypress showed up RTT + tick + easing late (roughly 250-500ms in
production, per HAR analysis of a live playtest). Two changes, shipped
together:

Direction edges now fire immediately with a monotonic seq instead of queueing
behind an in-flight POST. The registry applies only strictly newer seqs, so
out-of-order action POSTs can never resurrect a stale intent, and echoes the
last applied seq back in every snapshot for client reconciliation.

The client predicts its own seat locally with a line-level port of the
engine's movement rule (align-first turns, blocked settle, slip-to-rest,
kick-push with an optimistic overlay) and reconciles per snapshot by
replaying unacknowledged inputs forward from the server position, timed by
send time plus measured latency, instead of snapping toward a stale sample.
A soft 20%/frame correction absorbs sub-cell error; teleports and round
resets still snap.
2026-10-16 01:41:19 -04:00
535a5208da v0.12.0 - add Ordnance Disposal multiplayer drill, anchor SSE bus for dev 2026-10-16 00:43:51 -04:00
f1b26c3998 docs: add v0.12.0 changelog entry 2026-10-16 00:43:46 -04:00
bbee22a457 docs(minigames): drop em-dash from bomperator AGENTS note 2026-10-16 00:38:45 -04:00
e29af6bc29 test(minigames): add bomperator engine and registry specs
22 engine tests cover grid seeding, movement, charge fuse/detonation, chain
blasts, kick-push, round end and sudden death. 17 registry tests cover lobby,
seat lifecycle, reconnect window, dissolve below two seats, expiry sweep and XP
reward derivation.
2026-10-16 00:32:54 -04:00
bfb5cea3c1 feat(minigames): add Ordnance Disposal (bomperator) multiplayer drill
Add a 2-8 player free-for-all Bomberman-style charge-clearing drill at
/minigames/bomperator, category multiplayer. Pure engine plus a single-instance
in-memory match registry, mirroring the call-for-fire-versus split but upgraded
from turn-based to a fixed ~10 Hz tick loop.

Engine (src/lib/minigames/bomperator): seeded RNG via state.rngState/gridSeed;
grid is 15x13 with border, even/even pillars and seeded crates; classic pickups
bomb/range/speed/kick. Movement is grid-locked with sub-cell interpolation,
charges fuse about 2.5s, cross-flames stop at walls, crates are destroyed and
charges chain-detonate and kick-push. Round ends at one alive; sudden death
spawns random explosions after 150s with a draw guard.

Registry (registry.ts): one setInterval per live match started on startMatch and
cleared on complete/dissolve; globalThis-anchored map; holds seats across a
reconnect window then eliminates; below two active seats it dissolves. On a
manual end, broadcasts a bomperator-terminated event so remaining players see a
toast, then awards rewards via stats.ts (minigame:bomperator, profile group
bomperator: matchesPlayed/matchWins/roundsWon/kills/xpEarned).

Clients POST rate-limited inputs and poll fetchBomperatorMatch; the SSE bus pushes
snapshots with a guarded slow-poll fallback. Registry row ships as upcoming so the
page renders the coming-soon shell until an admin flips it active. Adds the
migration for the stats group, the minigame:bomperator event type, XP
aggregation on the profile, generated types, and real-time event wiring.
2026-10-16 00:32:52 -04:00
4c6d34e868 feat(realtime): anchor SSE client set on globalThis for cross-bundle delivery
Next.js dev bundles server packages per route, so a module-level Set forks
into one copy per bundle: a broadcast issued from a server action or registry
bundle would never reach a client subscribed through the /api/realtime route
bundle. Anchoring the client set on globalThis unifies every bundle copy within
the single dev process, the same trick blackjack/poker already use. It is a
no-op in production, which has one module instance anyway.
2026-10-16 00:32:42 -04:00
49022e6dea v0.11.2 - changelog edit modal for staff tweaks 2026-10-15 12:41:30 -04:00
f31e93766a docs: add v0.11.2 changelog entry 2026-10-15 12:41:30 -04:00
3eb8ada8f8 feat(bot): add edit modal to /changelog for last-minute copy tweaks
/changelog edit=true resolves the target entry (latest or one version,
ranges rejected) and opens a modal prefilled with its raw markdown
instead of posting. Submit re-checks staff, renders the edited text
through the existing splitForDiscord pipeline and posts the amber
embed(s). One-shot by design: CHANGELOG.md is never written back.
Entries over the 4000-char modal cap refuse edit mode. Modal path
skips deferReply (first-response rule, same as /announce); submits
route through bot/index.ts on the ptf-changelog-edit: prefix.
2026-10-15 12:34:18 -04:00
000036beda v0.11.1 - approval reset on edit, tech tree conflict protection 2026-10-15 12:12:32 -04:00
02ad121220 docs: add v0.11.1 changelog entry 2026-10-15 12:12:25 -04:00
caf77e3a6b feat(tech-tree): optimistic concurrency for the tree editor
Guard the Technologies collection with an X-PTF-If-Unmodified-At
precondition hook (update-only, header-only) that rejects stale writes
with HTTP 409 and a stale_write payload, placed before the approval
reset hook. Bulk position writes gain per-row ifUnmodifiedAt tokens in
one all-or-nothing statement; conflicts return the offending ids and
successful writes return fresh tokens so clients advance their own
versions. The lite editor shows a Version Conflict dialog (load latest
or overwrite anyway); canvas position conflicts surface as a toolbar
banner with refresh / force-overwrite plus red node rings.

Tests: new tech-tree-concurrency int spec (guard, coexistence with the
approval reset, positions preconditions), two e2e scenarios for the
dialog and the banner; existing positions spec adapted to the new
return shape.
2026-10-15 11:48:30 -04:00