1
0
Fork 0
Commit graph

1104 commits

Author SHA1 Message Date
72276b6741 v0.12.14 - filter routine tick events, skip empty tick logs 2026-10-20 00:13:13 -04:00
d4a2752239 docs: add v0.12.14 changelog entry 2026-10-20 00:12:22 -04:00
707c5f6c81 feat(event-log): hide routine tick events behind a toggle
Add a client-safe ROUTINE_EVENT_TYPES list (game:tick, economy:tick, market:auto-generate) and hide those types on /events behind an off-by-default Routine ticks switch. The dashboard always excludes them so real events fill the recent list.

Tick bins now skip no-op emissions: game tick requires shipment, construction, or production activity; market tick requires an expiry or generation; economy tick requires processed items or errors. Historical events stay in the database and remain visible via the toggle or the admin panel.
2026-10-19 20:03:51 -04:00
f3e11769d0 v0.12.13 - member-facing tech research system and tech tree 2026-10-19 17:35:10 -04:00
e478d62eb2 docs: add v0.12.13 changelog entry 2026-10-19 17:35:10 -04:00
afa79b4be4 feat(tech): member-facing tech research system and tech tree
Add a research pipeline over the existing technology tree: Research
Facility blueprint fields copied to structure instances, tech-researches/
tech-ballots/tech-ballot-votes collections, Game Rules research config,
pure rules lib (capacity, duration math, eligibility, intel-weighted
tally with tie cascade), a timestamp-derived tech-tick bin that opens,
resolves, advances and completes research with notifications, vote
casting server actions, and a read-only member-facing tech tree page at
/intelligence/tech-tree with veil blackout and dossier-style panels.

Includes migration 20261019_184409_add_tech_research_system, permission
groups, event and notification types, sidebar entry, and integration
plus e2e coverage.
2026-10-19 17:28:26 -04:00
57b6999e61 fix(base): allow admin labor headcount edits while hiring is disabled
The admin game-structures Labor Crew panel writes through setLaborHeadcount, which failed closed whenever Game Rules staffHiringEnabled was off. Back-office operators had to toggle hiring on just to adjust headcount.

setLaborHeadcount now accepts an allowWhenHiringDisabled option. Only the admin API route passes it; player-facing server actions keep the gate.
2026-10-19 14:25:55 -04:00
805f6dee84 v0.12.12 - bake the arena origin into the client build 2026-10-19 14:06:04 -04:00
306952fbaf docs: add v0.12.12 changelog entry 2026-10-19 14:06:04 -04:00
2b5f274886 fix(docker): pass NEXT_PUBLIC_ARENA_URL into the production build
Coolify marks this variable build-time and passes it as a build arg, but
the builder stage never declared it, so `next build` saw an empty value
and inlined nothing. The client transport reads
`process.env.NEXT_PUBLIC_ARENA_URL` with dot access, so an empty build
value silently left every install on the HTTP fallback path.

Declare the arg and forward it through ENV before the build, the same way
the GIT_* build args are handled.
2026-10-19 14:05:43 -04:00
53387c957f v0.12.11 - restore Compose actions, clamp arena tick catch-up 2026-10-19 13:35:01 -04:00
67c0e4e94a docs: add v0.12.11 changelog entry 2026-10-19 13:34:59 -04:00
f5166c80b6 fix(ai-compose): keep named action instructions in the system prompt
The plugin carries a named action's whole instruction in the system
prompt (Expand, Simplify, Rephrase, Proofread, Summarize, Tone,
Translate), while Compose on richText wraps the field's own system prompt
in buildRichTextSystem, which adds rules demanding lexical JSON and a
blog layout. buildComposeSystem discarded the incoming system prompt and
kept only the block-placeholder paragraph, so every named action reached
the model without its instruction and richText Compose lost the field's
own prompt too.

Keep the caller's prompt and strip only the contradiction: cut at the
plugin's RULES marker, re-append the extracted block-placeholder
paragraph, drop the JSON and layout lines as a backstop in case that
marker is reworded, then append AI_OUTPUT_RULES. The fieldType argument
is no longer needed.

The tests embed the plugin's real Expand, Simplify and Rephrase systems
and assert each instruction arrives intact with the rules appended.
2026-10-19 13:34:37 -04:00
2713a786e4 fix(arena): clamp early-timer catch-up so the tick loop holds 20Hz
Node timers can fire a sub-millisecond early relative to
performance.now(); Math.floor((now - scheduledFor) / TICK_MS) then yields
-1, and (1 + extra) shaved a whole tick off the next schedule. The
resulting delay-0 re-fire doubled the sim rate (~33-40Hz observed on the
live arena during integration testing; local repro confirmed it is the
scheduler, not the host).

Clamp extra to [0, TICK_CATCHUP_CAP] and add a wall-clock regression test
that pins driftReport ticksRun to ~20/s (fails at the doubled rate).
2026-10-19 13:12:20 -04:00
c0167ac44b v0.12.10 - live Ordnance Disposal match sync, consistent field generation prompts 2026-10-19 13:05:33 -04:00
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