Skip to content

docs(loader): document structural vocabulary in Loader moduledoc#115

Merged
QMalcolm merged 1 commit into
mainfrom
qmalcolm--docs-structural-vocabulary-audit
May 6, 2026
Merged

docs(loader): document structural vocabulary in Loader moduledoc#115
QMalcolm merged 1 commit into
mainfrom
qmalcolm--docs-structural-vocabulary-audit

Conversation

@QMalcolm

@QMalcolm QMalcolm commented May 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds a ## Structural Vocabulary section to Loader's @moduledoc — the canonical reference for every concept metadata key the library reads at runtime
  • Covers reserved type IDs, all concept metadata keys grouped by context, the filter and choices nested schemas, and "hidden" (CLI-only, noted separately)
  • Provides the foundation for the next step: load-time validation warnings when unknown keys are present

Why

The library reads ~20 specific metadata keys (e.g. "required_count", "available_when", "target_type") that were previously undocumented — a system author had to read library source to know what keys are meaningful. This makes the implicit schema explicit and owned.

Part of the configurability cleanup identified in the architectural review.

Related

Summary by Bito

  • Added a new 'Structural Vocabulary' section to the module documentation, detailing the library's reserved keys and their meanings for interpreting concept definitions.
  • Documented reserved concept type IDs 'roll' and 'character_progression', along with their required and optional keys.
  • Explained universal keys applicable to any concept type, and specific keys for rolls, progressions, selectable concepts, inventory, and choices.
  • Included a note on CLI-only keys like 'hidden' that are used by ttrpg_dev_cli but not the library itself.

Adds a "Structural Vocabulary" section to the Loader @moduledoc listing
every concept metadata key the library reads at runtime. This is the
canonical reference for system authors and the foundation for adding
load-time validation.

The section covers: reserved concept type IDs ("roll",
"character_progression"), keys on progression concepts (required_count,
available_when, effect_target, roll_reference, filter and its subkeys),
keys on roll concepts (target_type, dice, bonus_field), keys on
selectable concepts (level, requires), starting_equipment, the choices
map and its subkeys (type, options, grants_to, name, contributes_field,
contributes_value), and the CLI-only "hidden" key.

This audit revealed that "roll" and "character_progression" are
structural type IDs hardcoded in the library — they belong in this
vocabulary section, not in config. It also surfaced that the filter
subkey "active_in" carries its own "field"/"type" subkeys, which was
previously implicit.

@QMalcolm QMalcolm left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

✔️

@QMalcolm QMalcolm merged commit 1c3b209 into main May 6, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant