Skip to content
Merged
Next Next commit
docs(249): stop promising mean_score for leaves under list parents
The _accumulate_field_metrics docstring said mean_score is recorded at
every node, "including leaves under list parents". It is not: those
leaves carry CM counts only, which the user docs and tests already
state. Reword the docstring to match. No behaviour change.

Refs #249 (per-leaf scores for list children remain open, post-1.0).
  • Loading branch information
sromoam committed Oct 15, 2026
commit 07af8aa6bee9302693c8a25a025c3ed4573ee021
Original file line number Diff line number Diff line change
Expand Up @@ -457,9 +457,11 @@ def _accumulate_field_metrics(
"""Recursively accumulate field-level CM counts and threshold_applied_score.

Walks both ``fields`` (object subtrees) and ``nested_fields``
(list-of-StructuredModel) so per-field ``mean_score`` is recorded
at every node compare_with emits, including leaves under list
parents.
(list-of-StructuredModel) so CM counts are recorded at every node
compare_with emits. Score sums (for ``mean_score``) are recorded
only where a node carries ``threshold_applied_score``. Leaves under
a list parent carry CM counts only, so their paths get no
``mean_score`` (see #249).
"""
for field_name, field_data in fields_dict.items():
if not isinstance(field_data, dict):
Expand Down