Add Master Mod tables and lookup engine - #354
Conversation
|
Reviewed — leaving in draft, not merge-ready yet. Two issues, one blocking on its own and one that's this batch's recurring pattern:
The lookup engine itself ( |
…ine trims - add Walk +4 Sonic / +5 Ssonic and split Technology Fantastic into the two printed sub-columns (Low 22-27, High 28-33) per Book 1 pp.265-266 - drop footnote asterisks from NewSpeak Worst and Truth GAEWK rows - remove the placeholder-substitution engine (only <…> text is the book-literal "<none>"); Lookup now takes just the total - Get returns deep copies; sparse() panics on empty rolls; Lookup no longer revalidates registered tables - replace tautological TestRegistryValid with a dice-notation check (Parse-able or exact-string allowlist) and assert the full sorted 139-name manifest - reorganize table files by printed page (tables_p264.go..tables_p269.go) with per-chart Book 1 citations and quirk notes; document deliberate exclusions in CLAUDE.md Co-Authored-By: Claude
There was a problem hiding this comment.
Pull request overview
This PR introduces a new internal/mastermod package that registers and serves the Traveller5 Book 1 (pp.264–269) “Master Mod / Typical Mods” named reference tables via a small lookup engine, including support for sparse/non-contiguous roll keys and a defensive-copy Get.
Changes:
- Added a table registry + lookup API (
Table,Lookup,Get,Names) with support for both contiguous and sparse roll keying. - Transcribed the Book 1 pp.264–269 tables into per-page Go files (
tables_p264.go…tables_p269.go) with deliberate exclusions documented. - Added tests covering name manifest stability, boundary/sparse lookup behavior, golden rows, and dice-notation parseability/allowlisting.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/mastermod/mastermod.go | Core table type, registry, lookup logic, and public accessors (Get, Names). |
| internal/mastermod/mastermod_test.go | Validates registry inventory, lookup behavior, deep-copy semantics, and dice-notation rules. |
| internal/mastermod/tables_p264.go | Registers damage location tables from Book 1 p.264. |
| internal/mastermod/tables_p265.go | Registers Typical Mods charts 01–04 from Book 1 p.265 (including Fantastic split). |
| internal/mastermod/tables_p266.go | Registers Typical Mods charts 05–08 from Book 1 p.266 (including sparse Highway/Drive tables). |
| internal/mastermod/tables_p267.go | Registers Typical Mods charts 09–12 from Book 1 p.267 (including <none> rows). |
| internal/mastermod/tables_p268.go | Registers Typical Mods charts 13–16 from Book 1 p.268 (Senses + QREBS mods). |
| internal/mastermod/tables_p269.go | Registers Typical Mods charts 17–21 from Book 1 p.269 (including 2x1D MegaCorp/QREBS and extended severities). |
| internal/mastermod/CLAUDE.md | Documents scope, exclusions, and “do not fix” quirks for the transcription. |
Suppressed comments (1)
internal/mastermod/tables_p268.go:255
- Spelling: "Burdensom" should be "Burdensome".
"Very Burdensom",
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The four flagged spellings (Truthfullness, Cacaphony, More/Very Burdensom, Vfast Land) are the book's own printed typos, verified against the rendered PDF pages — preserved per transcription fidelity and now marked sic in code and CLAUDE.md. The Table doc comment no longer claims contiguous-only lookup. epic's CLAUDE.md is corrected to distinguish its two ligature extraction artifacts from the book's real Truthfullness typo, which it deliberately normalizes. Co-Authored-By: Claude
Summary
Get)<none>entries from p.267)tables_p264.go…tables_p269.gowith per-chart citationsDicenotation isdice.Parse-able or on an exact-string allowlist (Bad Flux,2x1D,Hits/2)Validation
task checkgit diff --checkPart of #181 (the issue also covers chargen background tables pp.92-97 and career muster-out tables, which this PR does not transcribe)