feat(backend): Open5e adapter and the starter-pack build scripts for content packs (#553) #564
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/553-open5e-adapter-starters"
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?
Phase 1 of #553, lane 4 of the content-packs spec. Stacked on #562 (the Foundry fixes); merge that first and this PR's diff shrinks to its own four commits.
The Open5e reader. Saved v2 API pages, bare arrays, and
open5e-*.zipbundles map to the shared kinds, with the SRD 5.1 / 5.2.1 CC-BY-4.0 attribution carried as the licence. Registered last inDETECT_ORDER; the detection cases for kilobyte-record arrays now answeropen5ethanks to #562's closed native-array rule.Two starter-pack builds, as scripts, not bundled content.
scripts/content/build_5e_starter.py(Open5e's SRD documents, third-party documents dropped, CC-BY notice to Wizards) andbuild_pf2e_starter.py(the Foundry pf2e system's ORC-licensed records only, flavour text removed, records re-stamped with the ORC Notice and Paizo attribution). The pf2e build stages an ORC-only, flavour-free copy of each pack file and maps it through the real Foundry adapter, so there is one pf2e mapping in the tree. Both are pinned to an upstream commit and byte-identical on a re-run (SOURCE_DATE_EPOCH); the packs they produce are release assets fetched on request, never shipped in the image. Adapter warnings reachcounts.warningsand a SOURCES.md section.Also. The formats-endpoint test is lane 3's registry invariant; the starter script tests pin the rendered body (Statistics and Defences before Strikes, enrichers as prose) so a regression in the Foundry maps shows up here too.
Tests: 368 across the Open5e, starter-script, detection, Foundry, 5etools, orcbrew, import, admin, export, task, URL-fetch, search, game-systems and stat-schema suites. Fixtures are invented; the starter scripts are exercised against fixture trees, not live downloads.
🤖 Generated with Claude Code
kind(#553)Rebased onto lane 2's fix for the three gaps this lane found, and flipped everything that was pinned as a gap into an assertion that it works. The pf2e starter's creature bodies now carry the whole stat block — Statistics and Defences before the strikes — and its enrichers read as prose again ("DC 26 basic Fortitude", "30-foot emanation", "4d6 fire"), so the starter-script tests assert the real shape rather than what was missing from it. A bare Open5e array is no longer claimed by the native reader; the two detect cases lane 2 left as `!= "questboard"` pending this lane now read `== "open5e"`, and the "known gap" test that pinned the old behaviour is gone because the behaviour is gone. `headline()` stays. The adapter summarises from the opening paragraph, and with the flavour paragraph removed the opening paragraph is `## Statistics` rather than `## Strikes` — a better heading, still a heading. One repair outside this lane: `test_a_malformed_pack_leaves_the_row_failed_with _its_reason` staged `[{"name": "Truncated"`, which under the closed native-array rule is nobody's format, so the row failed with "could not tell what format" instead of the parse error the test is about — and the test above it already covers that failure. The fixture now leads with `kind`, which is what the rule and CONTENT-PACKS.md ask of a native array, and the test is about the parse again. It fails on the fix branch without this change; it is not caused by registering the Open5e adapter. The CHANGELOG gains one bullet for the Open5e reader and the two build scripts: what they build, that the packs are release assets rather than image content, and the notices each carries. The foundation bullet loses "A reader for Open5e follows", which it no longer does. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>caa5ac2bdf59f4ffc44d