openpickleball-engine 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. openpickleball_engine-1.0.0/.gitignore +39 -0
  2. openpickleball_engine-1.0.0/CHANGELOG.md +254 -0
  3. openpickleball_engine-1.0.0/LICENSE +662 -0
  4. openpickleball_engine-1.0.0/PARAMETERS.md +59 -0
  5. openpickleball_engine-1.0.0/PKG-INFO +248 -0
  6. openpickleball_engine-1.0.0/README.md +217 -0
  7. openpickleball_engine-1.0.0/examples/basic_match.py +88 -0
  8. openpickleball_engine-1.0.0/pyproject.toml +87 -0
  9. openpickleball_engine-1.0.0/scripts/check_installed_wheel.py +72 -0
  10. openpickleball_engine-1.0.0/scripts/check_release.py +68 -0
  11. openpickleball_engine-1.0.0/scripts/check_sdist.py +110 -0
  12. openpickleball_engine-1.0.0/scripts/check_wheel.py +149 -0
  13. openpickleball_engine-1.0.0/src/open_engine/__init__.py +95 -0
  14. openpickleball_engine-1.0.0/src/open_engine/_config.py +1379 -0
  15. openpickleball_engine-1.0.0/src/open_engine/_connectivity.py +167 -0
  16. openpickleball_engine-1.0.0/src/open_engine/_engine.py +1582 -0
  17. openpickleball_engine-1.0.0/src/open_engine/_errors.py +90 -0
  18. openpickleball_engine-1.0.0/src/open_engine/_evaluation.py +705 -0
  19. openpickleball_engine-1.0.0/src/open_engine/_ledger.py +277 -0
  20. openpickleball_engine-1.0.0/src/open_engine/_math.py +290 -0
  21. openpickleball_engine-1.0.0/src/open_engine/_model.py +614 -0
  22. openpickleball_engine-1.0.0/src/open_engine/_replay.py +255 -0
  23. openpickleball_engine-1.0.0/src/open_engine/_seeds.py +327 -0
  24. openpickleball_engine-1.0.0/src/open_engine/_snapshot.py +1511 -0
  25. openpickleball_engine-1.0.0/src/open_engine/_types.py +254 -0
  26. openpickleball_engine-1.0.0/src/open_engine/_validation.py +220 -0
  27. openpickleball_engine-1.0.0/src/open_engine/_version.py +9 -0
  28. openpickleball_engine-1.0.0/src/open_engine/engine.py +99 -0
  29. openpickleball_engine-1.0.0/src/open_engine/params/v1.json +108 -0
  30. openpickleball_engine-1.0.0/src/open_engine/py.typed +0 -0
  31. openpickleball_engine-1.0.0/src/open_engine/winprob.py +196 -0
  32. openpickleball_engine-1.0.0/tests/api_surface.txt +316 -0
  33. openpickleball_engine-1.0.0/tests/fixtures/README.md +5 -0
  34. openpickleball_engine-1.0.0/tests/helpers.py +57 -0
  35. openpickleball_engine-1.0.0/tests/test_addendum_review_fixes.py +197 -0
  36. openpickleball_engine-1.0.0/tests/test_api.py +553 -0
  37. openpickleball_engine-1.0.0/tests/test_api_surface.py +169 -0
  38. openpickleball_engine-1.0.0/tests/test_apply_update_model.py +118 -0
  39. openpickleball_engine-1.0.0/tests/test_calibration.py +384 -0
  40. openpickleball_engine-1.0.0/tests/test_calibration_bins.py +67 -0
  41. openpickleball_engine-1.0.0/tests/test_category_seed_fuzz.py +200 -0
  42. openpickleball_engine-1.0.0/tests/test_category_seed_import.py +101 -0
  43. openpickleball_engine-1.0.0/tests/test_category_seed_not_stored.py +332 -0
  44. openpickleball_engine-1.0.0/tests/test_check_installed_wheel.py +67 -0
  45. openpickleball_engine-1.0.0/tests/test_check_release.py +149 -0
  46. openpickleball_engine-1.0.0/tests/test_check_sdist.py +187 -0
  47. openpickleball_engine-1.0.0/tests/test_check_wheel.py +234 -0
  48. openpickleball_engine-1.0.0/tests/test_clamped_loss_boundary.py +50 -0
  49. openpickleball_engine-1.0.0/tests/test_clamped_precision.py +74 -0
  50. openpickleball_engine-1.0.0/tests/test_clamped_visible_loss.py +90 -0
  51. openpickleball_engine-1.0.0/tests/test_config_checks.py +463 -0
  52. openpickleball_engine-1.0.0/tests/test_config_checks_review.py +423 -0
  53. openpickleball_engine-1.0.0/tests/test_config_checks_review2.py +160 -0
  54. openpickleball_engine-1.0.0/tests/test_config_float_override.py +98 -0
  55. openpickleball_engine-1.0.0/tests/test_config_immutable.py +357 -0
  56. openpickleball_engine-1.0.0/tests/test_config_rebuilt_after_iterables.py +165 -0
  57. openpickleball_engine-1.0.0/tests/test_config_rebuilt_at_entry.py +573 -0
  58. openpickleball_engine-1.0.0/tests/test_config_rebuilt_leaves.py +321 -0
  59. openpickleball_engine-1.0.0/tests/test_content_duplicates.py +503 -0
  60. openpickleball_engine-1.0.0/tests/test_content_key_scores.py +47 -0
  61. openpickleball_engine-1.0.0/tests/test_date_min_windows.py +300 -0
  62. openpickleball_engine-1.0.0/tests/test_digest_tags.py +154 -0
  63. openpickleball_engine-1.0.0/tests/test_docstrings.py +140 -0
  64. openpickleball_engine-1.0.0/tests/test_duplicate_order.py +64 -0
  65. openpickleball_engine-1.0.0/tests/test_engine.py +872 -0
  66. openpickleball_engine-1.0.0/tests/test_enum_str.py +61 -0
  67. openpickleball_engine-1.0.0/tests/test_established.py +171 -0
  68. openpickleball_engine-1.0.0/tests/test_evaluation_date_types.py +71 -0
  69. openpickleball_engine-1.0.0/tests/test_exact_identity_types.py +482 -0
  70. openpickleball_engine-1.0.0/tests/test_exact_identity_types_review.py +296 -0
  71. openpickleball_engine-1.0.0/tests/test_exact_input_callbacks.py +182 -0
  72. openpickleball_engine-1.0.0/tests/test_exact_input_plain_unchanged.py +194 -0
  73. openpickleball_engine-1.0.0/tests/test_exact_input_review.py +511 -0
  74. openpickleball_engine-1.0.0/tests/test_exact_input_review2.py +317 -0
  75. openpickleball_engine-1.0.0/tests/test_exact_input_review3.py +138 -0
  76. openpickleball_engine-1.0.0/tests/test_exact_input_types.py +917 -0
  77. openpickleball_engine-1.0.0/tests/test_exact_input_zoneinfo.py +130 -0
  78. openpickleball_engine-1.0.0/tests/test_exact_input_zoneinfo_range.py +89 -0
  79. openpickleball_engine-1.0.0/tests/test_examples.py +30 -0
  80. openpickleball_engine-1.0.0/tests/test_expected_share_scale.py +54 -0
  81. openpickleball_engine-1.0.0/tests/test_external_seed_format.py +27 -0
  82. openpickleball_engine-1.0.0/tests/test_external_seed_types.py +81 -0
  83. openpickleball_engine-1.0.0/tests/test_failed_calls_create_nothing.py +243 -0
  84. openpickleball_engine-1.0.0/tests/test_float_summation.py +146 -0
  85. openpickleball_engine-1.0.0/tests/test_future_seed.py +124 -0
  86. openpickleball_engine-1.0.0/tests/test_game_format_checks.py +183 -0
  87. openpickleball_engine-1.0.0/tests/test_game_format_coverage.py +91 -0
  88. openpickleball_engine-1.0.0/tests/test_game_format_override.py +61 -0
  89. openpickleball_engine-1.0.0/tests/test_game_shape.py +20 -0
  90. openpickleball_engine-1.0.0/tests/test_hash_seed_messages.py +208 -0
  91. openpickleball_engine-1.0.0/tests/test_imbalance_rounding.py +54 -0
  92. openpickleball_engine-1.0.0/tests/test_imported_reliability.py +80 -0
  93. openpickleball_engine-1.0.0/tests/test_imported_reliability_rounding.py +36 -0
  94. openpickleball_engine-1.0.0/tests/test_inherited_live_updates.py +297 -0
  95. openpickleball_engine-1.0.0/tests/test_inherited_rd_checks.py +103 -0
  96. openpickleball_engine-1.0.0/tests/test_int_config_overflow.py +300 -0
  97. openpickleball_engine-1.0.0/tests/test_int_config_reachable_multiplier.py +152 -0
  98. openpickleball_engine-1.0.0/tests/test_late_live_category.py +151 -0
  99. openpickleball_engine-1.0.0/tests/test_late_live_match.py +231 -0
  100. openpickleball_engine-1.0.0/tests/test_ledger_conflict_copy.py +27 -0
  101. openpickleball_engine-1.0.0/tests/test_match_digest_strict.py +126 -0
  102. openpickleball_engine-1.0.0/tests/test_match_exact_types.py +356 -0
  103. openpickleball_engine-1.0.0/tests/test_match_field_types.py +128 -0
  104. openpickleball_engine-1.0.0/tests/test_match_ids.py +54 -0
  105. openpickleball_engine-1.0.0/tests/test_match_performance.py +96 -0
  106. openpickleball_engine-1.0.0/tests/test_match_status.py +415 -0
  107. openpickleball_engine-1.0.0/tests/test_match_status_review.py +127 -0
  108. openpickleball_engine-1.0.0/tests/test_match_type_checks.py +242 -0
  109. openpickleball_engine-1.0.0/tests/test_model_worked_example.py +439 -0
  110. openpickleball_engine-1.0.0/tests/test_module_layout.py +97 -0
  111. openpickleball_engine-1.0.0/tests/test_net_rating_created.py +294 -0
  112. openpickleball_engine-1.0.0/tests/test_network_connectivity.py +500 -0
  113. openpickleball_engine-1.0.0/tests/test_own_k.py +257 -0
  114. openpickleball_engine-1.0.0/tests/test_parameter_identity.py +357 -0
  115. openpickleball_engine-1.0.0/tests/test_parameter_set_binding.py +89 -0
  116. openpickleball_engine-1.0.0/tests/test_parameter_set_check_order.py +104 -0
  117. openpickleball_engine-1.0.0/tests/test_parameter_sets.py +474 -0
  118. openpickleball_engine-1.0.0/tests/test_plain_numbers.py +442 -0
  119. openpickleball_engine-1.0.0/tests/test_plain_numbers_review.py +368 -0
  120. openpickleball_engine-1.0.0/tests/test_possible_duplicates.py +107 -0
  121. openpickleball_engine-1.0.0/tests/test_prequential_duplicate_seed.py +31 -0
  122. openpickleball_engine-1.0.0/tests/test_prequential_seed_validation.py +43 -0
  123. openpickleball_engine-1.0.0/tests/test_properties.py +823 -0
  124. openpickleball_engine-1.0.0/tests/test_public_class_identity.py +100 -0
  125. openpickleball_engine-1.0.0/tests/test_published_parameter_sets.py +111 -0
  126. openpickleball_engine-1.0.0/tests/test_read_only_lookups.py +197 -0
  127. openpickleball_engine-1.0.0/tests/test_read_only_lookups_followup.py +143 -0
  128. openpickleball_engine-1.0.0/tests/test_readme.py +88 -0
  129. openpickleball_engine-1.0.0/tests/test_record_as_of_order.py +95 -0
  130. openpickleball_engine-1.0.0/tests/test_refactor_parity.py +974 -0
  131. openpickleball_engine-1.0.0/tests/test_refactor_parity_143.py +5375 -0
  132. openpickleball_engine-1.0.0/tests/test_reference_date.py +183 -0
  133. openpickleball_engine-1.0.0/tests/test_reference_date_live.py +43 -0
  134. openpickleball_engine-1.0.0/tests/test_reject_reserves_match_id.py +302 -0
  135. openpickleball_engine-1.0.0/tests/test_replay_as_of_type.py +69 -0
  136. openpickleball_engine-1.0.0/tests/test_replay_digest_path.py +69 -0
  137. openpickleball_engine-1.0.0/tests/test_replay_info_mapping.py +88 -0
  138. openpickleball_engine-1.0.0/tests/test_replay_live_parity.py +196 -0
  139. openpickleball_engine-1.0.0/tests/test_replay_resume.py +381 -0
  140. openpickleball_engine-1.0.0/tests/test_reseed_after_rejected_match.py +191 -0
  141. openpickleball_engine-1.0.0/tests/test_reseed_refreshes_derived.py +222 -0
  142. openpickleball_engine-1.0.0/tests/test_reserved_match_ids.py +190 -0
  143. openpickleball_engine-1.0.0/tests/test_reserved_provenance.py +497 -0
  144. openpickleball_engine-1.0.0/tests/test_reserved_provenance_shapes.py +442 -0
  145. openpickleball_engine-1.0.0/tests/test_resumable_possible_duplicates.py +100 -0
  146. openpickleball_engine-1.0.0/tests/test_resume_after_changes.py +174 -0
  147. openpickleball_engine-1.0.0/tests/test_resume_ledger_players.py +110 -0
  148. openpickleball_engine-1.0.0/tests/test_resume_whole_ledger.py +95 -0
  149. openpickleball_engine-1.0.0/tests/test_resume_whole_ledger_type.py +36 -0
  150. openpickleball_engine-1.0.0/tests/test_scale_k_ridge.py +141 -0
  151. openpickleball_engine-1.0.0/tests/test_scoring_output_type.py +79 -0
  152. openpickleball_engine-1.0.0/tests/test_seed_containers.py +75 -0
  153. openpickleball_engine-1.0.0/tests/test_seed_huge_int.py +87 -0
  154. openpickleball_engine-1.0.0/tests/test_seed_identity_fields.py +63 -0
  155. openpickleball_engine-1.0.0/tests/test_seed_identity_values.py +361 -0
  156. openpickleball_engine-1.0.0/tests/test_seed_keeps_open_history.py +356 -0
  157. openpickleball_engine-1.0.0/tests/test_seed_provenance.py +431 -0
  158. openpickleball_engine-1.0.0/tests/test_seed_provenance_entry_points.py +130 -0
  159. openpickleball_engine-1.0.0/tests/test_seed_rating_bounds.py +68 -0
  160. openpickleball_engine-1.0.0/tests/test_seed_rd.py +35 -0
  161. openpickleball_engine-1.0.0/tests/test_seed_replay_pinned.py +105 -0
  162. openpickleball_engine-1.0.0/tests/test_seed_sensitive_processed_entry.py +91 -0
  163. openpickleball_engine-1.0.0/tests/test_seed_sensitive_rejections.py +889 -0
  164. openpickleball_engine-1.0.0/tests/test_seed_types.py +143 -0
  165. openpickleball_engine-1.0.0/tests/test_seed_validation.py +186 -0
  166. openpickleball_engine-1.0.0/tests/test_singles.py +90 -0
  167. openpickleball_engine-1.0.0/tests/test_snapshot.py +659 -0
  168. openpickleball_engine-1.0.0/tests/test_snapshot_engine_made.py +104 -0
  169. openpickleball_engine-1.0.0/tests/test_snapshot_identities.py +140 -0
  170. openpickleball_engine-1.0.0/tests/test_snapshot_invariants.py +382 -0
  171. openpickleball_engine-1.0.0/tests/test_snapshot_log_links.py +233 -0
  172. openpickleball_engine-1.0.0/tests/test_snapshot_log_players.py +281 -0
  173. openpickleball_engine-1.0.0/tests/test_snapshot_net_negative_zero.py +42 -0
  174. openpickleball_engine-1.0.0/tests/test_snapshot_net_rating_created.py +156 -0
  175. openpickleball_engine-1.0.0/tests/test_snapshot_possible_duplicates.py +84 -0
  176. openpickleball_engine-1.0.0/tests/test_snapshot_reserved_match_ids.py +189 -0
  177. openpickleball_engine-1.0.0/tests/test_snapshot_verified_log.py +648 -0
  178. openpickleball_engine-1.0.0/tests/test_snapshot_verified_matches.py +148 -0
  179. openpickleball_engine-1.0.0/tests/test_str_match_type.py +71 -0
  180. openpickleball_engine-1.0.0/tests/test_summary_as_of_type.py +45 -0
  181. openpickleball_engine-1.0.0/tests/test_summary_reliability.py +17 -0
  182. openpickleball_engine-1.0.0/tests/test_verified_established.py +240 -0
  183. openpickleball_engine-1.0.0/tests/test_winprob.py +109 -0
  184. openpickleball_engine-1.0.0/tests/test_winprob_format.py +43 -0
@@ -0,0 +1,39 @@
1
+ # Secrets
2
+ .env
3
+ .env.*
4
+ !.env.example
5
+ secrets/
6
+ *.pem
7
+ *.key
8
+
9
+ # Local data: never commit real player data
10
+ /data/
11
+ /local-data/
12
+ *.sqlite
13
+ *.sqlite3
14
+ *.db
15
+ *.dump
16
+
17
+ # Editors and operating systems
18
+ .idea/
19
+ .vscode/
20
+ .DS_Store
21
+
22
+ # Python
23
+ __pycache__/
24
+ *.py[cod]
25
+ .venv/
26
+ venv/
27
+ .pytest_cache/
28
+ .ruff_cache/
29
+ .mypy_cache/
30
+ .coverage
31
+ htmlcov/
32
+ build/
33
+ dist/
34
+ *.egg-info/
35
+ /.claude/worktrees/
36
+
37
+ # Local tooling
38
+ .superpowers/
39
+ /uv.lock
@@ -0,0 +1,254 @@
1
+ # Changelog
2
+
3
+ All notable changes to the OPEN rating engine are recorded here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and versions follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html). Before 1.0.0, a minor version could include breaking changes. Since 1.0.0, a breaking change to anything the stability promise covers needs a new major version.
4
+
5
+ The engine is the reference implementation of the OPEN rating method. Its outputs are not OPEN ratings, and no OPEN rating is live.
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [1.0.0] - 2026-11-23
10
+
11
+ The 1.0.0 release is the same code as 1.0.0rc2, which the OPEN backend was tested against; only the version differs. It is published to PyPI, so `pip install openpickleball-engine` installs it, and an evaluation can pin `openpickleball-engine==1.0.0`. Two release candidates came first, 1.0.0rc1 and 1.0.0rc2, and this entry covers everything since 0.3.0.dev0. The package is the reference implementation of the OPEN rating method. Its outputs are not OPEN ratings, and no OPEN rating is live.
12
+
13
+ The stability promise in `docs/behavior.md` ("Stability") and the README's "Public API" section is in effect from this release. A breaking change to anything it covers needs a new major version.
14
+
15
+ Highlights since 0.3.0.dev0:
16
+
17
+ - **Parameter set identity** (issue #155). `Config.params_version` labels a published parameter set, and `Config.parameter_fingerprint()` names the parameter values apart from the package version. `ReplayInfo` carries both, and since issue #48 so does `PlayerSummary`.
18
+ - **Public API freeze** (issue #156). `tests/api_surface.txt` records the public surface, a test fails when the code differs from it, and the stability promise is written down.
19
+ - **Parameter set v1** (issue #48). `src/open_engine/params/v1.json`, `PARAMETERS.md`, `docs/parameters.md`, and `Config.from_parameter_set`. v1 did not pass the gain bar of the rule for changing defaults, so `Config()` keeps its placeholder defaults and v1 is loaded explicitly.
20
+ - **What a rating means** (issue #149). `docs/model.md` and the README declare what a rating gap means under v1, that `Config()` carries no such meaning, what the level means, and that scaling the scale and K together changes no prediction.
21
+ - **Packaged parameter sets** (issue #165). The wheel ships `v1`, and `Config.published("v1")` loads it from an installed package without a repository checkout. `Config.published_sets()` lists the labels.
22
+ - **API decisions and known limitations** (issue #167). The README lists the known limitations the evaluation's simulations found, and the stability promise now says what it covers for returned objects, published parameter sets, and `Config()` defaults.
23
+ - **Published to PyPI** (issue #169). The release workflow publishes each tagged version to TestPyPI and then, after a second approval, to PyPI.
24
+ - **Breaking changes**, each listed below: snapshot schema version 9 (a version 8 snapshot no longer loads; a full replay rebuilds it), two new required `PlayerSummary` fields (`params_version` and `parameter_fingerprint`), `RatingEngine.self_reported_log` renamed to the internal `_self_reported_log`, `Config.from_dict` needing the `params_version` key, the new `Config` and `ReplayInfo` fields shifting positional arguments, every `Config.fingerprint()` changing, and the `scoring` fields of `EvaluationReport`, `ScaleFit`, and `WinCalibrationFit` typed `ScoringType`, not str (issue #167).
25
+ - The version gives a new default `Config().fingerprint()`, `30dc01fa90e94c97` (1.0.0rc2 gave `7334117efa23cc98`), so a snapshot made under a release candidate with the default `Config.version` fails `from_snapshot` under the 1.0.0 default `Config()` with a config version mismatch. A full replay rebuilds it. `parameter_fingerprint()` does not change: `Config()` stays `1058623faf5d9367`, and `v1` stays `f9149f3c38a01efc`.
26
+
27
+ ### Added
28
+
29
+ - `.github/workflows/release.yml` has a `publish-pypi` job. It runs after `publish-testpypi` succeeds, in the `pypi` environment, and publishes the same files to PyPI with trusted publishing. `docs/releasing.md` describes the two approvals and the one-time PyPI setup (issue #169).
30
+ - `Config.published(label)`, a classmethod that loads a parameter set this release publishes, such as `Config.published("v1")`, from the file the package ships. It reads `open_engine/params/<label>.json` with `importlib.resources` and passes the parsed JSON to `Config.from_parameter_set`, so it makes the same label and fingerprint checks. A label that is not exactly a str, a label this release does not publish, and a packaged file that is missing, unreadable, or not JSON raise `ConfigError`, the error `from_parameter_set` raises for an unpublished label. Only a label in the engine's table is used to find a file, and the message for an unpublished label does not show it. `docs/behavior.md` ("Config validation") lists the checks in order (issue #165).
31
+ - `Config.published_sets()`, a classmethod that returns the labels this release publishes, in order, so callers do not hard-code them. It returns `("v1",)` (issue #165).
32
+ - The wheel ships the published parameter sets, so an installed package loads `v1` without a repository checkout. CI's `package` job now installs the built wheel alone in a clean virtual environment and loads every published set from it (`scripts/check_installed_wheel.py`) (issue #165).
33
+ - A "Known limitations" section in the README, linked from the status note and from `docs/model.md` ("Assumptions"). In plain language, it lists what the evaluation's simulations found: regular partners end up with one shared rating, deliberate losing is not detected and lasts, colluding accounts can inflate one player with no cap, a closed group can be labeled established, `v1` makes the sandbagging and collusion effects 1.9 to 2.6 times larger than `Config()`, and `v1` is not shown to predict better than the defaults (issue #167).
34
+ - The stability promise (README "Public API" and `docs/behavior.md` "Stability") now states that `RatingEngine.player()` and `RatingEngine.state()` return the engine's own objects, not copies (a starting state from `state()` is a new copy, and a later update replaces a stored state with a new object), and that changing a `Player` or `RatingState` in place is unsupported and outside the promise. It also states that a published parameter set's values never change (retuning publishes a new label) and that a change to the `Config()` defaults comes in a minor release. `docs/parameters.md` has a new section, "A published set never changes". No code behavior changed (issue #167).
35
+ - `docs/model.md`, the rating model in one place: the team rating, expected point share, match performance, evidence weight, inactivity, K, the update with its clamp and RD shrink, frozen players, imbalance, the starting states, categories, the eligibility checks, reliability, win probability, and evaluation and calibration, each equation naming the function it comes from, with a table of the `Config` parameters, their defaults, and which are placeholders or declared choices. The README links it. The literals on the rating, prediction, and reliability paths are now named constants in `engine.py` with the same values (the expected-share exponent clamp, the reliability blend, the clamp detection tolerance, the reported decimal places, and the reliability cap display step), and `player_k`, `information_multiplier`, `_actual_point_share`, `_rolling_unique_count`, `_clone_state`, and `clone_player` have docstrings. No behavior, output, `Config` field, fingerprint, or snapshot changed (issue #125).
36
+ - A "Public API" section in the README that lists every public name. Names not listed there, including everything reached only through `open_engine.engine` or `open_engine.winprob`, are internal. A test checks that the list equals `open_engine.__all__`.
37
+ - An exception hierarchy. `OpenEngineError` is the base, and every class is a `ValueError`, so `except ValueError` still works: `ConfigError` (configuration, and game formats checked outside a match), `InvalidMatchError` (matches, teams, ids, game scores, `played_at`, and a match's game format), `InvalidSeedError` (external and replay seeds), `PlayerError` (player ids, account and external identity links), `EvaluationError` (evaluation, calibration, and win probability arguments), and `LedgerConflictError`, now under `OpenEngineError`. Seeding can also raise `PlayerError` for player identities, such as a blank or repeated player id, or an account or external identity already linked to another player.
38
+ - `RejectionReason`, a string enum with one member per reason a match is not counted.
39
+ - `PlayerSummary`, the frozen dataclass `player_summary` returns.
40
+ - Docstrings on every public name and on the public methods of public classes. A test checks them.
41
+ - Engine snapshots and checkpoints. `RatingEngine.to_snapshot()` returns the engine's whole state as JSON-safe data (schema version 9, documented in the README), with sorted keys and lists so the same state gives the same text. `RatingEngine.from_snapshot(snapshot, cfg=None)` rebuilds the engine after checking every key and type, the ranges of ratings, RDs, reliabilities, and counts, the config version and fingerprint against `cfg`, and the engine's own rules for states and identities (an unplayed state has a seed RD and no partners, counts and dates agree, and a resumable snapshot holds nothing dated after its replay). It checks shape and these rules, not authenticity, so a stored snapshot needs the same write protection as ratings. `replay` takes new keyword arguments: `from_snapshot` resumes from a replay's snapshot and gives the same result as a full replay, with the whole ledger or only the rows after the checkpoint, and `whole_ledger=True` (only with `from_snapshot`, else `SnapshotError`) tells resume it has the whole ledger, so it raises `SnapshotError` naming any row the checkpoint saw that is missing (a voided or deleted row). Take the snapshot right after the replay: every engine method that changes state (a live match, a seed, an identity link, a new player or rating state) makes resume refuse it, and changing objects the engine returns directly is not tracked and makes the snapshot unsafe to resume. Resume raises instead of differing: `SnapshotError` for a snapshot not from a replay or changed since, an `as_of` before the checkpoint, a row on or before the checkpoint date that the checkpoint did not see, or a seed for a player the checkpoint's rows named; `LedgerConflictError` for a changed row on or before the checkpoint date or a later row that reuses its id; `PlayerError` for a seed already in the snapshot. Without `whole_ledger=True`, resume cannot see a voided row on or before the checkpoint, and given only the newer rows it cannot see an edited or backdated row on or before the checkpoint either. With or without it, resume cannot see a seed withdrawn or corrected after the checkpoint. Those need a full replay. A `whole_ledger` that is not a bool raises `SnapshotError`. This change does not alter the ratings a full replay gives for any ledger a full replay still accepts. The Fixed section lists the rows a full replay now rejects (issue #16).
42
+ - `SnapshotError`, an `OpenEngineError`, for a snapshot that cannot be loaded or resumed from (issue #16).
43
+ - `UnknownPlayerError`, a `PlayerError`, for a read of a player id with no player record. `RatingEngine.player`, `RatingEngine.state`, and `RatingEngine.player_summary` raise it (issue #23).
44
+ - `ReferenceDateError`, an `OpenEngineError`, for a `player_summary` call with no date to measure at, or with an `as_of` that is not a plain date (issue #17).
45
+ - `Config.established_reliability_threshold` (default 60.0) and `PlayerSummary.established`, a bool right after `imported_reliability`. It is `True` when `reliability` (OPEN-earned, as displayed, rounded to 1 place, at the summary's reference date) is at least the threshold and, since issue #59, the state has at least `Config.established_min_verified_matches` counted verified matches. `Config` raises `ConfigError` for a threshold below 0, above 100, or NaN. Imported reliability never counts. Under the default config an unplayed imported seed is not established (its earned reliability is at most 32.6). An established player who stops playing loses it as the reference date moves on. Under the defaults, a new player with no imported rating, playing one match a week with varied partners and opponents, becomes established after about 10 to 13 tournament, league, or recreational verified matches (10 tournament, 11 league, or 13 recreational verified matches of one game, fewer for best of 3), and after about twice as many against the same players. Since issue #58, with `Config.connectivity_reliability_cap` set, these counts are for a player whose network connectivity is connected. Self-reported matches raise reliability past the threshold after about 20 to 25 with varied players (never against the same players, because repeat matches are discounted and then rejected); since issue #59, established also needs a minimum of counted verified matches, so such a player is not established until they have it (see the `Config.established_min_verified_matches` entry). A player seeded from a recently captured imported rating starts at a lower RD (`Config.external_seed_rd`) and is established after about 3 to 4 tournament, league, or recreational verified matches. RD grows from the capture date, so an older import gives less of a head start, and a very old one none. The imported rating and its reliability value do not change the count. A rating that is not established is what external rating systems usually call provisional; OPEN's provisional live updates and the `open_provisional` source are different things. The threshold changes no rating and no `evaluate`, `prequential_predictions`, `fit_scale`, or `fit_win_calibration` output. It is separate from evaluation's eligibility rule (an imported baseline or `burn_in_matches` OPEN matches). The new field changes the default `Config().fingerprint()`. A snapshot made under an earlier default config fails `from_snapshot` under the new default config with a fingerprint mismatch, and replay records carry a different fingerprint (issue #18).
46
+ - `MatchResult.imbalance`: the mean team A delta plus the mean team B delta, from the unrounded changes, rounded to 5 places. Each delta is rounded on its own, so `imbalance` can differ from the same sum of the rounded deltas by up to 1.5e-5. It is 0.0 when both teams have the same mean K and no player is clamped or frozen, and for a match that did not count. It can be nonzero when the teams' mean K differ or a player is clamped or frozen. A value of 0.0 does not mean nothing was clamped or frozen: read `clamped` and `frozen` for that. A category match's `parent` result has its own value. The field comes after `clamped` and before `parent` (issue #14).
47
+ - `MatchResult.late`, a bool right after `imbalance`, default `False`. It is `True` for a counted match dated before a player's last match in that rating format, or before the date that player's rating in that format already reflects (for a category rating copied from overall doubles). Frozen players count. Live recording applies matches in arrival order, so the backend should check `late` and, for a category match, `parent.late`, and schedule a replay when either is `True`. It compares dates only, so a match on the same date is never late. It is `False` for a match that did not count and for every match a replay records. A category match's `parent` result has its own value, measured against the overall doubles dates (issue #19).
48
+ - A published policy for match performance: team A's share of all points across games, blended with the result by `Config.win_weight` (default 0.0, pure point share). A team can win and still lose rating when it wins by less than expected or wins a best of 3 (or 5) with fewer total points. There is no floor on a winner's change other than the rating range (`min_rating` to `max_rating`), and `win_weight = 1.0` scores the result only. The default changes only when out-of-sample evaluation supports another value. The policy is in the engine module docstring, the `Config` comment, and a new README section, with tests that pin it. It changes no rating (issue #20).
49
+ - `MatchResult.possible_duplicate_of`, the last field, default `None`. It names the earliest counted match with the same content as this one under another `match_id`: the same `played_on`, the same two teams as sets of players (either side may be team A), and the same game scores read from the same side. Match type, rating format, game format, `best_of`, `played_at`, `sequence`, and `confirmed_by` are left out. It is `None` when there is no such earlier match. Only a counted match and a match rejected as a possible duplicate carry it; it is `None` on every other result and on `parent`. The later match in processing order is the one flagged: arrival order live, ledger order in a replay (issue #21).
50
+ - `Config.reject_content_duplicates` (default `False`), a bool; any other value raises `ConfigError`. `False` does not reject a possible duplicate: it goes through the other checks and, if it counts, is flagged. `True` does not count it and returns `RejectionReason.POSSIBLE_DUPLICATE`. A real rematch on the same day between the same teams with the same scores is flagged too, or not counted under `True`. Reports that disagree on the date are not caught. The new field changes the default `Config().fingerprint()`, so a snapshot made under an earlier default config fails `from_snapshot` with a fingerprint mismatch. Under the default, every rating is the same as before (issue #21).
51
+ - `RejectionReason.POSSIBLE_DUPLICATE` (`"possible_duplicate"`), for a match rejected under `Config.reject_content_duplicates` (issue #21).
52
+ - Which report counts as the copy is set by processing order alone (arrival order live; ledger order in a replay, where, within a date, untimed rows come first by `sequence` then `match_id`, then timed rows by the UTC instant of `played_at`, then `sequence` and `match_id`), whatever the match type, rating format, or game format. Under `reject_content_duplicates=True` a weaker or relabeled copy (an untimed self-report of a timed tournament match, or a mixed doubles copy of a doubles match) can count while the stronger report is rejected, a category copy that counts first can keep the other row from updating its rating format, and live recording and a replay can keep different rows. Under the default the flagged row can be the stronger one. Use reject only when the backend trusts who files reports, and otherwise resolve flags in the backend. Under the default, a category copy of a doubles match can count twice in overall doubles, once directly and once through `parent`, whose `possible_duplicate_of` is `None`. Do not show `possible_duplicate_of` to whoever submitted the match: it names another report (issue #21).
53
+ - `RatingEngine.possible_duplicates`, a dict from the `match_id` of each match flagged or rejected as a possible duplicate to the `match_id` it repeats. An entry never clears, since its `match_id` is processed or, for a rejected copy, reserved (issue #76). `record` fills it live and in a replay, under both policies, so the backend can read the flags after a replay. Recording a rejected copy in it is a state change, so a snapshot taken after it is not resumable. The snapshot carries it as `possible_duplicates` (issue #21).
54
+ - `MatchStatus`, a public string enum: `COMPLETED` (`"completed"`), `FORFEIT` (`"forfeit"`), `RETIRED` (`"retired"`), and `INCOMPLETE` (`"incomplete"`) (issue #22).
55
+ - `Match.status`, the last field, default `MatchStatus.COMPLETED`, so a match built without it validates and rates as before. `Match.validate` raises `InvalidMatchError` for a status that is not a `MatchStatus` member (the plain text `"completed"` included), `games` that is not a tuple or list (for every status, so a completed match with `games=None` gets this message instead of "At least one game score is required"), a forfeit with any game, and a retired or incomplete match with a decided winner. A forfeit must have no games. A retired or incomplete match has zero or more finished games, each valid in its game format, and no decided winner, so in a best of 1 it has no games. Every other match check applies to every status (issue #22).
56
+ - `RejectionReason.MATCH_NOT_COMPLETED` (`"match_not_completed"`), for a match whose status is not completed (issue #22).
57
+ - A published policy for forfeits, retirements, and incomplete matches: they are never rated. `record` rejects such a match after the `match_id` check (a processed or reserved `match_id` gets `DUPLICATE_MATCH_ID`), moves no rating, and reserves its `match_id`: a later `record` call for a match with that id that does not raise returns `DUPLICATE_MATCH_ID` (see the Security entry for issue #73). `replay` accepts the row and counts it in `matches_considered` but not `matches_counted`. A full replay gives each player the same ratings as a full replay without it. As for any rejected row, a checkpoint tracks the row and its players, so resume raises `SnapshotError` for a new seed for a player named only in such a row. Replacing the row with a completed one under the same `match_id` is an edited row: for a row dated on or before a checkpoint it needs a full replay (resume raises `LedgerConflictError` when given it). `prequential_predictions` (and so `evaluate`, `fit_scale`, and `fit_win_calibration`) never predicts it, and takes its seed date limit and default scheduled anchor from completed rows only, so a seed dated after the last completed match raises `InvalidSeedError` whatever rows follow it, and a ledger with no completed match has no seed date check. No rating math changes. The backend should verify a status as it verifies scores, since a status keeps a match from moving any rating, and store which team forfeited or retired (issue #22).
58
+ - `Config.to_dict()` and `Config.from_dict()`. `to_dict` returns a new dict (enum keys and values as their strings, game length keys as strings, `allowed_game_formats` as a sorted list of `[scoring, points]` pairs, other values as they are). `from_dict` takes that data, also after a round trip through Python's `json` module, and returns an equal `Config` with the same fingerprint. An int and a float are different values to the fingerprint, so a store that rewrites `8.0` as `8` changes the config. `from_dict` needs exactly the keys `to_dict` gives and raises `ConfigError` for a missing or unknown key, a value it cannot convert, or a value `Config` rejects (issue #25).
59
+ - `Config` is hashable, so it can be a dict key or a set member. Equal configs hash equal. Since issues #68 and #70, `Config` rejects any field value JSON cannot hold, such as a `Decimal` or a non-finite float, so `hash`, `==`, and `fingerprint()` never raise on a built config (issue #25).
60
+ - `Config.established_min_verified_matches` (default 3), a whole number of at least 0; anything else (a negative int, a bool, a float, a str) raises `ConfigError`. It is in the fingerprint and in `to_dict` and `from_dict` (issue #59).
61
+ - `RatingState.verified_matches_played`, the last field, default 0: the counted tournament, league, and recreational verified matches that moved the state. It counts where `matches_played` counts, so a frozen player gains neither, a counted category match counts in its category and, when its overall doubles update counts, in doubles, and a category state derived from overall doubles starts at 0. Self-reported matches never count. A seed must have 0, else `InvalidSeedError` (issue #59).
62
+ - `ReplayInfo.net_rating_created`, the last field: per rating format, the net rating a replay's counted updates added to that pool (negative when they removed it), summed in ledger order from the unrounded changes. A category match adds to its format and, when `Config.category_feeds_parent` is on and its overall doubles update counts, to doubles. It has a key for every `RatingFormat` (0.0 where nothing counted) and is read-only. It defaults to all zeros, so a `ReplayInfo` built without it still works. A resume continues from the checkpoint's total and gives the same floats as a full replay. Live updates do not change it. Adding `team_size * imbalance` of each live result between replays gives an approximate running total (imbalance is rounded to 5 places); the next replay gives the exact total. The engine reports the total and does not limit it; a limit would discard evidence and needs out-of-sample evaluation first (issue #42).
63
+ - `NetworkConnectivity`, a public frozen dataclass, and `PlayerSummary.connectivity`, then its last field (`params_version` and `parameter_fingerprint`, issue #48, now follow it): whether the player's pool connects to the wider network in that rating format, measured at the summary's reference date over `Config.diversity_window_days` from the partners and opponents stored in each rating state. It reports `pool_size`, `fringe_players`, `outside_players`, `outside_days`, `group_size`, `in_main_network`, and `connected`. A group is a set of players linked by contact, and a main network is a group with at least half as many players as the largest. A pool is a set of players linked by ties, where two players in contact are tied when they share at least `connectivity_min_shared_contacts` contacts and each of them is in contact with those shared players on at least `connectivity_min_contact_days` distinct dates. The pool's fringe is the players in contact with it whose contacts are all in the pool or in contact with it (drop-ins). A player is connected when they have a contact in the window, their group is a main network, and the pool with its fringe holds more than half the group or the pool has at least `connectivity_min_outside_players` other outside players on at least `connectivity_min_contact_days` distinct dates. A summary for a format the player has no state in is measured as if the unplayed state a seed would store were stored, so it is not connected. The measure is derived from stored state only, so the snapshot format does not change (still version 6) and a resume gives the same values as a full replay. The results are cached per format and reference date until the next state change, for the 16 most recent dates. The rule can be gamed through group sizes and can mark players in a real but smaller network as not connected; the module docstring and README list its limits (issue #58).
64
+ - `Config.connectivity_reliability_cap` (default `None`, off; else a number from 0 to 100), `Config.connectivity_min_shared_contacts` (default 4), `Config.connectivity_min_contact_days` (default 3), and `Config.connectivity_min_outside_players` (default 8), the last three positive ints (not bools). Other values raise `ConfigError`. They are in the fingerprint and in `to_dict` and `from_dict` (issue #58).
65
+ - `Config.params_version` (default `None`), a new field right after `version`: the label of a published parameter set, `None` or exactly a `str` of the form `v<N>` with N a positive whole number and no leading zero (`v1`, `v12`). Any other value raises `ConfigError`. It is a label and changes no rating. `Config.parameter_fingerprint()`, a new method, returns 16 lowercase hex characters: the hash of every field but `version` and `params_version`. So the same parameter values give the same parameter fingerprint under every package version and every `params_version`, and a change to any other field changes it. A release that adds, removes, or renames a `Config` field, or changes how a value is written in the payload, changes every parameter fingerprint even when no value changes. `fingerprint()` still hashes every field, now `params_version` too (issue #155).
66
+ - `ReplayInfo.params_version` and `ReplayInfo.parameter_fingerprint`, right after `config_fingerprint`, set by `replay` from the engine's config. The snapshot's `replay_info` carries both, and `from_snapshot` checks each against the given config (issue #155).
67
+ - A stability promise, in effect from this release, in the README's "Public API" section and a new "Stability" section in `docs/behavior.md`: what strict Semantic Versioning covers (the public names, signatures, dataclass fields, enum members and properties, error classes and `LedgerConflictError.match_ids`, the `RatingEngine` attributes that are for reading, and the ledger rules) and what it does not (snapshots, rating values and default `Config` values, additions in a minor release, stored `Config.to_dict()` output, error message text, `repr` output, internal modules, and pickles made by another version; the "Stability" section has the full list) (issue #156).
68
+ - `tests/api_surface.txt` and a test that compares the public surface with it, so a change to a public signature, field, enum member, error class, or `RatingEngine` attribute must update the file (issue #156).
69
+ - `Config.from_parameter_set(data)`, a classmethod that loads a published parameter set from the parsed JSON of a `src/open_engine/params/v<N>.json` file. It builds the config with `version` set to the running package version and `params_version` set to the file's label, and trusts the label only when it names a set this release publishes, the file's `parameter_fingerprint` is the one published for it, and the values hash to it. So a file cannot pass other values off as a published set or relabel one, and publishing a new set needs an engine release that adds it. A missing key, a key or value of the wrong type, a label inside `parameters`, a malformed fingerprint or label, a label this release does not publish, and a fingerprint that is not the published one or does not match the values raise `ConfigError`. `docs/behavior.md` ("Config validation") lists the checks in order (issue #48).
70
+ - `src/open_engine/params/v1.json`, the first published parameter set, with parameter fingerprint `f9149f3c38a01efc`. It changes four values from `Config()`: `scale_by_scoring` (side-out 1.0, rally 1.0), `win_calibration_by_scoring` (side-out 0.476, rally 1.0), `k_min` (0.1079136690647482), and `k_max` (0.539568345323741). Every other field is at its default. `Config()` defaults are unchanged: v1 did not clear the default-change rule's gain bar, so it is loaded on purpose. The wheel and the sdist ship it (issues #48 and #165).
71
+ - `PARAMETERS.md`, the register of published parameter sets, and `docs/parameters.md`, the maintenance and parameter versioning page: identity, the file format and loader, the default-change rule, the rule that a new set re-rates all history by full replay, the evidence each retune needs, the planned change caps (no helper yet), and the schedule (issue #48).
72
+ - `PlayerSummary.params_version` and `PlayerSummary.parameter_fingerprint`, the last two fields, after `connectivity`: the engine config's `params_version` and `parameter_fingerprint()`, so every shown rating names its parameter set and the values hash that checks it. They have no defaults (see the breaking entry under Changed) (issue #48).
73
+
74
+ ### Changed
75
+
76
+ - **Breaking:** `EvaluationReport.scoring`, `ScaleFit.scoring`, and `WinCalibrationFit.scoring` are now typed `ScoringType` (`ScoringType | None` on `EvaluationReport`) and hold the `ScoringType` member that `evaluate`, `fit_scale`, or `fit_win_calibration` was given, not its str value, so outputs match inputs. `ScoringType` is a str enum, so `==` with the str value, `str()`, f-strings, and `json.dumps` give the same results as before. Code that checks `type(x) is str` breaks, and `repr()` and `dataclasses.asdict()` now show the member. `tests/api_surface.txt` records the new types. No snapshot or `to_dict` output holds these types, so `snapshot_version` does not change (issue #167).
77
+ - The published parameter set files moved from `params/` at the repository root to `src/open_engine/params/`, the one copy, which the wheel and the sdist ship. `params/v1.json` is now `src/open_engine/params/v1.json`, with the same content and parameter fingerprint `f9149f3c38a01efc`. The sdist no longer has a top-level `params/`. `Config.from_parameter_set` is unchanged (issue #165).
78
+ - The status label is now "reference implementation" instead of "demonstration", in the README, `docs/model.md`, `docs/behavior.md`, `docs/parameters.md`, `PARAMETERS.md`, the module docstrings, and the package description (issue #161). The status no longer says the API may change without notice or that the methods have not been validated on real match data. It says the engine was evaluated on one club's closed pool (1,601 doubles matches, 189 players), described in a forthcoming report, and that ratings are provisional: pools that share no players are not comparable, and parameters are retuned on a published schedule. A test checks every module docstring for the label. The README no longer says the API may change in any 0.x release.
79
+ - `Config.version` and `__version__` are `1.0.0`. This changes every `Config.fingerprint()`: `Config()` now gives `30dc01fa90e94c97` (1.0.0rc1 gave `4012bfec9bfddd48`, and 1.0.0rc2 gave `7334117efa23cc98`). `parameter_fingerprint()` leaves out the version, so it does not change, and neither does any rating.
80
+ - **Breaking:** `RatingEngine.self_reported_log` is now `RatingEngine._self_reported_log`, an internal attribute. Its keys are an internal type, so it is not part of the public API. The snapshot key `self_reported_log` is unchanged, and so is `snapshot_version`. A pickle of a `RatingEngine` made before this change lacks the new attribute, so `to_snapshot` fails on it, and so can a self-reported match that reaches the repeat-limit check; rebuild the engine from a snapshot or a replay instead (issue #156).
81
+ - **Breaking:** every config's `fingerprint()` changes, since the payload gains the `params_version` key. Stored fingerprints and replay records made before this release no longer match the same config. Stored snapshots fail on `snapshot_version` first (see the next entry). No rating changes (issue #155).
82
+ - **Breaking:** snapshot schema version 9 adds `params_version` and `parameter_fingerprint` to `replay_info`. A version 8 snapshot no longer loads; run a full replay to make a new one (issue #155).
83
+ - **Breaking:** `Config.from_dict` needs the new `params_version` key, so a config dict stored before this release raises `ConfigError` ("Config data has missing keys: params_version"). Migration: add `"params_version": null` to the stored dict (issue #155).
84
+ - **Breaking:** the new fields shift positional arguments. `params_version` comes right after `version` in `Config(...)`, and `params_version` and `parameter_fingerprint` come right after `config_fingerprint` in `ReplayInfo(...)`. Pass these by keyword (issue #155).
85
+ - **Breaking:** `PlayerSummary` gains two required fields at the end, `params_version` and `parameter_fingerprint`, with no defaults. Code that builds a `PlayerSummary` itself, by position or by keyword, raises `TypeError` unless it passes both (issue #48).
86
+ - Documentation and a test only: `docs/model.md` finishes the engine method specification. The worked example carries the second match through to its result, and gives each player's rating after both matches. A new "Assumptions" section states how the update treats matches, rating formats, partners, and the pool. "Win probability" gains an example of what a team rating gap of 0.5 or 1.0 means as a win probability for one side-out game to 11, with its placeholder and side-out caveats. The "What the model does not do" bullet on external scores, and the "External ratings" note in "What a rating means", now say an imported rating sets a starting state, not only a starting rating. A new test, `tests/test_model_worked_example.py`, checks each of these figures against the engine and against the doc text. No rating, default, `Config` field, fingerprint, or snapshot changed (issue #47).
87
+ - Documentation only: a new "What a rating means" section in `docs/model.md`, summarized in the README. It states what a rating gap means as an expected point share under the default placeholder scale, what the rating level means (relative to the players a player has played, with an unseeded singles or overall doubles pool's mean moving only through imbalance), that an imported rating is a seed only, and that no `Config` value is chosen to move OPEN ratings toward an external rating. `CLAUDE.md` and the `docs/model.md` parameter notes state the same rule. No rating, default, `Config` field, fingerprint, or snapshot changed. Declaring the scale so a gap has a fixed meaning stays open (issue #149).
88
+ - Documentation and a test only: "What a rating means" in `docs/model.md` gains "Scale and K together". Multiplying every scale, `k_min`, and `k_max` by the same factor leaves every expected point share the same and multiplies each rating's distance from `default_rating` by that factor, until a rating reaches `min_rating` or `max_rating`. A new test, `tests/test_scale_k_ridge.py`, checks this on a synthetic ledger, and checks that the 2.0 floor breaks it. No rating, default, `Config` field, fingerprint, or snapshot changed (issue #149).
89
+ - Documentation only: "What a rating means" in `docs/model.md` and the README now declare what a rating gap means for the published parameter set `v1`, as an expected point share, not a win probability. At `v1`'s scale of 1.0, a team gap of 0.5 means the stronger team is expected to win about 76.0% of the points, and a gap of 1.0 about 90.9%. The meaning is fixed by declaring the scale and recorded in the parameter version, so changing it takes a changed published parameter set. The docs say plainly that the `Config()` defaults are placeholders that do not carry this meaning, and that a caller loads `v1` with `Config.from_parameter_set` for it. They also state that an external rating is only a seed, never a conversion, and that OPEN's first release does not seed, since the evaluation's seeding test did not pass. The `Config()` defaults do not change: the evaluation's default-change rule, fixed before it ran, did not pass its gain bar (see PARAMETERS.md), so the defaults are checked again with the same rule on new data. No rating, default, fingerprint, or parameter set changed (issue #149).
90
+ - The README is now a short front page: what the engine is, its status, install, setup, the quick start, the public API with one line per name, and short summaries that link to `docs/behavior.md` and `docs/model.md`. The rules that only the README held moved into `docs/behavior.md` unchanged, apart from cross-references and merged duplicates: the snapshot schema (a new "Snapshot schema" section), the list of what raises each error class (under "Errors"), the ledger order list, the match status list and `Match.validate` field rules, the snapshot and checkpoint notes, the calibration advice, and a few `Config` and input type rules. Where `docs/behavior.md` then stated a rule twice (input types, the `played_at` time zone rule, ledger order, match fields and status, errors, resume, and the snapshot schema and checks), the copies were merged into one statement that keeps every condition, and the other places link to it. The "Player summaries" note and the `player_summary` docstring now give the order of the player id checks the code uses: `PlayerError` for a blank id before `UnknownPlayerError`. `CLAUDE.md` points at `docs/behavior.md` for the input type carve-outs and the snapshot schema. Documentation only: no behavior, output, or API changed (issue #144).
91
+ - The engine's code moved out of `engine.py` into private modules, one per concern: `_validation`, `_types`, `_config`, `_model`, `_ledger`, `_math`, `_connectivity`, `_seeds`, `_snapshot`, `_engine`, `_replay`, and `_evaluation`. Every definition moved unchanged, and `engine.py` now re-exports every public name it defined, so `from open_engine.engine import X` still works for those names; private names now import from their new module. Pickles of `Config`, `RatingEngine`, and `ReplayInfo` made before this change still load: `engine.py` still exposes `_FrozenMapping`, the read-only mapping they hold. No behavior, rating, public API, `Config` field, fingerprint, match digest, or snapshot changed. The module most public classes report, and with it pickles made from now on and the class `repr` of those that are not enums, changed in issue #133 (next entry). `winprob._type_name` and `winprob._type_is` moved to `_validation`, and `winprob`'s number check now shares `_number_broken` with the engine, with the same messages (issue #127).
92
+ - Public classes that reported `open_engine.engine` (all but the error classes, which already reported `open_engine._errors`) now report the module that defines them, such as `open_engine._model` for `Match`. So the class `repr` of each one that is not an enum changes (for example `<class 'open_engine._model.Match'>`; an enum's stays `<enum 'MatchStatus'>`), `inspect.getsource` works on them, and `typing.get_type_hints` resolves their annotations in that module. Match digests now take the type tag of every value a validated match can hold, other than `played_at` (digested untagged, as its UTC instant and offset when set), from a fixed table instead of the class's `__module__`, with the same strings as before, so every digest, snapshot, and checkpoint is unchanged, `SNAPSHOT_VERSION` stays the same, and a checkpoint taken before this change still resumes. Pickles made before this change still load, since `open_engine.engine` still re-exports every public class and `_FrozenMapping`. Pickles of those classes made now name the new modules, so they do not load in released versions before the module split (0.3.0.dev0 and earlier), which have no such modules (issue #133).
93
+ - Internal restructuring, with no behavior change: the longest engine functions are split into helpers, each holding a block of the original body moved as written and called in the original order (issue #128). `Config.__post_init__` calls one helper per group of checks, `_read_snapshot` one per part of the snapshot, `RatingEngine.seed_external_rating` separate helpers for its argument checks, the rules that allow a seed, and the commit, and `RatingEngine._compute` separate helpers for the gap filters, the per-player update (`_apply_update`), and the result. `RatingEngine._consider`'s self-reported checks move to `_self_reported_factor`. Every check keeps its order, error class, and message, and every rating, snapshot, fingerprint, and match digest is unchanged. `docs/model.md` names the new helpers where it cites code.
94
+ - Internal restructuring, with no behavior change: ten more long functions are split the same way (issue #143), each helper holding a block of the original body moved as written and called where it stood. `_check_resumable` moves its first pass over dates and per-player rules to `_check_resumable_dates`, `_snap_seed_sensitive_rejections` its key checks to `_check_rejection_key`, `_prequential` its seed checks and scheduled windows to `_check_prequential_seeds` and `_prequential_windows`, `RatingEngine.player_summary` its imported reliability rule to `_imported_reliability`, `RatingEngine._consider` its commit of a counted match to `_apply_counted`, `RatingEngine._compute` its frozen players to `_frozen_players`, `fit_scale` its search to `_scale_search`, `Match.validate` its result checks to `Match._validate_result`, `_network_connectivity` its linking pass to `_link_contacts`, and `Match._validate_field_types` its `played_at` checks to `Match._validate_played_at_type`. Every check keeps its order, error class, and message, and every rating, prediction, fit, summary, snapshot, fingerprint, and match digest is unchanged. `docs/model.md` names the new helpers where it cites code.
95
+ - The engine's published behavior notes and production notes moved from the `engine.py` module docstring to a new page, `docs/behavior.md`, one section per topic, along with the edge cases the public docstrings listed. The text moved with only headings, links, issue-number citations, and the `Args`, `Returns`, and `Raises` layout changed, plus one new lead line in "Seed rules" that names the calls its rules apply to (`add_player`, `replay`, and `prequential_predictions`). Each public docstring now has a one-line summary, a short description, and `Args`, `Returns`, and `Raises` sections where they apply, and many name the `docs/behavior.md` section that holds their edge cases. `docs/model.md`, the README, and `CLAUDE.md` link the new page. One moved claim that was false is now corrected: `fit_scale`'s note said every other argument is checked before any trial config is built, but the first trial config is built before any row or seed is checked, so a low of 0 or less raises `ConfigError` ahead of a bad row or seed. Documentation only: no behavior, output, `Config` field, fingerprint, or snapshot changed (issue #126).
96
+ - **Breaking:** `Config` raises `ConfigError` ("allowed_game_formats entries must be (scoring type, whole number) pairs") for an `allowed_game_formats` pair whose scoring type is not a `ScoringType` member or exactly a `str`, such as a `str` subclass or another object that hashes and compares equal to `"rally"`. Such an object was accepted and stored as the member, after the membership check ran its own `__hash__` and `__eq__`. A caller who passed one must pass the member or its exact `str` value. Each pair's points are also judged by their real type alone (a real `int`, not a `bool`), so an object whose `__class__` property raises gives `ConfigError` instead of its own exception (issue #145).
97
+ - **Breaking:** `Config` raises `ConfigError` ("allowed_game_formats points must be at least 1") for an `allowed_game_formats` pair with points of 0 or less, in `Config(...)`, `from_dict`, and the rebuild every entry point that takes a config runs. Such a pair was stored and then rejected as "No game_length_weight for games to 0" (or the negative length), so no valid config changes. Because the check now runs while the formats are stored, it comes before the key checks and positive-value checks of `scale_by_scoring`, `win_calibration_by_scoring`, and `match_weights`: and before the check that every allowed format has a game length weight: for a config that also has a missing or extra key, a `str` subclass key, or a value of 0 or less in one of them, or an allowed format with no game length weight, the message is now "allowed_game_formats points must be at least 1". Each mapping field's "must be a mapping" and "values must be finite numbers" checks, and the checks of `game_length_weights`' own keys and values, still come first (issue #145).
98
+ - **Breaking:** `Config` judges the `allowed_game_formats` container by its real type, so an object whose `__class__` property claims `set` or `frozenset` raises `ConfigError` ("allowed_game_formats must be a set or frozenset") before any of its code runs. Such an object was accepted and iterated. A real `set` or `frozenset` subclass is still accepted and read once (issue #145).
99
+ - **Breaking:** `RatingEngine.seed_provisional_rating` no longer stores a category state while `Config.category_feeds_parent` is on. In a category format (mixed, men's, or women's doubles) the player has no stored state in, it returns the starting state the player's first match there would use if played now, the same state `state` returns, as a new object each call, and stores nothing. For an unknown player id it still creates the empty player record, and nothing else. A state the player already has in the format is returned as stored, as before. In singles and overall doubles, and in a category format while `category_feeds_parent` is off, it stores the state as before. Before, it stored a copy of the starting state derived from overall doubles, and that copy did not follow later changes to doubles: a doubles match, the doubles update of another category's match, or a first doubles seed or a reseed of a provisional doubles state. The player's next category match then started from the stale copy live, while a replay from seeds without the copy started from the current doubles state, so live and replay ratings could differ, and with `max_doubles_partner_gap` set they could disagree on whether the match counted. Now live and a replay from the engine's own players as seeds start from the same state. A call in a category format under `category_feeds_parent` for a player that already has a record no longer changes the engine, so it keeps a replayed engine resumable. After `seed_provisional_rating(p, category)`, `seed_external_rating(p, category, ...)` is now accepted with or without `replace_unplayed_seed=True`, as for a player who never called `seed_provisional_rating`, since no state is stored to replace. Before, it raised "Cannot replace a rating derived from OPEN overall doubles" with or without the flag when the player had a dated or played doubles state, and needed the flag only for an `open_provisional` copy. So the issue #79 repro (three counted doubles matches, `seed_provisional_rating` in mixed doubles, then an import for mixed doubles) is now accepted through the public API. That follows the issue #79 decision: seeding a category format that has no stored state stays allowed, since an import for that format is direct evidence for it. The issue #101 refresh in `seed_external_rating` is kept: a seed (`add_player`, replay seeds) or a loaded snapshot can still hold a stored, unplayed category state derived from overall doubles, and a doubles reseed still refreshes it. The seed rules and the snapshot load rules for unplayed derived states do not change, so snapshots an earlier release wrote with such a state still load. The snapshot schema, `snapshot_version` (still 8), `Config`, and its fingerprint do not change. `player_summary` connectivity can change for other players, since an unstored category state no longer joins that format's pool; it now matches a replay. Migration: a backend that relied on `seed_provisional_rating` storing a category state should read it with `state` (or keep the value `seed_provisional_rating` returns) when needed, and should not pass an unplayed category state it got that way as a seed to `add_player` or `replay`. Assigning to the state `seed_provisional_rating` returns in a category format under `category_feeds_parent` changes nothing, since it is a copy. A snapshot from an earlier release that holds such a stale unplayed category state (`matches_played` 0, with `initial_source` `open_parent:` plus the parent's value or `open_provisional`, in a category format) still loads, with no error or flag, so the backend must find those states, drop them from its seeds, and rebuild with a full replay, so a replay derives the category from doubles as live now does (issue #112).
100
+ - **Breaking:** `record`, `replay`, and `prequential_predictions` (both modes, and so `evaluate`, `fit_scale`, and `fit_win_calibration`) raise `InvalidMatchError` for a match that is not exactly a `Match`, with "match must be a Match, not <type>", before any state changes and before calling the subclass's own `validate`. `replay` and `prequential_predictions` raise it for such a row wherever it sits in the ledger, after `as_of` included. `ledger_order` raises it too, for a subclass or any other type, and so does `Match.validate` for a subclass that does not override it. An exact `Match` whose instance `__dict__` holds anything but its own fields raises `InvalidMatchError` ("match has attributes that are not Match fields") in the same places, since such an entry could hide `validate`, a method `validate` calls, or the field list. The duplicate check and the checkpoint's row digest also read the field list from the `Match` class. A subclass could return one value to validation and another to rating (for example a `match_id` property that changes between reads), so `record` counted a match whose stored id made the engine's own snapshot fail to load. `Match.validate` now also requires `team_a` and `team_b` to be exactly `tuple`, `confirmed_by` exactly `set` or `frozenset`, `games` and each game in it exactly `tuple` or `list`, and each score exactly `int`; a subclass of any of these raises `InvalidMatchError` with the existing message for that field. Each member of `confirmed_by` must now be exactly a non-blank `str`, as team player ids are, else "confirmed_by player ids must be non-empty strings", checked before the participant check. Before, a member was compared only by equality, so a `str` subclass equal to every value passed. No rating changes for a match built from plain types. `game_format`, `played_on`, `played_at`, `sequence`, and `best_of` keep their `isinstance` checks, and caller code that runs during validation (a `GameFormat` subclass, or the `tzinfo` of `played_at`) can still change a match after a check has passed; issue #116 tracks both. Since issues #116, #118, and #119, those fields are checked exactly too, and neither callback can run (see the Security entry). Migration: build plain `Match` objects with plain tuples for teams, a plain `set` or `frozenset` of plain `str` ids for `confirmed_by`, and plain tuples or lists of plain ints for `games`. Convert an `IntEnum` or other `int` subclass score with `int()` (issue #109).
101
+ - **Breaking:** `RatingEngine.from_snapshot` (and `to_snapshot` and resume, which apply its checks) raises `SnapshotError` for more states the engine never produces, which let a snapshot edited in a second field pass the `verified_matches_played` check. For each `self_reported_log` entry's latest date, every named player must have a baseline dated on or after it (the state's `initial_source_date` in the entry's format or, with no state stored there, under `category_feeds_parent` in a category format, the overall doubles state's), or a played state in that format whose `last_played` is on or after it and that records every teammate as a partner and every player of the other team as an opponent, each dated on or after it. At least one named player must have no baseline on or after it. The errors name `snapshot.self_reported_log[<i>].teams` and the date; an error about one named player also names that player and the format, with what is missing, and the error for an entry whose named players all have such a baseline says it names no player who moved in the match on that date. In a resumable snapshot, a played state with an `initial_source_date` must have a `last_played`, and every partner and opponent date, after that date; the error names the field. A resumable snapshot whose log has a date after `calculated_as_of` no longer reaches the log date message: a named player's own state or baseline would need a date on or after it, so it fails the log entry rule, or the check of state dates after `calculated_as_of`, first. Some snapshots edited in several fields still load, for example: one that is not resumable where a played state gets an `initial_source_date` before every logged date that moved it and a `verified_matches_played` raised to match (with an external `initial_source`, or an `open_parent:doubles` state dated with its doubles state; a dated `open_provisional` state does not load since issue #97); the same dated-state edits that resumable snapshots now reject, in a snapshot that is not resumable; a resumable snapshot with a state dated on or after an earlier match that moved it, with `verified_matches_played` raised to match, when its `last_played` and every partner and opponent date are still after the new date (for example, because it met the same partners and opponents again later), since those dates keep only the latest one; a log name swapped to a player who later played in that format with the same teammates and opponents, on or after the entry's latest date, with the verified counts adjusted to match; a whole log entry deleted with the named players' verified counts raised, since the snapshot does not tie a match id to its match type; and edits that also rewrite the partner and opponent names or dates to match. No snapshot field, `snapshot_version`, `Config` field, or rating changes, and the engine's own snapshots still load. Migration: an edited or hand-built snapshot that breaks these rules no longer loads; run a full replay to make a new one (issue #102).
102
+ - **Breaking:** `Config` raises `ConfigError` for int configs whose exact step weight would overflow in rating code. A self-reported match's step weight is an exact int product when the `SELF_REPORTED` match weight, `max_information_multiplier`, and `self_reported_repeat_factor` are all ints and that match's information multiplier is `max_information_multiplier` itself. So when those three are ints, the check tests whether a match could get there, allowing up to `sys.maxsize` games. It counts the multiplier as reachable when, for some `(scoring, points)` in `allowed_game_formats`, `game_length_weights[points] * (1.0 + game_count_bonus * (sys.maxsize - 1))` is not below `max_information_multiplier` (`sys.maxsize` is the most games `len()` can report). No real match has that many games, so the check can reject a config whose multiplier no real match reaches. When it is reachable, a config now raises when the self-reported weight times the multiplier does not convert to a float, or when the largest K times it is not finite, with "k_max times the largest match weight and max_information_multiplier must be finite". It also raises when `rd_shrink_per_match` is an int and `rd_shrink_per_match` times the self-reported weight times the multiplier does not convert to a float, with "rd_shrink_per_match times the largest match weight and max_information_multiplier must be finite". Some of these configs used to build, and then a self-reported match could raise `OverflowError` from `record` or `replay`, or turn a surprise of 0 into a jump to `max_rating` with nothing in `clamped`. Others needed a match too long to build. A config that was already rejected for another field, such as an int `self_reported_repeat_factor` of 2, can now get one of these messages first, because this check runs before the later range checks. The issue's example (`w = m = math.isqrt(6 * 2**1024 // 10)`, `self_reported_repeat_factor=1`, `rd_shrink_per_match=2`, and an 11-point length weight of `int(sys.float_info.max)`) now raises the `rd_shrink_per_match` message. A config with a float in any of the three values, or whose multiplier the check counts as unreachable, is not affected (the issue's values with the default length weights build). Defaults do not change, `Config().fingerprint()` stayed `17f2981186edf96c` (issue #155 changed it to `40d9d88d4ae408cd`), and every rating for a config that still builds is unchanged. No rating code changed. Migration: use smaller int values, or store the self-reported weight, `max_information_multiplier`, or `self_reported_repeat_factor` as a float (issue #93).
103
+ - **Breaking:** `Config` checks every field's type, finiteness, and range when it is built, and raises `ConfigError` for each value it now rejects. A `bool` is never a number. Newly rejected: a wrong type in any scalar field (for example a str, `None`, a `bool`, or a `Decimal` where a number is expected, an int where a bool is expected, or a non-str `version`); a NaN, infinite, or too-large-for-a-float value in any number field, in a mapping value, or as a `game_length_weights` key; a float such as `7.0` in a whole-number field (the day counts, `diversity_target`, `self_reported_max_repeats`, `import_reliability_carry_matches`); `min_rating`, `max_rating`, or `default_rating` beyond `2**511` in magnitude (so `max_rating=1e308` raises); `rd_min` equal to `rd_max`, or an int and a float that are equal once converted, so `rd_max - rd_min` is 0.0; `rd_max` above `2**511`; a negative `rd_shrink_per_match`; `rd_growth_per_day` below 0 or above `2**511`, or above `2**500` as an int; a `game_count_bonus` above `2**511` as an int (these two int bounds exist because exact int arithmetic raises `OverflowError` where float arithmetic goes to infinity); a `match_weights` or `game_length_weights` value of 0 or less; a `game_length_weights` key below 1; a negative `game_count_bonus`; points in `allowed_game_formats` too large for a float; a K range whose largest K (`k_min + (k_max - k_min) * 1.0`, which can round just above `k_max`) times the largest match weight and `max_information_multiplier` is not finite in floats; two `game_length_weights` keys that name the same length; `replay_interval_days`, `diversity_window_days`, `self_reported_repeat_window_days`, or `import_reliability_max_age_days` above 3,652,058 (the days `timedelta` holds; since issue #92, a window that reaches back before `date.min` stops there instead of raising `OverflowError`); and a negative `max_singles_rating_gap` or `max_doubles_partner_gap`. Before, some of these built and then raised `TypeError`, `ValueError`, `ZeroDivisionError`, or `OverflowError` later, in `fingerprint()` or on the first match, and an overflowing K step could turn a surprise of 0 into a jump to `max_rating`. Issue #93 closes the remaining int case; see its entry. `Config` now stores mapping keys and `allowed_game_formats` pairs as their own types: a `ScoringType` or `MatchType` key given as its str value, or an object equal to one, becomes the enum member (since the second review of issues #116, #118, and #119, a mapping key must be a member or an exact str; a lookalike `allowed_game_formats` scoring still converts), and an int subclass key or points value becomes the plain `int` of its own value (an overridden `__int__` is not used). The fingerprint of every config that built before and was JSON-safe stays the same, except for a key or points value whose `str()` differs from its value (such as a str or int subclass with its own `__str__`): it now gives the fingerprint of the plain enum member or int. Ratings do not change in those cases. `Config.from_dict` raises `ConfigError` instead of a bare `ValueError` for an int too large to print in its data. A config passed to `Config.from_dict` with `"k_min": "low"` now raises `ConfigError` with "k_min must be a finite number" instead of the wrapped `TypeError` message. Defaults do not change, `Config().fingerprint()` stayed `17f2981186edf96c` (issue #155 changed it to `40d9d88d4ae408cd`), and no rating, prediction, or evaluation output changes for a config that still builds. The README "Config values" section lists the rules. Migration: fix any stored or hand-built config that now raises; store whole-number fields as ints, and use `rd_min < rd_max` (issues #68 and #70).
104
+ - **Breaking:** `prequential_predictions`, `evaluate`, `fit_scale`, and `fit_win_calibration` raise `EvaluationError`, naming the argument, for a `score_from` or `anchor` that is not `None` and not a plain `date`: a str, a naive or aware datetime, or any other type. Another bad argument can still fail first, for example a `fit_scale` `low` of 0 or less raises `ConfigError` when the trial config is built. A `date` subclass that is not a datetime is still accepted. Since issues #116, #118, and #119, a `date` subclass is rejected, and `fit_scale` checks every argument before it builds a trial config, so a bad date now raises `EvaluationError` even with a `low` of 0 or less. `prequential_predictions` checks both first, before `mode` and before it reads the ledger, in both modes. Such a value used to fail later with an error that is not an `OpenEngineError` (most often a bare `TypeError` from a date comparison), or be accepted. Some calls that were accepted, and now raise: an `anchor` in `"live"` mode, which never read it; a `score_from` that no row was compared against, such as on an empty ledger; and a `"scheduled"` call on a ledger with no completed match. For example `prequential_predictions([], score_from="2026-03-01")` returned `[]`, and `evaluate(ledger, anchor="2026-03-01")` in live mode returned a report. Those calls now raise. A call with both a bad `mode` and a bad date now names the date. No prediction or evaluation output changes for a call that still runs. Migration: pass a `datetime.date`. For a datetime, pass `.date()`. Parse a str with `date.fromisoformat` (issue #90).
105
+ - **Breaking:** `replay` raises `ReferenceDateError` for an `as_of` that is not a plain `date`: a str, a naive or aware datetime, `None`, or any other type. A `date` subclass that is not a datetime is still accepted (since issues #116, #118, and #119 it is rejected). It checks this first, before `whole_ledger`, `from_snapshot`, the ledger rows, and the seeds. Such an `as_of` used to reach the later checks, which most often failed with a bare `TypeError` or with whichever engine error came first. Some calls replayed and stored it as `calculated_as_of`, for example `replay([], as_of="2026-03-31")`; those now raise. Migration: pass a `datetime.date`. For a datetime, pass `.date()`. Parse a str with `date.fromisoformat` (issue #66).
106
+ - **Breaking:** `PlayerSummary.connectivity` has no default, so code that builds a `PlayerSummary` itself must pass it. The new `Config` fields change the default `Config().fingerprint()` to `17f2981186edf96c` (`40d9d88d4ae408cd` since issue #155), so a snapshot made under an earlier default config fails `from_snapshot` with a fingerprint mismatch, and a stored `Config.to_dict()` from before lacks the new keys, so `Config.from_dict` raises `ConfigError`. With `Config.connectivity_reliability_cap` set, `PlayerSummary.reliability` is at most the cap (shown rounded down to 1 place) for a player whose `connectivity.connected` is False, and `established` and the imported reliability carry compare against that displayed value. The default cap is `None`, so under the default config `reliability` and `established` are unchanged, and no rating, RD, K, prediction, `evaluate`, `prequential_predictions`, `fit_scale`, or `fit_win_calibration` output changes under any cap. Turning the cap on by default waits for out-of-sample review of real ledgers (issue #58).
107
+ - **Breaking:** seed and identity entry points reject blank and shared identities. `add_player`, `replay(seed_players=...)`, and `prequential_predictions` (both modes, and so `evaluate`, `fit_scale`, and `fit_win_calibration`) raise `InvalidSeedError` for a seed whose player id, `account_user_id` (when not `None`), external source, or external id is blank or whitespace only, and for a seed state whose `initial_rating` is not an int or finite float (not bool) or is outside `min_rating` and `max_rating`. Such a replay used to succeed, and `to_snapshot()` on it then raised `SnapshotError`. They raise `PlayerError` for a seed whose `account_user_id` or (source, external id) pair another player already holds: an existing player in `add_player`, an earlier seed in the same batch, or a checkpoint player on resume. The messages are the ones `link_account` and `attach_external_id` use. Every check runs before any state changes. `link_account` and `attach_external_id` raise `PlayerError` for a whitespace-only or non-str account, source, or external id, which used to be accepted; a whitespace account made `PlayerSummary.account_linked` `True`. `seed_external_rating` raises `PlayerError` when its snapshot has a non-empty `external_player_id` and that id or the source is whitespace only. An empty `external_player_id` still links nothing, and the provenance it stores is not checked. The issue #74 entry under Security replaces these two rules with `InvalidSeedError`. The same external id from two different sources is still accepted. A `RatingState` built with the dataclass default `initial_rating` (3.5) is now rejected as a seed under a config whose rating range excludes 3.5; `seed_provisional_rating` and `seed_external_rating` set it within the range. `RatingEngine.player`, `state`, `player_summary`, `link_account`, `attach_external_id`, `seed_provisional_rating`, and `seed_external_rating` raise `PlayerError` for a non-str player id instead of `AttributeError`. Seed identity checks for a batch (in `replay` and `prequential_predictions`) are a fixed number of set lookups per seed identity, so they do not slow down as the number of seeds grows. Ratings do not change for any input that is still accepted. Snapshot loading now follows these rules too, see the issue #61 entry (issue #52, also #44 and #45).
108
+ - **Breaking:** `RatingEngine.from_snapshot`, and so `replay(from_snapshot=...)`, raises `SnapshotError` naming the field for snapshot states no engine method produces. Any snapshot: an `account_user_id` that is blank or whitespace only, an `external_ids` source or id that is blank or whitespace only, two players with the same `account_user_id` or the same source and external id pair (the later player in the list is named), and a `partners` or `opponents` id or a `self_reported_log` team member that is not a player in the snapshot. A resumable snapshot: a nonzero `live_updates_since_replay`, a processed match id that is not a `ledger_digests` id, and a player with a played state who is not in `ledger_player_ids`. A stored snapshot holding one of these used to load and now fails. Every snapshot the engine's own methods produce still loads, except one an earlier version wrote with an `open_` source or a blank evidence reference (see the issue #97 entry under Security). `to_snapshot()` checks its own output the same way, so it now raises `SnapshotError` for these states when a caller sets them directly on public engine attributes, for example two players with the same `account_user_id` assigned into `engine.players`. No engine method produces them. The schema and `snapshot_version` do not change, and no rating changes. Resuming from a resumable snapshot with a live update count but no live match now fails at load with the `live_updates_since_replay` message instead of the resume message, and resuming from a resumable snapshot whose replay counts still match but which has a processed match id with no ledger digest (for example a digest key swapped for another id) now fails at load with the `processed_match_ids names ...` message instead of the resume message. A snapshot that is not resumable still gets the resume message (issue #61).
109
+ - **Breaking:** `Config.scale_by_scoring`, `win_calibration_by_scoring`, `match_weights`, and `game_length_weights` are read-only copies of the mappings passed in. Item assignment, `update`, `pop`, and the other dict changes raise `TypeError`, and changing the dict a config was built from no longer changes the config. A non-mapping value, a mapping value that is not a finite int or float (a `bool`, a string, a list, NaN, or infinity), or a `game_length_weights` key that is not an int (`"11"`, `11.0`, `True`) raises `ConfigError`. A string key used to share a fingerprint with the int key the engine reads. `allowed_game_formats` is stored as a `frozenset`; a value that is not a `set` or `frozenset`, such as a list, or an entry that is not a (scoring type, int) pair, raises `ConfigError`. Build a new config with `dataclasses.replace` instead of changing one (issue #25).
110
+ - **Breaking:** `Config` equality compares fingerprint payloads, so equal configs always have the same fingerprint and hash. Configs that used to compare equal with different fingerprints, such as `Config(k_min=0)` and `Config(k_min=0.0)`, are no longer equal. No config that still builds gets a new fingerprint: `Config()` still gave `c5bb49f7c37a013a` after that change; the later `established_min_verified_matches` field changes it.
111
+ - `RatingState.inherited_live_updates`, a new int field, default 0. It comes after `opponents`, so positional calls that pass `partners` or `opponents` keep their meaning; `verified_matches_played` (issue #59) now follows it as the last field. A category state (mixed, men's, or women's doubles) derived from overall doubles copies a rating that can hold live updates since the last replay. The field records how many the parent state had when the category state was derived, and never changes after that. It is 0 for every state not derived from its parent. `PlayerSummary.live_updates_since_recalculation` keeps its name and type but now reports `live_updates_since_replay + inherited_live_updates`, so a derived category state is labeled with the parent's live updates in its starting rating, before and after its first match. It used to report the state's own count only, which labeled such a state too low. A replay gives 0 for every state. No rating, RD, or reliability changes. A seed (`add_player`, `replay`, and `prequential_predictions`) with an `inherited_live_updates` that is not an int, or not 0, raises `InvalidSeedError`. Snapshot schema version 4 added an `inherited_live_updates` key to each state. `from_snapshot` raises `SnapshotError` for a version 3 snapshot, a missing key or a value that is not a nonnegative int, a nonzero value on a state not derived from its parent (one needs `category_feeds_parent` and an `initial_source` of `open_parent:` plus the parent's value), a nonzero value with no parent state or above the parent state's `live_updates_since_replay`, a nonzero value on a state whose `initial_source_date` differs from the parent state's or that has an `initial_source_reliability`, `initial_external_player_id`, or `initial_evidence_reference`, a nonzero value on an unplayed state with an RD below `category_seed_rd` or an `rd_as_of` that is null or after the parent state's, and a nonzero value in a resumable snapshot. Resume refuses a snapshot with a nonzero value, as it refuses one with live updates. Snapshots were never in a release, so version 3 snapshots were only written by unreleased builds of main. They no longer load; run a full replay to make a new one (issue #23).
112
+ - **Breaking:** `RatingEngine.player`, `RatingEngine.state`, and `RatingEngine.player_summary` no longer create anything. For a player id with no player record they raise `UnknownPlayerError` (`player_summary` after its `ReferenceDateError` checks), and a blank id still raises `PlayerError`. They used to create an empty player, and `state` and `player_summary` stored a rating state for a format the player had none in, so a lookup of a mistyped id added a player and a read cleared the snapshot's resumable mark. For a known player with no state in the format, `state` returns, and `player_summary` reports, the starting state the player's first match in that format would use if played now (a category state derived from overall doubles where that applies, else a provisional default), without storing it. That returned state is a new object each call, so changing it changes nothing. Reads now keep a replayed engine resumable. A player or state is created on purpose by `add_player`, `seed_provisional_rating`, `seed_external_rating`, `link_account`, `attach_external_id`, or a counted `record` (and so `replay`), which still create as before (except that, since issue #112, `seed_provisional_rating` stores no category state under `category_feeds_parent`; see that entry). An id named only in uncounted rows, or in rows after a replay's `as_of`, has no player record, so `player_summary` and `state` now raise `UnknownPlayerError` for it where they used to return a provisional default. Apart from the snapshot schema change in the `RatingState.inherited_live_updates` entry (version 3 snapshots no longer load, and version 4 added an `inherited_live_updates` key to each state), replay, resume, and evaluation results do not change for any ledger and snapshot that worked before. Reads that used to create a player or rating state no longer do, so later calls see the engine as it was before the read. For example, the first match in a category format after a read of that missing format now rates as it would have without the read, as a replay does, and a later `seed_external_rating` without `replace_unplayed_seed`, or `add_player` for that id, no longer finds a state or player the read created. Those reads also no longer clear the resumable mark (issue #23).
113
+ - Snapshot schema version 3 changed no key, but each row digest in `ledger_digests` now covers `Match.status`, so resuming from a version 2 checkpoint would raise a misleading `LedgerConflictError` for any row given to it dated on or before the checkpoint. `from_snapshot` raises `SnapshotError` for a version 2 snapshot instead. Snapshots were never in a release, so version 2 snapshots were only written by unreleased builds of main. Run a full replay to make a new one (issue #22).
114
+ - Snapshot schema version 2 added `content_keys` (the content digest of each counted match, mapped to the `match_id` of the first match counted with it, so a loaded or resumed engine still catches a later duplicate) and `possible_duplicates`. `from_snapshot` raises `SnapshotError` for a version 1 snapshot, and for `content_keys` that is not an object, has a key that is not 64 lowercase hex characters, has a value that is not a processed match id, or names one id under two keys, and for `possible_duplicates` that is not an object, has a key or value that is not a non-blank str, has a value that names its own key, has a key that is a `content_keys` value, has a value that is not a `content_keys` value, has a key that is not a processed match id under the default config or is one under `reject_content_duplicates=True`, or, in a resumable snapshot, has a key that is not a `ledger_digests` id. Snapshots were never in a release, so version 1 snapshots were only written by unreleased builds of main. They no longer load; run a full replay to make a new one (issue #21).
115
+ - **Breaking:** `player_summary` measures inactivity, RD, and reliability at a reference date. With no `as_of`, it is now the later of the last replay date (`calculated_as_of`) and the player's last match. It used to be the player's own last RD update, or today, so a player who stopped playing kept the same reliability however late the replay was. Now a stale player is measured at the replay date and loses reliability, and shows a wider RD, as replays move forward. A player with live matches since the replay is measured at their last match. Players in one engine can be measured at different dates. With no `as_of` on an engine that was never replayed, it raises `ReferenceDateError`, so pass `as_of` on a live engine. An `as_of` that is not a plain date (a str, or a datetime) also raises `ReferenceDateError`; a datetime used to be accepted for an unplayed provisional state, and a str raised `TypeError` after creating state. Both checks come before the player id is checked. An explicit `as_of` still wins, but an `as_of` earlier than the player's last match does not rebuild past state: RD and partner variety stay as of the stored state. `imported_reliability` uses the same reference date. An unplayed import is now measured at the replay date by default, not its capture date, so it stops being carried once it is older than `import_reliability_max_age_days` at that date, and an unplayed import captured after the last replay is not shown. `reliability(state, cfg, as_of)` now requires `as_of`, and calling it without one raises `TypeError`. The engine no longer reads the wall clock anywhere (issue #17).
116
+ - **Breaking:** `RatingEngine.predict` is now `predict_point_share` and `RatingEngine.win_probability` is now `predict_win_probability`, with the same arguments and, for valid player ids, the same results. The old names are gone.
117
+ - **Breaking:** `clone_player`, `inflated_rd`, `player_k`, and `information_multiplier` are no longer exported from `open_engine`. They stay in `open_engine.engine` as internal helpers. `recency_multiplier` is no longer exported either, and is removed (see below).
118
+ - **Breaking:** `player_summary` returns a `PlayerSummary` instead of a dict. Other than the reliability fields (see the next entry), fields keep their names and values (`initial_source_reliability` now comes before `initial_source_date`, which changes the key order of `dataclasses.asdict`), but `rating_format` is a `RatingFormat`, `reliability` is always a float, and `last_played`, `initial_source_date`, and `calculated_as_of` are `date` objects or `None` instead of ISO strings. `dataclasses.asdict` gives a dict, but its dates need converting before JSON.
119
+ - **Breaking:** `PlayerSummary.reliability` is always OPEN-earned reliability. It used to show the imported external reliability while it was carried. The carried value is now in a new field, `imported_reliability`, right after `reliability`: the imported reliability as a float while it is carried (captured on or before the reference date and fresh within `import_reliability_max_age_days`, fewer than `import_reliability_carry_matches` OPEN matches, and, rounded to 1 place, higher than the earned value), otherwise `None`. The `reliability_basis` and `open_reliability` fields are removed (issue #15).
120
+ - **Breaking:** `seed_external_rating` no longer takes `rd_override`; passing it raises `TypeError`. `Config.external_reliability_maps_to_rd` is removed, so `Config(external_reliability_maps_to_rd=...)` raises `TypeError`. A seeded state's RD is always `Config.external_seed_rd`, whatever the snapshot's reliability, so an external score never becomes OPEN RD. `Config.fingerprint()` changes for every config, since the field is no longer hashed (issue #15).
121
+ - **Breaking:** `add_player`, `replay(seed_players=...)`, and `prequential_predictions` (and so `evaluate`, `fit_scale`, and `fit_win_calibration`) check every seed against the seed rules and raise `InvalidSeedError` for one that breaks them, naming the player (and the format, for a rule on one rating state), before any state changes (`prequential_predictions` checks every seed up front, in both modes, even for an empty ledger, and raises `PlayerError` for a repeated seed id as `add_player` does). The rules: a seed is a `Player` with a `str` id, its `ratings` are a dict, every key is a `RatingFormat`, and every value is a `RatingState`; its `external_ids` are a dict of `str` to `str` and its `account_user_id` is a `str` or `None`; `rating`, `rd`, and an imported reliability are ints or finite floats (not bool), the counts are ints, `partners` and `opponents` are dicts, and the dates are dates. A seed or field of the wrong type, or a huge int, raises `InvalidSeedError`, not `TypeError`, `AttributeError`, or `OverflowError`. A seed has no matches, `last_played`, partners, opponents, or live updates, and its rating is within `min_rating` and `max_rating`. A provisional seed has RD `new_player_rd`, no `rd_as_of`, and no imported reliability. An imported seed, or a category seed derived from one, has RD `external_seed_rd` or `max(external_seed_rd, category_seed_rd)`, `rd_as_of` equal to `initial_source_date`, and an imported reliability that is `None` or between 0 and 100. Seeds are checked against the config they are added under. `replay` also rejects a seed whose `initial_source_date` is after `as_of`, and `prequential_predictions` one dated after its last completed ledger match; `add_player` and `seed_external_rating` have no reference date and make no date check. A played state can no longer be restored through `add_player`; rebuild it with `replay`. `seed_external_rating` checks its `rating_format` (a `RatingFormat`, not a str) and its snapshot with the same type rules before anything changes, raising `InvalidSeedError` for a rating format or one of these snapshot fields of the wrong type, so every state it seeds passes them: `captured_on` must be a `date` (not a `datetime`), `source` a `str`, `external_player_id` a `str` or `None`, `rating` an int or finite float (not bool) within the rating bounds, and `reliability` `None` or an int or finite float (not bool) between 0 and 100; a datetime `captured_on`, a bool rating or reliability, or a str `rating_format` used to be accepted (issue #15).
122
+ - **Breaking:** `MatchResult.reason` is a `RejectionReason`, or `None` when the match counted, instead of free text. `MatchResult.rating_format` is a `RatingFormat` on every result, including rejections before any rating work, instead of a string that could be empty. `rating_format` is now required and comes second (`counted`, `rating_format`, `reason`), and `reason` defaults to `None` instead of `""`, so code that builds a `MatchResult` must pass `rating_format` and, if it uses positions, follow the new order.
123
+ - **Breaking:** errors that were plain `ValueError`s are now the classes above. A `GameFormat` used for win probability is validated first, so an invalid format raises `ConfigError`. That includes `win_by=0`, which used to raise the `ValueError` that is now `EvaluationError`.
124
+ - **Breaking:** match and player ids must be non-empty strings that are not only whitespace. `Match.validate` raises `InvalidMatchError` for any other `match_id` or player id, and for a game that is not a pair of scores. Blank match ids already raised. These used to be accepted:
125
+ - Player ids that are blank, whitespace-only, or not strings, in a row after `as_of` or in a rejected row. Ledgers with such rows used to replay.
126
+ - Ids that are bytes. `record` used to count those matches.
127
+ - Blank player ids in `predict_point_share` and `predict_win_probability`, which used to return a value.
128
+
129
+ Such rows now raise in `record`, `replay`, and `prequential_predictions` (and so in `evaluate`, `fit_scale`, and `fit_win_calibration`). Every ledger that still replays gives the same ratings.
130
+ - **Breaking:** replay recency decay is removed. `Config.recency_half_life_days` is gone, so `Config(recency_half_life_days=...)` raises `TypeError`, and the `recency_multiplier` helper is gone. A replay now gives the same ratings as recording the same ledger live in ledger order, and the replay date no longer changes any update. Inactivity still widens RD through `inflated_rd`. Under the old default (a 365-day half-life), any counted match older than the replay date now has a larger `MatchResult.effective_weight`, so replayed ratings and RDs can change. A config that used to set `recency_half_life_days=None` gives the same ratings without the field. `Config.fingerprint()` changes for every config, since the field is no longer hashed.
131
+ - **Breaking:** each player now moves by their own K: `sign * K * effective_weight * surprise`. The shared match K (the mean K of all players) and the split of a team's change by K share are removed. Each player's step now depends only on their own K. A partner's or opponent's K no longer changes it: before, a player's step grew when the opponents' mean K was above their own team's and shrank when it was below. Team average movement is no longer always zero-sum: the team with the higher mean K can move more, and `MatchResult.imbalance` reports the net. Deltas are unchanged in a match where both teams have the same mean K, counting every player (including when every player has the same K). Ratings can change for a ledger with any match whose team mean K differ (issue #14).
132
+ - Because team movement is not zero-sum, matches between high-K and low-K players can add rating to the pool or remove it. Colluding accounts can exploit this: a new account can gain rating by beating a low-K account again and again, or lose rating faster on purpose. `MatchResult.imbalance` is the per-match signal, and each replay now totals it per rating format in `ReplayInfo.net_rating_created` for the backend to monitor (issue #42). A limit is tracked in issue #82.
133
+ - **Breaking:** `RatingFormat`, `MatchType`, and `ScoringType` are `StrEnum`s, so `str()` and f-strings give the value (`"doubles"`, not `"RatingFormat.DOUBLES"`). Comparison with the value, `repr`, pickling, and `Config.fingerprint()` are unchanged.
134
+ - **Breaking:** `Match.validate` raises `InvalidMatchError` for a `played_on` that is not a plain `date` (a `datetime`, a str, `None`, or any other type) and for a game score that is a `bool`. A `datetime` `played_on` could count, and then a comparison with a plain `date` raised `TypeError`: a later `record` with a plain-date `played_on` for one of its players, `player_summary` for one of its players, or a `replay` with a plain-date `as_of`. A str `played_on` raised `TypeError` in `replay` and `AttributeError` in `record`. A bool score was read as its int value (`True` as 1), so a match such as `(11, True)` could count. Such rows now raise `InvalidMatchError` in `record`, `replay`, and `prequential_predictions` (and so in `evaluate`, `fit_scale`, and `fit_win_calibration`) before any state changes, wherever they sit in the ledger. `record` also raises `InvalidMatchError` for an `as_of` that is not a plain `date`, checked right after the match. It used to return any rejection that comes before the date check (such as `DUPLICATE_MATCH_ID` or `MATCH_NOT_COMPLETED`), count the match with a falsy `as_of` such as `0` or `""` as if none was given, and otherwise raise `TypeError`. Every ledger that still replays gives the same ratings (issue #24).
135
+ - **Breaking:** `record` raises `InvalidMatchError` for an `as_of` earlier than the match date whatever the match's status, game format, or `match_id`. It used to return `MATCH_NOT_COMPLETED`, `GAME_FORMAT_NOT_ACCEPTED`, or `DUPLICATE_MATCH_ID` for such a call, and raise only for a completed match that passed those checks. The check now runs right after the match is validated, before any rejection. `replay` never records a row dated after its `as_of`, so replay results do not change (issue #72).
136
+ - **Breaking:** `PlayerSummary.established` also needs at least `Config.established_min_verified_matches` (3 by default) counted verified matches in the format, so under the default (any minimum above 0) a player whose matches are all self-reported is no longer established at any reliability. No rating, RD, reliability, prediction, or evaluation output changes. `established_min_verified_matches=0` gives the old rule (issue #59).
137
+ - **Breaking:** the snapshot schema is version 6. Each state has `verified_matches_played` (a nonnegative int no larger than `matches_played`), and `replay_info` has `net_rating_created` (a finite float for every rating format value, 0.0 for every format when `matches_counted` is 0 and for a format no player has a played state in, and never a negative zero). Loading also checks `matches_played - verified_matches_played` against `self_reported_log`, so a stored snapshot that raises `verified_matches_played` without a matching change to the log does not load, except in the cases the README names. Version 5 snapshots do not load; run a full replay to make a new one (issues #59 and #42).
138
+ - **Breaking:** the new `Config` field changes every fingerprint: `Config()` gave `d921695e186f6bc5` until the issue #58 fields changed it again. A stored `Config.to_dict()` from before lacks `established_min_verified_matches`, so `Config.from_dict` raises `ConfigError` for the missing key; add the key to load it (issue #59).
139
+ - **Breaking:** `Match.validate` checks the type of more fields and raises `InvalidMatchError` naming the field and the type given. `rating_format` must be a `RatingFormat` and `match_type` a `MatchType`. A str is rejected, even one equal to a member's value, such as `"tournament"` or `"doubles"`. `team_a` and `team_b` must be tuples. `confirmed_by` must be a set or frozenset. `sequence` and `best_of` must be ints; a `bool` or a float such as `3.0` is rejected. An int subclass is accepted (since issues #116, #118, and #119 it is rejected, and every type here is checked exactly). `game_format` must be a `GameFormat`, and `played_at` a `datetime` or `None`. Before, on a row with every other field valid, these validated and could count: a str `match_type` equal to a member's value, both teams as lists, a `confirmed_by` that is a tuple, list, dict, or dict view whose items are all participants, and a `bool` or float `sequence` or `best_of` that met the range rules. On such a row, a NaN or positive infinite float `sequence` also validated and could reach `ledger_order`; it is now rejected. On such a row that is not completed, any str `match_type` validated, and `record` and `replay` could accept the row without counting it. On such a row, a str `confirmed_by` validated when every character of it was a participant id. So with one-character player ids it could pass the self-reported confirmation rule: `confirmed_by="bd"` could count as confirmed by players `b` and `d`. Rejecting it is an integrity fix. On such a row, a `match_type` of `"bogus"`, `None`, or `RatingFormat.DOUBLES` passed `validate` and could then raise `KeyError` in `record` and `replay`. On such a row, a member of a str-mixin enum whose value equals a `MatchType` value compared equal and could count; it is now rejected too. Also fixed: on such a row, a str or `None` `sequence` or `best_of`, or one team a list and the other a tuple, raised `TypeError`, and a str `rating_format`, a str `game_format`, or a str or plain `date` `played_at` raised `AttributeError`. `record`, `replay`, and `prequential_predictions` (and so `evaluate`, `fit_scale`, and `fit_win_calibration`) now raise `InvalidMatchError` for all of these rows wherever they sit in a ledger, after `as_of` included, and `record` leaves the engine unchanged. A stored ledger with such rows no longer replays, and a resumable snapshot taken from one cannot be resumed with the same rows. Every ledger that still replays gives the same ratings. Migration: pass enum members, tuple teams, a set or frozenset for `confirmed_by`, ints for `sequence` and `best_of`, a `GameFormat`, and a `datetime` or `None` for `played_at`, then run a full replay. A numpy int64 or other integer type that is not an int subclass is rejected for `sequence` and `best_of`, so convert it with `int()` (issues #65 and #83).
140
+ - **Breaking:** `GameFormat` checks the type of each field before its range, and the error names the field and the type given. `scoring` must be a `ScoringType`; a str is rejected, even one equal to a member's value, such as `"rally"`. `points_to` and `win_by` must be ints, and `cap` an int or `None`; a `bool` or a float such as `11.0` is rejected, and an int subclass is accepted (since issues #116, #118, and #119 it is rejected). The error class follows the entry point. Through `Match.validate`, and so `record`, `replay`, and `prequential_predictions` (and `evaluate`, `fit_scale`, and `fit_win_calibration`), a bad game format raises `InvalidMatchError`, wherever the row sits in a ledger, after `as_of` included, and `record` leaves the engine unchanged. This includes the range rules (`points_to` or `win_by` below 1, `cap` not greater than `points_to`), which raised `ConfigError` there before, and a `ConfigError` raised by the `validate` of a `GameFormat` subclass, which `Match.validate` still calls and now raises as `InvalidMatchError` with the same message. Since issues #116, #118, and #119, a `GameFormat` subclass is rejected and its own `validate` never runs. `GameFormat.validate` called directly, `game_win_probability`, `match_win_probability`, and `RatingEngine.predict_win_probability` raise `ConfigError` for the same values, with the same messages. `predict_win_probability` now validates the game format before it reads `scoring`. Before, on a row with every other field valid, a field of the wrong type could validate and count, for example a str `scoring` equal to a member's value, a float such as `11.0`, a `Decimal`, a numpy integer, or a `True` `win_by`. Depending on the value, the `Config`, and the entry point, a field of the wrong type could also raise `ConfigError` for a range, raise `InvalidMatchError` for a game score, raise a non-engine error (`TypeError`, or `KeyError` for a `scoring` that was not a member), or be rejected without counting. Through `predict_win_probability`, a str `scoring` equal to a member's value gave a probability, any other `scoring` that was not a member, such as `None` or `"bogus"`, raised `KeyError`, and a float `points_to` or `cap` raised `TypeError`. A stored ledger with such rows no longer replays, and a resumable snapshot taken from one cannot be resumed with the same rows. Every ledger that still replays gives the same ratings. `Config` and its fingerprint are unchanged. Migration: build each `GameFormat` from a `ScoringType` member and ints (convert a numpy integer or a float with `int()`), catch `InvalidMatchError` (or `OpenEngineError`) where `record` or `replay` was caught for `ConfigError` on a bad game format, then run a full replay (issue #88).
141
+
142
+ ### Fixed
143
+
144
+ - A `ConfigError` message no longer depends on `PYTHONHASHSEED` (issue #145). Three checks walked a set and named the first failing entry, and set order for strs and enum members changes with the hash seed. `Config` now names the shortest game length that has no `game_length_weights` entry: `Config(game_length_weights={11: 1.0})` said "No game_length_weight for games to 15" or "... 21", and now always says 15. For a caller's `allowed_game_formats`, `Config` checks that every entry is a pair, then that no entry has a `ScoringType` that is not a member, then each entry's scoring type and points, so a set with a non-member and another bad entry gives one message ("entries must be (scoring type, whole number) pairs" when an entry is not a two-item tuple, else "has a ScoringType that is not a member") instead of either. The rebuild of a `Config` whose `allowed_game_formats` was changed after it was built (`object.__setattr__`) checks every entry and raises the first problem in sorted message order, for example "cfg.allowed_game_formats entries must be pairs, not float" for a set of `"ab"`, `1.5`, and `(ScoringType.SIDE_OUT, True)`. A set with more than one bad entry whose message happened not to vary with the seed on `main` (for example because its entries hash without the seed, such as ints, floats, `None`, and an empty-string non-member, or hash by identity, or because a non-member's entry always landed in the same place) can get a different message, once; from now on it is fixed. For example `Config(allowed_game_formats=frozenset({(fake, 11), (5, 11)}))` with such a non-member `fake` always said "entries must be (scoring type, whole number) pairs" and now says "has a ScoringType that is not a member", since every entry's shape is checked, then every non-member, then each scoring type and points. This holds for `Config(...)` and for the rebuild of a changed config. The error class is unchanged, and so is every valid result and fingerprint.
145
+ - `expected_point_share` raises `EvaluationError` ("scale must be greater than 0") for a scale of 0 or less, after its type and finiteness checks. A scale of 0 could raise a bare `ZeroDivisionError`. **Breaking:** a negative scale is now rejected too; it was accepted and could return a share that ran the wrong way. `Config` already rejects such a scale, so `RatingEngine`, `replay`, and the evaluation functions do not change (issue #134).
146
+ - `MatchResult.clamped` now also lists a player when float rounding of the new rating dropped at least 5e-6 of their change, half a unit in the fifth place that deltas and `imbalance` are reported to. Before, only a rating range cut was listed, so with a very large rating (such as 1e17 in a 0 to 1e18 range) a change could round away entirely while `clamped` stayed empty and `imbalance` was nonzero with equal K and nothing clamped or frozen. The range check is unchanged, so every player listed before is still listed. A rounding loss under 5e-6 is not listed. Rounding drops that much only at very large magnitudes: with the old and new rating both below 2**34 (about 1.7e10) in magnitude it cannot, so under the default config, and any config whose ratings stay below that, `clamped` is the same as before. In a measured sweep with steps up to 1, the first such loss came at ratings of 2**36 (about 6.9e10). No rating, delta, `imbalance`, or `ReplayInfo.net_rating_created` changes. The docs now say that `imbalance` can differ from 0.0 with equal K and nothing clamped or frozen from float rounding: unlisted losses can add up to plus or minus 1e-5 at ratings near 2**36 in magnitude, and steps far larger than the default config gives can round visibly (issue #129).
147
+ - A match or reference date near `date.min`, or a very long configured window, no longer raises a bare `OverflowError` (issue #92). Each window cutoff (the self-reported repeat window in `record`, partner and opponent diversity, and network connectivity in `player_summary`) subtracted the window from the date and overflowed when the result fell before `date.min`. Each cutoff now stops at `date.min`. The engine keeps a date when it is on or after the cutoff, so a cutoff at `date.min` keeps every date, as the earlier cutoff would have. `prequential_predictions(mode="scheduled")` (and so `evaluate`, `fit_scale`, and `fit_win_calibration` in that mode) raised it too, when a window's replay date fell before `date.min`: for a match within `replay_interval_days` of `date.min`, an `anchor` after early matches, or a very large `replay_interval_days`. That window has no earlier matches, so it is now replayed with none, and only its replay date stops at `date.min`, so a match dated `date.min` is never in the replay that predicts it. No rating, summary, prediction, or evaluation output changes for an input that worked before.
148
+ - A self-reported match given with `match_type` as its str value (`"self_reported"`), which `Match.validate` then accepted, skipped the confirmation rule, the repeat discount and limit, and the self-reported log, so it counted at full self-reported weight with no confirmation. `record` now compares the type by equality, so the str value gets every self-reported rule, exactly like `MatchType.SELF_REPORTED`. Ratings can change for such rows. Under the default config, an unconfirmed one no longer counts, a repeat is discounted and then rejected, and the row now counts toward later repeat checks. This is an integrity fix. Since issues #65 and #83, `Match.validate` rejects a str `match_type` with `InvalidMatchError`, so such a row no longer reaches `record` (see Changed).
149
+ - `fit_scale` and `fit_win_calibration` now raise `EvaluationError`, before any prediction work, when `low` is not less than `high`, `tolerance` is not finite and greater than 0, or `2 * low`, `2 * high`, or `(high - low) * 14` is not finite, so `low` and `high` must be finite and not near the float limit (issue #28). A `tolerance` of 0 or less could hang the search, and swapped or equal bounds could return a fit from a meaningless range. The search also ends when its bracket stops shrinking, so a positive `tolerance` below the float spacing near the fitted value no longer hangs. With the default tolerances, or any tolerance well above that spacing, the fits are the same as before.
150
+ - Evaluation, calibration, and win probability results are now the same on Python 3.11, 3.12, and 3.13 (issue #40). Python 3.12 changed the built-in `sum()` of floats to compensated summation, so on 3.11 a float sum could round differently in the last bit. The engine now adds floats with `math.fsum`, which is correctly rounded on every version. Ratings, RDs, and `ReplayInfo` do not change on any version: every float sum on the rating path adds one or two terms, which `sum()` and `math.fsum` round the same way. The exception is a `Config` whose rating range is so large that two ratings add up past the largest float: those sums gave `inf` and wrong expectations before, and now raise `OverflowError` (issue #70). Win probabilities (`game_win_probability`, `match_win_probability`, `predict_win_probability`, `PrequentialPrediction.win_probability_raw`), `evaluate` reports, `ScaleFit.profile`, and Brier scores can move in the last bit, mostly on 3.11 and rarely on 3.12 and later. A value rounded for display can change where that bit decides the rounding: in a synthetic test, one `evaluate` calibration bin's mean actual share moved from 0.6047 to 0.6048 on 3.11. A test pins exact replay, evaluation, and win probability output on every CI Python version.
151
+ - A `Config`'s mapping fields can no longer change after it is built (issue #25). They were plain dicts, so `cfg.match_weights[MatchType.LEAGUE] = 9` succeeded and changed `cfg.fingerprint()`, the provenance stored with each replay. The dict fields also made `Config` unhashable.
152
+ - `link_account`, `attach_external_id`, and `seed_external_rating` now run every check before they change anything. A call that raised for a new player id (an account or external identity already linked to another player, or a snapshot identity with no source) used to leave an empty player record behind and clear the snapshot's resumable mark. Now a call that raises leaves the engine as it was. Error types and messages, and what a successful call creates, are unchanged (issue #23). The issue #74 entry under Security changes the snapshot identity with no source case to `InvalidSeedError` ("External snapshot source must not be blank").
153
+ - A live match dated before a player's last match, or before the date a category rating copied from overall doubles already reflects, no longer moves `last_played`, `rd_as_of`, or partner and opponent dates back. Each now keeps the later date, and a new partner or opponent gets the match date. Before, inactivity RD growth ran again from the older date, so it counted twice, `last_played` (and with it `player_summary`'s default reference date) was wrong, and a partner or opponent seen recently could drop out of the rolling diversity window. The late match's own update is unchanged, and so is every match recorded in play order, so replay gives the same ratings as before. Live results still apply in arrival order; `MatchResult.late` flags these matches. Because dates never move back, a future-dated live match now holds its players' dates at that future date until the next replay, so their RD stops growing and their reliability stays high. The engine never reads the clock, so the backend must reject a match whose `played_on` is after the date it was submitted. A later honest match with those players that counts in the same rating format is flagged `late`, and for a category match `parent.late` covers the overall doubles rating (issue #19).
154
+ - Rows that repeat a `match_id` and differ only in the type of a member inside a list or set field (for example a game written as `[11, 1]` in one row and `[11, True]` in the other) now raise `LedgerConflictError` in `replay` and `prequential_predictions`, as the rule that every field matches in type and value says. They used to collapse to one row, because list and set fields were compared with `==` only (issue #16).
155
+ - Replay no longer shrinks old matches' updates. Recency decay scaled each update by the match's age at the replay date, so a replay disagreed with live recording of the same ledger, `evaluate(mode="live")` and `evaluate(mode="scheduled")` disagreed, a player whose matches were all long ago drifted back toward the default rating, and every recalculation shifted ratings even with no new matches (issue #13).
156
+ - `record` with a blank or whitespace-only player id, or one that is not a string (such as an int), no longer changes any rating. It used to update the players before the bad id, then raise before marking the match processed, so every retry moved those ratings again. It now raises `InvalidMatchError` before anything changes.
157
+ - `LedgerConflictError` survives pickling and copying with its message and `match_ids` intact. The message used to come back garbled.
158
+ - `game_win_probability`, `match_win_probability`, and `predict_win_probability` validate the `GameFormat` and raise `ConfigError` for an invalid one. Before, a `cap` at or below `points_to` silently returned a wrong probability, and `points_to=0` raised a bare `ValueError` from inside the math.
159
+ - A malformed game score (not a pair of scores) raises `InvalidMatchError` instead of a bare `ValueError` or `TypeError` from unpacking.
160
+ - `evaluate` no longer counts a prediction twice in its calibration table (issue #130). Each bin's upper edge was its lower edge plus 0.1, and `0.2 + 0.1` is `0.30000000000000004`, so a scored `expected` of exactly 0.3 was in both the 0.2 and the 0.3 bin, and the bin counts could add up to more than `matches_scored`. Both edges are now `k / 10`, so one bin's upper edge is the next bin's lower edge, every scored pair is in exactly one bin, and the counts add up to `matches_scored`. A report with a scored `expected` of exactly 0.3 changes: the 0.2 bin loses that pair (and is no longer listed if it had no other), its count drops by one, and its means can change. No other bin assignment changes for a scored `expected`, which is rounded to 5 places. The calibration tables in `ScaleFit.fitted` and `ScaleFit.at_default` change the same way, since they are `evaluate` reports. `mse`, `mae`, `bias`, `matches_scored`, predictions, ratings, the scale `fit_scale` picks, and the `fit_win_calibration` result do not change.
161
+
162
+ ### Security
163
+
164
+ - **Breaking:** every public entry point that takes a `Config` (`RatingEngine`, `RatingEngine.from_snapshot`, `replay` with and without `from_snapshot`, `prequential_predictions`, `evaluate`, `fit_scale`, `fit_win_calibration`, and `reliability`) now builds a fresh `Config` from the given one's stored field values and uses only that copy (issue #122). An exact `Config` could be rewritten with `object.__setattr__` after its checks, and the engine trusted the rewritten values. Now every check and the plain-value conversion run again. Each stored value is read by its real type alone, so no caller code runs while the copy is built: a mapping field must hold exactly a `dict`, or exactly the read-only copy a `Config` stores holding exactly a `dict`, with enum member or exact `str` keys (real `int` game length keys) and number values; `allowed_game_formats` exactly a `frozenset` or `set` of real tuple pairs, each a `ScoringType` member or exact `str` and a real `int`; and a scalar field an exact `bool`, an exact `str`, `None`, or a real `int` or `float`. Anything else raises `ConfigError`. The issue's example, a `match_weights` replaced by a dict holding an int subclass of 1 that overrides `__mul__`, now rates like the plain config: the #107 conversion turns the int subclass into the plain int 1. A rewritten value that `Config` rejects, such as a negative `k_max` or a negative match weight, now raises `ConfigError`; it used to rate. `engine.cfg` is now the copy, never the caller's object. For a config that was not rewritten, it is equal to the given config and has the same fingerprint. Rewriting the caller's config after the call no longer changes the engine. The engine trusts its own stored copy, and rewriting that copy after the call is outside the threat model. `replay` and the evaluation functions build the copy only after they read `matches` and `seed_players`, so a caller's `Config` rewritten while they are read is rebuilt and checked too. No rating, fingerprint, snapshot, report, or fit changes for a `Config` that was not rewritten. The snapshot format, `snapshot_version`, and the `Config` fields do not change. The copy is built once per public call, not per match, and `RatingEngine.player_summary` reads the engine's own copy without rebuilding it. Migration: build configs with `Config(...)` or `Config.from_dict`, and never rewrite their fields. Compare `engine.cfg` with `==` or `fingerprint()`, not `is`.
165
+ - **Breaking:** every public entry point now takes exact input types for the arguments it checks (issues #116, #118, #119), with three carve-outs: `Config(...)` numbers, mappings, and `allowed_game_formats`, seed state numbers, `ExternalRatingSnapshot` numbers, and snapshot numbers are read once and converted to plain values (issue #107); `matches` and `seed_players` may be any iterable, read once into a list; and output dataclasses are not inputs. A subclass, or an object whose `__class__` only claims the type, could give a check one value and rating another, or run its own code while the engine read it, and so rewrite a validated `Match`. Each now raises the entry point's `OpenEngineError` subclass before any state changes. `Match` fields: `game_format` must be exactly a `GameFormat` holding only its fields (its `scoring` exactly a `ScoringType`, `points_to`, `win_by`, and `cap` exactly ints), `played_on` exactly a `date`, `played_at` `None` or exactly a `datetime` whose `tzinfo` is exactly `datetime.timezone` or exactly `zoneinfo.ZoneInfo` (a subclass of either, or a custom tzinfo, raises; an exact `ZoneInfo` is standard library C code that runs no caller code, and its offsets come from its tz data, the tz database or the file given to `ZoneInfo.from_file`, as before; on a Python build that uses the pure-Python `zoneinfo` fallback, `ZoneInfo` instances have a `__dict__` and are rejected; an offset of a day or more, which a `from_file` zone can hold, raises `InvalidMatchError` instead of datetime's own `ValueError`), `sequence` and `best_of` exactly ints, and `status`, `rating_format`, and `match_type` exactly their enums (`InvalidMatchError` from `Match.validate`, `record`, `replay`, `prequential_predictions`, and `ledger_order`, which now checks the type of every field but `games` and the ids inside the teams and `confirmed_by`). The engine calls `GameFormat.validate` and `validate_game` through the class, so a `GameFormat` subclass's own `validate` never runs. A `cfg` must be `None` or exactly a `Config` whose instance `__dict__` holds only its fields (`ConfigError` from `RatingEngine`, `RatingEngine.from_snapshot`, `replay`, `prequential_predictions`, `evaluate`, `fit_scale`, `fit_win_calibration`, and `reliability`, which takes no `None`); before, a falsy non-`Config` silently became `Config()`. `fit_scale` builds its trial configs from the fields of `Config` itself instead of `dataclasses.replace`. Every date argument (seed `initial_source_date` and `rd_as_of`, `captured_on`, each `as_of`, `score_from`, `anchor`) must be exactly a `date`. `burn_in_matches` must be exactly an int, `mode` exactly a str, `scoring` exactly a `ScoringType`, and the fits' `low`, `high`, and `tolerance` exactly an int or float, checked before any prediction work (`EvaluationError`); a fit's `scoring` can no longer be `None`. The win probability functions, `expected_point_share`, and `reliability` (its state and the fields it reads) raise `EvaluationError` for a number that is not exactly an int or float, and `best_of` must be exactly an int. `predict_point_share` needs teams that are exactly a tuple or list, and exactly a `RatingFormat` and `ScoringType` (`InvalidMatchError`); `state` and `player_summary` raise `PlayerError`, and the seed methods `InvalidSeedError`, for a `rating_format` that is not exactly a `RatingFormat`, and `seed_external_rating` raises `InvalidSeedError` for a `replace_unplayed_seed` that is not exactly a bool (`0`, `1`, and `None` included). `Config`'s bool fields must be exactly bools, `Config.from_dict` takes exactly a `dict`, and `from_snapshot` takes exactly `dict` objects and `list` or `tuple` lists at every level and an exact bool `resumable` (a `MappingProxyType` raises). `replay` and the evaluation functions read `matches` and `seed_players` once, into lists, before any row is checked, so a generator cannot change a row after its check. Where an earlier release converts a number to its plain value (`Config` numbers and mappings, seed state numbers, `ExternalRatingSnapshot` numbers, and snapshot numbers, issue #107), that conversion stays. An object of an enum's own type that is not one of its members (`str.__new__(RatingFormat, "singles")`) is rejected wherever an enum is checked, since `team_size` compares by identity and dict lookups by equality; `Config` raises `ConfigError` for such a mapping key or `allowed_game_formats` scoring entry (a plain str key still converts). `played_at`'s offset must be exactly a `timedelta`, since an exact `timezone` keeps a `timedelta` subclass it was built with. `GameFormat.validate_game` called directly now raises `ConfigError` for a format that is not exactly a valid `GameFormat` (field types included) and `InvalidMatchError` for scores that are not exactly ints. Snapshot objects and `Config.from_dict` data must have exactly `str` keys, checked before any lookup. `Config.from_dict` also reads its nested data only as exact types: `scale_by_scoring`, `win_calibration_by_scoring`, `match_weights`, and `game_length_weights` exactly dicts with exact `str` (or member, or for game lengths exact `int`) keys, and `allowed_game_formats` an exact list or tuple of exact two-item lists or tuples of a scoring str or member and an exact `int`. `Config(...)` converts each enum mapping key once, from a member or an exact `str`: a `str` subclass key raises `ConfigError`, and a key of any other type that only hashes and compares like a member's value is no longer stored as that member (issue #107's conversion of such a key is reversed), since a key read twice could answer differently each time. Every type name in a rejection message is read without running caller code (a metaclass `__name__` property never runs). An int too large for a float, and a NaN or infinite float, raise `EvaluationError` in `expected_point_share`, the win probability functions, and `reliability`'s `rd`, and so does arithmetic on values that pass but overflows (a game format long enough to overflow a float, a rating difference too large to divide, an RD too large to inflate), instead of `OverflowError`; the fits' `low`, `high`, and `tolerance` raise it for an int too large for a float; and a `best_of` too large to compute raises it too, instead of `OverflowError`. `predict_win_probability` checks `best_of` before any prediction work. `reliability` needs exact `str` keys in `partners` and `opponents`. A rejection message names a wrong-typed value's type instead of running its `__repr__`. `fit_scale` now checks `mode`, `scoring`, `burn_in_matches`, `score_from`, and `anchor` before it builds a trial config, so `fit_scale(low=0, mode="bad")` raises `EvaluationError`, not `ConfigError`. `Config().fingerprint()` and every rating for plain inputs are unchanged, and the snapshot schema stays at version 8. Migration: pass plain values: `int(x)`, `float(x)`, `date(d.year, d.month, d.day)`, a `Config` built with `Config(...)` or `Config.from_dict`, a `GameFormat(...)`, and teams as a tuple or list. A `played_at` with a custom tzinfo, a tzinfo subclass, or a `timezone` built from a `timedelta` subclass needs converting: use `played_at.astimezone(timezone(timedelta(seconds=played_at.utcoffset().total_seconds())))`, which gives plain values with the same UTC instant and offset, so ledger digests are unchanged and existing checkpoints still resume. An exact `datetime.timezone` or `zoneinfo.ZoneInfo` works unchanged. A `played_at` that is a `datetime` subclass is rejected too, and `astimezone` keeps the subclass: rebuild it first as `datetime(played_at.year, played_at.month, played_at.day, played_at.hour, played_at.minute, played_at.second, played_at.microsecond, tzinfo=played_at.tzinfo, fold=played_at.fold)`, then convert its tzinfo as above if it needs it. The rebuilt row keeps its UTC instant and offset unless the subclass overrides `datetime`'s own methods. Pass a snapshot as `json.loads` or `to_snapshot` gives it.
166
+ - A doubles reseed under `category_feeds_parent` now refreshes the player's stored, unplayed category states derived from overall doubles (issue #101). `seed_external_rating` with `replace_unplayed_seed=True` replaced the doubles seed but left an unplayed mixed, men's, or women's doubles state with `initial_source` `open_parent:doubles` as it was derived from the old seed. A later category match could then start from the old seed live and in a replay given that stored state, but from the new seed in a replay without it, so the two replays could disagree. Now each such state is rebuilt from the new doubles seed, as a category match would start it right after the reseed, in the same call and after every check, so a refused reseed changes nothing. Imported and provisional category states, played states, and reseeds of other formats are unchanged. The refresh can change those category states, and so predictions and the results of later matches that include those players. The snapshot schema and `Config` do not change. A stored unplayed category state still does not follow a later change to the player's doubles state from a match, and a provisional category state stored before a doubles seed is not refreshed. Since issue #112, `seed_provisional_rating` stores no such state, so only a seed or a loaded snapshot holds one; see the issue #112 entry under Changed.
167
+ - Reliability can no longer be set without match results (issue #15). A seed passed to `add_player` or `replay` could carry any RD, partners, and opponents with zero matches (for example RD 0.10 and 20 partners gave reliability 100), `rd_override` let a caller pick a seed's RD, `external_reliability_maps_to_rd` turned an external score into OPEN RD, the headline summary reliability showed the imported value, a seed dated in the future froze every match before its date and kept its imported reliability shown (`replay` and `prequential_predictions` now reject it, and `player_summary` does not carry an import captured after its reference date, which with no `as_of` is the later of the last replay date and the player's last match (see the `player_summary` entry under Changed)), and a seed rating outside the rating bounds moved other players' ratings. Each is closed by the breaking changes above.
168
+ - **Breaking:** live `record` no longer counts a match that reuses the `match_id` of a match it rejected as not completed (issue #73). It used to leave that `match_id` free, so a completed match with the same id, even with other players, counted live, while `replay` of the same two rows raised `LedgerConflictError`. A party that could submit a forfeit and then a completed match under its id could move other players' ratings live in a way no replay would. `record` now reserves the `match_id` of every match it rejects with `MATCH_NOT_COMPLETED`, and every later `record` call for a match with that id that does not raise returns `DUPLICATE_MATCH_ID`. The reservation moves no rating and changes no count, content key, or possible duplicate. A live reservation sets the snapshot's `resumable` to `false`. To relabel a forfeit as completed, use a new `match_id`, as replay already required. The snapshot schema is version 5: a new key, `reserved_match_ids`, sorted. `from_snapshot` raises `SnapshotError` for a version 4 snapshot, and for `reserved_match_ids` that is missing, not a list, has an id that is not a non-blank str, repeats an id, or has an id in `processed_match_ids`, and, in a resumable snapshot, has an id that is not a `ledger_digests` id or (until issue #76 removed this rule) is a `possible_duplicates` key. Snapshots were never in a release, so version 4 snapshots were only written by unreleased builds of main. Run a full replay to make a new one. Replay ratings do not change for any ledger.
169
+ - **Breaking:** live `record` now reserves the `match_id` of every match it considers and does not count, whatever the `RejectionReason` (issue #76). It used to reserve only a match rejected as not completed (issue #73), so after any other rejection (`GAME_FORMAT_NOT_ACCEPTED`, `POSSIBLE_DUPLICATE`, `SELF_REPORTED_UNCONFIRMED`, `SELF_REPORTED_REPEAT_LIMIT`, `BEFORE_IMPORTED_BASELINE`, `SINGLES_RATING_GAP`, or `DOUBLES_PARTNER_GAP`) a different match with the same id could count live, while `replay` of the same two rows raised `LedgerConflictError`. That let a provisional rating move on a row the next replay refuses, and let a party that could reuse a rejected `match_id` move other players' ratings live. Now every later `record` call for a match with a rejected id that does not raise returns `DUPLICATE_MATCH_ID`, so a match never counts live under a `match_id` whose earlier row would make a replay of the same rows raise `LedgerConflictError`. The reservation moves no rating and changes no count or content key. A live rejection other than `DUPLICATE_MATCH_ID` sets the snapshot's `resumable` to `false`. A `possible_duplicates` entry never clears: a copy rejected under `reject_content_duplicates=True` keeps its id reserved, so it can no longer count later on its own and leave the map. The snapshot schema is version 7, with no new key: `reserved_match_ids` holds the id of every rejected match. `from_snapshot` raises `SnapshotError` for a version 6 snapshot; under `reject_content_duplicates=True` for a `possible_duplicates` key that is not a reserved id; and, in any snapshot, live or resumable, for a `ledger_digests` id that is neither processed nor reserved. The old rule that a reserved id in a resumable snapshot is never a `possible_duplicates` key is gone. Replay ratings do not change for any ledger. Migration: give a corrected resubmission a new `match_id` and keep the rejected row in the ledger unchanged. Resubmit only after a rejection that comes from the match itself (`GAME_FORMAT_NOT_ACCEPTED`, `SELF_REPORTED_UNCONFIRMED`, `MATCH_NOT_COMPLETED`), for example a self-reported match resubmitted after both teams confirm it, or a match corrected to an accepted game format. Do not resubmit after any other rejection: a replay can count the original row, and a copy under a new `match_id` could count too. A replay under a different `Config` can count rows rejected for game format or confirmation, so review resubmitted rows before such a replay. Run a full replay to replace stored version 6 snapshots.
170
+ - **Breaking:** a seed's external provenance must be its own and not blank (issue #74). A seed `RatingState` could name another player's (source, external id) pair in `initial_source` and `initial_external_player_id` without listing it in the seed's own `external_ids`, so the identity uniqueness check from issue #52 did not see it, and `add_player`, `replay(seed_players=...)`, and `prequential_predictions` accepted a second player carrying the first player's imported provenance. `add_player`, `replay(seed_players=...)`, and `prequential_predictions` (both modes, and so `evaluate`, `fit_scale`, and `fit_win_calibration`) now raise `InvalidSeedError`, before any state changes, for a seed state whose `initial_source` is not a str or is blank or whitespace only, whose `initial_external_player_id` is not a str or `None` or is blank or whitespace only, or whose `initial_external_player_id` is set while the seed's own `external_ids` does not map `initial_source` to it. A seed that does list the pair is covered by the issue #52 check, so it raises `PlayerError` ("This external identity is already linked to another player") when an existing player or an earlier seed in the same batch holds the pair, unless its source starts with `open_`, which raises `InvalidSeedError` first (issue #97). A seed that names another player's pair without listing it gets `InvalidSeedError`, not `PlayerError`, since the seed rules run first. `seed_external_rating` raises `InvalidSeedError` for a snapshot `source` that is blank or whitespace only and for an `external_player_id` that is `""` or whitespace only, before anything changes. It used to accept a blank or whitespace-only source when no external id was given (`None` or `""`) and store it as provenance, with an empty `external_player_id` stored too. With an external id, a blank or whitespace-only source raised `PlayerError`, as did a whitespace-only id. `external_player_id=None` still links nothing. These snapshot field checks run before the player id check, as the other snapshot field checks do, so a call with a blank player id and a blank source now raises `InvalidSeedError` instead of `PlayerError`. `RatingEngine.from_snapshot`, and so `replay(from_snapshot=...)`, raises `SnapshotError` naming the field for a state whose `initial_source` is blank or whitespace only, whose `initial_external_player_id` is `""` or whitespace only, or whose `initial_external_player_id` the same player's `external_ids` does not map `initial_source` to. A stored snapshot holding one of these used to load and now fails, for example one taken after `seed_external_rating` with `source=" "` or `external_player_id=""`. Every snapshot the engine's own methods produce from plain `str` and `dict` values still loads, except one an earlier version wrote with an `open_` source or a blank evidence reference (see the issue #97 entry). `to_snapshot()` checks its own output the same way, so it raises `SnapshotError` for such a state when a caller sets it directly on public engine attributes. No engine method produces one from plain `str` and `dict` values. A `str` subclass that overrides `__eq__` or `strip`, or a `dict` subclass that overrides `get`, could pass these checks and still give a snapshot that did not load; since issue #96 these values must be exactly `str` and `dict`. The schema and `snapshot_version` do not change. Ratings do not change for any input that is still accepted. Migration: give every seed state a non-blank `initial_source`, and either list its `initial_external_player_id` in the same seed's `external_ids` under that source or set it to `None`. Pass `external_player_id=None`, not `""`, to `seed_external_rating` for a snapshot with no external id. For a stored snapshot that now fails, correct the seeds and run a full replay to make a new one.
171
+ - **Breaking:** `seed_external_rating` no longer replaces or creates a rating that carries OPEN history (issue #79). It raises `InvalidSeedError` ("Cannot replace a rating derived from OPEN overall doubles") for a stored category state derived from overall doubles (`initial_source` starting with `open_parent:`), even with `replace_unplayed_seed=True`. Such a state has `matches_played` 0, so the import used to replace a rating that came from OPEN doubles matches. It also raises `InvalidSeedError` ("Cannot seed a rating format in which OPEN matches have counted for this player") when a counted update in that format included the player, including one in which the player was frozen because it was on or before the imported capture date. For overall doubles, that includes the doubles update of a category match. A frozen player keeps `matches_played` 0, so a reseed used to pass, and a reseed with an earlier capture date changed whether the player was frozen in that match, so live ratings and a replay of the same ledger could disagree. This also covers a category format with no stored state when the player was frozen in a counted category match there. Under `category_feeds_parent`, it also raises `InvalidSeedError` when seeding overall doubles while a counted category match included the player, whatever the player's state in that category is, since a new doubles seed could change whether that match's doubles update counts (for example one rejected as before the imported baseline) or the state a replay starts the category from. This applies to a first doubles seed too. A reseed after a match that did not count is covered by the issue #99 entry. The engine finds such a match from the `partners` and `opponents` of the players who moved in it, so the check does not depend on `initial_source`, and no snapshot field changes. A refused call changes nothing. Seeding a category format with no stored state and no counted match in it is still allowed, even when the player has an overall doubles rating, and an unplayed seed with no counted match can still be replaced. Since issue #112, `seed_provisional_rating` no longer stores a derived category state, so the `open_parent:` refusal applies to a stored, unplayed derived state from a seed or a loaded snapshot; a played derived state is refused as a played state (see the issue #112 entry). `seed_external_rating` also raises `InvalidSeedError` for a `snapshot` that is not an `ExternalRatingSnapshot`, instead of `AttributeError`. Ratings, replay, and the snapshot schema do not change. Migration: import a corrected external rating before the player's first counted OPEN match in that format, or rebuild with `replay` from corrected seeds.
172
+ - **Breaking:** a snapshot's overall doubles count of self-reported updates must now equal the logged doubles and category matches when category matches feed doubles and `max_doubles_partner_gap` is unset (issue #84). Under `category_feeds_parent`, `matches_played - verified_matches_played` of an overall doubles state was checked only against a range: at least the self-reported doubles matches logged for the player, at most those plus the logged category matches. So a stored snapshot that relabeled a self-reported update that reached doubles from a category match as verified still loaded, for example one where a player's doubles state with one self-reported doubles match and one self-reported mixed doubles match had `verified_matches_played` raised from 0 to 1. Under `category_feeds_parent` with `max_doubles_partner_gap` unset, a counted category match's doubles update is rejected only when every player is frozen in doubles, so a doubles state that is not frozen moves in every logged doubles and category match that names the player. `RatingEngine.from_snapshot`, and so `replay(from_snapshot=...)`, now raises `SnapshotError` for an overall doubles state with no `initial_source_date`, or any overall doubles state of a resumable snapshot counting only logged dates after its `initial_source_date`, whose count differs from that total, when `category_feeds_parent` is on and `max_doubles_partner_gap` is unset. A count below the total but within the old range now fails with "must equal the self-reported doubles and category matches logged for this player"; a count outside it fails with the same messages as before. `to_snapshot()` checks its own output the same way, so it raises for such a state when a caller sets it directly on public engine attributes. Still a range: with `max_doubles_partner_gap` set, since the gap can reject a category match's doubles update, and the snapshot (since issue #99) records each rejected doubles update in `seed_sensitive_rejections` but without its date, teams, or self-reported flag, so it cannot be matched to `self_reported_log` entries; and an imported doubles state in a snapshot that is not resumable, which keeps only the upper bound, since such a snapshot does not record when each seed was set relative to the logged matches. The exact rule for an imported doubles state applies only while `resumable` is true, which the snapshot itself sets. A snapshot edited in other fields as well, such as `matches_played`, `initial_source_date`, `resumable`, or `self_reported_log`, could still load; issue #102 rejects some of those edits (see its entry and the snapshot schema section of the README). The schema and `snapshot_version` 7 do not change. Ratings do not change. Migration: a stored snapshot that now fails was edited or is not from the engine; rebuild it with a full replay.
173
+ - **Breaking:** identity and provenance values must be exactly `str` and `dict`, not subclasses (issue #96). The identity checks accepted `str` and `dict` subclasses and then called their methods, so a subclass that overrides `__eq__`, `__hash__`, `strip`, or `get` could pass a check the plain value would fail. For example, a seed state whose `initial_external_player_id` compared equal to anything was accepted while naming another player's external id, and a source whose `strip` lied was stored as whitespace. The engine then held a state its own snapshot could not load. Now player ids, `account_user_id`, external sources and external ids, `Player.external_ids` (the dict, its keys, and its values), and a seed state's `initial_source`, `initial_external_player_id`, and `initial_evidence_reference` must be exactly `str` (or `None` where allowed) and exactly `dict`. `add_player`, `replay(seed_players=...)`, and `prequential_predictions` (both modes, and so `evaluate`, `fit_scale`, and `fit_win_calibration`) raise `InvalidSeedError` for a seed that breaks this, before any state changes. `seed_external_rating` raises `InvalidSeedError` for a snapshot `source`, `external_player_id`, or `evidence_reference` that is not exactly a `str` (or `None` where allowed), and `PlayerError` for such a player id. `attach_external_id` and `link_account` raise `PlayerError` for such a player id, source, external id, or account, and create no player. `RatingEngine.from_snapshot`, and so `replay(from_snapshot=...)`, raises `SnapshotError` for a `str` subclass in any of these string values in a snapshot passed in memory (snapshot containers can still be any mapping, since the loader copies them into plain dicts; since issues #116, #118, and #119 they must be exactly `dict`, `list`, or `tuple`, with exactly `str` keys). The same rule covers more than the identity values:
174
+ - A seed must be exactly a `Player`, each seed state exactly a `RatingState`, a seed's `ratings` exactly `dict`, and a seed state's `partners` and `opponents` exactly `dict`. `seed_external_rating` requires exactly an `ExternalRatingSnapshot`. A subclass can return a different value on a later read, so it could pass the checks and then store another player's id, account, or external id, or an unplayed state with partners.
175
+ - `ExternalRatingSnapshot.evidence_reference` and a seed state's `initial_evidence_reference` were not checked at all. A value such as `123` was stored, and `to_snapshot()` then raised `SnapshotError`. Both must now be a `str` or `None`.
176
+ - `Match.validate`, `record`, `replay`, `predict_point_share`, and `predict_win_probability` raise `InvalidMatchError` for a `match_id` or team player id (team player ids for the predict methods) that is not exactly a `str`. `player`, `state`, `player_summary`, and `seed_provisional_rating` raise `PlayerError` for such a player id. A `str` subclass id gets the same message as a blank one.
177
+ - `seed_provisional_rating` raises `InvalidSeedError` ("rating_format must be a RatingFormat") for a rating format that is not a `RatingFormat`, before it creates a player. A plain str such as `"singles"` used to raise a bare `AttributeError` for a player with no state in that format, and return the stored state for one with it; it now raises in both cases. A value that is not a `RatingFormat` but has a `parent` attribute could be stored as a rating key, and for one whose value is not a rating format, `to_snapshot()` then raised `SnapshotError`. The check runs before the player id check, so a call with a blank player id and a wrong rating format now raises `InvalidSeedError` instead of `PlayerError`.
178
+ - `Config` raises `ConfigError` ("version must be a str") for a `version` that is not exactly a `str`. Such a config used to build and snapshot. It is rejected now because `from_snapshot` reads `config_version` only as an exact `str`, so `to_snapshot()` would raise `SnapshotError`.
179
+ - `from_snapshot` reads `content_keys` keys, `ledger_digests` values, rating format keys, and dates only from exact `str` values. A `ledger_digests` value that never compared as different let a resume accept a changed row instead of raising `LedgerConflictError`.
180
+
181
+ Every snapshot the engine writes from plain values still loads, except one an earlier version wrote with an `open_` source or a blank evidence reference (see the issue #97 entry). Ratings do not change for any input that is still accepted. The schema and `snapshot_version` do not change. Not covered: `Match` and `tuple` subclasses and `confirmed_by` elements (issue #109). Int and float subclasses in seed states and `Config` were not covered here either; the issue #107 entry covers them. Migration: convert values to plain types before calling, for example `str.__str__(x)` for an id, source, or external id (plain `str(x)` works unless the subclass overrides `__str__`) and a new `dict` of plain keys and values for `external_ids`, and pass plain `Player`, `RatingState`, and `ExternalRatingSnapshot` objects. A `RatingFormat` or other `StrEnum` member used as an id or a `Config.version` is a `str` subclass too: pass its `.value`.
182
+ - **Breaking:** the `open_` provenance prefix is reserved for the engine (issue #97). The engine writes `open_provisional` and `open_parent:` plus a parent format's value as `initial_source`, and `seed_external_rating` refuses to replace a state named `open_parent:...` because it treats it as derived from overall doubles. An external source could take those names: `seed_external_rating` stored a snapshot with `source="open_parent:doubles"` as an import that then looked derived (a reseed raised "Cannot replace a rating derived from OPEN overall doubles"), `attach_external_id` linked a source such as `open_provisional`, and seeds and snapshots carried both. Now a source that starts with `open_` is rejected before any state changes: `seed_external_rating` raises `InvalidSeedError` ("External snapshot source must not start with open_") after its source type and blank checks, `attach_external_id` raises `PlayerError` ("source must not start with open_"), `add_player`, `replay(seed_players=...)`, and `prequential_predictions` (both modes, and so `evaluate`, `fit_scale`, and `fit_win_calibration`) raise `InvalidSeedError` for a seed `external_ids` source that starts with it, and `RatingEngine.from_snapshot`, and so `replay(from_snapshot=...)`, raises `SnapshotError` naming the field. A seed or snapshot state whose `initial_source` starts with `open_` must have no imported reliability, `initial_external_player_id`, or `initial_evidence_reference`, and be one of two names. `open_provisional` must have no `initial_source_date`. In a category format, `open_parent:` plus that format's parent's value is checked against how the engine derives it, under the engine's config for a seed and the snapshot's config for a snapshot: `category_feeds_parent` is on, the same player has a parent state, the state has an `initial_source_date` exactly when the parent state has one (the dates may differ: a parent reseed refreshes an unplayed derived state, so the engine's own states share the parent's date, but a seed or snapshot made before that refresh existed, or built by a caller, can hold another date), an undated one has a played parent state, and, while unplayed, its RD is at least `category_seed_rd`. A seed's parent state is unplayed, so an undated `open_parent:` seed is always rejected. Any other such state raises `InvalidSeedError` in a seed and `SnapshotError` in a snapshot, for example a dated `open_provisional`, `open_parent:doubles` in doubles or singles, `open_parent:doubles` with no doubles state, or `open_x`. A seed taken from an engine with `category_feeds_parent` on is now rejected by an engine with it off when it holds an `open_parent:` state. `RatingState.initial_source` defaults to `open_provisional`, so a caller-built dated seed that never set `initial_source` (for example `RatingState(rating=4.0, rd=cfg.external_seed_rd, rd_as_of=d, initial_rating=4.0, initial_source_date=d)`), accepted before, is now rejected. `to_snapshot()` checks its own output the same way. An evidence reference must also not be blank: `seed_external_rating` raises `InvalidSeedError` for an `evidence_reference` that is `""` or whitespace only, a seed raises `InvalidSeedError` for such an `initial_evidence_reference`, and a snapshot raises `SnapshotError`. `None` is still allowed, and the same reference may be used for many seeds. The prefix is matched exactly and is case sensitive, so `OPEN_x` and ` open_x` are not reserved. With this, the issue #79 refusal ("Cannot replace a rating derived from OPEN overall doubles") meets only `open_parent:` states that the engine derived or that pass these rules, and no import made through `seed_external_rating` can reach it. What remains: these rules do not compare an `open_parent:` state's rating or date with its parent state's. A dated `open_parent:` state that meets them, played or not, with any rating in range, looks the same whether the engine derived it, a caller built it as a seed, or an older version imported it under that name, so such a seed is accepted, a stored snapshot from before this change that holds such an import still loads, and both keep the refusal. An `open_provisional` state can carry any provisional rating in range. The schema and `snapshot_version` do not change, and no `Config`, `RatingState`, or `Player` field changes. Ratings do not change for any input that is still accepted. Migration: rename any external source that starts with `open_` (for example to `ext_open_...`) in seeds, `attach_external_id` calls, and `seed_external_rating` snapshots, set `initial_source` on every dated seed state, give an `open_parent:` seed state its parent state in the same seed under a config with `category_feeds_parent` on, pass `evidence_reference=None` instead of a blank one, and for a stored snapshot that now fails, correct the seeds and run a full replay to make a new one.
183
+ - **Breaking:** a seed that could change a rejected match is refused (issue #99). `record` kept no record of the players in a match it rejected for `BEFORE_IMPORTED_BASELINE`, `SINGLES_RATING_GAP`, or `DOUBLES_PARTNER_GAP`, or in a counted category match whose overall doubles update it rejected for one of those. Those reasons read the players' seeded ratings or dates. A later `seed_external_rating` (with or without `replace_unplayed_seed=True`, and for a player with no record yet) or `add_player` for one of those players was accepted, and a replay, which adds every seed before any row, could then count a row live never counted. Now `record`, live and in a replay, keeps each such update in a new snapshot key, `seed_sensitive_rejections`: the `match_id`, the format of the rejected update, and the sorted ids of the match's players. `seed_external_rating` and `add_player` raise `InvalidSeedError`, changing nothing, for a seed of a named player in that format or, under `category_feeds_parent`, in its parent format. A rejection for any other reason is not recorded and blocks no seed. `replay` and resume add seeds as before, so their errors do not change. The snapshot schema is version 8, and `from_snapshot` checks every rule the engine keeps for the new key (see the README's schema section). Replay results do not change, and neither does any call that is still accepted. Migration: a version 7 snapshot does not load; rebuild it with a full replay. A backend that needs a new seed for a player named in such a row rebuilds with a full replay from the corrected seeds.
184
+ - **Breaking:** `Config` and seed numbers are stored as plain `int` and `float` (issue #107). An `int` or `float` subclass can override its operators, so a `Config` field or a seed value could pass a check its plain value fails, or give rating code a different value than the checks and the fingerprint read. For example, a `match_weights` value that was an `int` subclass of 1 whose multiplication returned `10**6` gave the same fingerprint as the plain config but in the issue's example a tournament match moved each winner by 4.5 instead of 0.1125, and a seed rating of 99.0 whose `>=` and `<=` returned True passed the rating bounds. Now:
185
+ - An exact `Config` converts every number field, mapping value, `game_length_weights` key, and `allowed_game_formats` points value to the plain `int` or `float` of its own value (`int.__int__` or `float.__float__`, so an int stays an int and a float a float) before any range or cross-field check, and stores that value. A whole number must still be an `int`, so a float subclass is rejected there as a float is. A bool is still rejected with the same message. Each mapping is read once through `items()`, and game length keys are converted to plain ints before anything hashes them, so a repeated item raises "repeats the game length" and keys that a subclass's `__eq__` makes equal are kept by their own values. Each `allowed_game_formats` entry is read once through `tuple`'s own methods, so the stored pair is the one the check read. In an exact `Config`, a number field or mapping value given as a subclass now passes or fails each check as its plain value would.
186
+ - `Config.fingerprint()`, and so `==`, `hash`, and `to_dict()`, reads the fields of `Config` itself. An instance `__dataclass_fields__` attribute or a subclass's extra fields no longer change it, and `to_dict()` leaves those extra fields out. `from_dict()` also reads the fields of `Config`, so a subclass round trips through `to_dict()` and the extra fields take their defaults. A `Config` subclass is still accepted (since issue #118, `Config` itself still is, but every entry point that takes a config rejects one).
187
+ - `add_player`, `replay(seed_players=...)`, resume (`replay(from_snapshot=..., seed_players=...)`), and `prequential_predictions` (both modes, and so `evaluate`, `fit_scale`, and `fit_win_calibration`) check and store the plain value of a seed state's `rating`, `rd`, `initial_rating`, `initial_source_reliability`, `matches_played`, `verified_matches_played`, `live_updates_since_replay`, and `inherited_live_updates`, and raise `InvalidSeedError` where the plain value breaks a seed rule. `seed_external_rating` does the same for the snapshot's `rating` and `reliability`. The caller's `Player`, `RatingState`, and `ExternalRatingSnapshot` are not changed, and their copies are built from the fields of each class, so an instance `__dataclass_fields__` attribute does not drop a field.
188
+ - A value whose `__class__` claims `int` or `float` while its real type is neither, or an `allowed_game_formats` entry that claims to be a `tuple`, now raises `ConfigError`, `InvalidSeedError`, or `SnapshotError` with the usual type message instead of a bare `TypeError`.
189
+ - `RatingEngine.from_snapshot`, and so `replay(from_snapshot=...)`, stores the plain value of a state's numbers and the replay counts in a snapshot passed in memory, and raises `SnapshotError` where the plain value is out of range.
190
+
191
+ The snapshot format and `snapshot_version` do not change, and no `Config` or `RatingState` field changes. Ratings and fingerprints of configs and seeds built from plain `int` and `float` values do not change (`Config().fingerprint()` was still `17f2981186edf96c`, until issue #155 changed it to `40d9d88d4ae408cd`). Not covered: a `Config` subclass whose own methods, such as an overriding `__post_init__`, store other values (issue #118), and `Match` and `GameFormat` numbers, which keep their own type checks (issue #116 tracks some `Match` fields). Since issues #116, #118, and #119, both are covered: a `Config` subclass is rejected wherever a config is taken, and `Match` and `GameFormat` numbers must be exactly `int`. Migration: a config, seed, or snapshot that a subclass let past a check now raises, so pass plain values, for example `int.__int__(x)` or `float.__float__(x)`. A config or seed holding a subclass whose operators changed results now gives the results of its plain value, so ratings computed from it can change.
192
+
193
+ ## [0.3.0.dev0] - 2026-11-15
194
+
195
+ The first dev release, published to TestPyPI.
196
+
197
+ ### Added
198
+
199
+ - `scripts/check_wheel.py`, which fails unless a wheel holds only the `open_engine` modules, `py.typed`, and one `openpickleball_engine-<version>.dist-info` directory, which must contain `METADATA`, `WHEEL`, and `RECORD`. Every module and `py.typed` must be present, and repeated names and other directory entries fail. CI's `package` job and the release build run it after `check_sdist.py`.
200
+ - Tests that the README quick start runs and that the README install line pins the package version.
201
+ - `twine` in the `dev` extra, so contributors can run `twine check --strict` as CI does.
202
+ - `LedgerConflictError`, a `ValueError` raised by `replay` and `prequential_predictions` (and so by `evaluate` and `fit_scale`) when ledger rows share a `match_id` but differ. Its `match_ids` attribute is the sorted tuple of every conflicting id.
203
+ - CI builds the package and runs `scripts/check_sdist.py`, which fails when the source distribution has an unexpected top-level entry.
204
+ - CI reports branch coverage of `src/open_engine` on every supported Python version. The `dev` extra now includes `pytest-cov`; run `pytest --cov` for the same report locally.
205
+ - A release workflow (`.github/workflows/release.yml`). Pushing a `v*` tag reruns the test workflow (`test.yml`) on the tagged commit, checks that the commit is on `main`, builds the sdist and wheel once, and publishes them to TestPyPI through Trusted Publishing, with no stored upload token. `docs/releasing.md` lists the one-time setup and the release steps.
206
+ - `scripts/check_release.py`, which fails unless a release tag is exactly `v` plus the version of the built sdist and wheel, and `dist/` holds nothing else.
207
+ - A test that `Config.version` equals `__version__`.
208
+
209
+ ### Changed
210
+
211
+ - **Breaking:** Python 3.11 or later is required. Python 3.10 is end of life. CI tests 3.11, 3.12, and 3.13.
212
+ - The version is set in one place, `src/open_engine/_version.py`. `open_engine.__version__`, the `Config.version` default, and the build read it from there.
213
+ - `Config.version` and `__version__` are `0.3.0.dev0`. This changes every `Config.fingerprint()`.
214
+ - The source distribution now ships only `src/`, `tests/`, `scripts/`, `examples/`, `README.md`, `LICENSE`, `CHANGELOG.md`, and `pyproject.toml` (plus the `PKG-INFO` and `.gitignore` that hatchling adds). Untracked top-level files and directories (such as local tool output) and repo-only paths such as `CLAUDE.md`, `docs/`, and `.github/` are no longer bundled. Untracked files that are not gitignored inside the shipped directories still ship, and those under `src/open_engine/` also ship in the wheel. The wheel is otherwise unchanged.
215
+ - `fit_scale` compares unrounded MSE; `ScaleFit.profile` reports unrounded values.
216
+ - CI's `package` job installs `build`, `hatchling`, and `twine` from a hash-pinned lock (`.github/requirements/release.txt`), builds with `--no-isolation`, and runs `twine check --strict`, the same install and build steps the release workflow uses.
217
+ - The engine now type-checks under `mypy --strict`, and CI runs `mypy src` on every supported Python version. `ledger_order` was annotated as returning `tuple[date, time, int, str]` (its return type changes again in the breaking entry below), and `RatingEngine.player_summary` as returning `dict[str, Any]`. Runtime behavior is unchanged.
218
+ - **Breaking:** `Match.played_at` must be timezone-aware and convertible to UTC. `Match.validate()` and `ledger_order` raise `ValueError` for a naive value or one outside the range UTC can represent.
219
+ - **Breaking:** matches still sort by `played_on` first. Within one day, `ledger_order` now orders timed matches by the UTC instant of `played_at` instead of its local clock time, places untimed matches before timed ones (a timed match at local midnight used to tie with them), and returns `tuple[date, int, datetime, int, str]`. This changes the replay order, and so the ratings, for some ledgers that mix time zones on one day.
220
+ - **Breaking:** `replay` and `prequential_predictions` (and so `evaluate` and `fit_scale`) validate every ledger row before replaying, including rows after `as_of`. An invalid row now raises wherever it sits in the input.
221
+
222
+ ### Fixed
223
+
224
+ - `replay` and `prequential_predictions` no longer depend on input order when the ledger repeats a `match_id`. Rows with the same `match_id` collapse to one, so `ReplayInfo.matches_considered` counts them once, only when every field matches in type and value, with `played_at` compared by its UTC instant and UTC offset. Any other repeat raises `LedgerConflictError`, including values equal under `==` but of different types (such as `best_of=3` and `best_of=3.0`) and two readings of a repeated wall time in a daylight saving fold.
225
+
226
+ ## 0.2.0 - 2026-11-15
227
+
228
+ 0.2.0 was never tagged or published.
229
+
230
+ ### Added
231
+
232
+ - `game_win_probability`, `match_win_probability` and `calibrate_win_probability` in `open_engine.winprob`, and `RatingEngine.win_probability` for a calibrated match win probability.
233
+ - `Config.win_calibration_by_scoring`, a per-scoring-type calibration exponent that defaults to 1.0.
234
+ - `PrequentialPrediction` and `prequential_predictions`, which predict each match from ratings that have not seen it.
235
+ - `ScaleFit.profile` (the error at each scale searched) and `ScaleFit.at_bound` (whether the fit landed on a search edge), so an unidentified fit is visible.
236
+ - `WinCalibrationFit` and `fit_win_calibration`, which fit the win-probability calibration per scoring type.
237
+
238
+ ### Changed
239
+
240
+ - `evaluate` and `fit_scale` accept `mode` (`"live"` or `"scheduled"`), `score_from` and `anchor`. The defaults keep the previous behavior.
241
+ - `match_win_probability` raises `ValueError` unless `best_of` is an odd integer of at least 1.
242
+ - `Config.version` and `__version__` are now `0.2.0`.
243
+
244
+ ## [0.1.0] - 2026-11-12
245
+
246
+ ### Added
247
+
248
+ - First demonstration release of the `openpickleball-engine` package (`open_engine`), with no runtime dependencies, for Python 3.10 and later.
249
+ - A basic match example in `examples/basic_match.py`.
250
+
251
+ [Unreleased]: https://github.com/openpickleball/engine/compare/v1.0.0...HEAD
252
+ [1.0.0]: https://github.com/openpickleball/engine/compare/v0.3.0.dev0...v1.0.0
253
+ [0.3.0.dev0]: https://github.com/openpickleball/engine/compare/v0.1.0...v0.3.0.dev0
254
+ [0.1.0]: https://github.com/openpickleball/engine/releases/tag/v0.1.0