Add species architecture β composable creature inheritance#88
Open
woltspace wants to merge 4 commits intorefactor-speciesfrom
Open
Add species architecture β composable creature inheritance#88woltspace wants to merge 4 commits intorefactor-speciesfrom
woltspace wants to merge 4 commits intorefactor-speciesfrom
Conversation
Introduces a species/ directory that defines creature types declaratively: each species has a species.json (runtime mode, singleton, model, tiers), instructions.md, and optional skills/. This replaces hardcoded constants with file-driven discovery. Three-layer inheritance: platform skills β species skills β wolt overrides. entrypoint.sh now reads the wolt's type from wolt.json and layers species skills between platform and wolt-specific skills. species.py provides the loading/resolution library. wolts.py now reads valid types and singleton constraints from species definitions instead of hardcoded sets. bot core.py reads creature models from species.json with fallback to previous hardcoded values. All changes are backwards-compatible β if species/ is missing, everything falls back to previous behavior. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
All hardcoded prompt sections in build_system_prompt() are now loaded
from species/dog/prompts/*.md files:
- intro.md / intro-fallback.md β dog identity intro
- creatures.md β creature roster with {creature_list} and {species_list} vars
- voice.md β how the dog talks
- tools.md β available tools
- projects.md β project routing rules
- communication.md β session message protocol
- memory.md β memory usage instructions
build_system_prompt() is now a pure file loader: load, substitute
variables, concatenate. Zero prompt text in Python.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
jerpint
reviewed
Mar 16, 2026
| } | ||
|
|
||
|
|
||
| def build_system_prompt() -> str: |
Owner
There was a problem hiding this comment.
this feels hacky, why dont we have a build system prompt per species?
jerpint
reviewed
Mar 16, 2026
container/bot/core.py
Outdated
| except ImportError: | ||
| pass | ||
| # Fallback: hardcoded mapping (removed once species/ is stable) | ||
| return { |
Addresses PR review: prompt composition and creature resolution no longer
live in core.py at all.
- build_system_prompt() is now ~10 lines: gather variables, call
species.build_prompt("dog", variables), append memory. Done.
- species.build_prompt() owns all composition: loads prompts/ in order
defined by order.txt, substitutes variables, concatenates.
- _resolve_creature_model() drops the hardcoded fallback dict β just
calls species.get_creature_model() directly.
- CREATURE_EMOJIS hardcoded dict removed β build_ack_text() calls
species.get_creature_emoji() instead.
- _load_prompt(), _build_creatures_list() removed β their logic now
lives in species.py where it belongs.
- intro-fallback.md removed β intro.md handles both cases via
{dog_identity} variable (empty string when no dog-wolt exists).
- species/dog/prompts/order.txt added β loading order declared in the
species definition, not in Python.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Covers what's done (PR #88), what's left (phases 3-5), and key design decisions so the next session can pick up without re-litigating. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
The creatures section has been held together by hardcoded strings and constants scattered across 4 files. This PR introduces a
species/directory that makes creature types declarative and file-driven.What changes:
species/directory withspecies.json+instructions.mdfor each creature type (rodent, wolf, dog, spider, bear, panda)container/lib/species.pyβ loading, resolution, and inheritance librarycontainer/lib/wolts.pyβ reads valid types and singleton constraints from species definitions instead of hardcodedVALID_TYPES/SINGLETON_TYPEScontainer/bot/core.pyβ creature model resolution reads from species.json, creature descriptions in system prompt built dynamically from species definitions (with full hardcoded fallback)container/entrypoint.shβ 3-layer skill loading: platform β species β woltWhat stays the same:
species/is missing, all code falls back to previous hardcoded behavior.typefield in wolt.json becomes the inheritance pointer βtype: wolfmeans "inherit fromspecies/wolf/"Design doc:
neowolt/wolt/site/species-architecture.htmlhas the full visual specThe inheritance model
Adding a new species = drop a folder in
species/. No touching bot core, entrypoint, or wolts.py.Test plan
πΏοΈ Generated with Claude Code