feat(archives): auto-generated war narrative (#274)#446
Merged
Conversation
A collapsible, in-world "war narrative" for each season's /archives page —
a chronological chronicle generated in the Ministry of Truth propaganda voice
from existing getCampaign data (no schema/DB/query changes).
- buildWarNarrative(data): pure helper → ordered [{day, text}] beats — opening,
faction arrivals (introduction_order + first_seen), cascade runs collapsed via
findAllCascades, per-event field reports, and a getWarOutcome cap. Defensive:
empty → []; reduce-min war_start fallback (no Math.min spread).
- NarrativeSection.jsx: native <details>/<summary> collapsible, hide-when-empty,
data-umami-event="archive-narrative-toggle". Wired into ArchivesClient after
the Player Engagement section.
- 12 unit tests incl. an Illuminate-cascade regression for the article-stripped
faction name ("The Illuminate", not "The The Illuminate").
Verified: lint, typecheck, test:unit (1515), build all pass.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #274.
What
A collapsible War Narrative on each season's
/archivespage — a chronological, in-world chronicle generated in the Ministry of Truth propaganda voice. Pure frontend: a transform over data already supplied bygetCampaign, no schema/DB/query changes.How
buildWarNarrative(data)— pure helper → ordered[{day, text}]beats: opening → faction arrivals (introduction_order+ per-factionfirst_seen) → cascade runs collapsed viafindAllCascades→ per-event field reports → agetWarOutcomecap. Defensive (empty → [], reduce-minwar_startfallback).NarrativeSection.jsx— native<details>/<summary>collapsible, hide-when-empty (like Player Engagement),data-umami-event="archive-narrative-toggle". Wired intoArchivesClient.Sample (from the test fixture)
Review verification
Built by an implementation agent; reviewed + an integration bug caught and fixed during review: the cascade beat bypassed the article-stripping helper, so an Illuminate cascade rendered "The The Illuminate push through" (the enum name is "The Illuminate"). Fixed to resolve via
factionName(cascade.factionIndex)+ added a regression test.✅ lint · typecheck · test:unit (1515) · build — all pass (node 24).
buildWarNarrative.mjs.developbumps to the next version and folds into the open v0.60.0 release PR Release v0.60.0 #445. Recommend merging this after v0.60.0 ships.🤖 Generated with Claude Code