Head-to-head artillery duel in a new "multiplayer" registry category
(out of periods). Each operator hides a fire-base fleet on a 10x10 grid,
then takes turns calling fire: the first mission is a grid designation,
every later shot adjusts from that operator's last impact using the
single-player range/deflection controls. First to reduce every enemy
emplacement wins; a cap decides on emplacements then cells.
Pure engine in src/lib/minigames/call-for-fire-versus (engine, views,
types, constants) is client-safe and unit-tested. The server-only
registry mirrors the blackjack table pattern (globalThis-anchored Map,
lobby, per-turn timeout, expiry sweep, single-instance only); its views
are built per viewer so the opponent's fleet layout never leaves the
server. The client polls the match snapshot (the in-memory SSE bus is
unreliable across dev module copies). Rewards on completion update the
callForFireVersus profile group, pay XP and chips, and emit
minigame:call-for-fire-versus.
Wires the game into the registry (new multiplayer category + enum
migration), the sidebar grouping, the command palette, and the profile
XP aggregation. The registry row seed is split into its own migration
because Postgres forbids using a freshly added enum value in the same
transaction.
Verified: 21 new tests (engine + registry) plus the wider minigame suite
pass; tsc clean; a live two-player award run confirmed XP, chips, and
the event.
- Optional `estimatedReleaseDate` (date and time) on the minigames registry,
with a named migration and regenerated types.
- Sidebar: an `upcoming` game renders greyed out and non-interactive, with a
tooltip carrying the estimate and a live countdown. It is a hoverable row
rather than a disabled menu item, because a disabled Radix item sets
`pointer-events: none` and would swallow the tooltip.
- Page gate: each minigame page checks its registry status and renders
`MinigameComingSoon` instead of the arena while the game is upcoming, so a
typed URL cannot reach unfinished gameplay. The date is display only: the
game goes live when an admin flips `status` to active.
- Leaderboards exclude upcoming games, so they get neither a tab nor a board.
- Pure `countdown.ts` formatter plus a client ticker that computes the
remaining time only after mount, avoiding an SSR hydration mismatch.
Note: `registry.ts`, `payload-types.ts` and `migrations/index.ts` also carry
the Call for Fire registry row and its generated types. That feature was
committed as 6d6a5fb and announced a separate commit for those files; they are
included here because they are entangled with these edits in the same files.
Tests: pure countdown unit tests, registry/gate/leaderboard integration tests,
and an e2e that seeds an upcoming row, hovers the disabled sidebar entry to
assert the tooltip, and checks the coming-soon gate.
Adds the callForFire row to BUILTIN_MINIGAMES (core, period-scored,
order 6; poker/blackjack shift to 7/8), adds it to CORE_MINIGAME_KEYS
period-scoring fallback, and maps the key to the callForFire profile
group. Regenerates payload-types and the generated db schema, and
registers the add_call_for_fire_minigame migration.
Bracket hidden artillery targets across patrol/checkpoint/compound
difficulties. Pure rules in src/lib/minigames/call-for-fire.ts (compass
bearing observer reports, ADD/DROP + RIGHT/LEFT corrections, scoring,
distance-to-target accuracy, injected rng) with a 23-case spec.
Wires the game into the minigame ecosystem: submit action validates the
run, updates the profile callForFire group, pays out XP and chips, emits
minigame:call-for-fire, and records the period ledger entry (accuracy is
distance-to-target on a win, null on a loss). Adds the game page with
period standings and an all-time board, a command palette entry, the
Target icon, and the profiles XP aggregation.
The registry row and regenerated payload types land with the minigame
registry changes in a separate commit.
Phase 8 of the minigame periods feature:
- e2e smoke: the unified leaderboards page shows the period boards, the Core
game tabs and the achievements section; switching to All-Time reveals the
cardtable games; a game page shows its anchored period standings card.
(Passes with the bundled Chromium via E2E_BROWSER_PATH; Vivaldi crashes under
automation, as the root guide warns.)
- Integration coverage already added alongside each phase: entry recording,
the close pipeline and awards, month/year windows, the registry, the read
model and the in-app notifications, plus a pure bot renderer test.
- Document the periods, achievements and registry invariants in the minigames
AGENTS guide.
Phase 7 of the minigame periods feature:
- New admin component `PeriodCloseControl` renders above the minigame-periods
list: it shows the recent periods with their status and a Close now / Reopen
button that drives POST /api/minigame-periods/close (gated on
minigame-periods:close; a 403 is shown inline rather than swallowed).
- Registered via `admin.components.beforeListTable` and the import map
regenerated.
Registry CRUD and the period/entry/achievement review lists already exist as
permission-gated admin collection views, so this was the only missing surface.
Verified end to end in the running admin panel: an open period closed, its
status flipped and closedAt stamped, then reopened.
Phase 6 of the minigame periods feature:
- Muteable `minigame:achievement` notification type; the close pipeline now
notifies each winner in-app, but only when the achievement row is newly
written, so a re-run or a concurrent closer never double-sends.
- New bot service `achievementAnnouncements` polls achievements with no
announcedAt, groups them by window, posts ONE embed per window to
DISCORD_ANNOUNCE_CHANNEL_ID, then stamps announcedAt + discordMessageId.
A failed post leaves the rows unannounced so the next tick retries them.
- Pure, testable renderer (bot/lib/achievementRender.ts) for grouping and the
embed shape; window labels reuse the period/calendar helpers.
- Register the service in the bot registry and add
DISCORD_ACHIEVEMENT_POLL_MS (default 60s).
- Tests: renderer grouping/ordering/fallbacks and the in-app notification
path (including idempotency).
Phase 5 of the minigame periods feature:
- Read model (lib/minigames/periods/standings.ts) that shapes period boards
from the ledger (rank, placement points, names) and All-Time boards from the
untouched profile aggregates into one row type.
- GET /api/minigames/leaderboards: ?period=current|<id>|all-time, returning
the period, the period list, the boards and the achievements honor roll.
- New /minigames/leaderboards page: period selector (current, every past
period, All-Time), per-game tabs, and the achievements honor roll. Core-only
in period mode; every registered game in All-Time.
- Shared client pieces: useLeaderboards hook, StandingsTable,
PeriodStandingsCard (period by default, All-Time toggle) and
AchievementsHonorRoll.
- Each Core game page gains an "Anchored period standings" card so the period
board is visible on the game itself; its existing all-time board and
mode/difficulty selectors are untouched, and it links to the full page.
(Plan said replace the inline board; keeping it preserves the per-mode
selectors, so the period board is added instead. Easy to swap if you prefer.)
- Ledger fetch helper extracted to lib/minigames/periods/ledger.ts.
- Integration test for the period boards, the All-Time path and the honor roll.
Phase 4 of the minigame periods feature:
- Server registry loader (lib/minigames/loadRegistry.ts) reads the
minigames collection and falls back to the built-in seven when it is empty
or unreadable, so the nav and boards never render blank.
- The sidebar minigames dropdown now renders from the registry (Core and
Cardtable groups, retired games hidden, registry order), with lucide icons
resolved from the icon-name string through a client icon map and a
safe fallback.
- Period scoring is registry-driven: the close pipeline uses core games with
countsForPeriods instead of a hardcoded list. A retired game simply stops
accruing entries and drops out of the next period while its history stays.
- Integration tests for the fallback, ordering, retirement filtering and the
non-scoring-game exclusion; the older minigame specs now wipe the registry
too so files stay order-independent.
Phase 3 of the minigame periods feature:
- Record each ledger row's own instant (`occurredAt`, server clock at
submit) so calendar windows score runs that actually happened in them.
Backfilled from createdAt for existing rows.
- Pure UTC calendar windows (lib/minigames/periods/calendar.ts): completed
month and year windows, with the first window of each kind partial because
it begins at the anchor, and nothing crowned until the window has ended.
- Close pipeline extended: after the period sweep it crowns Player of the
Month and Player of the Year for every completed window, scored with the
same placement ladder as the period champion. Idempotent like the period
close (achievement unique key plus an existence check).
- period-tick logs the crowned windows; integration tests cover window
enumeration, both crowns and idempotency.
Phase 2 of the minigame periods feature:
- Pure board + award math (lib/minigames/periods/boards.ts): best-performer
boards from the ledger, a fixed top-N placement ladder summed across the
five Core boards, and the five period awards (Period Champion, Diligence,
Dedication, Precision, Most Improved) with the locked tie-break (raw
period score, then earliest submission).
- Close pipeline (lib/minigames/periods/lifecycle.ts): computes boards for a
period, writes its achievement rows, and marks it closed. Idempotent: the
status is re-checked before committing and the achievements unique key
makes a duplicate close insert nothing, so the tick and the admin override
cannot double-grant.
- Shared rules resolver (lib/minigames/periods/rules.ts), now used by both
the entry recorder and the close pipeline.
- New period-tick bin (registered in payload.config.ts) closes every due
period and materializes the current one, mirroring the mission tick.
- Admin close/reopen route (POST /api/minigame-periods/close), gated on the
minigame-periods:close permission. Reopen removes the period's awards so a
future close can re-grant them.
- Integration tests for the pure math and the full close/reopen cycle, plus a
clean-slate guard so the two minigame specs stay order-independent.
Phase 1 of the minigame periods feature:
- Shared server-side recorder (lib/minigames/periods/record.ts) writes one
minigame-entries row per completed scored run, lazily creating the
anchored period it belongs to (unique startDate makes it race-safe).
Failures are swallowed so a ledger hiccup can never break a submission.
- Pure anchored-period math (lib/minigames/periods/derive.ts).
- Wire the recorder into all five Core submit actions after their profile
update: flappy (passes > 0), EOD (win), radio (>= 1 correct message),
aim trainer and OPORD (any completed round).
- Server-validated durations for every game: flappy and radio watch now
report durationMs (with bounds), aim trainer reports its run duration
(clamped to the 30s course), EOD derives it from seconds, OPORD from
timeMs.
- Integration test covering derivation, lazy period creation, pre-anchor
null period and the never-throw guarantee.
Phase 0 of the minigame periods feature:
- New collections: minigames (registry), minigame-entries (append-only
ledger), minigame-periods, achievements; new minigame-rules global
(anchor, 14-day periods, top-10 ladder, precision minimum).
- Pure registry lib with the seven built-in games, achievement
type/window enums and rule defaults.
- Permissions: extend the Minigames group with registry/entries/
periods/achievements CRUD (plus minigame-periods:close) and add a
Minigame Rules (Global) group; mirror both into ALL_PERMISSION_VALUES.
- Migration add_minigame_periods seeds the seven registry rows and the
minigame-rules defaults idempotently so production seeds from the
migration chain; dev seed script mirrors it for local resets.
Defer the reply before the permission check (uncached member fetch + DB
lookups) so a slow preamble no longer trips Discord's 3-second window and
shows "The application did not respond". Wrap all post-defer work in one
try/catch that editReplies an error, and make channel resolution catch fetch
errors so an unreachable DISCORD_CHANGELOG_CHANNEL_ID replies clearly instead
of hanging the interaction.
Also export compareVersions and make the shipped-file test assert
newest-first rather than a hardcoded version.
The startDateTime default in the Missions collection and the weekly
generate-mission bin both forced the date at least a week out by adding 7
days to the offset to the next Saturday. Generated midweek that landed on
the Saturday AFTER the coming one (a Tuesday generation went 11 days out
instead of 4), which also pushed the bot's roll-call (posted within 3 days
of start) days into the future and read as a missing roll-call.
Add nextSaturdayStart() to the unit-timezone date helpers: the nearest
upcoming Saturday at 20:00 America/New_York, rolling a week only once
today's 20:00 has passed. Use it for the collection default and the
generator, derive the generator codeName datestamp in unit time, and cover
the boundary cases in tests/int/next-saturday-start.int.spec.ts.
New Intelligence tab on the Missions collection holds a threatAssessment.likelihoods
array (category + 5-level likelihood select). Renders a color-coded, dossier-styled
table on the mission details page, ordered after Mission Details and above the
briefing. Rows match the free-text category to a lucide glyph (helicopter, plane,
armor, infantry, etc.) so the estimate scans at a glance.
- Read labor requirements via useAllFormFields + reduceFieldsToValues:
useField on an array path returns the row count, not rows, so
requirementList.flatMap threw and raised the "Failed to load labor
data" toast on every page load
- Use valid REST where syntax (where[structure][equals]= plus
positionType/status filters); the dot-notation key was silently
ignored and returned every staffing doc unfiltered
- Match staffing rows by raw relationship id at depth=0;
m.laborClassification?.id never matched numeric ids
- Validate fetch responses and show a distinct load-failure message
instead of the misleading "no classifications configured" empty state
- Give the Apply button type="button" so it stops submitting the
whole document form on every click
/changelog now accepts an inclusive range via from..to notation: v0.3.0..v0.5.0
(an inclusive slice, output oldest-to-newest), either end open (v0.3.0.. to the
latest, ..v0.5.0 from the oldest), and reversed ranges are normalized. Each
version posts as its own amber embed. Ranges over 10 versions warn but proceed.
Posts a CHANGELOG.md release entry to #releases (new DISCORD_CHANGELOG_CHANNEL_ID,
falls back to the announce channel). /changelog targets the latest entry;
/changelog <version> targets a specific version for catch-up.
Rendering is a pure, tested module (bot/lib/changelogRender.ts): entries are
split on "# vX.Y.Z" headers, ### sections become bold, bullets become the
bullet glyph, and entries over Discord's 4096-char limit are split across
messages at section/bullet boundaries with the header re-attached to each
chunk. Guild-scoped, staff-only command.
Redesign the World Map picker as 4:3 cards with cover imagery, a classification strip (REF code + campaign), corner brackets, and a readout footer (size/weather/access/faction). Add OverflowTooltip, a hover tooltip that only opens when the value is actually clipped, so truncated readouts stay readable.
Seed a new 'Welcome to the Unit' documentation page that anchors the wiki 'Start here' strip. seedDocumentation flags it featured at order 1 (idempotent; Game Masters can re-feature other pages between runs).
Rewrite the wiki index: filters (query/tag/category/sort) sync to the URL for shareable/bookmarkable views; a moderator-curated 'Start here' featured strip; category grouping with per-category portal pages (/wiki/category/*) and CATEGORY_META blurbs; excerpt previews; case-insensitive, alphabetized tag counts; and a compact WikiRow. Updates the wiki controls tour copy.
Add a curation group to wiki-pages with featured and featuredOrder, access-gated to intelligence (wiki moderators). A page flagged featured surfaces in the 'Start here' strip on /wiki. Migration adds curation_featured (default false) and curation_featured_order (nullable).
Provision a find-only API key bound to a superuser so agents can read every collection without create/update/delete. Idempotent per label, with --rotate to replace, env selection (dev/stg/prd), and a --help flag. Wires up the new bun run mcp:key script.
Reward users for helping build the app: wiki pages, mission planning
markers (queued until the mission completes), surveys, and manual awards.
Contribution XP folds into the existing virtual profile total, so it
flows into the level ladder, sidebar XP display, dashboard, and profile.
- contribution-entries ledger collection + profile progression.contributions.xpEarned bucket
- src/lib/contributions service (record/grant/expire/revoke, caps, idempotency, leaderboard) with a pure rules module
- per-mission planning-map delegation (missions:update grants) and a completed/cancelled map lock
- wiki, survey, and marker action/hook integration
- contribution:* event types, muteable notifications, permissions group, event targets
- profile Contributions section and /contributions leaderboard
- migration, reconcile tool, and integration tests
Move 19 domain sections out of the root guide into per-directory
AGENTS.md files that OpenCode v2 injects lazily when an agent reads
each subtree. The always-loaded root drops from 121KB to ~30KB and
gains a domain index table with never-miss invariants. Original root
and pre-merge sub-guides are preserved under
docs/backups/pre-agents-split-20261009/ for restoration.
Note: also carries the pre-existing uncommitted wiki-section edits to
the root AGENTS.md, preserved verbatim in src/lib/wiki/AGENTS.md.
Staff with read-all oversight (superuser / system:admin-access) see everyone's
notifications in the bell. Add a "Show all users" switch inside the dropdown,
rendered only when the caller can view others, that narrows the feed to the
caller's own notifications. The choice is remembered per browser (localStorage)
and the unread badge follows the selected scope.
The inbox route now reports canViewOthers and honors scope=all|mine; non-staff
callers are always forced to their own regardless of the param.
Drafts were only reachable in the admin panel: /story hard-filtered to
published. Story staff (admin/developer) now see drafts in the
Chronicle, badged and clearly marked, while everyone else stays
published-only. The collection's own read access remains the backstop
(overrideAccess stays false), so a non-staff request can never leak a
draft.
- page: staff fetch all entries, others published-only
- new DraftBadge (amber pill) rendered in the list, immersive reader,
book view, and table of contents
- drafts hide the read marker and reactions
- front-end copy adopts Chronicle wording
The Chronicle collections were auto-labeled from their slugs ("Story
Beats"). Give them explicit Chronicle labels and adopt the word
Chronicle in the surrounding titles, descriptions, and event text.
- StoryBeats: labels Chronicle Entry/Entries, admin group Story ->
Chronicle, descriptions updated
- Voiceovers / StoryBeatStates: Chronicle labels, group, descriptions
(including the "beat" field label)
- GameEventLogs: event-log target labels -> Chronicle Entries / States
- lib/story: event message text -> "chronicle entry" (internal
event-type strings left intact so existing logs stay valid)
- regenerate payload-types.ts
Slugs are unchanged, so no migration is required.
Regenerated the Payload admin import map to pick up the LaborCrewField
admin component. Unrelated to the campaign/notifications changes; kept in
its own commit so the feature commits stay focused.
listScriptsForUser passes all submissions at once, so a take on one
script was being counted under every script's card. Skip submissions
whose script id doesn't match the card being rendered so each count stays
scoped to its own script.
Read state is personal to the recipient. Marking a notification read now
only ever flips the acting user's own rows — never another user's, even
when staff view it via read-all oversight (which would otherwise hide it
from its real owner).
- add /api/notifications/inbox endpoint that enriches each row with
ownerId, ownerName, and isMine so the bell can label "meant for
someone else" rows
- move mark-read logic into per-user lib helpers (markNotificationsReadForUser,
markAllNotificationsReadForUser) and have the actions delegate
- surface ownership in the bell UI and skip marking rows that aren't mine
Default the campaigns list "Show completed" toggle to off, so only
ongoing campaigns show until the user opts in. Renamed the toggle from
"Hide completed" to "Show completed" and flipped the empty-state link to
turn completion visibility on.
Add a Campaign Status dropdown on the campaign detail page, gated by
campaign ownership or the campaigns:update permission (mirroring the
existing requireCampaignOwnership gate). Owners can set On Hold to pause
a campaign they are not actively running, and flip it back; admins act
through the same control. The editor optimistically updates the field,
toasts on success, refreshes the view, and reverts on failure.
- new CampaignStatusEditor client component (optimistic select + save)
- updateCampaignStatus server action (owner OR campaigns:update)
- render the editor on the detail page for authorized users
- add "On Hold" to the create dialog status options
- color + label the new status on cards and campaign rows (missions,
factions, dashboard) so it never renders as raw "onHold"
Introduce an "onHold" campaign status, placed between inProgress and
completed in the select. The enum value is added via a migration
(ALERT TYPE enum_campaigns_status ADD VALUE 'onHold' BEFORE 'completed'),
the type is regenerated, and every Record<Campaign["status"]> map now
includes onHold so the build stays green.
- Campaigns.ts: add "On Hold" status option
- migration 20261009_160740_add_campaign_on_hold_status + registration
- regenerate payload-types.ts
The open-slot notice fired for a claimed slot because upcomingFridayRange
built its query window from the server-local calendar. On the UTC deploy
container, Wednesday 8 PM ET is already Thursday, so the window became
Fri 00:00Z-23:59Z (Thu 8 PM ET - Fri 8 PM ET) and any op starting Friday
evening Eastern fell outside it: hasMissionOnFriday said open,
getFridayClaimant found no claimant, and the dedup token rendered the
wrong date (October 8 instead of October 9).
The window is now Friday 00:00-23:59:59.999 America/New_York computed
from the Eastern calendar date, identical on any server timezone. When it
is already Friday Eastern, that day itself is the slot, keeping the dedup
token stable from Wednesday through the op day so late claims still
credit. Tests use explicit UTC instants plus a regression case for the
prod scenario, verified under TZ=UTC and America/New_York.
Root cause of the upload failures: the launcher writes an
<?xml version="1.0"?> prologue, Payload sniffs uploads with
fileTypeFromBuffer, and the collection mimeTypes allowlist lacked
application/xml, so every genuine launcher export was rejected with
'Invalid MIME type: application/xml'.
- Add application/xml to the mod-lists upload mimeTypes (the document is
still stored as text/html; verified end to end).
- New pure parser src/lib/modlistPreset.ts validates the launcher export
structure (arma:Type=preset meta + data-type=ModContainer rows) and is
shared by the server action (authoritative) and CreateSideOpDialog
(instant client-side feedback).
- Plain-text lists are no longer accepted anywhere: dialog accept/hint,
collection mimeTypes, and the action now agree on HTML presets only.
- Upload name defaults to the preset's own arma:PresetName.
- Tests: tests/int/modlist-preset.int.spec.ts (9 cases).
VoiceSubmissions, ModLists and MissionFiles relied on Payload's default
upload staticDir (the collection slug resolved from cwd), so prod wrote
their files to /app/<slug> instead of the mounted /app/media volume and
every redeploy wiped them (voice takes returned 500 on play/download).
Pin all three under media/ subdirs like story Voiceovers already does,
add regression guards, and fix the audio-preview fallbacks that pointed
at the media collection's file route instead of the owning collection.
Wire the previously orphaned LaborCrewPanel into the game-structures
editor so staff can set actual headcount and per-worker wage for a
labor classification. Adds a laborCrewPanel ui field on the edit view,
a POST route under /api/game-structures that authenticates and gates on
game-structures:update, delegates to the canonical setLaborHeadcount
service (enforcing caps and wage logic), and an integration test
covering auth, validation, and cap enforcement.
The countdown rendered each time unit with a raw monospace space,
which reads wide and odd when inline with proportional text. Split the
value into per-unit inline-flex cells separated by a CSS gap so spacing
stays consistent, and cover the new markup in the interpolate
integration test.
The plugin generates one checkbox column per enabled collection
(<slug>_find/_create/_update/_delete), but only recent feature migrations
added theirs; 256 columns for older collections were never created, so any
query against the keys table failed with 'column does not exist' (HTTP 500
on list/create). Adds an idempotent ALTER TABLE IF NOT EXISTS migration for
all missing columns, registered in the migration index with a full-schema
snapshot sidecar (migrate:create reports no diff since the snapshot chain
already contained them).
The MCP plugin's key collection was gated by hasRoles(), which reads only
the legacy roles enum column. All current admins authenticate through
dynamic roleDocs superuser roles, so nobody could create an MCP API key
and every client of /api/mcp got 401. Both override blocks (MCP keys and
the AI plugin instructions) now use requirePermission('system:admin-access'),
and the sync-only admin.hidden checks were dropped in favor of the read
gate, matching the repo's requireAdminPageAccess pattern.
Adds tests/int/mcp-api-keys.int.spec.ts covering the plain-user rejection,
dynamic-superuser key creation with HMAC index resolution (mirroring the
plugin's resolveAccessSettings), explicit system:admin-access grants, and
read visibility.
- Enlarge flow-editor wire handles from size-2 (8px) to size-3 (12px) so
they are easier to click and grab.
- Select an edge by clicking it, then remove it with the Delete key.
Selection is tracked in state and the highlight renders through BaseEdge
stroke props so the chosen line stands out.
- Edges are a derived projection, so deletion scrubs the hop from the
source node data via a new pure removeHopFromNode() helper in dialogue.ts
(choice row, condition branch, or single continuation).
- Add tests/int/npc-dialogue-remove-hop.int.spec.ts (4 tests).
Choice rows in the dialogue node editor now have up/down buttons so a
choice can be moved up or down into the desired order, which is the
order shown to the player. The swap lives in a pure reorderChoice
helper (no-op at the edges, input not mutated) with a focused test.
The Line textarea in the dialogue node editor grows to fit its content
up to a 200px default max, so long lines no longer scroll in a
fixed-height box. It stays drag-resizable (resize-y) and the user can
still expand it past the max.
The auto-grow hooks run above the early-return guard so their call
order never changes, fixing a Rules of Hooks violation the change would
otherwise introduce.
Event node flag effects previously always wrote the active participant's
flag. A flag's identity is (owner, key), so the same key can hold
independent values for different owners, but there was no way to target
them from the editor.
- Add flagTarget ("self" | "global" | "user") + flagTargetUserId to
NpcDialogueEffect. "self" (default) keeps current behavior.
- Add resolveFlagOwner (flags.ts) to map a scope onto the player-flags
user column; "user" with no id falls back to the participant so a
misconfigured effect never nudges the global flag.
- Move applyFlagEffect into flags.ts, parameterized by resolved owner;
the runtime action resolves the owner and delegates.
- Add a Target control (+ user picker) to the event node editor and
validateGraph enforcement for the "user" scope.
- Integration tests cover owner resolution and self/global/user writes.
Archived tickets disappear from every front-end surface for all users
(staff included): helpdesk list, detail page 404s, dashboard widget, and
project board/sprints/releases/search views. They remain fully visible in
the Payload admin panel, where un-archiving restores them. The collection
hook stamps archivedAt and appends an activity entry on each toggle; the
archiveTicket server action is tickets:staff gated and emits a
ticket:archive event. Edits and votes on archived tickets are rejected.
New Game collection reinforcement-pools (name, faction, armaFactions,
available, enabled) with manual-edit audit via reinforcement:adjust. The
events hook applies reinforcement.spawn/.refund deltas (soft limits, no
floor, idempotent by eventId) before the game's next pull, and a new GET
/api/arma/v1/reinforcements endpoint serves enabled pools to the server.
- game-event-logs gains visibility (public|restricted) + requiredPermissions
(any-of gate from the permission registry); read access becomes a Where
clause: public OR actor-is-me OR held permission; superusers and
game-event-logs:update staff see all; admin panel gate unchanged
- src/utils/event-log/visibility.ts: per-type policy map consumed by
emitGameEvent, with per-emit overrides; npc:dialogue and flag:set start
restricted, everything else stays public
- PlayerFlags hooks emit restricted flag:set audit events on every flag
write (admin edits and dialogue effects alike)
- fix dashboard RecentEvents leaking events: local API find now runs as
the viewer with overrideAccess false
- SSE broadcast sends an opaque nudge for restricted events instead of
type/actor metadata
- /events table marks restricted rows with a lock badge
- migration 20261007_025942_add_event_log_visibility + regenerated types
- tests/int/event-log-visibility.int.spec.ts (8 cases)
- Converse button no longer floats over the hero text on phones: it sits
in the card's content flow below the status chips and only anchors to
the hero's right edge from md up
- conversation dialog keeps a side margin on small screens instead of
rendering edge-to-edge
- dialog titles truncate with min-w-0 so long NPC names and attachment
urls cannot push the close buttons out
Rearranging nodes on the canvas (positions, edge ids, styling) no longer
changes the flow hash, so tidying a conversation in the editor does not
re-badge it as NEW for every player. The hash now covers node identity,
type, data, and edge source/target with order-independent serialization;
real text or branching edits still re-flag.
- DialogueText rewritten as a recursive parser so markup accumulates
({green}**bold green**{/} and friends nest freely, colors close inner-first)
- [label](url) dialogue links open in an iframe popup dialog so
conversation progress survives; only http(s)/relative urls render
- NEW badges: Converse button + choice buttons badge unread paths via a
per-browser seen map (ptf:npc-dialogue-seen) keyed by flow hash, so GM
edits re-flag the conversation
- choices gain lockedHint: failing conditions can show the choice disabled
with a rich tooltip instead of hiding it (evaluateNpcDialogueChoices now
returns ChoiceGate pass/showLocked pairs)
- player flags gain activatesAt/expiresAt time windows honored by readFlag,
flag effects gain flagDelayMinutes for slow-burn writes, and
{{countdown:key}} tokens tick live toward activation (done/missing states)
- migration 20261006_add_flag_time_windows; spec extended to 33 tests
- npc-dialogues gains priority + entryGate (flag key/op/amount) fields
- contact page offers the highest-priority conversation whose gate
passes (ungated = fallback, ties by oldest); only the winner's flow
leaves the server so locked story content never reaches clients
- extract shared flag reads (readFlag/evaluateCondition) to
lib/npc-dialogue/flags and pure selection to lib/npc-dialogue/selection
- migration 20261006_203217_add_dialogue_entry_gate; spec covers
ordering, gating, fallback, and storage round-trip
Extract the dialogue canvas's routing upgrades into routeEdge() in the
shared lib: perpendicular handle stubs, candidate scoring (Z-step vs
straight for forward edges, top/bottom bus corridors for back edges),
per-edge detour lane spreading, and multi-pass obstacle clearing. The
NPC dialogue RoutedFlowEdge becomes a thin renderer over it, and the
tech tree RoutedEdge now inherits the same logic while keeping its own
features intact: manual waypoints route verbatim (and define the
add-a-bend base), per-source stepPosition lanes feed the Z-step, and
its fixed right/left handles map to the new direction params.
New pure spec covers the Z-step shape, blocked-forward detouring,
back-edge bus routing, per-id lane spread, and waypoint pass-through.
Two routing defects on the dialogue canvas:
- Return edges entering the same handle detoured through identical
corners, stacking into one thick bundle on the left of the target.
Each edge now derives a stable lane offset from its id, so parallel
detours run in visibly separate lanes.
- Long leftward runs relied on greedy corner-hopping alone, which could
still leave a segment cutting under a card. Back edges now try
structured bus routes (corridor above or below every card, then swing
in to the entry handle) and score candidates by residual crossings,
picking the first clean shape. The router also re-runs until clean
(bounded to three passes) instead of trusting one greedy pass.
Verified on doc #2: all seven edges route with zero card crossings and
no stacked lanes; tech-tree edge-routing specs still pass.
Dragging a card updated the canvas but never wrote to the Payload
field, so document Save persisted stale positions. Wrap onNodesChange
and serialize once a drag settles (the final position change with
dragging === false), keeping the write off the mousemove hot path.
Selection and in-progress-drag flags are stripped before serializing
so clicking a card never marks the document dirty.
- Selected node cards gain a gentle cyan ring so selection state is
obvious without fighting the per-type border colors.
- A node created via double-click/toolbar/pane menu opens straight into
its dialog; closing that dialog with Cancel (or Escape/backdrop/X)
now discards the empty draft instead of persisting it. Saving clears
the draft marker, so cancelling a later edit never deletes anything.
- New Snap toggle in the editor toolbar enables React Flow grid
snapping (20px, matching the background dots); the preference is
remembered per browser like the tech tree's.
Crossing Bezier connectors made return edges (a choice looping back to
an earlier line) impossible to trace on the dialogue canvas. Extract
the tech tree's obstacle-avoidance router into a shared pure lib
(src/lib/flow-edge-routing.ts, plus rounded path building and a new
polylineMidpoint for label placement), leave re-export shims where the
tech tree imported it, and render dialogue edges through a new
RoutedFlowEdge type: perpendicular stubs at each handle, an orthogonal
base for forward edges, full-card detouring for back edges, arrowheads,
and condition labels as chips at the path midpoint.
- Single click now only selects a node; the edit dialog opens on
double-click so the Del-to-delete flow is never interrupted by a modal
- Guard the canvas double-click handler so double-clicking a node can
never also spawn a new dialogue node behind the dialog
- Update the editor hint text to describe the new click model
- Delete selected nodes with Del/Backspace (guarded against open dialogs,
menus, and focused form fields)
- Double-click the canvas to drop a dialogue node at the cursor; right-click
empty canvas for a New node menu with all six types; toolbar buttons now
place nodes at the viewport center instead of blind grid coordinates
- Choices support optional flag conditions evaluated server-side per player
(player flag first, global fallback); gated choices stay hidden until the
server confirms them, so forbidden options never flash on screen
- Litegraph-style per-output handles: one source handle per choice row plus
dedicated true/false handles on condition nodes, wired through derived
edges and handle-aware connections
- Brighten passive edge lines and edge labels on the dark canvas
- New dialogue nodes default to an empty speaker, rendering the NPC's name
Raise the default editor height from h-96 to 60vh (min 28rem) and add an
Expand/Shrink toolbar toggle that floats the whole editor over the document
form, filling the viewport right of the admin sidebar via the shell's
--nav-width/--app-header-height vars. Esc collapses it unless the node
dialog or context menu is open.
Finish the NPC dialogue flowchart work carried over from the base commit:
- Coloured NPC dialogue text via friendly names ({red}) or hex ({#ff00ff});
invalid names/hex render as literal text. Shared client-safe renderer
(DialogueText.tsx) used by both the admin canvas preview and the runtime.
- Player-flags feature: condition nodes branch on flags (evaluated
server-side), flag effects set/clear/adjust flags, PlayerFlags collection
+ migration, and event nodes can set flags.
- One-time ("once") choices: a choice flagged "Hide after picked" is hidden
for the rest of the current conversation only (per-session, resets on
begin()); GMs can persist across conversations with a condition flag.
- Admin editor: colour hint, once checkbox on choices, amber "once" badge.
Migration repair: the player_flags migration (20261005_185014) was sorting
before 20261006_000000, whose stale snapshot omitted player_flags, so any
future `migrate:create` re-emitted player_flags DDL. Restored 20261006_000000's
snapshot to the full current schema so it is the correct diff base.
Verified: `bun run payload migrate` clean, `migrate:create` reports no
schema changes, `tsc --noEmit` clean.
- GameNpcs: Narrative Activity group (weighted options, forced flag,
configurable reshuffle interval), level + richText levelDescription,
canMessage toggle
- New npc-dialogues collection with a purpose-built React Flow dialogue
editor (dialogue/choice/event/end nodes) in the admin panel
- Frontend: Currently-activity line and level description on the contact
profile page; NpcConversation messaging surface with a documented
(disabled) LLM extension seam
- Permissions: npc-dialogues CRUD + admin manage in a new NPC Dialogue
group; event types for dialogue triggers
- Migration 20261006_000000 (applied to dev DB) with full schema
snapshot sidecar
Adds DISCORD_ANNOUNCE_MENTION_ROLE_ID; when set, /announce without a message
(compose dialog) posts the announcement with that role mentioned. Documented
in config, env example and the bot design guide.
Remove the hover-only brightening of the tactical dossier grid texture so it
keeps a constant opacity across EmploymentCard, CampaignCard, and the
operations surfaces (OperationSections, StrategicSummary, tokens).
isMissionEvaluable now considers the full scheduled window (start +
estimated duration) rather than the start alone, so evaluation reminders
fire once a mission's window has genuinely closed. Extends the profile page,
the remindEvaluations command and the evaluationReminders service to match,
and adds integration tests. Updates the bot evaluation-reminders docs.
Register 20261005_001212_add_map_grid_config,
20261005_051452_add_game_structure_item_storage and the two game-npc
migrations in the migration index, and normalize trailing commas on the
preceding entries.
Game NPCs gain an image upload and a Lexical rich-text bio (with data
migration that wraps existing plain text in a paragraph). NPC profile, card
and directory surface the portrait, a status-chip row and initials fallback;
contacts list and detail pages adopt the redesigned cards.
New item storage (limited-arsenal stock) on game-structures: a unique
storageSlug identifying the structure to the game bridge, an Item Storage
Access group (anyone / specific roles / specific users) backed by
canAccessStructureStorage, a storedAssets array (asset, quantity, grid
position, rotation, per-instance attachments/skin/custom name) with a
storedAssetCount rollup, and a beforeChange hook that pushes a locker.apply
command to the game whenever web-originated stock changes. Migration
20261005_051452_add_game_structure_item_storage.
New locker-sync bridge: web-originated storedAssets edits enqueue a
locker.apply command sent to the game, and game-side locker.sync merges
feed back into the member UI. Position/equipment layout is preserved across
merges. Adds the lockers service, LockerStorages + ArmaSyncEvents wiring and
integration tests. Docs in docs/arma-bridge/locker-sync.md.
Per-map grid config (gridEnabled, easting/northing origin, spacing, label
digits, over-lines) rides on the Maps collection and surfaces via
/api/map-features. Pure math in src/lib/map/grid.ts mirrors CfgWorlds Grid
(floor truncation, mod-10^digits wrapping, nested levels). GridLayer renders
hairlines + edge labels on the world map and mission planning maps, and
armaGridRef now delegates to gridRef. Migration 20261005_001212_add_map_grid_config.
v0.2.33 tightened hasIntelligenceQualification to write permissions for wiki
moderation, but the same check also gated navigation: regular members lost the
Intelligence sidebar section, command palette entries, keyboard shortcuts,
dashboard widgets, and tour steps. Add canViewIntelligence (intel read
permissions, with the strict qualification as a fallback) and use it for those
visibility surfaces. Wiki moderation, the tech tree, and division admin pages
keep the strict qualification.
- New mission-map-markers collection (permission-gated, removed with its
mission via a Missions beforeDelete hook) plus an opt-in
classification.planningMapEnabled flag on missions.
- The mission page gains a planning section: place and edit Arma markers
(icons, ellipses, rectangles, polylines) with debounced saves, an SQF copy
export, and an Arma grid readout. Everyone who can read the mission sees the
plan once enabled; editing requires missions:update or mission ownership.
- Base layers come from GET /api/map-features?layers=base, which skips the
structure, node and shipment queries; marker icons render tinted by color
exactly like in-game.
- Includes the hand-written migration, the missionMap service lib, server
actions emitting mission:map-marker-* events, and integration plus e2e
coverage.
- Add bun run markers:arma (src/tools/arma/extractMarkers.ts), which scans the
game install and every DLC addons dir, merges CfgMarkers, CfgMarkerColors,
CfgMarkerBrushes and CfgMarkerClasses with inheritance, resolves stringtable
names, and converts marker icons to PNG.
- Commit the converted PNGs under public/arma/markers so production needs no
game files.
- Add the pure, client-safe catalog lib in src/lib/arma-markers: generated
catalog, case-insensitive lookups, the Arma marker model with validation,
and SQF export helpers.
Every canvas position write (Auto-arrange, Save positions, drags, freeze pins)
used to send one PATCH per technology, all at once. On a large tree that was
dozens of concurrent full document updates, which exhausted the database pool
and could crash the server.
- Add POST /api/tech-tree/positions: validates `{ positions: [{ id, x, y }] }`
(null x/y clears a pin, capped at 2000) and applies every position in a
single UPDATE on the tree position columns. Access mirrors the technologies
update rule (technologies:update or Intelligence membership).
- Route all canvas position writes through it; failures now surface in the
toolbar instead of being swallowed.
- Auto-arrange is optimistic: the canvas re-lays out on click and the pins
are restored if the save fails. A spinner status chip shows while a layout
save runs, and layout controls and dragging are locked until it finishes.
- Integration tests for validation and the bulk write; the e2e checks the busy
indicator and that no per-node PATCHes are sent.
- Regenerate payload-types and the drizzle schema for the new collections and
fields (promotion nominations, leadership transfers, the accessory asset
type, the Ornith model settings) and register the new migrations.
- Fix the reset-sequences SQL function to skip empty tables, and update the
prod sync script to match.
Adds an "accessory" asset type for flashlights and lasers, allowed on the same
equipment slots as optics, muzzles, and bipods, with a locker label and colour.
Point the AI compose plugin at Unsloth Studio serving Ornith 1.0 9B (replacing
Gemma 4 26B), and rename the model settings to ornith-9b-settings. Ornith is a
reasoning model, so requests disable reasoning (reasoning_effort "none") to stop
a small token budget being spent entirely on the reasoning block. Adds the
migration and documents UNSLOTH_URL / UNSLOTH_API_KEY in .env.example.
- Add an `icons:arma` tool (extractArmaIcons.ts) that pulls inventory icons
out of the game's PBOs and materializes the .paa files the catalog needs.
- Extend the catalog import library with the matching planning and upsert
support, and cover it with integration tests.
- The mission tick now runs two idempotent sweeps: auto-start flips Scheduled
missions whose start time has arrived to Active, and auto-complete sets
missions whose scheduled window (start plus duration) has fully passed to
Completed with a stamped completedAt.
- Side ops are created as quiet Ready drafts and committed with a "Mark as
Scheduled" control, which is what posts the Discord roll-call and hands the
op to the lifecycle above.
- Daily schedule reminders nudge the creator to set a draft live (web
notification plus Discord DM).
- Adds the mission lifecycle/commit event types and the matching notification
labels, and updates the bot docs.
- Promotion nominations: members can nominate a peer for promotion from their
profile, and a new /personnel/promotions page lets staff review and action
the nominations (with an optional note on each).
- Leadership transfers: a member's leadership can be handed over to another
member, surfaced on the transfers page and in the roster (which also gains a
staff remove-member dialog).
- Adds the PromotionNominations and LeadershipTransfers collections (registered
in the Payload config), their service libs, the migration, and integration
coverage.
Round out the canvas editing experience.
- Dragging one card of a multi-selection now moves and persists the whole
selection (React Flow hands the full dragged set to onNodeDragStop).
- A category band is draggable by its header, which moves every technology in
that band; the band body stays click-through.
- A "Snap: On/Off" toolbar toggle (default on, remembered per browser) snaps
dragged cards to a 46px grid that divides the column and row steps, so
snapped cards line up with the automatic layout.
- Connection lines are adjustable: select an edge to reveal "+" handles at each
segment's midpoint (click to add a bend), drag bends to reroute, and
double-click a bend to remove it. Routes persist per browser.
- Edges route around technologies they are not connected to, and corners are
rounded, so lines no longer cut through unrelated cards.
- Ctrl/Cmd-clicking to multi-select no longer pops the side panel over the
canvas.
Add usage analytics via @microsoft/clarity across the frontend app and the
login page. ClarityAnalytics loads the tracking script only in production
builds (never local dev), keyed by NEXT_PUBLIC_CLARITY_ID; unset disables it.
Mounts it in both the (frontend) root layout and the standalone login layout
so both surfaces are covered without touching the admin panel.
Move the record contract, planning, and upsert logic out of the CLI script
and into src/lib/arma-import/catalog.ts so it can be unit-tested and reused.
The CLI (importArmaLibrary.ts) becomes a thin wrapper. Records are upserted
into assets (keyed by className) and vehicles (by classname); thumbnails are
materialized from .paa inventory icons, and fuel config is resolved per
record type. Adds integration coverage for the catalog import path.