Lane 11 PR 7: today's stat blocks become blocks on the new sheets (#737, D205) #974

Merged
claude-bot merged 7 commits from build/lane11-7-convert into main 2026-09-30 16:00:06 +00:00
Collaborator

Part of #737 (lane 11, character sheets), PR 7 of the build contract (docs/design/lane11-build-contract.md).

What changes

  • Data migration 11b2c3d4e5f6 (chains on 11a1b2c3d4e5). Every person's and creature's lore_entries.stats becomes a creature sheet for its game, via legacy.py's legacy_map: PF2e, 5e, a pack's system, or the generic block when the game is gone.
    • Who can see it: a public block becomes table-visible (D205, L-decision "table" not "party"); a GM-only or player-private block stays GM.
    • Nothing is lost: the old block is kept with the sheet, and values that don't fit are kept aside.
    • Downgrade: implemented and tested.
  • Lazy rebuild: the page's block projection is rebuilt the first time it's opened. python -m app.sheets.rebuild_projections [--dry-run] does it on demand, and the worker runs it once at start.
  • Compat shim: until PR 13 removes the old editor, the page's stats input on create and update is translated through legacy_map into the page's creature sheet. The stat block editor, the importer, "Stat block" and "Convert stats" work on the sheet.
  • Drafts: a drafted stat block fills the block's fields, and on approval lands on the page's sheet instead of in its text.
  • Edge case: a block nobody may read projects to nothing.

Checks

  • Locally, after merging main: tests/sheets, the content-pack suites, the lore suites and test_quest_objectives_fk_migration: 861 passed.
  • Migrations: alembic upgrade head gives a single head 11b2c3d4e5f6, and downgrade -1 / upgrade head round-trips.
  • Ruff 0.4.4 check and format are clean, including alembic/.
  • New tests/sheets/test_stat_block_conversion.py, which moves the one-head pin.
  • Changelog: changelog.d/737-lane11-*convert* (added).

PR 8 (packs) is stacked on this and re-points its migration 11c3d4e5f6a7 onto 11b2c3d4e5f6.

🤖 Generated with Claude Code

Part of #737 (lane 11, character sheets), PR 7 of the build contract (`docs/design/lane11-build-contract.md`). **What changes** - **Data migration `11b2c3d4e5f6`** (chains on `11a1b2c3d4e5`). Every person's and creature's `lore_entries.stats` becomes a creature sheet for its game, via `legacy.py`'s `legacy_map`: PF2e, 5e, a pack's system, or the generic block when the game is gone. - **Who can see it:** a public block becomes table-visible (D205, L-decision "table" not "party"); a GM-only or player-private block stays GM. - **Nothing is lost:** the old block is kept with the sheet, and values that don't fit are kept aside. - **Downgrade:** implemented and tested. - **Lazy rebuild:** the page's block projection is rebuilt the first time it's opened. `python -m app.sheets.rebuild_projections [--dry-run]` does it on demand, and the worker runs it once at start. - **Compat shim:** until PR 13 removes the old editor, the page's `stats` input on create and update is translated through `legacy_map` into the page's creature sheet. The stat block editor, the importer, "Stat block" and "Convert stats" work on the sheet. - **Drafts:** a drafted stat block fills the block's fields, and on approval lands on the page's sheet instead of in its text. - **Edge case:** a block nobody may read projects to nothing. **Checks** - Locally, after merging main: `tests/sheets`, the content-pack suites, the lore suites and `test_quest_objectives_fk_migration`: 861 passed. - Migrations: `alembic upgrade head` gives a single head `11b2c3d4e5f6`, and `downgrade -1` / `upgrade head` round-trips. - Ruff 0.4.4 check and format are clean, including `alembic/`. - New `tests/sheets/test_stat_block_conversion.py`, which moves the one-head pin. - Changelog: `changelog.d/737-lane11-*convert*` (added). PR 8 (packs) is stacked on this and re-points its migration `11c3d4e5f6a7` onto `11b2c3d4e5f6`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Data migration 11b2c3d4e5f6 (down_revision 11a1b2c3d4e5) inserts the built-in
definitions, explodes non-builtin systems' legacy schemas into generated
creature definitions, and converts every npc/creature page's legacy stat
envelope into a creature sheet under the system it was written for, keeping
who could see it (public -> table, gm/player_private -> gm), the old envelope
in source_ref.legacy and anything that didn't fit in legacy_unmapped. stats is
untouched; projections rebuild lazily on read, by
python -m app.sheets.rebuild_projections, and once at worker start.

LoreEntryCreate/Update.stats is now a compat shim into the page's sheet; the
importer checks creatures against the creature definition; generate_statblock
and convert_stats target the creature definition's draft_fields, route #20
drafts a block, and approval writes the sheet.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Merge remote-tracking branch 'origin/main' into build/lane11-7-convert
Some checks failed
CI / Backend lint (ruff) (pull_request) Successful in 1m13s
CI / Summarisation accuracy eval harness (stub provider) (pull_request) Successful in 2m39s
CI / Feedback site tests (pull_request) Successful in 1m45s
CI / Bot/backend version sync (pull_request) Successful in 49s
CI / Does this change touch the recording path? (pull_request) Successful in 35s
CI / Bot tests and audit (pull_request) Successful in 4m19s
CI / Docker image build (pull_request) Successful in 1m13s
CI / Frontend (shard 2/2) (pull_request) Successful in 13m36s
CI / Frontend (shard 1/2) (pull_request) Successful in 19m38s
CI / Backend migration, tests, and audit (pull_request) Failing after 38m18s
CI / End-to-end journeys (desktop) (pull_request) Successful in 18m6s
CI / End-to-end journeys (keyboard) (pull_request) Successful in 17m31s
CI / End-to-end journeys (phone) (pull_request) Successful in 16m2s
CI / Synthetic session harness (no GPU, no LLM) (pull_request) Has been cancelled
7a239fbe50
Lane 11 PR 7: rebuild_projections takes a task session, not the pooled factory (#737, #129)
All checks were successful
CI / Summarisation accuracy eval harness (stub provider) (pull_request) Successful in 2m8s
CI / Backend lint (ruff) (pull_request) Successful in 1m3s
CI / Bot tests and audit (pull_request) Successful in 3m52s
CI / Docker image build (pull_request) Successful in 33s
CI / Bot/backend version sync (pull_request) Successful in 52s
CI / Feedback site tests (pull_request) Successful in 1m36s
CI / Does this change touch the recording path? (pull_request) Successful in 36s
CI / Frontend (shard 2/2) (pull_request) Successful in 12m50s
CI / Frontend (shard 1/2) (pull_request) Successful in 18m17s
CI / End-to-end journeys (phone) (pull_request) Successful in 15m24s
CI / End-to-end journeys (keyboard) (pull_request) Successful in 16m55s
CI / End-to-end journeys (desktop) (pull_request) Successful in 17m8s
CI / Synthetic session harness (no GPU, no LLM) (pull_request) Successful in 32m2s
CI / Backend migration, tests, and audit (pull_request) Successful in 43m23s
a4952f83f2
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign in to join this conversation.
No description provided.