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
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
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.
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.
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.
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.
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.
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.
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.
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
- 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
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.
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.
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.
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.
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.
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.
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).
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.
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.
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.
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.
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.