Skip to content

Phase 9 plan — adventure-bundled monsters#25

Merged
mmacy merged 3 commits into
mainfrom
phase-9-plan
Jul 18, 2026
Merged

Phase 9 plan — adventure-bundled monsters#25
mmacy merged 3 commits into
mainfrom
phase-9-plan

Conversation

@mmacy

@mmacy mmacy commented Jul 18, 2026

Copy link
Copy Markdown
Owner

The plan for phase 9: an Adventure document carries its own MonsterTemplates, resolved everywhere the engine resolves template ids — the consumer-demonstrated need phase 6 pinned as the reopening condition ("post-1.0 if a consumer ever demonstrates the need"), demonstrated now by osr-forge's phase 7 (custom monster emission). Document-carried data, not a runtime registration API: the phase 6 boundary stands.

Notable decisions

  • The seam is a session-held union, not a threading project. Every engine site that resolves a template id already has the session in scope, so the design is GameSession.effective_monsters (built once in __init__) plus four one-line redirects; the fifth load_monsters() site — validation in GameSession.new — keeps passing the base catalog by contract.
  • validate_adventure keeps its exact signature and unions internally, honoring the consumer contract osr-forge's merged phase 7 plan pins: its existing call is correct unchanged.
  • Collisions are errors, never overrides (shadowing orc would silently re-stat every reference); the _effective_monsters helper returns a first-occurrence-wins dedup union plus the colliding-id list, so both callers stay total and each turns collisions into its own typed ContentValidationError — checked before construction because MonsterCatalog's own validator raises a bare ValueError, the wrong failure shape.
  • Inline wandering-table monster_ids join validation, closing a pre-existing deferred play-time ValueError surface (Changed bullet pinned — previously-accepted dangling ids now fail the gate up front).
  • No SCHEMA_VERSION bump, no golden regeneration, no __all__ edit — the field is additive and defaulted, no golden embeds a serialized Adventure, and the property/helper are invisible to test_public_surface.py. Released as 1.2.0, semver-minor under the phase 8 discipline.

Review provenance

Rubber-ducked per AGENTS.md; first pass NEEDS REVISION, second pass SOLID. The blocking finding: the validation failure path was decision-incomplete — when the union fails, which catalog do the remaining checks use? Fixed by making the helper total (dedup union + collision list), pinning that remaining checks resolve the union so a colliding adventure's report names exactly the root cause with no spurious unknown-monster echo, and pinning the tests that assert it. Non-blocking findings addressed: the redirect count corrected (four, not five — the validation site is kept by contract), the id-domain docstring sweep added, the helper's definition moved to the validation work item, the versioned-docs evaluation now cites the 1.1.0 precedent and rebuts the AGENTS.md gloss instead of reading past it, the wandering-tightening Changed bullet pinned, the property renamed effective_monsters (leaving room for effective_equipment siblings, no helper shadowing), and the adaptations-register silence recorded as deliberate. Sign-off cosmetic notes folded in.

https://claude.ai/code/session_01EVrxXFxYBEGYjTF6wqnGP2

mmacy added 3 commits July 17, 2026 19:28
Blocking: the validation failure path is now total — _effective_monsters
returns the first-occurrence-wins dedup union plus the colliding-id list,
so both callers get a usable catalog, collision reports name every id,
and a colliding adventure's report carries no spurious unknown-monster
echo (pinned, with the tests to match). Non-blocking: fact 1's redirect
count corrected to four with the validation site kept-by-contract; the
id-domain docstring sweep added to work item 4; the helper's definition
moved under work item 3; the versioned-docs evaluation now cites the
1.1.0 precedent and rebuts the gloss instead of reading past it; the
wandering-validation tightening gains its Changed bullet; the property
renamed effective_monsters (room for effective_equipment siblings, no
helper shadowing); the adaptations register's silence recorded as
deliberate.

Claude-Session: https://claude.ai/code/session_01EVrxXFxYBEGYjTF6wqnGP2
The DoD's changelog line pluralizes to match work item 4's Added-plus-
Changed pair, and the empty-bundle sentence states the tuple return
shape exactly.

Claude-Session: https://claude.ai/code/session_01EVrxXFxYBEGYjTF6wqnGP2
@mmacy
mmacy merged commit 8bd0a40 into main Jul 18, 2026
5 checks passed
@mmacy
mmacy deleted the phase-9-plan branch July 18, 2026 02:58
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