1
0
Fork 0
Commit graph

1225 commits

Author SHA1 Message Date
d4d121b5a7 feat(minigames): add period, entry, achievement and registry schema
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.
2026-10-11 17:06:52 -04:00
0c00726759 v0.8.7 - tidier release notes 2026-10-11 16:53:29 -04:00
703ba0f1a2 docs: add v0.8.7 changelog entry 2026-10-11 16:51:27 -04:00
88d1d1f6f1 feat(changelog): fall back to a generic line for empty entries and sections 2026-10-11 16:41:04 -04:00
0ef3da018e v0.8.6 - fix /changelog missing file in prod image 2026-10-11 16:28:35 -04:00
a9949aac38 docs: add v0.8.6 changelog entry 2026-10-11 16:26:41 -04:00
bcbfa09d68 fix(deploy): ship CHANGELOG.md in the runtime image for /changelog 2026-10-11 16:26:00 -04:00
be21ca36c2 v0.8.5 - restore Discord bot command responses 2026-10-11 16:15:48 -04:00
3fb21c777c docs: add v0.8.5 changelog entry 2026-10-11 16:13:30 -04:00
32b63d9061 fix(bot): shorten /changelog option description to unblock bot startup, register /rollcall 2026-10-11 16:12:05 -04:00
2298cff2fa v0.8.4 - add /rollcall force command, fix changelog acks 2026-10-11 15:33:43 -04:00
02188b4d44 docs: add v0.8.4 changelog entry 2026-10-11 15:33:43 -04:00
dda9f08f33 feat(bot): add /rollcall to force-send or refresh a mission roll-call 2026-10-11 15:26:17 -04:00
bf36e1e2be fix(deploy): supervise the Discord bot in the entrypoint
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.
2026-10-10 16:07:26 -04:00
6bc7413cd7 fix(bot): acknowledge /changelog immediately and surface post-defer errors
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.
2026-10-10 15:57:51 -04:00
16664b6d4e v0.8.3 - correct release-order instructions 2026-10-10 15:15:07 -04:00
9ed63b1031 docs: add v0.8.3 changelog entry 2026-10-10 15:15:02 -04:00
a0213b3c92 docs: correct release-order instructions (version bump is the deploy tip) 2026-10-10 15:08:33 -04:00
fcd3bfe856 v0.8.2 - schedule new main ops for the coming weekend 2026-10-10 15:04:41 -04:00
3bf87172c7 docs: add v0.8.2 changelog entry 2026-10-10 15:04:41 -04:00
eed33de2e9 fix(missions): default new main ops to the upcoming Saturday
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.
2026-10-10 14:54:06 -04:00
969ca75a70 docs: add v0.8.1 changelog entry 2026-10-10 13:31:49 -04:00
c65fd436b1 v0.8.1 - add threat assessment dossier table, color-coded likelihoods, smart category icons 2026-10-10 13:28:07 -04:00
32365e6612 feat(intelligence): add threat assessment dossier table to mission details
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.
2026-10-10 13:26:02 -04:00
db98adbcee fix(game-structures): repair Labor Crew panel data loading
- 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
2026-10-10 13:23:52 -04:00
9a0b78fcf0 feat(bot): support version ranges in /changelog
/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.
2026-10-10 13:13:55 -04:00
2e23d074a4 feat(bot): add /changelog command to post release notes to Discord
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.
2026-10-09 19:01:21 -04:00
d4812de032 docs: add v0.8.0 changelog entry 2026-10-09 18:10:58 -04:00
e8f101d5b2 v0.8.0 - redesign wiki index (featured strip, category portals, URL-shared filters), redesign World Map picker, add read-only MCP key CLI 2026-10-09 17:59:43 -04:00
4673aa7a66 feat(map): redesign world picker cards with overflow tooltips
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.
2026-10-09 17:56:22 -04:00
eff7aea914 test(wiki): cover index view helpers and curation mapping
Add tests for buildExcerpt (markdown stripping, truncation), filterWikiPages (category/tag/excerpt), sortWikiPages (recent/oldest/title), groupWikiPagesByCategory, collectTagCounts (dedupe/count/sort), selectFeatured (ordering, FEATURED_CAP), CATEGORY_META coverage, and mapWikiPageToEntry (System fallback, curation passthrough).
2026-10-09 17:56:17 -04:00
35bae586b4 feat(wiki): add welcome-to-the-unit starter guide
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).
2026-10-09 17:56:13 -04:00
42d860da44 feat(wiki): redesign index with URL-shared filters, category portals, featured strip
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.
2026-10-09 17:56:09 -04:00
2bc9e08b6f feat(wiki): add page curation for featured strip
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).
2026-10-09 17:56:02 -04:00
cab789cf75 feat(mcp): add read-only MCP key provisioning CLI
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.
2026-10-09 17:55:58 -04:00
3a2ae34b83 feat(contributions): add crowdsourced XP reward system
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
2026-10-09 16:30:05 -04:00
b28708c590 docs(agents): split domain guidance into nested AGENTS.md files
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.
2026-10-09 15:46:36 -04:00
4de7a4e923 feat(mcp): add read-only server instructions to the MCP plugin 2026-10-09 15:10:52 -04:00
f454d3523d docs: document read-only production MCP for agents 2026-10-09 15:10:49 -04:00
37d7297b1a feat(notifications): add staff toggle to show only your own notifications
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.
2026-10-09 14:43:12 -04:00
0ed7524fdf v0.7.4 - show Chronicle drafts to staff, rename Story Beats to Chronicle Entries 2026-10-09 13:48:56 -04:00
aa09252b06 feat(chronicle): show draft entries to staff on /story
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
2026-10-09 13:48:51 -04:00
dffcd0013c chore(chronicle): rename Story Beats to Chronicle Entries
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.
2026-10-09 13:48:14 -04:00
a696a864ca docs: add v0.7.3 changelog entry 2026-10-09 13:22:05 -04:00
2687402d5c v0.7.3 - add on-hold campaign status, per-recipient notification read state, voiceover + bot fixes 2026-10-09 13:16:18 -04:00
b0ce171c2e test(voiceover): add per-script submission count test 2026-10-09 13:14:35 -04:00
9f9257cadf test(notifications): add per-recipient read-scope test 2026-10-09 13:14:35 -04:00
5c06e9f40f chore(payload): regenerate admin import map
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.
2026-10-09 13:13:27 -04:00
741469e88e fix(voiceover): scope script submission counts per script
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.
2026-10-09 13:13:19 -04:00
66e70d3d56 feat(notifications): scope notification read state per recipient
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
2026-10-09 13:13:16 -04:00