The bot ran as an unsupervised background process, so a crash left the unit
with no bot while the web app stayed healthy (and the failure was invisible).
The entrypoint now runs the bot in a restart loop with capped exponential
backoff (5s .. 60s), logs every exit, and stops the loop cleanly on
SIGTERM/SIGINT. The web server still owns the container lifetime. DEPLOYMENT.md
section 5 updated to match.
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.