Repository navigation
Autoresolve campaign battles by simulation - #56
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (21)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review. 📝 WalkthroughWalkthroughWar battle voting now limits postponements before attempting autoresolution. The resolver predicts battle losses and applies campaign outcomes directly. The change also updates autoresolution feedback, resets postponement counts, and excludes the configured battle-window end hour. ChangesCampaign battle flow
Priority: ⬇️ Low Estimated code review effort: 4 (Complex) | ~45 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant BattleScheduleService
participant BattleAutoresolveService
participant CampaignBattleOutcomeService
participant BattleCasualtyService
BattleScheduleService->>BattleAutoresolveService: resolve(war) after postponement limit
BattleAutoresolveService->>BattleAutoresolveService: predict battle result and losses
BattleAutoresolveService->>CampaignBattleOutcomeService: apply campaign outcome
CampaignBattleOutcomeService->>BattleCasualtyService: apply casualties
BattleAutoresolveService-->>BattleScheduleService: return resolution result
Suggested reviewers: Merge Risk: ⚪ Minimal · up to The identified feedback concern does not affect reachable close-vote responses, and naval auto-losses complete their campaign outcome. No actionable merge-blocking risk remains after normal checks. Security Architecture ReviewSecurity architecture risk: 🟡 Moderate · up to Autoresolve is now able to change regiments and territory without a live battle. The normal path has safeguards, but an interrupted or overlapping resolution could leave a war in an inconsistent state or apply an outcome more than once. Retained concerns
Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 4.71% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 85 functions across 20 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
I’m a rabbit with a battle plan, Comment |
07c13bc to
e41f35d
Compare
0634fcd to
d57480f
Compare
e41f35d to
670bdb9
Compare
0c47c30 to
206d40a
Compare
Autoresolve no longer starts a live battle. Each side's committed regiments become lives, a luck roll scales them, and Lanchester's square law picks the winner and the winner's losses. The loser loses a set share of its lives. Losses go through the normal casualty and outcome path, with the offensive pinned so fuel is charged correctly. A stalled battle vote postpones once (war.battle_voting.max_postponements) and then autoresolves. Legacy AUTORESOLVE_PENDING wars are resolved on the next tick. Battle start hours are now 21 to 23; the window end hour is not a start time. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
206d40a to
da05dc6
Compare
Stacked on #54.
What changes
[1 - luck, 1 + luck], and Lanchester's square law decides the winner and the winner's losses. The loser losesloser_loss_fractionof its lives. Ties go to the defender.war.battle_voting.max_postponementstimes (default 1), then autoresolves. The counter resets when a battle is scheduled or resolved.AUTORESOLVE_PENDINGphase are resolved on the next tick.window_end_hourcloses the window and is no longer a start hour.Config (add to live war.yml)
Tests
mvn test: 2141 passing. NewBattleAutoresolveServiceTestcovers the prediction; schedule, tick, window and config tests are updated.🤖 Generated with Claude Code
Summary by CodeRabbit