Skip to content

refactor(playerbots): create bots through Package-owned Accounts - #70

Merged
Mathih13 merged 1 commit into
mainfrom
feat/package-owned-accounts
Oct 7, 2026
Merged

Mathih13 merged 1 commit into
mainfrom
feat/package-owned-accounts

Conversation

@Mathih13

@Mathih13 Mathih13 commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

playerbots wrote its own game_account rows and called Core's create_character through the auth root. Both lines needed a package-api: exempt marker, and Core had no record of which Accounts were the Package's.

spawn_one now calls package_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_ACCOUNT and 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.rs has no auth exemption 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 named playerbots#<n>.

CI pins the Core branch head in every workflow that pinned dd287126. The baseline builds still compile against the new Core, because crate::auth keeps Account and create_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_reducers and passes 1,868 lib tests. playerbots_personality and 12 of 13 playerbots_roles durable 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

  • Changes
    • Bot characters are now created through package-owned accounts, and the roster uses the account associated with each character.
  • Documentation
    • Updated the bot account description to clarify that accounts are package-owned.

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>
@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c2d2fd48-425c-455b-84b5-9f3557209081
📥 Commits

Reviewing files that changed from the base of the PR and between 7794b8f and 16af34e.

📒 Files selected for processing (7)
  • .github/workflows/core-tip.yml
  • .github/workflows/playerbots-capacity.yml
  • .github/workflows/playerbots-class-behavior.yml
  • .github/workflows/playerbots-target-claims.yml
  • playerbots/README.md
  • playerbots/src/mod.rs
  • playerbots/testsuite/tests/playerbots_personality.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Playerbot character creation now uses package account creation instead of explicit bot account selection. The workflows also pin LyraCore to a new revision.

Changes

Playerbot Account Flow

Layer / File(s) Summary
Package account character creation
playerbots/src/mod.rs, playerbots/README.md, playerbots/testsuite/tests/playerbots_personality.rs
spawn_one creates a character through package_account::create_package_character, sets its level, updates its position, and reads the account ID from the updated row. The module removes bot account selection helpers and their tests. The documentation describes bot accounts as Package-owned.
Core checkout references
.github/workflows/core-tip.yml, .github/workflows/playerbots-capacity.yml, .github/workflows/playerbots-class-behavior.yml, .github/workflows/playerbots-target-claims.yml
The workflows now check out LyraCore at 34f860b8666fc711dc56c3fcbd491203af295546 instead of dd287126ec8ee0ff58efc85fa745b309ed50f296.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~15 minutes

Change: Refactor

Suggested reviewers: perpersen

Merge Risk: ⚪ Minimal · up to 16af3

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)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning 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… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: creating bot Characters through Package-owned Accounts.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

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.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Mathih13
Mathih13 merged commit 403f15e into main Oct 7, 2026
22 checks passed
@Mathih13
Mathih13 deleted the feat/package-owned-accounts branch October 7, 2026 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant