Skip to content
This repository was archived by the owner on Sep 9, 2026. It is now read-only.

Add Master Mod tables and lookup engine - #354

Merged
philoserf merged 5 commits into
mainfrom
agent/mastermod-tables
Aug 4, 2026
Merged

philoserf merged 5 commits into
mainfrom
agent/mastermod-tables

Conversation

@philoserf

@philoserf philoserf commented Jul 22, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • add a generic named die-table engine (registry, contiguous and sparse lookup, deep-copy Get)
  • preserve sparse and non-contiguous source rolls without inventing entries for blank cells; rows are book-literal text (including the seven <none> entries from p.267)
  • transcribe 139 Master Mod tables (Book 1 pp.264-269), split by printed page into tables_p264.go … tables_p269.go with per-chart citations
  • represent both printed Fantastic sub-columns (p.265) as "Technology Fantastic (Low)" 22-27 and "(High)" 28-33; Walk (p.266) carries the printed +4 Sonic / +5 Ssonic rows
  • validate the full sorted name manifest, boundary behavior, sparse lookup, representative golden rows, and that every Dice notation is dice.Parse-able or on an exact-string allowlist (Bad Flux, 2x1D, Hits/2)
  • document deliberate exclusions (Barrier H/W/D blanks, Scene Mods formula, unrolled Imperiallines/Hortalez rows) in the package CLAUDE.md

Validation

  • task check
  • git diff --check

Part of #181 (the issue also covers chargen background tables pp.92-97 and career muster-out tables, which this PR does not transcribe)

@philoserf

Copy link
Copy Markdown
Owner Author

Reviewed — leaving in draft, not merge-ready yet.

Two issues, one blocking on its own and one that's this batch's recurring pattern:

  1. Confirmed transcription bug. internal/mastermod/tables.go:41-55, the Anatomical Damage Location table, rows 9-10: transcribed as "Limb-Group-3"/"Limb-Group-4", but Book 1 p.264 actually prints Limb-Grip-3/Limb-Grip-4 — distinct from rows 3-4's genuine Limb-Group-1/Limb-Group-2. Worse, mastermod_test.go:34's golden test asserts the wrong value ({9, "Limb-Group-3"}), so it locks in the error rather than catching it. (10 other spot-checked rows across different tables matched the book exactly — this looks like an isolated slip, not systemic, but the full 138-table set wasn't exhaustively re-verified.)
  2. Orphan package. grep -rn mastermod outside internal/mastermod/ returns nothing — no CLI, no other package imports it. Same zero-consumer pattern already held back on Add travel-time kinematics #345 and Add shared benchmark scales #346 in this batch.

The lookup engine itself (Table/Lookup/sparse-rolls/substitution) is clean and well-tested. Suggest fixing the Grip/Group typo (and its golden test) and either wiring in a real first consumer or confirming primitive-first is intentional here before this comes out of draft.

…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
@philoserf
philoserf marked this pull request as ready for review August 4, 2026 19:25
Copilot AI lite review requested due to automatic review settings August 4, 2026 19:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread internal/mastermod/mastermod.go Outdated
Comment thread internal/mastermod/tables_p267.go
Comment thread internal/mastermod/tables_p268.go Outdated
Comment thread internal/mastermod/tables_p268.go Outdated
Comment thread internal/mastermod/tables_p266.go Outdated
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
@philoserf
philoserf merged commit f306bba into main Aug 4, 2026
1 check passed
@philoserf
philoserf deleted the agent/mastermod-tables branch August 4, 2026 20:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants