1
0
Fork 0
Commit graph

1281 commits

Author SHA1 Message Date
99ef9ec73c fix(mission-ratings): block mission authors from rating their own mission
Authors can no longer rate a mission they ran or planned. The rating action, the availability check and the server submit all enforce it, and the UI explains why. The mission-ratings fixtures now use a dedicated author so the rater accounts stay non-authors.
2026-11-01 15:21:53 -05:00
e9bc929213 feat(bot): post modlist reminder 8 hours before scheduled operations
Adds reconcileModlistBuffer, which resends the modlist-updated message once per Scheduled mission with a modlist attached, when its start is within DISCORD_MODLIST_BUFFER_HOURS (default 8). Tracked by the new discordModlistBufferSentAt marker, so it is independent of the roll-call modlist sync. Also fixes type errors in modlist-file-access.int.spec.ts.
2026-11-01 15:20:02 -05:00
a6709e4cf3 fix(modlists): allow anonymous link download of preset files
The file-serving route (/api/mod-lists/file/<name>) runs the collection
read access with isReadingStaticFile: true, but mod-lists required the
mod-lists:read permission, so anyone clicking a shared download link got
403 until they signed in. Gate the read access on isReadingStaticFile: the
file-serving path serves the preset to anyone with the link, while REST and
admin-panel reads keep the mod-lists:read gate. Documented in
src/collections/AGENTS.md and covered by an integration test.
2026-10-31 15:01:29 -04:00
948109e362 v0.14.0 - add mission ratings system, post-op survey, Discord prompt, rating XP 2026-10-31 10:28:31 -04:00
1f46275926 chore(mission-ratings): sanitize em-dash placeholders in overview + discord embed 2026-10-31 10:28:28 -04:00
b207adc4dc docs: add v0.14.0 changelog entry (mission ratings) 2026-10-31 10:28:11 -04:00
8faa45a954 test(mission-ratings): eligibility, aggregate math, threshold, XP
Covers window classification, yes-RSVP/prior-rating gating, idempotent write,
factor validation, per-factor/distribution/overall-average aggregation,
anonymity threshold, custom-factor aggregation, numeric myValues, XP grant +
per-user idempotency, and permission gating (deny without / allow with read).
2026-10-31 10:25:37 -04:00
afe47ccd87 feat(mission-ratings): add collection, mission field, and discord rating marker
- add_mission_ratings: mission-ratings collection + enum values + missions
  missionRating.customFactors field
- add_mission_rating_sent_at_marker: Missions.discordRatingSentAt one-shot flag
- register both in migrations/index.ts
2026-10-31 10:25:33 -04:00
ee622ff6dd feat(mission-ratings): UI, page wiring, discord embed + button handler
- MissionRating.tsx star form + overview renderer, wired into missions/[id]
- Discord rating embed + ptf-rate action row, posted on mission Completed
- interactionCreate ptf-rate handler replies ephemeral with mission URL
2026-10-31 10:25:28 -04:00
f41a5bd5e4 feat(mission-ratings): service, contribution rule, server action
- service: isRatingAvailable, submitMissionRating, getMissionRatingState,
  getMissionRatingAggregate (per-factor/distribution/overall-average math,
  anonymity threshold, custom-factor support)
- contributions: mission-rating-completion rule (50 instant XP)
- server action submitMissionRating with permission + contribution XP award
2026-10-31 10:25:24 -04:00
1db0aabb7c feat(mission-ratings): add permissions, collection, mission field, config, generated types
- permissions: mission-ratings group + ALL_PERMISSION_VALUES, granted in seedRoles
- collection: src/collections/intelligence/MissionRatings.ts (field-gated, Intelligence group)
- Missions: missionRating.customFactors group (array of {label})
- payload.config: register MissionRatings + requireAdminPageAccess
- regenerate payload-types
2026-10-31 10:24:04 -04:00
35185600b4 v0.13.3 - drop stored evaluation kind, derive rating direction from ranks 2026-10-31 03:34:13 -04:00
43446d2a40 docs: add v0.13.3 changelog entry 2026-10-31 03:32:44 -04:00
66666547ad refactor(evaluations): drop stored kind, derive rating direction from ranks 2026-10-31 03:26:51 -04:00
fee3377474 v0.13.2 - label subordinate ratings on profiles 2026-10-31 02:23:58 -04:00
f1a246c945 docs: add v0.13.2 changelog entry 2026-10-31 02:23:33 -04:00
502eef5228 fix(profile): label downward leadership ratings as rate subordinate
Seniors viewing a junior's profile saw 'Rate leadership', but that rating is
stored as a subordinate review. The section now passes the rank direction to
the dialog, which labels the trigger, title, copy and toast accordingly.
2026-10-31 02:23:29 -04:00
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