Skip to content

RFC 0003: Sport Scoping (sport field + per-sport action vocabularies) - #36

Merged
OliEder merged 8 commits into
mainfrom
feat/sport-scoping
Aug 27, 2026
Merged

OliEder merged 8 commits into
mainfrom
feat/sport-scoping

Conversation

@OliEder

@OliEder OliEder commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Implements accepted RFC 0003. Additive, backwards-compatible → v1.2.0.

Summary

  • Optional top-level sport field (enum basketball/soccer/handball/hockey/futsal, default basketball).
  • Per-sport action-type whitelist via draft-07 allOf+if/then; the pre-existing custom-ruleset if/then is folded into the same allOf (only one top-level if allowed).
  • Basketball branch matches anyOf[ sport-absent, sport==basketball ] so existing sport-less documents stay valid (JSON Schema default doesn't apply during validation).
  • Reserved skeleton action types (tackle/clear/faceoff/check) with no variants; action_ref pattern extended.
  • External sport vocabularies: sports/basketball-v1.json (defined) + soccer/handball/hockey/futsal (v0.0.1 provisional skeletons).
  • Fixtures (valid + invalid), a convention test (every sport enum value has a branch) and a skeleton↔schema consistency test — both mutation-tested to prove they catch drift.
  • Docs (== Sport, changelog), framing reconciled to "team-sport / invasion sports, basketball first", version → 1.2.0 in all four places, RFC 0003 marked accepted.

Verified (ajv/draft-07)

  • back-compat: sport-less basketball doc validates; custom-ruleset fold still rejects custom without custom_dimensions.
  • gating: basketball+tackle rejected, soccer+screen rejected, soccer+tackle valid, volleyball rejected.
  • strictTypes: 0 warnings (ocf-validator runs ajv with strictTypes enabled).
  • $id stays schema/v1.json (v1 major line, additive).

Test Plan

  • npm test — 7 valid examples, 15 invalid rejected, 5 position + 3 sport tests
  • Site builds; version consistent at 1.2.0 across package.json / $comment / :version: / changelog

Known follow-up (not in this PR)

The schema caps player numbers at nr 1-9 (entity_ref _[1-9]), which fits basketball but not soccer (11) / handball (7). Raising it touches the neutral core (entity nr, entity_ref, action_ref, state patternProperties) and is a separate change — tracked as an RFC 0003 open question.

🤖 Generated with Claude Code

@OliEder
OliEder merged commit 68a3ff4 into main Aug 27, 2026
1 of 2 checks passed
@OliEder
OliEder deleted the feat/sport-scoping branch August 29, 2026 05:17
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