Commit Graph
100 Commits
Author SHA1 Message Date
258f739d02 Move SparklePlugin to separate Bazel workspace to resolve rules_swift conflict (#5882)
* Move SparklePlugin to separate Bazel workspace to resolve rules_swift conflict

The problem: grpc 1.76.0.bcr.1 requires rules_swift 3.x, but rules_apple 4.x
requires rules_swift 2.x. These have different compatibility levels, causing
bzlmod resolution to fail when both are in the same workspace.

The solution: Move SparklePlugin (the only thing using rules_apple) to a
separate Bazel workspace at `sparkle_workspace/`. This workspace has its own
MODULE.bazel with only rules_apple and Sparkle dependencies, completely
isolated from the grpc/flatbuffers dependency tree.

Changes:
- Create sparkle_workspace/ with isolated MODULE.bazel
- Move SparklePlugin source files to sparkle_workspace/
- Update build_sparkle_plugin.sh to build from subworkspace
- Remove rules_apple from main MODULE.bazel
- Add single_version_override for rules_swift 3.1.2 (for grpc/flatbuffers)

All 315 tests pass.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Add WORKSPACE.bazel to sparkle_workspace to prevent parent workspace detection

Without this file, Bazel may walk up the directory tree and find the parent
workspace's MODULE.bazel, causing dependency conflicts.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 06:23:46 -08:00
f125c8f5f6 Remove unused macos_command_line_application from action_point_distances (#5881)
This target was a development utility that's no longer used.
Removing it helps reduce rules_apple dependencies.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 22:40:54 -08:00
adminandGitHub 22b0bc00cc Remove unused api_keys_data filegroup (#5879) 2026-02-04 17:51:42 -08:00
45942688a9 Add ApprehendOutlawQuest type (PR 1/3) (#5872)
* Add ApprehendOutlawQuest type (PR 1/3)

Add a new quest type where unaffiliated heroes require the faction to
apprehend a specific outlaw currently in their territory. The quest:

- Proto: Added ApprehendOutlawQuest message with outlaw_hero_id field
- Scala: Added case class with quest fulfillment logic
- Failure: Quest fails if the outlaw is no longer in faction territory
- Fulfillment: Completed when ApprehendOutlawCommand targets the outlaw
- Updated ApprehendOutlawCommand to check for quest fulfillment and
  return multiple results (main result + quest completion if matched)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix ApprehendOutlawQuest failure condition

Only fail if the hero is no longer an outlaw anywhere. Moving to a
different province is fine - quest remains valid. Quest fails only
when someone else apprehends them.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 17:01:39 -08:00
a7b7b0e444 Upgrade Scala 3.7.4, rules_scala 7.1.5, protobuf 33.0, grpc 1.76.0, Bazel 7.7.1 (#5871)
* Upgrade rules_scala 7.1.5, Scala 3.7.4, protobuf 32.1

- Update rules_scala from 7.1.1 to 7.1.5
- Update Scala from 3.7.2 to 3.7.4
- Update protobuf from 29.2 to 32.1 (required by rules_scala 7.1.5+)
- Add force_version for Maven dependency conflicts (gson, errorprone, guava)
- Update -Wconf pattern in tools/BUILD.bazel for Bazel 7/8 compatibility
- Add -Wno-deprecated-copy-with-dtor to suppress protobuf 32.x warning

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Add grpc 1.76.0, protobuf 33.0, and Bazel 7.7.1 compatibility fixes

- Upgrade grpc from 1.71.0 to 1.76.0.bcr.1 (required for protobuf 33.0)
- Upgrade protobuf from 32.1 to 33.0 (matches grpc 1.76.0 expectations)
- Upgrade Bazel from 7.6.1 to 7.7.1
- Add single_version_override for rules_swift 3.1.2 (grpc needs 3.x, rules_apple needs 2.x)
- Add --features=-module_maps workaround for grpc cf_event_engine macOS build issue

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 17:01:15 -08:00
76be41d841 Enable WinBattlesQuest generation (PR 3/3) (#5870)
* Enable WinBattlesQuest generation (PR 3/3)

Adds WinBattlesQuest to the available quest generators. The quest
requires winning 2-4 battles (randomly determined).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix DivineCommandTest for new quest type random sequence

Adding WinBattlesQuest changed the random sequence during quest creation,
causing hero 12 to get a quest with a province target. Updated test
expectation to match the new (correct) notification output.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 15:27:06 -08:00
8ee4e1475c Add client UI support for WinBattlesQuest (PR 2/3) (#5869)
- DisplayNames.cs: Add "Win Battles" display name
- UnaffiliatedHeroRowController.cs: Show progress (X/Y battles won)
- DivineMessagePromptGenerator: Add divine message text
- QuestEndedGeneratorUtilities: Add quest ended description

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 15:20:31 -08:00
c583e216d3 Add WinBattlesQuest type (PR 1/3) (#5868)
* Add WinBattlesQuest type (PR 1/3)

Adds a new quest type where a hero asks the player to win X battles
(where X is 2-4). This is a ComponentQuest that tracks progress.

- Proto: Add WinBattlesQuest message and field
- Quest.scala: Add WinBattlesQuest case class extending ComponentQuest
- QuestConverter: Handle WinBattlesQuest toProto/fromProto
- ResolveBattleAction: Increment quest counter when winning battles
- CheckForFulfilledQuestsAction: Quest is fulfilled via ComponentQuest
  handling when componentsFulfilled >= componentCount

This quest never fails.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Add WinBattlesQuest cases to prompt generators

The exhaustive pattern matching on Quest types requires adding cases
to all prompt generators when a new quest type is added.

Also updates CLAUDE.md to require running full test suite before pushing.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 15:07:01 -08:00
f3dea0306d Enable BorderSecurityQuest and WinBattleOutnumberedQuest generation (#5858)
- BorderSecurityQuest: Creates one quest per border province (provinces
  with neighbors controlled by other factions)
- WinBattleOutnumberedQuest: Simple quest with no parameters

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 14:24:27 -08:00
acf57f3c96 Enable BetrayAllyQuest generation (PR 3b/3) (#5856)
Adds quest generation for BetrayAllyQuest, which is available when
the faction has at least one ally.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 14:20:33 -08:00
9cb7cadcdf Change BetrayAllyQuest to target specific ally (#5867)
Instead of a generic "betray any ally" quest, BetrayAllyQuest now
targets a specific faction with `targetFactionId`. This makes the
quest more meaningful and allows players to plan strategically.

Changes:
- Proto: Add target_faction_id field to BetrayAllyQuest message
- Quest.scala: Change from case object to case class with targetFactionId
- QuestConverter: Handle new targetFactionId field
- CheckForFailedQuestsAction: Update failure logic to check if specific
  target faction no longer exists or is no longer an ally
- BreakAllianceResolutionHelpers: Check if broken alliance matches
  quest's target faction for fulfillment
- DivineMessagePromptGenerator & QuestEndedGeneratorUtilities: Update
  quest descriptions to mention specific ally name
- UnaffiliatedHeroRowController (C#): Display specific ally name in UI

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 14:14:20 -08:00
1bbdd18f9f Fix reconnecting status stuck after sleep/wake (#5864)
* Fix reconnecting status stuck after sleep/wake

Race condition: when device wakes from sleep, CheckForIdleTimeout and
HandleStreamingCall both try to initiate reconnection, leading to
conflicting state updates and duplicate retry timers.

Fix: Cancel thread token in CheckForIdleTimeout before disposing the
streaming call, and check the token in HandleStreamingCall exception
handlers to skip ScheduleReconnect if another path is handling it.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix threadToken scope to be accessible in catch blocks

Move threadToken declaration outside try block so exception handlers
can check if the token was cancelled.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 13:58:14 -08:00
aad241ed77 Upgrade Java build toolchain from 17 to 21 (#5866)
Updates .bazelrc to use Java 21 for compilation.

Requires PR #5865 (URL deprecation fix) to be merged first, otherwise
the build will have deprecation warnings from the old URL constructor.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 13:57:08 -08:00
4ff93ac8fc Fix deprecated URL constructor in LLM integration classes (#5865)
JDK 20+ deprecates `new URL(String)`. Use `URI.create().toURL` instead.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 13:56:41 -08:00
e3b88215aa Enable SwearBrotherhoodWithHeroQuest generation (PR 3a/3) (#5855)
Adds quest generation for SwearBrotherhoodWithHeroQuest, which targets
vassal heroes in the province who are not already faction leaders.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 13:52:43 -08:00
c89a4ef51b Add client UI support for 4 new quest types (PR 2/3) (#5853)
Adds C# client display support for:
- SwearBrotherhoodWithHeroQuest: "Swear brotherhood with {heroName}"
- BetrayAllyQuest: "Break an alliance with an ally"
- BorderSecurityQuest: "Control all provinces bordering {provinceName}"
- WinBattleOutnumberedQuest: "Win a battle while outnumbered"

Changes:
- DisplayNames.cs: Add quest type strings
- UnaffiliatedHeroRowController.cs: Add quest descriptions in SetQuestText and ShortQuestString

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 13:38:58 -08:00
7d07bd97ad Add 4 new quest types with fulfillment logic (PR 1/3) (#5850)
Adds server-side support for:
- SwearBrotherhoodWithHeroQuest: fulfilled when player swears brotherhood with the target hero
- BetrayAllyQuest: fulfilled when player breaks an alliance with an ally
- BorderSecurityQuest: fulfilled when all neighboring provinces of the target province are controlled
- WinBattleOutnumberedQuest: fulfilled when winning a battle while having fewer troops

Each quest has proto definitions, Scala case classes, converter logic, fulfillment/failure
checks, and LLM prompt generators. PR 2 will add client UI and PR 3 will add quest generation.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 13:29:01 -08:00
5a80fcf765 Add hero faction membership utility functions to FactionUtils (#5861)
Adds two utility functions for checking hero faction membership:

- heroIsInFaction(heroId, factionId, heroes): Efficiently checks if a
  specific hero belongs to a faction by checking hero.factionId
- heroIdsInFaction(factionId, heroes): Returns Set of all hero IDs
  belonging to a faction

These functions check the hero's factionId field, which is the
authoritative source for faction membership. Heroes retain their
factionId when in a province, in a moving army, or imprisoned. They
lose it when exiled, become outlaws, or depart.

This is more reliable than checking province.rulingFactionHeroIds
which misses heroes in moving armies.

Includes comprehensive tests for various scenarios:
- Heroes in provinces
- Heroes in moving armies (retain factionId)
- Imprisoned heroes (retain factionId)
- Exiled heroes (factionId cleared)
- Outlaws (factionId cleared)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 13:14:21 -08:00
8a2bc8d984 Upgrade to Java 25 (LTS) (#5859)
Upgrade Eagle server and JFR sidecar from Java 21 to Java 25.

Java 25 is the latest LTS release (September 2025). Scala 3.7.2
fully supports JDK 25.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 13:04:32 -08:00
50c632a8ea Increase battalion backstory length limits (#5860)
- Initial backstory: 50 → 100 words
- Growth per update: 20 → 50 words
- Soft cap: 150 → 300 words

This allows battalion histories to build up more narrative over time
while still keeping them from growing unbounded.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 13:04:11 -08:00
ac11292778 Upgrade to Java 21 (LTS) (#5851)
Upgrade Eagle server and JFR sidecar from Java 17 to Java 21.

Benefits:
- Better garbage collection (Generational ZGC available)
- General JVM performance improvements
- Foundation for future virtual threads adoption
- Supported until 2031

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 12:07:48 -08:00
de01fc1451 Fix bug report JSON escaping using Newtonsoft.Json (#5852)
Use JsonConvert.ToString() from Newtonsoft.Json for proper JSON string
escaping instead of manual character replacement. This handles all
control characters and edge cases correctly.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 12:02:59 -08:00
fde8ccf675 Fix S3 credentials: separate credentials for Eagle and admin (#5854)
Eagle and admin server use different S3 buckets:
- Eagle: eagle0 bucket (game data) - uses DO_SPACES_* secrets
- Admin: eagle0-assets bucket (What's New) - uses ACCESS_KEY_ID/SECRET_KEY secrets

The previous change (#5847) broke Eagle by giving it credentials that only
have access to eagle0-assets. This fix:
- Reverts Eagle to use DO_SPACES_* secrets (eagle0 bucket access)
- Adds ADMIN_S3_* env vars for admin server (eagle0-assets bucket access)
- Admin container receives ADMIN_S3_* values as DO_SPACES_* env vars

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 11:28:30 -08:00
1033a4b730 Use JRE instead of JDK for Eagle server image (#5849)
The Eagle server only needs to run Java, not compile it. Using the JRE
base image instead of JDK reduces the image size from ~273MB to ~120MB.

The JFR sidecar still uses JDK because it needs jcmd for JFR dumps.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 11:11:27 -08:00
f3959c8c79 Fix collection modified exception in CancelAllPendingSubscriptionAcks (#5848)
TrySetCanceled() can trigger synchronous continuations that re-enter
the lock (C# locks are reentrant) and call Remove() on the dictionary
while the foreach is still iterating, causing InvalidOperationException.

Fix by snapshotting values and clearing the dictionary before cancelling
the TaskCompletionSources.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 11:02:55 -08:00
f7b76bb30d Fix admin server S3 credentials: use working secrets (#5847)
The docker_build workflow was using DO_SPACES_ACCESS_KEY/SECRET_KEY
secrets which don't have write access. Use ACCESS_KEY_ID/SECRET_KEY
instead, which are the same secrets that work for CI builds.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 10:26:13 -08:00
eaae3089de Enable release all prisoners quest generation (PR 3/3) (#5846)
Add quest creation logic to QuestCreationUtils.scala:
- Only available if faction's provinces have at least 3 prisoners
- Returns ReleaseAllPrisonersQuest when condition is met

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 10:09:38 -08:00
eb2e954c2c Add client handling for release all prisoners quest (PR 2/3) (#5845)
- Add QuestTypeString case in DisplayNames.cs
- Add ShortQuestString case in UnaffiliatedHeroRowController.cs

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 10:09:12 -08:00
95b4201819 Add release all prisoners quest types and handling (PR 1/3) (#5842)
Add ReleaseAllPrisonersQuest that requires the faction to release all
prisoners held in their provinces. The quest fails if any prisoner is
executed, moved, or traded away in ransom.

- Add proto definition and Scala case object
- Add proto converter for serialization
- Add fulfillment check (succeeds when 0 prisoners/moving prisoners)
- Add failure handling in ManagePrisonersCommand (Execute, Move)
- Add failure handling in RansomResolutionHelpers (ransom acceptance)
- Add LLM prompts for divine message and quest ended narratives

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 09:41:54 -08:00
5ba1948c8e Add missing meta file for duel_challenged.wav (#5844)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 09:36:25 -08:00
2f6ce2d0b7 Move WhatsNewPanelController to always-active Settings object (#5843)
The controller was on the What's New Panel itself, which starts disabled.
This meant Awake() wouldn't run until the panel was first enabled, but
the WhatsNewManager tries to call Show() before that happens - resulting
in the modal blocker appearing without the panel.

Moving the controller to the always-active Settings object ensures it
initializes properly at startup.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 09:33:30 -08:00
df916f9c29 Enable battalion diversity quest generation (PR 3/3) (#5838)
* Enable battalion diversity quest generation (PR 3/3)

Adds quest creation logic for BattalionDiversityQuest to QuestCreationUtils.

Quest availability:
- Only if province currently has 1-2 battalion types
- This encourages players to diversify their army composition

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Clarify PR dependency structure in quest docs

PR 2 (client) and PR 3 (generation) both depend on PR 1 (types),
but are independent of each other. They can be developed in parallel
and merged in either order after PR 1.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 09:11:03 -08:00
ddbc960945 Add aggressive docker image cleanup to prevent disk full (#5841)
The existing cleanup only removed dangling images. Now also removes
images older than 24h to prevent disk space exhaustion while keeping
recent images available for rollback.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 09:10:35 -08:00
e020a0f66c Add client handling for battalion diversity quest (PR 2/3) (#5837)
Adds C# client handling for BattalionDiversityQuest:
- DisplayNames.QuestTypeString() - returns "Battalion Diversity"
- UnaffiliatedHeroRowController.ShortQuestString() - shows quest description

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 08:53:23 -08:00
d60a9f79ec Fetch What's New data via public HTTP URL (#5839)
The S3 API requires credentials with bucket access, but the file is
publicly accessible at assets.eagle0.net. Use HTTP GET for reading
(no credentials needed) and keep S3 API only for writing.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 08:52:16 -08:00
6b55be9457 Add long-press support for right-click on touch devices (#5827)
* Add long-press support for right-click on touch devices

On iPad and other touch devices, right-click is not available. This adds
long-press detection to GeneralClickDetector (used by the strategic map)
to trigger right-click behavior after holding for 0.5 seconds.

- Tracks pointer down time and position
- Triggers right-click after 0.5s if finger hasn't moved >10 pixels
- Suppresses normal left-click if long-press was triggered
- Cancels long-press detection if finger moves too far

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Only enable long-press for touch input, not mouse

Mouse users can right-click, so long-press should only trigger for
touch devices. Check pointerId >= 0 to distinguish touch (0+) from
mouse (-1, -2, -3 for left, right, middle buttons).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 08:35:58 -08:00
716dd97f75 Fix S3 credentials: support both env var formats (#5840)
Restore support for ACCESS_KEY_ID/SECRET_KEY env vars (used by CI)
while also supporting DO_SPACES_* env vars (used by docker-compose).

Priority order:
1. ~/.s3cfg file
2. DO_SPACES_* env vars
3. ACCESS_KEY_ID/SECRET_KEY env vars

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 08:09:18 -08:00
413f70a3b3 Add battalion diversity quest type (PR 1/3 - types only) (#5836)
Adds BattalionDiversityQuest - a quest where unaffiliated heroes want
to see three different types of battalion at near-full strength (80%
capacity) in the current province.

This PR adds:
- Proto message definition
- Scala case object
- Proto converter
- Fulfillment check (near UpgradeBattalionQuest)
- LLM prompt generators

Does NOT generate the quest yet - that will be in PR 3 after client
handling is added in PR 2.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 07:52:59 -08:00
f2e08cdb5d Replace duel_challenged sound with licensed asset (#5825)
* Replace duel_challenged sound with licensed asset

Replace duel_challenged.mp3 (unknown license) with Weapon Draw Metal 1.wav
from the purchased Medieval Combat Sounds Unity Asset Store pack.

The dramatic sword unsheathing sound fits well for a duel challenge.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Wire up Weapon Draw Metal 5 as duel_challenged sound

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 07:50:49 -08:00
056127c614 Fix S3 credentials: use DO_SPACES_* env vars (#5835)
* Add S3 credentials to admin server container

The admin server needs DO_SPACES_* environment variables to access
S3/Spaces for What's New data storage. Without these, the What's New
Management page fails with "static credentials are empty".

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix S3 credentials: use DO_SPACES_* env vars

The aws package was looking for ACCESS_KEY_ID/SECRET_KEY env vars,
but docker-compose passes DO_SPACES_ACCESS_KEY/DO_SPACES_SECRET_KEY.
Updated ReadAwsConfig() to use the correct env var names and also
respect DO_SPACES_ENDPOINT.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 07:20:22 -08:00
95dba55902 Add stale PR refs cleanup to iOS CI workflows (#5832)
* Add stale PR refs cleanup to iOS CI workflows

Self-hosted runners persist .git between runs. When a PR is updated,
old local refs may point to commits that were never fetched, causing
"Could not scan for Git LFS files" errors.

Applied to:
- ios_addressables_build.yml
- ios_testflight.yml

(Same fix already present in mac_build.yml and unity_build.yml)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fetch LFS after checkout to avoid stale ref issues

Move LFS fetching out of actions/checkout and into a separate step.
This ensures our stale PR refs cleanup runs before any LFS operations,
avoiding "Could not scan for Git LFS files" errors.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix LFS fetch order in mac_build and unity_build workflows

Apply the same fix as ios_* workflows: set lfs: false in checkout
and fetch LFS files manually afterward to avoid stale ref issues.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 07:14:06 -08:00
30379e3e81 Add S3 credentials to admin server container (#5834)
The admin server needs DO_SPACES_* environment variables to access
S3/Spaces for What's New data storage. Without these, the What's New
Management page fails with "static credentials are empty".

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 07:07:13 -08:00
d1a2434c4a Enable province order quest generation (PR 3/3) (#5833)
Add quest creation logic for DevelopProvincesQuest and MobilizeProvincesQuest
to QuestCreationUtils.

Quest parameters:
- Availability: Only if faction has >= 3 provinces
- Target province count: Random 3-5, capped at current province count
- Target months: Random 3-6

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 07:05:42 -08:00
801ce59e29 Add client handling for province order quests (PR 2/3) (#5830)
- Add ADDING_NEW_QUESTS.md documentation explaining the three-PR
  strategy and listing all files that need modification for new quests
- Add DevelopProvincesQuest and MobilizeProvincesQuest cases to
  DisplayNames.QuestTypeString()
- Add quest description strings to UnaffiliatedHeroRowController
  showing progress (e.g., "3/5 months")

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 06:59:28 -08:00
67a57c73c8 Add click-to-dismiss on modal blockers as safety net (#5829)
* Add click-to-dismiss on modal blockers as safety net

If a modal panel somehow becomes invisible while its blocker remains
active, users can now tap the dimmed area to dismiss it. This prevents
getting stuck with an unresponsive UI.

Applied to all three controllers that share the modal blocker:
- WhatsNewPanelController
- BugReportPanelController
- SettingsPanelController

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Give each modal panel its own dedicated modal blocker

Previously Settings, Bug Report, and What's New panels shared a single
modal blocker, which could cause state conflicts if one panel's blocker
state affected another.

Now each panel has its own dedicated blocker:
- Settings Panel Modal Blocker
- Bug Report Modal Blocker
- What's New Modal Blocker

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 06:58:56 -08:00
7bc5149e02 Fix What's New entries not showing (S3 fetch error was silently swallowed) (#5831)
The fetchWhatsNewData function was silently swallowing ALL errors and
returning empty data, not just "file not found" errors. This masked
real issues like permission errors.

Now:
- Only returns empty data for actual "NoSuchKey" (file not found) errors
- Logs and returns other errors so they appear on the page
- Logs successful fetches with entry count for debugging

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 06:57:17 -08:00
ffe40c0c7b Fix What's New 'Add Entry' button not working (#5828)
The htmx form was receiving both an HX-Redirect header and HTML body content.
This caused htmx to swap the content before processing the redirect, making
the button appear to do nothing.

Fix: Return only the HX-Redirect header without body content on success.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 06:44:55 -08:00
2130313841 Add province order quest types (PR 1/3 - types only) (#5826)
* Add Province Order Quests (Develop/Mobilize)

Add two new quest types where unaffiliated heroes want the faction to
maintain a certain number of provinces in specific order states
(Develop or Mobilize) for a cumulative number of months.

Quest mechanics:
- Availability: Only if faction has >= 3 provinces
- Target province count: Random 3-5, capped at current province count
- Target months: Random 3-6 (componentCount)
- Progress: Each round, if faction has >= X provinces with the required
  order type, componentsFulfilled increments by 1
- Completion: When componentsFulfilled >= componentCount
- Failure: If faction falls below X total provinces

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Remove ProvinceOrderQuestProgress action result type

Fold the province order quest progress changes into the EndVassalCommandsPhase
action result instead of creating a separate action result type.

Also improve LLM prompt descriptions to explain what Develop and Mobilize
orders mean (Develop = improve agriculture/economy/infrastructure,
Mobilize = organize/train/arm troops for war).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Remove quest generation for province order quests

Keep the proto definitions, Scala types, converters, and handling code
(fulfillment, failure, progress tracking, LLM prompts) but remove the
actual quest creation logic from QuestCreationUtils.

This allows the client to be updated to understand these quest types
before the server starts generating them.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 06:41:47 -08:00
893bc3a009 Split Organize Troops cost display into separate value and warning labels (#5824)
- Change costLabel to only show the numeric cost value
- Add separate costWarningLabel for "(only X available)" warning
- Warning label only shown when insufficient gold available

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 21:20:59 -08:00
191dd0c3fd Request narrative prose output for backstory updates (#5823)
Update hero and battalion backstory prompt generators to explicitly
request flowing narrative prose rather than dated lists. The LLM
should weave events into a cohesive story that reads as a biography
or unit history, not a timeline.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 21:12:23 -08:00
faf53e642f Add clicked province panel support for narrow screens (#5822)
- Add underProvinceNameText/underProvinceOwnerText to MapController
- Update SetUpCenterText to populate both regular and under text fields
- Add clickedProvincePanel/underClickedProvincePanel refs to EagleGameController
- Switch panel visibility based on screen width in ArrangeLayout
- Organize EagleGameController Inspector fields with Header attributes

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 21:00:54 -08:00
45c6b22ef8 Add client update notification system (server-side) (#5820)
Notify connected clients when a new version is available after CI deploy.

Flow:
1. CI deploys new build and waits 60s for CDN cache
2. CI calls admin server HTTP endpoint with shared secret
3. Admin server calls Eagle via gRPC
4. Eagle broadcasts to all connected lobby users

Components:
- Proto: ClientUpdateAvailable message, NotifyClientUpdate RPC
- Eagle: notifyClientUpdate() broadcasts to lobby users
- Admin server: /notify-update HTTP endpoint with secret auth
- CI: Notify steps in mac_build.yml and unity_build.yml
- Docker: NOTIFY_SECRET env var passed to admin container

Client-side handling will be added in a follow-up PR.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 20:57:37 -08:00
7460b32098 Add battalion backstory to LLM prompt generators (#5813)
* Add battalion backstory to LLM prompt generators

Add descriptionWithBackstory methods to BattalionDescriptions that include
the battalion's backstory text alongside the basic description (name, type,
size). This gives LLM prompts richer context about the units involved.

Updated prompt generators:
- SuppressBeastsPromptGenerator (Failed and Succeeded): Include battalion
  backstory when describing beast hunting attempts
- HeroBackstoryUpdatePromptGenerator: Include battalion backstory in
  FoughtInBattle, SuppressedBeasts, and SuppressedRiot events

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix battalion backstory usage in prompts

Use basic description inline in sentences and include backstory as
separate context block, matching how hero backstories are handled.

- In SuppressBeastsPromptGenerator: use basic description in
  "$heroName took [battalion]" and add fullDescription as context
- In HeroBackstoryUpdatePromptGenerator: use basic description only
  in event text (hero's story doesn't need battalion backstory detail)
- Renamed methods in BattalionDescriptions for clarity:
  - backstoryText: just the backstory
  - fullDescription: "Name is a battalion... $backstory"
  - optionalFullDescription: for optional battalions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix duplicate code blocks from rebase

The rebase introduced duplicate code blocks in FoughtInBattle,
SuppressedBeasts, and SuppressedRiot cases that caused syntax errors.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Remove unused BattalionView methods from BattalionDescriptions

Since EventForHeroBackstory now uses BattalionId instead of BattalionView,
we no longer need the BattalionView overloads in BattalionDescriptions.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 20:56:53 -08:00
d4c6f3f83c Change EventForHeroBackstory to use BattalionId instead of BattalionView (#5818)
The FoughtInBattle, SuppressedBeasts, and SuppressedRiot events now store
Option[BattalionId] instead of Option[BattalionView]. This allows looking
up the battalion from GameState at prompt generation time, providing access
to the battalion's current backstory text rather than a snapshot.

Changes:
- Proto: Changed battalion field from BattalionView to optional int32
- EventForHeroBackstoryT.scala: Changed battalion type to Option[BattalionId]
- EventForHeroBackstoryConverter: Updated toProto/fromProto conversion
- ResolveBattleAction, SuppressBeastsCommand, HandleRiotCrackDownCommand:
  Now pass battalion.map(_.id) when creating events
- HeroBackstoryUpdatePromptGenerator: Looks up battalion from GameState
  using gameState.battalions.getOrElse(id, gameState.destroyedBattalions(id))
- Updated tests and removed unused BattalionViewFilter deps

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 20:27:17 -08:00
d1c30315c4 Update Notification Panel layout (#5817)
* Update Notification Panel layout

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Additional Notification Panel layout tweaks

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Update button text styling

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 20:09:13 -08:00
b54a64becb Update Exile Vassal and Hero Gift panel layouts (#5816)
* Update Exile Vassal panel layout

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Update Hero Gift panel layout

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 19:31:21 -08:00
47e9af8808 Fix battalion backstory crash and generate initial backstories for raised battalions (#5814)
* Fix empty.tail crash in BattalionBackstoryUpdatePromptGenerator

When a battalion had no previous backstory versions, calling .last on
an empty vector caused a NoSuchElementException. Use lastOption with
a match to safely handle the empty case by returning an empty string.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Generate initial backstory for newly raised battalions

When a player raises a new battalion via OrganizeTroopsCommand, now
generates a BattalionInitialBackstoryRequest so the battalion gets
its first backstory. Previously only battalions created at game start
(in NewGameCreation) received initial backstories.

This ensures all battalions have backstories from their creation,
complementing the empty.tail fix which handles the transitional case.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 19:14:56 -08:00
627dab71c6 Improve Suppress Beasts layout and cost display formatting (#5815)
- Update Suppress Beasts command panel layout in Unity
- Only show "(only X available)" when insufficient gold, with newline

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 19:07:17 -08:00
465b1dbab0 Add battalion popup header with name and type icon (#5811)
Add references for battalion name (GeneratedTextUpdater) and type icon
(RawImage) to the battalion popup panel header. Populate them when
hovering over a battalion row.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 18:55:18 -08:00
242df8d760 Fix None.get crash in OrganizeTroopsCommand backstory event creation (#5812)
When creating backstory events for changed battalions, the code assumed
every battalion in changedBatt would also be in changedBattalions. This
is not true when a battalion is modified indirectly - for example, when
troops are transferred OUT of it to another battalion.

The fix uses find() and handles the None case with default values (0 for
hired, dismissed, and transferred in counts).

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 18:47:03 -08:00
eb52ea5aaf Fix CI: detect and recover from git corruption (#5809)
* Add git corruption detection to Unity CI workflows

Self-hosted runners can accumulate corrupted git state over time.
Add a pre-checkout step that runs git fsck and nukes the repo if
corruption is detected, allowing a fresh clone.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix CI git corruption: check target ref objects instead of full fsck

Self-hosted runners can have stale refs (e.g., refs/remotes/pull/*/merge)
pointing to commits whose objects weren't fetched when the PR was updated.
Running git fsck is too broad and slow. Instead, check if the specific
target ref's objects are complete before checkout.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix CI: prune stale PR refs instead of checking all objects

Self-hosted runners persist .git between runs. When a PR is updated,
actions/checkout doesn't prune old local refs like refs/remotes/pull/*/merge.
These stale refs may point to commits whose objects were never fetched,
causing "missing object" errors during checkout.

Fix by explicitly removing PR refs before checkout. This is faster and
more targeted than validating object completeness.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 18:32:10 -08:00
1bcac6ee27 Add battalion backstory events for riot, training, arming, and starvation (#5810)
Add four new battalion backstory event types:
- SuppressedRiot: Records when a battalion helps suppress a riot, including
  the riot size, casualties, and whether the suppression succeeded
- Trained: Records training sessions by a hero, with training improvement
- Armed: Records equipment upgrades with armament improvement and cost
- SurvivedStarvation: Records when battalions suffer casualties due to
  food shortage, with loss proportion and whether on march or in garrison

The LLM prompt generator includes guidance to not over-emphasize routine
training and arming events in favor of more dramatic events like battles
and riots.

Also includes per-battalion cost tracking in ArmTroopsCommand to properly
attribute gold spending for each battalion's backstory event.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 18:31:12 -08:00
2562e99e3c Update TODO: mark shardok cancellation and what's new as done (#5807)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 18:11:23 -08:00
01bb6c47ab Add What's New feature to Unity client (#5805)
* Add What's New feature to Unity client

- Add WhatsNewManager singleton for fetching and tracking changelog
- Add WhatsNewPanelController for modal display with category styling
- Integrate CheckAndShow() call in ConnectionHandler after OAuth login

The manager fetches entries from assets.eagle0.net/whats-new.json,
tracks last seen date in PlayerPrefs, and shows new entries on login.
UI prefab setup required in Unity Editor.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Wire up What's New UI in Unity

- Move WhatsNewEntryUI to separate file for Unity component discovery
- Add What's New Entry prefab
- Wire up WhatsNewManager and WhatsNewPanelController in Gameplay scene

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 17:38:43 -08:00
85255d15d5 Style What's New summary as a button (#5808)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 17:24:34 -08:00
371d964922 Add battalion backstory events and LLM-driven updates (#5796)
* Add battalion backstory infrastructure

Adds support for battalions to have backstory events similar to heroes:

- New proto message EventForBattalionBackstory with event types:
  - OrganizedTroops: tracks size changes, hiring, dismissals, transfers
  - SuppressedBeasts: records beast suppression operations
  - ApprehendedOutlaws: records outlaw apprehension (for future use)
  - FoughtInBattle: records battle participation and casualties

- New Scala enum EventForBattalionBackstoryT matching the proto

- Updated BattalionT trait and BattalionC with:
  - backstoryVersions: Vector[BackstoryVersion] for LLM-generated text
  - backstoryEvents: Vector[EventForBattalionBackstoryT] for events
  - Helper methods: withBackstoryVersions, withBackstoryEvents, addBackstoryEvent

- New converters:
  - BackstoryVersionConverter (extracted for reuse)
  - EventForBattalionBackstoryConverter
  - Updated BattalionConverter to handle backstory fields

- Wired up backstory events in:
  - SuppressBeastsCommand: adds SuppressedBeasts event to battalion
  - ResolveBattleAction: adds FoughtInBattle event to battalions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Add LLM-driven battalion backstory updates

This commit adds the system to actually use battalion backstory events
to trigger LLM-generated backstory updates, similar to the hero backstory
update system.

New components:
- BattalionBackstoryUpdateAction: finds battalions with events, generates
  LLM requests, adds new backstory versions, and clears events
- BattalionBackstoryUpdateActionGenerator: creates action from game state
- BattalionBackstoryUpdatePromptGenerator: generates prompts describing
  events for LLM to update backstory
- BattalionBackstoryUpdateRequest proto message and converter

The system is wired into:
- EndPlayerCommandsPhaseAction
- EndVassalCommandsPhaseAction
- EndBattleAftermathPhaseAction
- EngineImpl (command execution)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Track previousSize/newSize for battalion events, add heroId to OrganizedTroops

Changes:
- SuppressedBeasts event: replaced 'casualties' with 'previousSize' and 'newSize'
- ApprehendedOutlaws event: added 'previousSize' and 'newSize' fields
- OrganizedTroops event: added 'heroId' for the province ruler who ordered the reorganization
- OrganizeTroopsCommand now creates battalion backstory events when troops are organized
- Updated prompt generator to include hero names and size information

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 16:55:46 -08:00
20f4ed5bc5 Cancel outstanding Shardok battles when game is deleted (#5806)
When a game is deleted (via admin console or last player dropping),
cancel any pending Shardok battles to:
- Stop processing battles for non-existent games
- Prevent reconnection attempts for deleted games
- Clean up resources

The implementation removes matching entries from pendingBattles map,
which prevents scheduleReconnect from re-establishing streams and
handleStreamingResponse from processing further updates.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 16:04:44 -08:00
7d69596176 Add What's New admin console and changelog script integration (#5804)
- Add CRUD handlers for managing what's-new entries stored in S3
- Add whats_new.html template with add/edit/delete forms
- Add navigation link to layout.html
- Add player-friendly summary generation to generate_changelog.sh
- Add seed JSON file for initial data

The admin console at /whats-new allows managing changelog entries
that will be displayed to players in the Unity client. The script
integration generates summaries and opens the admin console with
pre-populated content after sending weekly changelogs.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 15:51:53 -08:00
689dc5e531 Add battalion backstory popup on hover (#5803)
* Add battalion backstory popup on hover

Add support for displaying battalion backstories when hovering over
battalions in the Battalions panel, similar to hero backstories:

- Added battalionPopupPanel and battalionPopupPanelBackstory fields
- Added BattalionLongHoverRowChanged method to handle hover events
- Uses GeneratedTextUpdater for auto-scrolling text display

To wire up in Unity:
1. Create a popup panel similar to hero popup
2. Add GeneratedTextUpdater component for backstory text
3. Assign references in HeroesAndBattalionsPanelController
4. Wire battalionsTable.LongHoverRowChangedHandler to BattalionLongHoverRowChanged

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Add Eagle0 > Build Protos menu item for editor proto rebuilds

Provides a convenient way to rebuild protocol buffer files from within
Unity Editor (Cmd+Shift+P on Mac). This helps when proto files change
and the generated C# code needs to be updated.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Wire up battalion backstory popup panel in Unity

- Add TableRowHoverDetector to Battalion Row Prefab for hover events
- Configure battalion popup panel in Gameplay scene
- Wire LongHoverRowChangedHandler to BattalionLongHoverRowChanged

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Position popup column spacer via EagleGameController layout system

Set the popup column spacer width in ArrangeLayout() alongside the
heroes and battalions panel width, ensuring they stay synchronized
when resolution changes.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 15:03:36 -08:00
3a8f8a4aff Add backstory_text_id to BattalionView (#5802)
Propagate battalion backstories to clients by adding backstory_text_id
field to BattalionView proto and Scala view classes.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 11:24:50 -08:00
b957cdeed7 Add command interaction guidance and hero stat gain tutorials (#5800)
1. Command Interaction Guidance (onboarding step 7):
   - Explains clicking provinces for acting vs right-click for target
   - Describes using left side panels for heroes/battalions selection
   - Reminds that Commit finalizes the command

2. Hero Stat Gain Tutorial:
   - Triggered first time a player's hero gains a stat point
   - Uses HeroStatGained action result type for reliable detection
   - Explains experience, stat growth, and professions

Also updated info button tutorial to mention the '?' keyboard shortcut.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 10:57:49 -08:00
207f5e07ca Update alpha TODO: mark completed items, add end game ideas (#5801)
Completed:
- Bug report form in Unity client
- Feedback channel (Discord server)
- Support plan (Discord + bug reporting + email)
- Art/music licenses and open source disclosures (attributions panel)

Added end game ideas:
- Win condition: all other factions defeated
- Mid-game progression: King recognition events

Moved "What's new" changelog to nice-to-have.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 10:01:29 -08:00
fff739e144 Add battalion initial backstory generation (#5798)
* Add battalion initial backstory generation

Adds LLM-generated backstories for battalions created at game start.

Changes:
- Add backstoryVersions field to Battalion proto and BattalionT/BattalionC
- Add BattalionInitialBackstoryRequest to GeneratedTextRequestT
- Create BattalionInitialBackstoryPromptGenerator for LLM prompts
- Wire up in LlmResolver and NewGameCreation
- Update BattalionConverter to handle backstory versions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Rename hero_backstory_version to backstory_version

Since BackstoryVersion is used for both heroes and battalions, rename:
- hero_backstory_version.proto -> backstory_version.proto
- hero_backstory_version_proto -> backstory_version_proto
- hero_backstory_version_scala_proto -> backstory_version_scala_proto

Also rename leading_hero_id to province_ruler_hero_id in
BattalionInitialBackstoryRequest to clarify this is the hero who
rules the province, not a battalion commander.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 09:44:48 -08:00
14fcfa0f03 Fix bug report panel not showing on first click (#5799)
* Fix bug report panel not showing on first click

Change Start() to Awake() so initialization happens at load time
rather than when the GameObject first becomes active. This prevents
Start() from disabling the panel after Show() has enabled it.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Enable BugReportPanelController GameObject at scene start

The controller needs to be active so Awake() runs at load time,
allowing Show() to work on first click.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 09:39:06 -08:00
a098bf2f56 Add bug report form to Unity client (#5784)
* Add bug report form to Unity client

Adds a Report Bug button to the Settings panel that opens a bug report
form. Reports include:
- User description
- Game state (game ID, faction, date, active battles)
- System info (OS, CPU, GPU, resolution)
- Recent connection logs

Reports are sent via webhook (supports Discord and Slack).
Configure webhook URL with BugReportPanelController.SetWebhookUrl().

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Configure Discord webhook URL for bug reports

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Add escape key handling for bug report and attributions panels

- Bug report panel closes on Escape
- Attributions panel closes on Escape
- Settings panel only toggles if other panels aren't open
- Wire up bug report panel UI in Gameplay scene

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 09:10:44 -08:00
46b16ecbb7 Fix sporadic warmup binary build failure in CI (#5797)
The warmup binary was being copied from a hardcoded bazel-bin path that
doesn't work reliably with cross-compilation and remote caching. When the
binary was cached but not materialized locally, the cp command would fail.

Fix by:
- Create a warmup_tar pkg_tar target that packages the warmup binary
- Use tar extraction instead of cp, which forces Bazel to materialize
  the output file before the command runs
- Rename the binary from warmup_linux_amd64 to warmup in the tar

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 07:06:25 -08:00
1112739c04 Unity layout updates: Recruit panel and Diplomacy button-style toggles (#5795)
* Update Recruit command panel layout

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Update Diplomacy toggles to button-style like Improve

Change radio-style toggles to highlighted button toggles using
ToggleGroup and CanvasGroup alpha for disabled state.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 07:05:48 -08:00
0e24333aaf Refactor HeroGenerator and BattalionNameGenerator for functional purity (#5791)
- Make HeroGenerator immutable with private constructor
  - Change `var remainingPregeneratedHeroes` to `val`
  - Return tuple `(HeroGenerationResponse, HeroGenerator)` from getHero()
  - Add `forTesting()` factory method for test usage
  - Filter excluded names during construction instead of lazily

- Make BattalionNameGenerator immutable
  - Change `var excludingNames` to `val` (was never mutated anyway)

- Update callers to properly thread the generator through recursion/fold
  - PerformUnaffiliatedHeroesAction: thread generator through `go` recursion
  - NewGameCreation: thread generator through fold, extract at end
  - EngineImplTest: use forTesting() instead of mock

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 06:55:13 -08:00
4eb43010fd Fix casualtyCount to only reflect battalion losses (#5794)
casualtyCount was incorrectly set to total damage (including hero vigor
loss) instead of just battalion troop losses. Now:
- No battalion: 0 casualties
- Battalion survived: actual troop losses
- Battalion destroyed: entire battalion size

This ensures casualtyCount semantically represents battalion casualties,
not hero damage which is tracked separately.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 06:31:02 -08:00
c9ca34e5e8 Fix None.get crash in SuppressBeastsSucceededPromptGenerator (#5793)
When a hero suppresses beasts alone (no battalion), casualtyCount can
still be > 0 because casualties are applied to hero vigor. The code
incorrectly tried to access the battalion name for casualty text even
when no battalion existed.

Now only show battalion casualty text when a battalion actually exists.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 05:37:18 -08:00
5ffa08b0e5 Update Unity layout for command panel (#5792)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 21:53:42 -08:00
12b473ac61 Add detailed help content for command tutorials (#5790)
* Add detailed help content for command tutorials

Update help text for many commands with more useful information:
- Rest: Vigor mechanics and Constitution bonus
- Train: Strength/Charisma stats, Champion bonus
- Hero Gift: Loyalty thresholds and January check
- Feast: Benefits and cost scaling
- Trade: Exchange rates and Economy bonus
- Arm Troops: Infrastructure requirements
- Organize Troops: Battalion types and requirements
- Recruit Heroes: Ready to Join mechanics
- Travel: List of available town activities
- Send Supplies: Destination selection tips
- Divine: What it reveals and cost considerations
- Recon: Intelligence gathered and risks
- Swear Kinship: Requirements and benefits

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Auto-switch help panel when selecting a different command

If the help panel is open and the user selects a different command,
the help panel now automatically switches to show help for the new
command instead of staying on the old one.

Also fix Rest tutorial: Constitution is max Vigor, not recovery rate.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Add combat warning to March help

Mention that marching may trigger a battle if enemy occupies the
destination or is also marching there.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix Feast help: only costs gold, not food

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix Recon help: scouts can't be captured

Remove incorrect warning about capture risk.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix Recon help: remove incorrect agility info

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 21:41:18 -08:00
af5fb35731 Remove non-local returns and -Wconf suppression (#5789)
* Remove non-local returns and -Wconf suppression

Refactor code to avoid non-local returns (using `return` inside closures)
which are deprecated in Scala 3. Changes:

- OAuthService.scala: Replace early returns with if/else patterns in
  exchangeCodeForToken, fetchUserInfo, generateAppleClientSecret,
  exchangeAppleCode, and parseAppleIdToken methods
- PerformProvinceEventsAction.scala: Replace for-loop with early return
  with foldLeft pattern in beastType method

Remove the `msg=Non local returns:silent` suppression from the toolchain.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix non-local returns in MapValidationTest

Refactor checkMonthlyWeather to use exists() instead of foreach with
early returns. Also fixes typo in error message (was "> 0" should be "> 100").

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 21:32:54 -08:00
6f25ba93cf Add minimum width (720px) to tutorial panel (#5788)
* Add minimum width (480px) to tutorial panel

Prevents help text from being too tall and narrow.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Change tutorial panel minimum width to 720px

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 21:12:20 -08:00
660ee12afc Remove unnecessary -Wconf suppression for 'this' qualifier warnings (#5787)
This suppression was not needed - there are no warnings of this type
in the codebase.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 21:11:45 -08:00
c00db45794 Replace automatic command tutorials with info button system (#5785)
* Replace automatic command tutorials with info button system

Instead of showing one-time tutorial popups when command panels open,
users can now click an info button in the command panel header to view
help anytime. This makes help more accessible and less intrusive.

Changes:
- Remove automatic tutorial trigger from CommandSelector
- Add info button to CommandPanelController (created programmatically)
- Add ShowCommandHelp() to TutorialManager for repeatable help display
- Add info button intro step to onboarding sequence
- Update March, Defend, Improve help with detailed instructions
- Remove onboarding prerequisite from command tutorials

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Remove programmatic info button creation

Keep just the public field reference so it can be set up in Unity Editor.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix command tutorial ID lookup

Convert CommandType enum (e.g., "ImproveCommand") to tutorial ID format
(e.g., "command_improve") by removing "Command" suffix and lowercasing.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Add toggle behavior to info button and improve help content

- Clicking info button while help is showing now closes it
- Add ActiveSequenceId property to TutorialManager
- Update Improve help to mention agility/strength bonuses and engineer bonus

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix tutorial panel positioning to stay above command panel

- Simplify positioning logic for Top anchor to reliably place panel just above target
- Make panel at least 600px wide (or target width) for better readability
- Remove complex size-dependent clamping that caused inconsistent positioning
- Use simpler pivot-based positioning that doesn't depend on panel size calculations

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix command tutorial ID conversion for multi-word commands

Convert PascalCase command names to snake_case to match tutorial IDs:
- "OrganizeTroopsCommand" -> "command_organize_troops"
- "ArmTroopsCommand" -> "command_arm_troops"
- etc.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Reduce tutorial panel minimum width to 540px

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Add Paladin bonus tip to Give Alms help

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Add imprisonment warning to Diplomacy help

Warn that untrusted factions may imprison your ambassador.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix manage_prisoner tutorial ID to match command type

Command is ManagePrisonerCommand (singular), not ManagePrisonersCommand.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Add '?' keyboard shortcut to toggle command help

Press Shift+/ (?) to open/close help for the current command.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Remove forced width matching for tutorial panel

Let the panel use its natural ContentSizeFitter width instead of
forcing it to match the command panel width.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Add info button to command panel in Unity scene

Wire up info button UI in Gameplay.unity to show command help.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 17:09:57 -08:00
3af3c29630 Replace deprecated _ wildcard syntax with ? in type arguments (#5786)
Scala 3 deprecates `_` for wildcard type arguments in favor of `?`.
This fixes the one occurrence in CommandChoiceHelpers.scala and removes
the -Wconf suppression for this warning.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 16:54:25 -08:00
09280e2e70 Enable -Werror and fix all Scala compiler warnings (#5783)
* Enable -Werror and fix compiler warnings (partial)

This commit enables -Werror in the Scala toolchain and fixes warnings
in the main server code and several test files. Main changes:

Server code fixes:
- Remove unused imports (HeroId, ActionResult, unused, Try)
- Remove unused parameters (playerCount cascade in NewGameCreation,
  persister in synchronizedCreateGame, userServiceForGames in buildServer)
- Fix discarded value warnings with explicit : Unit type ascriptions
- Fix pattern match warning by removing unnecessary type annotation

Test code fixes:
- Remove unused imports across multiple test files
- Remove unused default parameter values that are always explicitly passed
- Fix ScalaMock expectation setup warnings with : Unit
- Fix MapValidationTest to properly combine boolean checks
- Fix loneElement usage to use proper assertions

The -Werror flag is now enabled along with -Wconf suppressions for:
- Initialization warnings (safe patterns Scala 3 warns about)
- ScalaTest assertion return values
- External/generated sources

Many test files still have warnings that need to be fixed in follow-up
commits before all 315 tests will build with -Werror.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Remove unused heroes variable in ReturningHeroesTest

Fix CI failure caused by unused private member warning.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix Scala compiler warnings in test files for -Werror compatibility

- Remove unused imports across multiple test files
- Remove unused private members and default parameters
- Add `: Unit` type ascription to ScalaMock expectations to silence discarded value warnings
- Fix deprecated `<function> _` syntax by removing trailing ` _`
- Replace deprecated `= _` with `scala.compiletime.uninitialized`
- Add `val _ =` to explicitly discard unused return values

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Fix remaining Scala compiler warnings in main sources for -Werror

- Remove unused imports: JString in OpenAIResponsesServiceImpl, FactionId in
  DiplomacyOptionConverter and RansomOfferDetailsConverter,
  OpenAIChatCompletionsServiceImpl in HeroLibraryGenerator
- Replace deprecated `= _` with `= uninitialized` in SseSubscriber and
  ShardokInstanceManager
- Remove unused private member MessageType in SseSubscriber
- Remove unused private member openAICaller in HeroLibraryGenerator
- Add missing pattern match cases: UNKNOWN_UNIT in UnitStatusConverter,
  Gender.Unknown in HeroLibraryGenerator
- Fix discarded value warnings with `val _ =` in ShardokInstanceManager
- Fix unused pattern variables in NameListChecker

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 16:28:25 -08:00
adminandGitHub 44e90aaed2 Fix compiler warnings across codebase for -Werror preparation (#5782) 2026-02-02 08:46:54 -08:00
73f6d1fc33 Fix tutorial auto-created game to use 7 factions (#5781)
Previously the tutorial created a 1-faction game (solo with no AI).
Now it creates a 7-faction game (1 human + 6 AI), matching the
default when creating a game from the lobby.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 21:21:38 -08:00
5e7d833738 Add alpha test notice to invitation landing page and email (#5780)
For the closed alpha, we're using a simple notice instead of a full
privacy policy. The notice explains:
- This is a private alpha test
- We collect OAuth email and gameplay data
- Users can delete their account via accounts.eagle0.net
- Contact email for questions

Added to:
- Invitation landing page (/invite/{code})
- Invitation email (HTML and plaintext)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 20:47:53 -08:00
b40be57329 Clean up faction names by removing unnecessary "The" prefix (#5779)
Remove "The" from faction names where it sounds better without:
- Jade Caravan
- Maniacal Monks
- Bulwark Brotherhood
- Builders of a Better World
- Iron Fist Confederacy
- Mad Doombringers
- Shadow Army
- Verdant Fellowship

Keep "The" where it adds gravitas or feels essential:
- The Ashen Circle
- The Fracture Covenant
- The Hollow Throne
- The King's Loyalists
- The Syncopated Sanctum

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 19:10:42 -08:00
3123d597e6 Add iOS export compliance flag to avoid manual App Store Connect step (#5778)
Set ITSAppUsesNonExemptEncryption=false in Info.plist during iOS build.
This indicates the app only uses standard OS-provided encryption (HTTPS)
and avoids the manual compliance questionnaire in App Store Connect.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 19:05:49 -08:00
85226178ec Fix additional compiler warnings for -Werror preparation (#5777)
- Remove unused imports (FactionT, HostileArmyGroupProto, GameId)
- Remove unused parameters (jwtService in AuthServiceImpl, gameId in MarchCommand, provinces in ProvinceDistances)
- Add exhaustive match handling for ImprovementTypeProto UNKNOWN case

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 18:03:00 -08:00
3ca987f3cd Unity layout updates (#5776)
* Layout updates

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Additional layout updates

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 15:53:14 -08:00
85fd136cf9 March/Defend command selector layout improvements (#5775)
* Wire up heroesColumn and battalionsColumn references in March Command Selector

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Update command selector layout when aspect ratio changes

Previously, hero/battalion column visibility was only set when a command
selector was first opened. Now layout changes are propagated to the
active selector via OnLayoutModeChanged(), so columns hide/show
dynamically when the window is resized.

- Add OnLayoutModeChanged() virtual method to CommandSelector
- Override in MarchCommandSelector and DefendCommandSelector
- Add UpdateSelectorLayoutMode() to CommandPanelController
- Call from EagleGameController when layout mode changes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Increase narrow screen threshold from 1.35 to 1.45

The previous threshold was too low to catch some narrow aspect ratios
that should trigger narrow layout mode.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 15:13:25 -08:00
813a1a05c3 Enable -Wall and fix compiler warnings for Scala 3 (#5767)
This is a stepping stone toward enabling -Werror for exhaustiveness checking
on sealed traits. Changes include:

- Enable -Wall in Scala toolchain configuration
- Add -Wconf suppressions for generated code and external dependencies
- Fix discarded value warnings by explicitly discarding with `val _ =`
- Fix non-local return warnings in JwtService using nested if/else
- Fix deprecated `= _` syntax using `= uninitialized` in OAuthHttpHandler
- Fix implicit parameter syntax: `(ec)` -> `(using ec)` in GrpcRetrier
- Remove unused imports across multiple files
- Add @unused annotation for intentionally unused parameters
- Fix wrong imports in SettingUpdater (was using wrong proto package)
- Fix BUILD.bazel exports to make GrpcRetrier available transitively
- BUG FIX: StringConstructionParser was silently ignoring parse errors
  when closing character wasn't found (added missing return)

Note: -Werror is not yet enabled (TODO in tools/BUILD.bazel) because
there are still unused import warnings in some files. Once those are
fixed, -Werror can be uncommented to get compile-time exhaustiveness
checking.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 15:08:00 -08:00
2726c477a1 Move displayName -> userId resolution from Eagle to admin server (#5774)
Eagle's GameAdminServiceImpl now expects userId directly in requests,
removing its dependency on UserService for displayName lookups.

Changes:
- Rename new_username -> new_user_id in game_admin.proto
- Rename previous_username -> previous_user_id in ReassignFactionResponse
- Rename Result enum values: INVALID_USERNAME -> INVALID_USER_ID,
  USERNAME_ALREADY_IN_USE -> USER_ALREADY_IN_USE
- Add resolveToUserId() to admin_server.go that accepts either userId
  or displayName and resolves to userId using the Admin API
- Remove resolveToUserId and UserService dependency from GameAdminServiceImpl

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 15:02:01 -08:00
641fe066fb Remove user_name field from Shardok PlayerSetupInfo (#5773)
Shardok never used the user_name field - the C++ code completely ignores
it and the Unity client creates its own player names ("You" and "AI").

Changes:
- Mark user_name as reserved in player_info.proto
- Change ShardokInterfaceProxy to use humanFactions: Set[FactionId]
  instead of playerToUserMap: Map[FactionId, String]
- Simplify GamesManager.resolveBattle to pass just the set of human factions
- Remove UserName assignments from CustomBattleHandler.cs

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 15:00:19 -08:00
df0379d36c Fix admin console display name lookup by passing admin auth (#5772)
The resolveDisplayName function calls adminClient.GetUser, which
requires admin authentication. Previously, fetchGames was passing
a plain context without the admin JWT token, causing GetUser to fail
and fall back to showing the UUID instead of the display name.

This fix changes fetchGames to accept the HTTP request and use
createAdminContext(r) which extracts the admin JWT token from the
request and adds it to the gRPC metadata.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 14:18:29 -08:00