22 Commits
Author SHA1 Message Date
adminandGitHub 21b56b8098 Upgrade Unity editor to 6000.4.10f1 (#7013) 2026-06-10 06:49:54 -07:00
adminandGitHub 646c47259c Upgrade Unity project to 6000.4.9f1 (#6788) 2026-05-29 06:52:18 -07:00
7830c42cd2 CLAUDE.md: forbid cd-prefixed commands; fix contradictory git rule (#6728)
Adds a no-`cd` rule to the CRITICAL BASH RULES section: run git/gh/bazel
directly from the cwd (repo/workspace discovery walks up from a subdir;
the shell resets cwd after every command so a cd never persists; and
`cd <dir> && <cmd>` also trips the no-chaining rule and forces an
approval prompt every time).

Also fixes the no-`git -C` rule, which previously said "Instead, cd to
the repo root" — directly contradicting the new rule. It now points at
the no-`cd` rule instead.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-19 07:03:29 -07:00
c461d5d04e Add git -C prohibition to CLAUDE.md (#6387)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 12:01:01 -08:00
9030c455e0 Add no-chained-commands rule to CLAUDE.md (#6295)
Prevents Claude from combining bash commands with &&, ||, or ;.
Each command must be a separate tool call, which makes permission
rules work correctly per-command.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 11:41:27 -08:00
82de1a01d1 Add warning to never modify hero names (#6077)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-15 23:54:34 -08:00
0313e0ce54 Add profession image to RunningGameItem (#6058)
- Add professionImage RawImage field
- Remove unused goButton field (whole row is now a button)
- Populate profession image using EagleCommonTextures
- Handle UnknownProfession by returning null (hides image)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-15 20:38:50 -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
8ce4e4c4a9 Add rule: Claude must never merge PRs (#5216)
User explicitly stated: "never ever ever ever merge a PR for me.
You create PRs. I merge them."

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-12 08:41:55 -08:00
1c24474a0b Add critical git rules to top of CLAUDE.md (#5192)
Prevent future accidental pushes directly to main by putting
explicit rules at the very top of the file.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 13:31:36 -08:00
314ff83d24 Migrate EndDiplomacyResolutionPhaseAction and PerformUnaffiliatedHeroesAction to protoless RandomStateSequencer (#4702)
* Migrate EndDiplomacyResolutionPhaseAction to protoless RandomStateSequencer

- Use ActionResultApplier instead of ActionResultTApplier
- Use RandomStateSequencer instead of LegacyRandomStateTSequencer
- All helper methods now accept GameState instead of GameStateProto
- Removed all proto converter calls
- Updated test to use ActionResultApplierImpl and provide a date

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* Convert PerformUnaffiliatedHeroesAction to use protoless RandomStateSequencer

- Migrated from LegacyRandomStateTSequencer to RandomStateSequencer
- Changed from ActionResultTApplier to ActionResultApplier
- Updated RoundPhaseAdvancer to pass actionResultApplier
- Updated test to call .results() directly and convert to proto (matching other migrated action tests)
- Updated DEPROTO_PLAN.md to mark action as migrated

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* Update PerformUnaffiliatedHeroesActionTest to use Scala types directly

- Use .results(SeededRandom(...)) instead of resultsOfExecute()
- Assert on ActionResultT types (HeroChangedResultType, ChangedHeroC, ChangedProvinceC)
- Use inside() pattern for safe type matching instead of asInstanceOf
- Add Scala testing patterns guidance to CLAUDE.md

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* Refactor PerformUnaffiliatedHeroesActionTest to use Scala GameState directly

Instead of constructing proto GameState and converting to Scala,
the test now creates Scala GameState directly with all required fields.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-19 09:57:23 -08:00
0551dd0f13 Convert vassal command Actions to use T-type commands via TCommand sealed trait (#4636)
* Convert remaining RandomSequentialResultsAction subclasses to TRandomSequentialResultsAction

- Convert EndHandleRiotsPhaseAction to TRandomSequentialResultsAction
- Convert PerformVassalCommandsPhaseAction to TRandomSequentialResultsAction
- Convert PerformVassalDefenseDecisionsAction to TRandomSequentialResultsAction
- Add withRandomAction and withOptionalRandomAction to RandomStateTSequencer
- Create ActionResultProtoWrapper to wrap proto ActionResult as ActionResultT
- Update VigorXPApplier to skip proto-wrapped results
- Expose protoApplier on ActionResultTApplierImpl for sequencer access

This enables executing proto Actions from CommandFactory.makeCommand() within
the T-based sequencer by wrapping results in ActionResultProtoWrapper.

9/10 RandomSequentialResultsAction subclasses now converted. Only
PerformProvinceEventsAction remains (heavily proto-based internally).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* Convert vassal command Actions to use T-type commands via TCommand sealed trait

- Create TCommand sealed trait unifying Simple, RandomSimple, and Sequential T-type actions
- Add makeTCommand method to CommandFactory returning T-type actions directly
- Add withTCommand/withOptionalTCommand helpers to RandomStateTSequencer
- Convert PerformVassalCommandsPhaseAction, PerformVassalDefenseDecisionsAction,
  and EndHandleRiotsPhaseAction to use T-type commands
- Add executeProtolessAction helper in RoundPhaseAdvancer to bridge T-type actions
  with proto-based engine interface
- Delete ActionResultProtoWrapper (no longer needed after T-type conversion)
- Add exports to action_result_trait for interface types to support ScalaMock mocking

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* Add VigorXPApplier.withVigorXp to test helper to match production behavior

Addresses Copilot review comment about test executeAction helper missing
vigor XP application that RoundPhaseAdvancer.executeProtolessAction does.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* Remove actionResultProtoApplier from TRandomSequentialResultsAction.randomResults

TRandomSequentialResultsAction subclasses should only use ActionResultTApplier,
not both appliers. The execute() method creates the T-type applier internally.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* Add execute method to ProtolessRandomSequentialResultsAction

Move the duplicate executeAction/executeProtolessAction helper code
into a proper execute() method on ProtolessRandomSequentialResultsAction.
This eliminates code duplication between tests and RoundPhaseAdvancer.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* Add troubleshooting guidance for Scala MissingType errors

Document that MissingType errors are BUILD.bazel dependency issues,
not compiler crashes. Also note to never run bazel clean without asking.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-13 09:04:06 -08:00
1a751cea6d Improve gazelle pre-commit hook to fail if BUILD files are modified (#4640)
The previous hook ran gazelle but didn't check if it modified any files.
This meant commits could go through with non-canonical BUILD files, causing
gazelle_test to fail in CI.

The new wrapper script:
1. Runs gazelle
2. Checks if any BUILD files were modified
3. Fails with a helpful message if they were, instructing the user to stage changes

Also adds a Pre-Commit Checklist section to CLAUDE.md documenting this behavior.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-06 08:58:07 -08:00
adminandGitHub 1b1d290ead Fix code highlighting for C++23 (#4475)
* upgrade bazelrc to c++23

* fix c++23 code highlighting issues
2025-10-16 09:25:46 -07:00
788b8c3338 MCTS only to the end of this player's turn (#4447)
* store the decision tree

* MCTS integration complete

* MCTSAI as a separate target

* still a little drunk but END_TURN is scoring correctly

* END_TURN not marked as terminal

* maybe kinda working

* revert AIScoreCalculator.cpp changes

* log sequence and look for player flip

* coords logging and use the correct gamestate

* didn't do what I hoped

* transposition detection

* Update AI_SCORING_SYSTEM.md with comprehensive MCTS configuration documentation

🤖 Generated with [Claude Code](https://claude.ai/code)

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

* Use optimized ShardokEngine constructor with pre-computed critical tiles in MCTS

Eliminates 8.5% runtime overhead by computing critical tiles once and passing them to all
ShardokEngine constructor calls in MCTSAI instead of recomputing them each time.

Updated all relevant locations:
- Search method: compute once at beginning
- BuildMCTSTree: pass through as parameter
- MCTSExpansion: pass through as parameter
- All ShardokEngine(settings, state) calls now use ShardokEngine(settings, state, criticalTiles)

🤖 Generated with [Claude Code](https://claude.ai/code)

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

* correct default

* Add null pointer safety checks to prevent MCTS simulation crashes

Added null checks in multiple locations to prevent segmentation faults during MCTS simulation:
- AIScoreCalculator: Check for null units in AttackerUnitsScore loop
- AIScoreCalculator: Check for null attacking unit in RecursiveAttackerMultiplierForTargetDistance
- AIUnitScoreCalculator: Check for null unit at start of UnitValue
- AIAttackGroups: Check for null units in all EffectiveDistance overloads

These crashes were occurring when BEST_IMMEDIATE simulation policy tried to evaluate
game states with invalid or deleted units during MCTS rollouts.

🤖 Generated with [Claude Code](https://claude.ai/code)

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

* Fix root cause of MCTS crash: uninitialized memory in Occupants function

The crash was caused by the Occupants function in HexMapUtils.hpp creating a vector
without initializing values. For coordinates without units, the vector contained
garbage values (random memory addresses) rather than nullptr, causing segmentation
faults when dereferenced.

Fixed by initializing both Occupants overloads with nullptr:
  vector<const Unit *> positions(rowCount * columnCount, nullptr);

Removed the band-aid null checks added in the previous commit as they're no longer
necessary with the proper fix in place.

🤖 Generated with [Claude Code](https://claude.ai/code)

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

* remove cache eviction

* unnecessary changes

* unnecessary call

* remove some options

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-27 18:20:09 -07:00
fcab1cb9e4 Complete GameState model with new Scala models (#4411)
* GameState scala model

* Complete GameState model with ShardokBattle, RunStatus, and ChronicleEntry

- Replace TODO comments with actual model references
- Add imports for the three new models we created:
  - net.eagle0.eagle.model.state.shardok_battle.ShardokBattle
  - net.eagle0.eagle.model.state.run_status.RunStatus
  - net.eagle0.eagle.model.state.chronicle_entry.ChronicleEntry
- Update BUILD.bazel dependencies to include the new model packages
- All fields from game_state.proto are now represented in GameState.scala

The GameState model is now complete and ready for use. A proto converter
can be added in a future PR once converter dependencies are resolved.

🤖 Generated with [Claude Code](https://claude.ai/code)

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

* Complete GameStateConverter implementation

- Add GameStateConverter with toProto and fromProto methods using pattern matching
- Fix dependencies and visibility in BUILD.bazel files for all required models
- Handle NotificationConverter's tuple return type correctly
- Add visibility for game_state converter to all dependent model packages

🤖 Generated with [Claude Code](https://claude.ai/code)

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

* Add explicit type declarations to GameStateConverter pattern matching

- Add proper proto type imports for all converter types
- Include explicit type declarations in both toProto and fromProto pattern matches
- Follow user preference for compile-time safety with full type declarations

🤖 Generated with [Claude Code](https://claude.ai/code)

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

* run gazelle

* rename the converter

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-16 13:04:49 -07:00
dc09ae768a WIP: Partial conversion of ResolveTruceOfferCommand to Scala models (#4379)
* WIP: Partial conversion of ResolveTruceOfferCommand to Scala models

- Updated imports to use Scala model types
- Converted base class from SimpleAction to ProtolessSimpleAction
- Updated BUILD.bazel dependencies partially
- Hit integration issues with LLM generator still expecting protobuf types

Still needs work to fully convert the diplomatic text generation integration.

🤖 Generated with [Claude Code](https://claude.ai/code)

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

* Revert ResolveTruceOfferCommand changes - too complex for first conversion

The LLM integration makes this command too complex for initial conversion.
Starting fresh with simpler commands without external dependencies.

🤖 Generated with [Claude Code](https://claude.ai/code)

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

* Migrate ResolveTruceOfferCommand from protobuf to Scala domain models

- Convert ResolveTruceOfferCommand to use ProtolessSimpleAction base class
- Replace protobuf imports with Scala domain model imports (TruceOffer, Status types)
- Update make() method signature to take explicit parameters instead of protobuf wrappers
- Use ActionResultC, ChangedFactionC, NotificationC, and LLM domain models
- Implement LLM integration with TruceResolutionMessage and NotificationC
- Update BUILD.bazel dependencies to use Scala model targets instead of protobuf
- Migrate ResolveTruceOfferCommandTest to use protoless API with proper domain models
- Replace protobuf test patterns with inside() pattern matching on domain types
- Add comprehensive test coverage for accepted, rejected, and imprisoned scenarios

Note: CommandFactory integration pending - requires protobuf to domain model conversion

🤖 Generated with [Claude Code](https://claude.ai/code)

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

* Complete ResolveTruceOfferCommand migration to protoless architecture

- Update CommandFactory to integrate with new protoless API
- Convert protobuf types to domain models (DiplomacyOffer → TruceOffer, Status)
- Add necessary dependencies for converters (DiplomacyOfferConverter, StatusConverter)
- Remove redundant targetFactionId parameter from command signature
- Fix test compilation issues and simplify parameter structure

The command now uses the modern protoless architecture with proper type safety
and domain model integration while maintaining full LLM functionality.

🤖 Generated with [Claude Code](https://claude.ai/code)

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

* gazelle

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-04 11:18:45 -07:00
adminandGitHub 1b731c2080 oops (#4352) 2025-08-22 17:45:43 -07:00
adminandGitHub dd2a397c55 perf-test (#4279) 2025-07-17 19:24:39 -07:00
adminandGitHub 4415ce175e update claude.md (#4278) 2025-07-17 17:40:47 -07:00
adminandGitHub 935b9341cd include client info too (#4148) 2025-06-10 07:46:04 -07:00
adminandGitHub 59c555a297 add CLAUDE.md (#4147) 2025-06-10 07:34:57 -07:00