You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG]: List[Dict[...]] exports clip_under_threshold=false, and its items are mistyped as string #333
Two defects stack on the List[Dict[...]] JSON-Schema export path. Neither corrupts scoring today, because the first one masks the second — but fixing the first without the second silently mis-sets clipping.
1. items is mistyped as string (pre-existing, unfiled)
A List[Dict[str, str]] field exports items: {"type": "string"}, so to_json_schema() → from_json_schema() returns Optional[List[str]]. The round-tripped model scores a different shape than the original. Present on dev; not introduced by #316.
2. clip_under_threshold: false is now written into the export
PR #316 admitted _is_list_of_mappings into _install_mapping_comparators (structured_model.py:455) to close a real Dict vs List[Dict] scoring divergence — the right fix. But the clip amendment mutates the FieldInfo the exporter reads, so the exported schema now carries a clip_under_threshold the user never wrote.
Why this matters later, not now
Because of defect 1 the re-imported field is already the wrong type, so no working measurement path changes and #316 was approved on that basis. Once items is exported correctly, defect 2 becomes live: the shape comes back as a primitive list with clipping off, which is wrong for a primitive list and will keep partial credit that should have been zeroed.
Suggested fix
Fix both together, or fix 2 first. The clip amendment should apply to the in-memory field (where it is correct and needed) without becoming part of the exported schema for a shape whose annotation the exporter cannot represent yet.
The comment at structured_model.py:477-481 declines to move the comparator substitution precisely to avoid changing this shape's exported schema — the clip amendment should follow the same rule.
Activity
docs(changelog): say what #333 changed on dev, not against an earlier…
release(v1.0.2): scoring, JSON Schema import and report fixes, strict…