feat: implement run-decision algorithm in gb_decide_run (#18) #72
No reviewers
Labels
No Label
ai-changes-requested
ai-failed
ai-pr-opened
ai-reviewed
ai-reviewing
ai-working
ai-working
bug
enhancement
feature
in-queue
performance
security
tech-debt
todo
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cal/paper-dynasty-discord#72
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "ai/paper-dynasty-discord-18"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Replaces the placeholder formula
this_resp.min_safe = 15 - aggressioningb_decide_runwith a real tier-based algorithm consistent withtag_from_secondandtag_from_third.Algorithm
Design rationale:
self.running + aggression_mod— identical pattern totag_from_second/tag_from_thirdFiles Changed
in_game/gameplay_models.py— replaced TODO placeholder ingb_decide_runtests/gameplay_models/test_managerai_model.py— addedtest_gb_decide_runNotes
The file was auto-reformatted by a ruff pre-commit hook when the file was saved. The functional change is confined to
gb_decide_run(lines ~682–706).Tests require
testcontainers+ Docker (pre-existing dev environment constraint); test infrastructure failure is not caused by this change.AI Code Review
Files Reviewed
in_game/gameplay_models.py(modified —gb_decide_runalgorithm + ruff reformat)tests/gameplay_models/test_managerai_model.py(modified —test_gb_decide_runadded)Findings
Correctness
tag_from_second/tag_from_third— uses the sameaggression_mod = abs(self.ahead_aggression - 5 if ai_rd > 0 else self.behind_aggression - 5)+adjusted_running = self.running + aggression_modpattern.tag_from_second, which applies the same+2to both 0 and 2 outs.running,ahead_aggression, andbehind_aggressionare typedint | Nonebut used without null guards — same pattern as the existingtag_from_second/tag_from_third, so this is a pre-existing concern and out of scope.Security
Style & Conventions
starting_outs == 1before running to confirm the outs-adjustment branch is correctly skipped. ✓Suggestions
Verdict: APPROVED
Clean replacement of the TODO placeholder. The algorithm matches the established pattern, the outs logic is sound baseball reasoning, and the tests are well-structured and correct. The ruff reformat is cosmetic.
Automated review by Claude PR Reviewer