1
0
Fork 0
Commit graph

1164 commits

Author SHA1 Message Date
2f81cc9ede v0.13.1 - add extraction review, vehicle cargo blacklist, brass ribbon devices 2026-10-27 02:16:03 -04:00
80f71dc917 fix(map-objectives): read Playwright request failure via errorText 2026-10-27 02:13:44 -04:00
3bef63af33 feat(map-objectives): superuser-authored strategic objectives on mission maps
Add a superuser-authored objective layer (defend, assault, secure, etc.)
shown as labelled map markers on both the world map and mission planning
map, with per-layer toggles on the planning map.

- collection: MapObjectives (map_objectives table, enums, FKs)
- lib: objectives service + objectiveTypes + permissions + event emit
- actions/api: create/update/delete objectives server actions
- UI: feature-layer toggles, objective picker dialog, world/plan markers,
  SQF export, dossier dialog integration
- generated: regenerate payload schema + types for map_objectives
- tests: 10 integration specs + e2e spec
- docs: CHANGELOG, map-system, AGENTS guides
2026-10-27 02:12:31 -04:00
245e70f3f2 feat(awards): brass-emboss ribbon devices, swap arrow for valor V 2026-10-27 01:47:10 -04:00
7430251adf feat(awards): render ribbon devices as vectors with tier-driven auto-layout
Introduce RibbonArt, a single shared SVG renderer used by both the production viewer and admin/studio preview so they can no longer diverge. Devices are now vector glyphs (star/oak leaf/campaign clasp/arrow up) instead of Unicode text, laid out as one centered cluster that shrinks to fit. Device count derives from advancement tier using the service-star convention (tier N shows N-1, cap 6; bare ribbon at tier 1 or for non-tiered awards). Legacy per-device x/y positions are stored but ignored, so no schema change. Designers add/remove/reorder device types and preview tiers.
2026-10-26 22:21:10 -04:00
f32afc6421 feat(logistics): restyle vehicle catalog cards in tactical dossier style
VehicleCard gains classification strip, corner brackets, squared corners, darkened cover imagery, faint grid texture and a permanent readout footer (matching CampaignCard). Fixes pre-existing defects: description rendered twice, category colors disagreed with the detail page, and stat accessors read nonexistent nested fields hidden by an 'as any' cast (now typed against Vehicle). Category color/label maps unified into src/lib/vehicles/categories.ts shared by card and detail pages.
2026-10-26 22:20:54 -04:00
acf47a75ea feat(operations): gate logistics extractions behind an officer review screen
Logistics operation-extraction effects now park as pending_action instead of auto-settling. Officers visit Operations > Extractions to keep, scrap, or expel each line; only kept lines deposit into HQ. A capacity failure leaves the effect retryable (pending_action) so a full HQ can free space and re-resolve. Adds resolveLogisticsExtraction/listPendingExtractions actions + ExtractionReview UI + tests.
2026-10-26 22:20:14 -04:00
40b074a693 feat(vehicles): add per-vehicle disallowed-cargo blacklist enforced at shipment
Vehicles gain a virtual-block disallowedCargo array (asset/vehicle/resource item + optional amount cap, 0 forbids outright). createShipment consults findDisallowedCargo() before deducting any origin stock and rejects matching cargo lines cleanly. Includes Payload migration + 7 integration tests.
2026-10-26 22:17:21 -04:00
02ef9f4954 feat(bot): add staff-only /debug command for previewing and reposting bot messages 2026-10-26 18:07:05 -04:00
6263730d9c refactor(bot): export render and send helpers for debug reuse 2026-10-26 18:07:05 -04:00
282b313cd5 fix(modlists): send modlist files as downloads instead of inline views 2026-10-26 18:07:05 -04:00
134c403b38 chore: regenerate db-schema (syncs payload-generated-schema.ts to current DB) 2026-10-26 03:39:40 -04:00
1fdb6bf872 feat(vehicles): add 'static' and 'drone' vehicle categories 2026-10-26 03:39:38 -04:00
adbfcb0fd7 v0.13.0 - add rank-based leadership evaluations 2026-10-25 21:39:49 -04:00
c5bd74f297 chore(locker): commit pending stock handling refinements 2026-10-25 21:23:40 -04:00
70b484ad31 docs: add v0.13.0 changelog entry 2026-10-25 21:22:01 -04:00
977f841056 feat(evaluations): gate leadership ratings by rank instead of squad assignments
Eligibility now requires a strict rank gap plus a yes-RSVP from at least
one side of the pair on an evaluable mission. Junior rates senior writes
leader-direct (feeds the anonymous aggregate); senior rates junior writes
subordinate; leader-indirect stays readable for legacy rows only.

- New src/lib/evaluations/ranks.ts ladder helpers shared by all call sites
- Profile page: eligible missions union viewer+subject attendance, dialog
  hidden without a rank gap, subordinate line visible to higher ranks
- Bot and in-app reminder planners pair co-attendees by rank, not squads
- isDirectLeaderOf/isAnyLeader removed; no schema change or migration
2026-10-25 02:53:49 -04:00
633853589f feat(arma): dedupe vehicle templates by name and mod with cleanup CLI 2026-10-22 13:18:11 -04:00
59460111fd chore(minigames): log Bomperator transport kind and raw ping samples in debug stats
The rtt fields in __bompDbg.stats() are the smoothed EMA (seeded at 100ms,
one WS sample per 2s), so short playtests read as 35ms+ even on a 5ms path.
Record every raw RTT sample and the active transport (logged on mount, not
only on fallback) so the next playtest shows the real numbers.
2026-10-21 20:50:40 -04:00
54efc9453f Revert "feat(minigames): make Bomperator own-seat movement server-authoritative"
This reverts commit 98d5ec63f8.
2026-10-21 20:25:38 -04:00
88f060cead feat(sidebar): move Contribute (Voiceover) out of account popover into sidebar above Minigames 2026-10-21 19:56:40 -04:00
cfbdcb6a22 v0.12.19 - bomperator movement sync, faster integration suite 2026-10-21 19:46:44 -04:00
b2a8e03be1 docs: add v0.12.19 changelog entry 2026-10-21 19:46:44 -04:00
e828f50516 test(vitest): honor KEEP_TEST_DBS=0 as force-drop escape hatch
Plan wording kept clones on failure unless KEEP_TEST_DBS=0; teardown now
implements both ends explicitly (=1 always keep, =0 always drop, default
keep-on-failure). Verified with a deliberately failing spec both ways.
2026-10-21 13:04:15 -04:00
507d0a9e5f docs: rewrite test-database lifecycle section for template/clone workers
Stage 4: document template + per-fork clones, the env flag matrix
(TEST_DATABASE_URI legacy serial bisect, TEST_DB_HARD_RESET, KEEP_TEST_DBS,
VITEST_MAX_FORKS, TEST_PG_POOL_MAX), jsdom-opt-in docblocks, and the
Vitest 4 returned-teardown contract.
2026-10-21 12:54:30 -04:00
938da9bf86 test(vitest): isolate:false shared forks with per-pid template clones + memoized payload boot
Stage 3 of the int-suite speedup (gate G2 showed Vitest 4's pool scheduler
only reuses worker processes between isolate:false tasks, so per-file fork
spawning made clone+boot costs unavoidable at stage 2):

- config: workers branch runs pool=forks with isolate:false, cap 8 via
  VITEST_MAX_FORKS, node default env (jsdom docblocks on DOM specs),
  failure-marker reporter, and idempotent setupFiles chain
- vitest-worker-setup: one template clone PER FORK PROCESS named by pid
  (VITEST_WORKER_ID churns per task, which silently re-cloned per file);
  DATABASE_URI repoint + TEST_PG_POOL_MAX=8 (measured hook deadlocks at 3)
- vitest.setup: once-per-process serial test URI markers; afterEach
  useRealTimers guard (restoreAllMocks omitted: it resurrects vi.mock
  module factories mid-file); logging absorber for fire-and-forget event
  writes that reject after their spec's cleanup deleted fixture users
- helpers/get-test-payload.ts: memoized Payload boot shared across files
  in a fork; codemod converted all 91 self-booting specs mechanically
- pinned opt-outs (own boot + comments): game-structures-labor-route,
  mission-reminder, notification-inbox-scope (jwtSign writes leak into
  the shared instance's auth state across files)
- promotion-nominations: create the superuser before its rank ladder so
  the Users-hook Recruit rank gets leading orderable tokens (its
  top-of-ladder guard needs Col to remain ladder-max on fresh clones);
  operation-economy: itemType-scope the market-state assertion (asset
  and resource ids collide as bare integers under per-fork databases)

Gate G3: 5 consecutive full green runs (149/149 files), warm wall 53-65s
vs 598s baseline (~10x), zero clone residue after green runs. Vitest 4
note: globalTeardown config no longer exists; teardown returns from
globalSetup.
2026-10-21 12:54:30 -04:00
98d5ec63f8 feat(minigames): make Bomperator own-seat movement server-authoritative
Four prediction generations shipped and production still disagreed with the
server: v0.12.16's ack-sized envelope, wall-clock catch-up with a 1s cap,
ghost parity in both sims, and a forward-only replay clock. The last playtest
(n=645, rtt 41-69ms) still read gapP50 1.26, gapP95 7.05, 30% of snapshots
easing, with frameMax 17ms and zero server-side jumps. A second simulation
cannot be kept in agreement with the server by tuning.

Remove the second simulation instead:

- own seat renders the server's snapshot position through the same one-pole
  ease as remote players (shorter constant, 0.6 vs 0.4 per frame, because
  easing reads as input lag), snapping only past 1.5 cells (respawn/reset)
- drop the pending ledger, ack drain, input-to-ack EMA, envelope, trim and
  ease correction, optimistic kick overlay, and the local movement copy
- drop ghosts stay as visual feedback, placed at the server's own copy of our
  cell so they align with where the charge will appear
- telemetry now reports the ease's own-seat trail, own/remote snaps, snapshot
  cadence, frame max, ghost rows and RTT
- delete bomperator/prediction.ts, its offline harness and the prod-RTT
  fixture: they covered a mechanism that no longer exists

Input stays level-triggered on the monotonic seq + 400ms keepalive path. Cost
is one tick of queue (~25ms) plus one-way latency, the explicit trade for a
render that cannot diverge from the server.

tsc clean; bomperator-registry 19/19.
2026-10-21 11:42:32 -04:00
cc8a911502 test(vitest): parallel forks with per-worker database clones
Stage 2 of the int-suite speedup: pool=forks with fileParallelism and a
default cap of 8 (VITEST_MAX_FORKS), each fork cloning the template into
ptf_*_test_w<ID> via tests/vitest-worker-setup.ts; environment defaults
to node with jsdom opt-in docblocks on the six DOM-consuming specs; a
tiny reporter writes a failure marker so post-run cleanup keeps clones
after red runs (KEEP_TEST_DBS=1 forces keeping); pg pools cap at
TEST_PG_POOL_MAX=3 per boot in workers mode. Legacy serial mode stays
reachable by setting TEST_DATABASE_URI.

Notes from the gate G2 runs (Vitest 4.0.16): globalTeardown config was
removed in Vitest 4 entirely - cleanup now returns from globalSetup. The
pool scheduler only reuses worker processes when isolate:false, so this
per-file-fork stage lands short of the wall-time target and is expected
to be superseded by the gated isolate:false stage. Gate G2 warm serial
equivalent stays green via TEST_DATABASE_URI bisect mode.
2026-10-21 10:41:57 -04:00
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