fix(game): profile ships mechanisms, demo defaults move to examples - #316
Open
prakashUXtech wants to merge 1 commit into
Open
prakashUXtech wants to merge 1 commit into
prakashUXtech wants to merge 1 commit into
Conversation
GrudgeKernel.birth() requires name and archetype and derives a persona from them. DialogueEngine.speak() takes npc_name so the templated lines and the LLM prompt work for any character instead of a hardcoded butcher. PRICING ships empty and CostMeter takes pricing=. DEFAULT_ZONE is "start" and GameWorld takes start_zone. Bjorn, his scripted lines, the tavern and the sample vendor rates live in examples/game, which both demos now import.
Issues (must fix)
Please update your PR to address these points. |
|
This PR has been automatically marked as stale because it has not had activity in the last 14 days. It will be closed in 7 days if no further activity occurs. If you're still working on this, please push an update or leave a comment. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The game profile used to ship with a specific character baked in.
GrudgeKernel.birth()defaulted to Bjorn the Butcher, the templated dialogue engine spoke Bjorn's lines for every NPC, the LLM prompt ignored thepersonait was handed and hardcoded a butcher,GameWorldput everyone in a "tavern", andCostMetercarried a table of vendor rates. That is demo content living in a library.What changed
GrudgeKernel.birth(name, archetype, ...)requires both arguments.personanow defaults to"I am <name>, <archetype>."for bothbirth()andawaken().DialogueEngine.speak()takesnpc_name. The templated lines are name-aware and trade-neutral, the same treatmentspeak_reputation()already had.LLMDialogueEngine.build_prompt()builds frompersonaandnpc_name. This is the one real bug fix in here: before, Astrid the innkeeper was prompted as Bjorn the butcher whenever the LLM engine was on.PRICINGis an empty dict.CostMeter(generate, model, pricing=None)reads a caller-supplied{model: (in_rate, out_rate)}table, or the module-level dict if you populate it at startup. An unconfigured meter raisesunknown model. I kept the exported name so existing imports resolve.DEFAULT_ZONEis"start", andGameWorldtakesstart_zone.Everything removed lands in
examples/game/: the Bjorn constants,ButcherDialogueEnginewith his original lines,birth_bjorn(),TAVERN, and the sample rate table. Both demos (npc_soul_grudge,butcher_remembers) import from there; they insert the repo root onsys.pathso they still run as scripts and still load by path fromtest_demo_server.py.Breaking
Four surfaces for anyone importing
soul_protocol.profiles.gamedirectly: the requiredbirth()arguments, thespeak()keyword (custom engines must accept it),CostMeterneeding a pricing table, and theDEFAULT_ZONEvalue. All listed in the CHANGELOG.Verification
Full suite on Python 3.12: 3264 passed, 3 skipped, no new failures. Ruff check and format clean.
tests/profiles/game/test_demo_server.pyexercises the relocated demo module through the real server.