Repository navigation
refactor(playerbots): create bots through Package-owned Accounts - #70
Conversation
playerbots wrote its own game_account rows and called Core's create_character from the auth root, both behind Package API exemptions. spawn_one now calls package_account::create_package_character. Core picks or creates the Account and records playerbots as its owner, so the Account block bookkeeping, its username scheme and its unit tests go. The Package keeps its free-name probe and one post-create fetch. CI pins the paired Core branch head. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (7)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughPlayerbot character creation now uses package account creation instead of explicit bot account selection. The workflows also pin LyraCore to a new revision. ChangesPlayerbot Account Flow
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~15 minutes Change: Refactor Suggested reviewers: Merge Risk: ⚪ Minimal · up to Bot creation now uses Package-owned Accounts, and the paired Core implementation supports the ownership and character-creation flow. No actionable merge-blocking risk is evident. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. (5 skipped: 5 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
playerbots wrote its own
game_accountrows and called Core'screate_characterthrough theauthroot. Both lines needed apackage-api: exemptmarker, and Core had no record of which Accounts were the Package's.spawn_onenow callspackage_account::create_package_character(ctx, PACKAGE, &name, race, class), which LyraCoreProject/LyraCore#625 adds. Core picks an Account playerbots owns with room, or creates one and records playerbots as its owner. The operation returns the new guid, so the post-create name lookup goes too.ensure_bot_account,account_block_with_room,bot_account_username,CHARACTERS_PER_ACCOUNTand their four unit tests are gone. Core now owns that logic and its durable test. playerbots keeps its free-name probe and one fetch to place and level the new Character.playerbots/src/mod.rshas noauthexemption left. Its raw Character lookups drop from 4 to 2, which matches the lowered Core budget.Bots made before this change stay on their
PLAYERBOT000-style Accounts. New bots go on Accounts namedplayerbots#<n>.CI pins the Core branch head in every workflow that pinned
dd287126. The baseline builds still compile against the new Core, becausecrate::authkeepsAccountandcreate_character, so they did not need a separate older Core.Paired with LyraCoreProject/LyraCore#625. Merge Core first, then this PR at once. After the Core merge, the pin can move to the merge commit if the maintainers prefer a main SHA.
Local checks against the Core branch: the Module with these Packages compiles for wasm without
debug_reducersand passes 1,868 lib tests.playerbots_personalityand 12 of 13playerbots_rolesdurable tests pass. The other one needs the CI-built PB-006 baseline wasm.Made by Claude Opus 5.5 in Claude Code.
🤖 Generated with Claude Code
Summary by CodeRabbit