1
0
Fork 0
Commit graph

1136 commits

Author SHA1 Message Date
15177b7765 v0.12.18 - fix admin document editing past the postgres 100-argument limit 2026-10-21 10:34:33 -04:00
77386eed3b docs: add v0.12.18 changelog entry 2026-10-21 10:31:18 -04:00
8174b32cd7 docs: document the postgres 100-argument lock limit and drizzle patch 2026-10-21 10:31:11 -04:00
e3926ab828 fix(db): chunk drizzle json_build_array under postgres argument cap
Postgres caps function arguments at 100. `payload_locked_documents_rels`
holds one foreign-key column per collection, and Drizzle hydrates the
locked document's polymorphic relationship with a single
`json_build_array(...)` over all of them. At 103 collections the query
throws 54023 and every admin edit view breaks while a lock row exists.

Patch drizzle-orm 0.45.2 to split the call into 100-argument groups
joined with `::jsonb || ::jsonb`, mirroring the unmerged upstream PR
drizzle-team/drizzle-orm#4495. Relations with 100 or fewer columns keep
the original code path unchanged.

Add tests/int/locked-documents-query.int.spec.ts, which creates a lock
row and reads it back at depth 1 (what getIsLocked and
handleFormStateLocking do). It fails on pristine drizzle with the exact
54023 error and passes with the patch.
2026-10-21 10:31:11 -04:00
6be14c9815 test(test-db): template database + schema-hash cache + clone primitives
Reworks the test-db module into explicit primitives: ensureTemplateDatabase
(dropped/recreated + built once per schema hash change, cached in
.cache/testdb-template.json), cloneTemplateInto, dropDatabaseIfPresent and
dropStaleWorkerDatabases. bootstrapTestDatabase() keeps its export but is
re-expressed as guarantee-template + fresh clone for the serial databases
(vitest pre-stage-2, Playwright), so repeated runs skip drizzle push
entirely. The legacy truncate+push flow survives verbatim as
bootstrapSerialDatabase for the TEST_DATABASE_URI bisect mode. Nothing may
connect to the template while clones run (loud invariant comment).
2026-10-21 10:03:33 -04:00
859f6d4310 test(int-suite): auto-accept drizzle push prompts in tests/push-schema.ts
payload's pushDevSchema() awaits prompts() whenever drizzle push reports
warnings (incl. DATA LOSS); under non-TTY stdin that await hangs forever
(2026-10-19 bootstrap hang). Inject confirmations through the single
hoisted prompts copy before getPayload boots; stdio stays inherit so all
other push output remains visible.
2026-10-21 10:03:33 -04:00
c64d56b830 v0.12.17 - superstructure interiors, bomperator prediction fixes 2026-10-21 02:15:00 -04:00
596e17e8d8 docs: add v0.12.17 changelog entry 2026-10-21 02:14:53 -04:00
1738a66e40 test: isolate locker-sync and award-automation specs from cross-file db state
Vitest 4 orders serial test files by cached durations, so adding the interior
suite reshuffled the schedule and exposed two order-dependent specs.

- arma-locker-sync: floor the apply-command scan at a beforeAll id baseline and
  assert the two enqueue tests via per-test id deltas (the pattern the echo-guard
  describe already used) instead of absolute totals that accumulate rows when
  foreign online game-servers change enqueue fan-out
- award-automation: scope every evaluateAwardRules call to this file's ruleIds,
  and track veteran/rookie USER ids separately from PROFILE ids because plans
  key on userId while makeUser returned profile ids; equality only held while
  both sequences stayed aligned
2026-10-21 02:14:43 -04:00
a01ccaa7f1 fix(minigames): keep the Bomperator estimate replay clock moving forward
Root cause of the remaining jitter, and why stride tuning never touched it.
projectServerPosition replayed every unacknowledged input, then moved its
replay clock back to that input's receive time even when it predated the
snapshot. The trailing segment (targetMs - t) then included the input's
whole age, so a keepalive still in flight inflated the estimate by up to
the 400ms re-assert cadence: a phantom lead of 1-4 cells that the reconcile
then chased toward a position the server never occupied.

Prod telemetry fits exactly: gap p50 1.0, p95 4.12, max 4.5, 22% of
snapshots easing, frameMax 38ms, remoteSnaps 0, 13 ghost rows. No hitches,
no server-side jumps, just an estimator biased by pending input age. The
bias scale with ack latency, which is why the first match looked clean
(p50 0.18) and a match with RTT spikes to 53ms did not.

- clamp the replay clock: an input whose receive time is at or before `t`
  contributes its direction only, never a rewind
- the component now calls the shared projectServerPosition instead of
  keeping an inline copy of the same replay (one implementation, one fix)
- unit tests pin both behaviors (stale input adds no travel, newer input
  still advances); harness 12 scenarios plus the two new tests green
2026-10-21 01:40:50 -04:00
b51d4bc0d0 fix(minigames): stop Bomperator prediction losing time and disagreeing on ghosts
Prod telemetry (3291 snapshots, one match): gap p50 0.18 but p95 1.22,
max 4.19 cells and 43 eases. A 4-cell gap is ~0.6s of running, so these
are events, not latency noise. Tuning the correction envelope could only
change how they were presented.

- advance prediction by real elapsed time (1s sanity cap) instead of a
  100ms slice: the engine runs on wall clock, so every main-thread hitch
  over 100ms left a permanent gap that had to be eased back. The ease
  branch keeps its own 100ms slice so a catch-up frame cannot discharge
  a whole gap at once
- release held keys when the tab hides: input is level-triggered, so a
  backgrounded tab kept the technician running server-side and then
  snapped back on return
- replay optimistic ghost charges in the server estimate too; pred saw a
  charge the estimate did not, so every unconfirmed placement read as
  divergence while it was in flight
- telemetry: per-row longest frame and ghost count, frameMax/ghostRows in
  stats, so the next playtest attributes any remaining gap directly
- harness mirror: same 1s catch-up and 100ms ease slice; 12 scenarios green
2026-10-21 01:20:13 -04:00
69a3cb92fb docs: add superstructure interior domain guide and index entry 2026-10-20 20:08:25 -04:00
151a31efab fix(interior): clear self-referential parentStructure during provisioning 2026-10-20 20:08:25 -04:00
54cbf19fdf feat(interior): route logistics deposits through the shared placement core 2026-10-20 20:08:25 -04:00
0af105e055 test(interior): harden cleanup afterAll, raise decay timeouts, and fix seed typing 2026-10-20 19:50:19 -04:00
e52cc83198 feat(interior): interiors screens, sidebar entry, and launch content seed 2026-10-20 18:33:43 -04:00
f2de7941ca fix(interior): bootstrap snapshots lazily, enforce per-room access, and cover gaps 2026-10-20 18:33:43 -04:00
d80a93c30c test(interior): e2e smoke covering enter, open, cleanup, and collect 2026-10-20 18:33:14 -04:00
68cd3cce7c feat(interior): fixture repairs, condition decay, and station blocking
completeInteriorJob restores broken fixtures on repair jobs. New decay.ts applies per-room condition loss (elapsed days x conditionPerDay x Game Rules multiplier) on the interior-tick bin, gated by interior.decayEnabled with a baseline first run that only stamps the structure clock; fixtures at or below the authored effectFloor break with new interior:fixture-broken events, floors condition at 0, and station starts fail room_damaged below the floor.

Declares blocksStation on structure-rooms fixture state: provisioning wrote it but the missing column silently stripped it, so broken doorway fixtures could never block stations. Regression test covers persistence through provisioning plus the end-to-end gate.
2026-10-20 16:17:01 -04:00
6bc295b630 feat(interior): station recipes unlock gating and flagged asset outputs
Produce starts now honor presence-based unlocks_recipe/unlocks_station effects (station marker is its authored name) and reject unknown or gated recipes with recipe_locked, locked stations with station_locked. Asset outputs credit game-structures.storedAssets behind a new Game Rules interior.assetOutputsEnabled switch (default off), prechecked before any deposit so a disabled switch parks the job untouched; storageBridge.depositAssetsToStructure merges quantities by asset without duplicate rows.
2026-10-20 16:01:35 -04:00
0b7959662a feat(interior): upgrade completion, tech/labor gates, and module bonuses
Complete-time level advance (clamped to maxLevel), open/upgrade tech and labor gates sourced from npc-staffing and technologies.researchedAt, and pure duration/output math in effects.ts applied to job durations and produce resource output.

Adds interior_job_speed and interior_output_bonus module effect types to the shared module system (additive aggregates; existing consumers unaffected) with a migration, which also closes Step 1 drift making structures_rooms_levels_effects.value nullable and adding its target column.
2026-10-20 15:44:36 -04:00
1b8c84be47 feat(interior): open-room and cleanup jobs with junk loot rolls
Open jobs consume the entry level's materials and duration, then flip the room to its destination level at completion. Cleanup runs fixed-time, decrement one junk level per run, and roll one weighted drop from the authored junk loot table onto the job for collection.

Fixes provisionInterior's inverted guard so rooms provision lazily on first entry instead of requiring an already-set provisionedAt, and adds the interior integration suite covering provisioning idempotency, access modes, start gates, cancel refund, collect refusal on full storage, sweep completion, notifications, and loot roll determinism.
2026-10-20 14:57:30 -04:00
c57fc3d23d feat(interior): add superstructure interior schema and engine core
Adds the interior authoring fields on structure blueprints, runtime interior snapshot fields on game structures, the structure-rooms and interior-jobs collections, GameRules toggles, and a Scrap resource seed.

Adds the src/lib/interior engine: access gate, room provisioning, job-start gates, structure storage bridge, job lifecycle (start, cancel, complete, collect), completion sweep, and the interior-tick bin.

Registers interior event types and the interior:job-ready notification type.
2026-10-20 14:37:13 -04:00
f62f5265fa feat(intelligence): export mission briefings to SQF
Add a briefing export dialog with a diary script and a structured text array. Convert Lexical formatting, including bold, code, underline, colors, headings, lists, and quotes, into Arma Structured Text. Scope the shared color palette to the briefing editors and render colors on the mission page.
2026-10-20 14:22:17 -04:00
3c774279aa feat(minigames): superuser developer console dock across all ten games
Adds a shared fixed-position debugging dock (Controls/State/Log tabs) gated
to dynamic superusers, mounted per minigame. Multiplayer games gain synced
server-authoritative admin commands with [dev-admin] audit logging: poker
(force fold, force street, per-viewer reveal-all, clock control, stack
adjust, force expire), blackjack (bankroll adjust, next-card injection,
dealer override, force expire), bomperator (pure applyAdminCommand: crates,
pickups, eliminate, freeze, sudden death, timer, end round; mirrored over
the arena REST path), and CFF Versus (reveal fleets, force shot outcome,
skip turn). Solo games get client-side tuning via persisted dev settings:
flappy physics sliders plus pause and invincibility, EOD layout reveal and
seeded boards, radio transcript view and timer freeze, aim trainer seed and
difficulty overrides plus hitbox overlay, OPORD answer reveal and study
window, call-for-fire target reveal, seeded grids, and free corrections.

Includes 26 new integration specs (command purity, gating, audit lines) and
a poker e2e smoke for the dock. Plan: Minigame Developer Console.
2026-10-20 12:48:27 -04:00
99d4982979 v0.12.16 - steady arena movement, powerup labels 2026-10-20 11:11:25 -04:00
e343a81c4a docs: add v0.12.16 changelog entry 2026-10-20 11:11:25 -04:00
d15beb8e35 fix(minigames): end Bomperator WS jitter with ack-sized envelope and rate-limited trims
Prod telemetry (bompDebug, 783 snapshots): ping RTT of 3-24ms shrank the
correction envelope to ~0.75 cells while the real gap noise floor sat at
p95 1.0, so 13% of snapshots trimmed and each trim closed its whole
excess in one frame - constant micro-teleports.

- size the envelope from transport RTT plus the server-side component of
  measured input-to-ack latency (tick queue + snapshot turnaround),
  which ping/pong cannot see; HTTP behavior stays near the v0.12.6 tuning
- rate-limit trims to 0.35 cells per snapshot (a run-speed glide); the
  >2.5-cell ease branch remains the fallback for genuine divergence
- harness mirror updated: maxJump now capped at 0.35 across all 12
  scenarios, prod-trace pulls 162 -> 47, zero teleports throughout
2026-10-20 02:02:00 -04:00
1883a1aabe feat(minigames): powerup name tags, centered loadout pips, prediction telemetry probe
- drawDrop now renders the powerup name on a semi-opaque plate pinned to
  the cell bottom (no bob, stays readable while the drop animates)
- own loadout pip row centered above the play area
- opt-in client telemetry behind localStorage.bompDebug='1': one row per
  reconciled snapshot (gap, envelope, correction branch, rttAvg, snapshot
  delivery cadence, remote-player snaps) plus transport kind changes,
  exposed as window.__bompDbg.stats()/.table()/.dump() to diagnose the
  reported WS jitter with data instead of guesses
2026-10-20 01:16:31 -04:00
8b7c698e96 v0.12.15 - filter routine tick events, fix fractional XP display 2026-10-20 00:23:45 -04:00
3fde91feda docs: add v0.12.15 changelog entry 2026-10-20 00:23:09 -04:00
2235d0d33d fix(xp): floor XP total so displays never render a float
The virtual profiles.progression.xp field summed awards, scoreboard
kills, and minigame/contribution xpEarned buckets without flooring,
so fractional values leaked into user-facing displays (e.g. 9,001.625
XP). Floor the total in the afterRead hook so every consumer receives
an integer, and update the profile page to show the already-resolved
xpLevel.xp instead of the raw value.
2026-10-20 00:15:50 -04:00
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