diff --git a/internal/topdata/CLASS_FEAT_GLOBAL_INJECTS_CONTRACT.md b/internal/topdata/CLASS_FEAT_GLOBAL_INJECTS_CONTRACT.md index f4e956d..7d0567d 100644 --- a/internal/topdata/CLASS_FEAT_GLOBAL_INJECTS_CONTRACT.md +++ b/internal/topdata/CLASS_FEAT_GLOBAL_INJECTS_CONTRACT.md @@ -65,6 +65,33 @@ effective output while keeping project policy in topdata authoring files. `position` defaults to `append`. The module uses `prepend` for class feat injections to keep generated policy rows before per-class authored rows. +## Global Injection Grammar + +Each injection entry may use only `row`, `require_present`, `any_present`, and +`unless_present`. `when_present` is invalid and rejected; it is not an alias. + +```json +{ + "row": { + "FeatIndex": { "id": "feat:example" } + }, + "require_present": [{ "field": "FeatIndex", "id": "feat:required" }], + "any_present": [ + { "field": "FeatIndex", "id": "masterfeats:metamagic" }, + { "field": "FeatIndex", "id": "masterfeats:combat" } + ], + "unless_present": [{ "field": "FeatIndex", "id": "feat:example" }] +} +``` + +- `require_present` means every listed reference must exist. +- `any_present` means at least one listed reference must exist, and the array + must not be empty. +- `unless_present` means none of the listed references may exist. +- Every present group on an entry must pass. +- Conditions observe the current rows in injection order, so earlier injections + can affect later conditions. + ## Acceptance Criteria - Class feat output contains the same effective shared feats as the prior YAML