Lane 11: a sheet's rank takes a name as well as an ordinal, as the evaluator reads it (#737) #966
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/lane11-rank-names"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A follow-up to #964 (lane 11 PR 3), found by PR 6.
The server's write validation refused rank names that the evaluator accepts. For example,
"skills.athletics.prof": "proficient"on a 5e sheet got a 422 "is a rank from 0 to 2", but PR 2'srank()reads either an ordinal or a name on the field's scale, and the built-in 5e fixtures store names.Fix (
sheet_values.check, the rank branch):Tests (
test_sheets_server.py): run for a PF2e-style scale and a 5e-style scale.expert→ 7,proficient→ 5), and so is an ordinal.tests/sheetspasses (478), and ruff (includingalembic/) is clean.No user-visible change yet (the sheet page arrives with PR 9), so there's no changelog fragment.
🤖 Generated with Claude Code
This PR now carries more than the rank-name fix. The sheet page's render check (PR 9) wrote the built-in fixtures through these routes and found two more places where the server refused data the evaluator accepts:
<resource>.maxas data, for a resource whose maximum is typed by hand (a creature'shp.max). This is PR 7's rule, taken exactly (legacy.spec_for), so the two branches merge cleanly..currentand.tempstay out ofdata.EntryAddalso takesoverrides.The new test:
tests/sheets/test_fixtures_through_the_server.pywrites every built-in fixture (all 21: PF2e, 5e and generic) through the routes: POST, then PATCH overrides, then resources, with gone rows made genuinely gone. It asserts the server's evaluated values equal each fixture's expectations. It would have caught all three problems, and it keeps the server's validation and the fixtures from drifting apart.Checks:
tests/sheetsplus the lore-restore and wiki-page tests pass (578), and ruff is clean, includingalembic/.