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.
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
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.
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.
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.
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.
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).
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).
- 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
/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.
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.
Add resetApprovalStatusOnEdit(), a collection beforeChange hook factory: when a
non-superuser updates a document whose stored approvalStatus is approved or
revision_requested, the status is rewritten to in_progress so the edit goes
through review again. Creates, superusers (system:admin-access), and system
writes with no user (catalog imports, seeds) are exempt, and an explicit
in_progress/ready_for_review in the edit is honored.
Wired into Technologies, Assets, Resources, Vehicles, and Structures.
Structures also moves from the legacy isDeveloper filterOptions gate to
approvalStatusFieldAccess("structures"), matching the other four collections
and removing the hard ValidationError when saving an already-approved structure.
Tests: 12 cases in tests/int/division-admin-access.int.spec.ts.
Add a "phasingOut" minigame status and an `estimatedRemovalDate` field so a
game can be announced as leaving soon while staying fully playable and keeping
scoring periods (unlike retired games). Visibility is the only difference:
- Sidebar badge + tooltip (amber "Phasing out", countdown to removal) in
NavMinigames, via new phasingOutTooltip in countdown.ts.
- In-game banner (PhasingOutBanner) on all 9 game pages, wired from
getMinigameReleaseState (added the fetch to call-for-fire, which lacked it).
- registry.ts status union + field; loadRegistry.ts maps the field;
config status select + estimatedRemovalDate date field added.
- Migration adds the enum value and column (idempotent); types + db schema
regenerated.
Adds tests for visibility, round-trip, and period scoring; updates the
minigames domain guide.
Event nodes gain a 'Post this event to the Discord NPC dispatch channel'
checkbox. The flag rides emit() onto game_event_logs (discordRequested +
announcement bookkeeping columns, migration add_event_log_discord_fields),
and a new bot poller stamps pending rows into an amber NPC Dispatch embed
with relative-time mention and a link back to the source contact.
Bot delivery itself is unverifiable locally (no Discord token or channel id
in dev); the DB-side contract is covered by an integration test and a live
probe walk confirmed discord_requested persists end to end.
DialogueText gains line-based block lists: consecutive lines starting
with - / * render as bullets, 1. / 2) as ordered lists, with item
content running through the inline parser so markup nests inside items.
Node editing swaps plain textareas for a shared MarkupEditor (line,
narration, lead-in, closing, tooltip, lock message, event message):
a formatting toolbar (bold, italic, code, color, link, bullet and
numbered list), a right-click menu wrapping the selection in tokens,
and a live DialogueText preview on the long-form fields. Storage stays
the plain custom-markup string; the editor only wraps selections.
Conditions become a discriminated union: the existing flag leaf plus a
single-level group combining leaves with AND / OR / NOR. The evaluator
recurses one level, and every flat-assuming site (choice gating, graph
validation, editor, canvas previews) is group-aware; DB entry gates stay
flat by design. The node editor gains a shared condition builder with a
combinator dropdown and repeatable rows for both branch nodes and gated
choices.
Display strings also gain ternaries: {{ key ? yes : no }}, {{ !key ? .. }},
and numeric compares like {{ rep >= 5 ? .. }}. A brace-depth scanner
rewrites ternaries over bounded passes so branches may nest flag tokens
and even nested ternaries, then plain interpolation runs its single
never-rescanned pass. Ternary keys join collectNodeTokens so the server
reads exactly the flags a node needs.
Nodes can carry pointers to media docs (transcripts, sealed orders,
images). Authors upload from the node editor (gated on
npc-dialogues:update); the runtime resolves ids to file URLs server-side
and players open them in a dossier-styled viewer modal with download
and new-tab escape hatches. Deleted media resolve to nothing instead of
dead chips.
The per-browser localStorage tracking reset on every new device and kept
re-badging whole conversations whenever a GM edited the flowchart (hash
change), which players read as "nothing I read is remembered". Read
progress now lives in a npc-dialogue-states collection: one row per
(user, dialogue, node) with a unique index, so a node badges NEW exactly
once per player and GM edits never re-flag content they already saw.
- New collection NpcDialogueStates (own-doc access, staff-visible admin
view) plus migration add_npc_dialogue_states.
- lib/npc-dialogue/states.ts: listSeenNodeIds for the page and an
idempotent markNodeRead; exposed via the markNpcDialogueNodeRead
server action, called fire-and-forget as nodes type in.
- The contacts page seeds initialSeenNodeIds into NpcConversation; the
component keeps an optimistic local set and no longer touches
localStorage. seen.ts and its tests are removed.
Verified live: fresh account shows NEW on all choices, reading the
"Who are you?" branch and reloading drops that badge while unread
branches keep theirs; npc_dialogue_states holds exactly the traversed
nodes. Interpolation int suite green (30/30).
CHANGELOG.md is newest-first, but resolveChangelogRange treated its two
range ends as a closed min/max index pair. A range with only a starting
version ("0.6.0..") therefore resolved to the oldest entries through
0.6.0 instead of 0.6.0 and everything newer, so the release-notes command
announced the wrong set of releases.
Resolve each open end toward the direction it opens: "X.." runs from the
newest entry down to X, "..X" runs from X to the oldest entry, and a
closed range still normalizes to min/max. Adds a regression test against
the shipped file.
- award-rules collection: metric/operator/value threshold rules linked to
awards, with auto-retire-lower-tiers and once-per-series flags, active
toggle, and award-rules:* permissions
- src/lib/awards/metrics.ts: pure metric resolvers (years of service from
dossier.enlistmentDate with account-age fallback, account age, missions
attended, total XP) plus operator comparison, unit tested
- evaluateAwardRules() sweeper: idempotent, dry-run capable; grants land as
profile rows with awardedBy null so the existing afterChange hook sends
award:granted notifications; upgrades replace the lower series tier in
place preserving the original date; emits award:rule-granted events
- award-tick payload bin for daily evaluation + admin Award Automation
view with Evaluate now (dry run) preview and Apply grants
- seedYearsOfServiceRules.ts wires the four years-of-service ribbons into
one advancement series and creates their rules (idempotent, dev seeded)
- migration add_award_rules_automation (table + awards event target enum)
- New Journals collection (Chronicle group): title, Lexical body, status
draft/published, optional in-world date and mission link; authors read,
edit, and delete their own entries at any status while every logged-in
user reads published ones; journals:* staff permissions bypass ownership
and gate the admin page (registered in the permission registry)
- /journals list with compose dialog and /journals/[id] reader reusing the
Chronicle typography; edit/delete controls for authors and staff; drafts
carry the DraftBadge and stay invisible to everyone but their author
- Server actions create/update/delete with ownership checks, publish-time
journal:created and journal:deleted feed events (journals added to the
GameEventLogs target collection enum via migration)
- Sidebar entry under Chronicle, command palette destination, admin panel
icon; excerpt extractor as a pure module (src/lib/journals/excerpt.ts)
- Access-control integration spec covers draft privacy, publish visibility,
non-author write blocking, and staff override (5 tests)
- normalizeSidebarOrder moves pinned sections (Platform) to the front, so
even hand-crafted stored orders cannot displace it; enforced server-side
in updateSidebarOrder via the same helper
- Customize mode renders Platform statically with a pin marker instead of
a drag grip; only the remaining sections are sortable
- Spec updated: user order preserved after the pinned head, new pinning test
- preferences.display.sidebarOrder json field on Users + named migration
add_sidebar_order_preference + regenerated types
- New pure helper src/lib/sidebar/order.ts (section ids, labels, default
order, normalizeSidebarOrder) modeled on lib/dashboard/layout.ts, with
tests/int/sidebar-order.int.spec.ts covering fallback/dupes/missing ids
- AppSidebar renders sections from the normalized order; feature-flagged-off
sections skip their slot and keep stored positions
- Customize mode: dnd-kit sortable grips on group headers, save-on-drop via
new updateSidebarOrder action, Reset clears the preference, Done exits;
hidden while the sidebar is collapsed
- updateSidebarOrder sanitizes server-side and rewrites full preferences
- Fix sibling clobbering: saveDashboardLayout now preserves sidebarOrder,
and updatePreferences now preserves both sidebarOrder and dashboard.layout
Completes the terminology pass: the "How to place" help block and the
engine's user-facing error strings ("Missing structure", "Structures cannot
overlap", "Placement is closed", "The opponent has not placed their
structures") now match the place/structure/target vocabulary used elsewhere
in the duel. Also splits a comment that had been merged onto the scoreOf
declaration. Strings only; no behavior change.
The L now pivots on its elbow (corner) cell instead of being re-laid-out in
its bounding box, so rotating keeps that one cell in place instead of
shifting the whole piece. Orientation 0 is the L look with the elbow at the
bottom-left and arms up and to the right.
Cells are the anchor plus two arm vectors rotated in quarter-turns, so the
anchor is always occupied. The editor recovers a stored emplacement's
(anchor, rotation) by matching its cells against every candidate, and the
engine test asserts the anchor cell is present in all four orientations.
The Ammo Depot is now a 3-cell L (a 2x2 box minus one corner) instead of a
2-cell line. Emplacement orientation becomes quarter-turns (0-3) so the L
can turn through all four; lines still use 0/1, the square ignores it.
The editor seeds an emplacement's rotation by matching its stored cells
against each orientation, the rotate toggle shows "Rotate 90°" for the L,
and the engine/rotation tests cover the four L orientations.