feat(srd): import Poisons and Diseases as structured hazard records (loreweaver-6ra)#159
Merged
Merged
Conversation
…loreweaver-6ra)
The SRD 5.1 gamemastering Diseases (Cackle Fever, Sewer Plague, Sight Rot)
and Poisons (14 named poisons) sections were absent from the pack. Import
them as structured records under the existing `hazard` kind, discriminated
by `data.category` ('disease' / 'poison') — no new exhaustive record kind,
per the section-coverage audit's Note B. Poisons additionally carry
`data.poisonType` (delivery method) and `data.price` (per dose, cross-
referenced from the Poisons table); save DC and damage stay in the
re-flowed `description`.
- parseDiseases.ts: exact-name match (like parseHazards), 3 records.
- parsePoisons.ts: inline `Name (Type).` bold lead-in detection + price
table cross-reference, 14 records.
- emit: diseaseExtractionsToRecords / poisonExtractionsToRecords; both fold
into the shared `hazard` concatenation. The pack goes 8 -> 25 hazards.
- sections: new `diseases` and `poisons` anchors (best-effort start,
requireEndHeading).
- index: best-effort slicing + fail-closed coverage gates
(EXPECTED_SRD_5_1_DISEASE_NAMES / _POISON_NAMES, Disease/PoisonCoverageError).
Extractor fix: the p205 "Sample Poisons" page is a single column whose
entries open with a short indented bold lead-in followed by the justified
remainder of the first line on the same baseline. That pattern opened a
phantom column gutter that displaced each poison's first sentence to the
end of the page. partitionItemsByColumn now merges such a page back to one
column when the widest cut straddles >=2 contiguous baselines with no real
gutter, is also the most balanced cut, and its right side owns no
standalone line — three conditions that together leave genuine two-column
pages (p238 Robe of Eyes, p226 Horn of Valhalla, p63 armor table)
untouched. The regenerated pack diff is purely additive (verify pack
reproducibility passes; 296 creatures / 319 spells / 238 magic items
unchanged).
Tests: parseDiseases/parsePoisons unit tests, emit record-shape tests, an
extract inline-lead-in regression test, and committed-pack coverage +
p205 reading-order assertions. README + section-coverage audit updated.
Co-Authored-By: Claude Opus 4.8 <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
Imports the SRD 5.1 gamemastering Diseases (Cackle Fever, Sewer Plague, Sight Rot) and Poisons (14 named poisons) sections — previously absent from the pack — as structured records under the existing
hazardkind, discriminated bydata.category('disease'/'poison'). No new exhaustive record kind is minted, per the section-coverage audit's Note B. Closes loreweaver-6ra.The pack goes from 8 → 25
hazardrecords (8 traps + 3 diseases + 14 poisons).What's in each record
category: 'disease'+ re-floweddescription.category: 'poison',poisonType(contact/ingested/inhaled/injury),price(per dose, from the Poisons reference table), anddescription(save DC and damage kept inline).Extractor fix (the interesting part)
The p205 "Sample Poisons" page is a single column whose entries open with a short indented bold lead-in (
Pale Tincture (Ingested).) immediately followed on the same baseline by the justified remainder of the first line (A creature subjected to). That pattern opened a phantom column gutter, so the extractor split the page and displaced every poison's first sentence to the bottom — corrupting the prose.partitionItemsByColumnnow merges such a page back to one column, gated by three conditions that together leave genuine two-column pages untouched:The regenerated pack diff is purely additive —
verify:dnd5e-srd-packpasses exactly, and the 296 creatures / 319 spells / 238 magic items baselines are unchanged.Fail-closed coverage
The real import validates parsed names against
EXPECTED_SRD_5_1_DISEASE_NAMES/_POISON_NAMES(throwsDiseaseCoverageError/PoisonCoverageErroron drift), mirroring the trap/ancestry gates.Tests / gates
parseDiseases/parsePoisonsunit tests;emitrecord-shape tests; anextractinline-lead-in single-column regression test; committed-pack coverage + p205 reading-order assertions.npm run check,npm run typecheck,npm run test(1224 passed / 3 documented skips), andnpm run verify:dnd5e-srd-packall pass.🤖 Generated with Claude Code