Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
e2de968
docs: state the list contract in one place, and correct the claims th…
sromoam Oct 16, 2026
ecaaecd
docs: link the None-list row gap to #418
sromoam Oct 16, 2026
91928e7
docs: link the first-pair mean_score exception to #428
sromoam Oct 19, 2026
9193892
Merge remote-tracking branch 'origin/dev' into docs/lists-contract
sromoam Oct 20, 2026
94f8401
Merge remote-tracking branch 'origin/dev' into m419
sromoam Oct 28, 2026
260fc04
docs: narrow the raw_similarity_score gap to List[StructuredModel] af…
sromoam Oct 28, 2026
1dd9089
Merge origin/dev into docs/lists-contract
sromoam Nov 17, 2026
a17dc85
docs(lists): correct the list contract against dev
sromoam Nov 17, 2026
0597663
docs(results): drop the fixed match gap and correct weighted_score fo…
sromoam Nov 17, 2026
789509f
docs(thresholds): correct what the runtime match_threshold gates
sromoam Nov 17, 2026
71fc040
docs(threshold-gated): qualify equal-length pairing for None, link th…
sromoam Nov 17, 2026
63af654
docs(hungarian): make the Result Structure checkable and nest leaf co…
sromoam Nov 17, 2026
ec0a2f9
docs: point list clipping at the Score rule, and limit the unordered …
sromoam Nov 17, 2026
5528a7e
docs(auto): state every effect of the runtime match_threshold in the …
sromoam Nov 17, 2026
d7dd08b
docs(changelog): re-add the list contract entry under Unreleased
sromoam Nov 17, 2026
4782d50
docs(auto): describe the List[BaseModel] clip gap without an issue link
sromoam Nov 17, 2026
e1d4e47
docs(lists): word the known gaps as defects, not as places the table …
sromoam Nov 17, 2026
174ed08
docs(thresholds): the runtime match_threshold also gates zero-config …
sromoam Nov 17, 2026
8150c77
docs: clip_under_threshold is off by default on dict and plain-model …
sromoam Nov 17, 2026
310a741
docs: qualify the equal-length pairing claims for None elements
sromoam Nov 17, 2026
90db276
docs(lists): scope the order claim to a list field's elements
sromoam Nov 17, 2026
9de4212
docs(lists): mark the List[StructuredModel] clip behaviour as a known…
sromoam Nov 17, 2026
e649f73
docs(lists): fix the review nits on reports, null lists and examples
sromoam Nov 17, 2026
0a314cf
docs(lists): scope the Reports row to field_comparisons, and say non_…
sromoam Nov 17, 2026
3218bc4
docs(lists): scope the clip defaults to a StructuredModel declared in…
sromoam Nov 17, 2026
23bc208
docs(json-schema): x-aws-stickler-infer-unspecified also infers the c…
sromoam Nov 17, 2026
6330692
docs(json-schema): keep the clip Default cell at true, and put the in…
sromoam Nov 17, 2026
69e178c
Merge origin/dev into docs/lists-contract
sromoam Nov 17, 2026
1d7ae07
docs(thresholds): fix the list rows the dev merge left inconsistent
sromoam Nov 17, 2026
aea762b
docs(thresholds): keep the List[StructuredModel] exception in Key Rul…
sromoam Nov 17, 2026
9a375d3
Merge branch 'dev' into docs/lists-contract
sromoam Nov 18, 2026
b918a52
Merge origin/dev into docs/lists-contract
sromoam Nov 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs(lists): scope the clip defaults to a StructuredModel declared in…
… Python, and the zero-config list threshold to the field name

The zero-config path is declared in Python too, and infers clip per field: a
plain Z(notes: List[str], tags: List[str], description: str) gives notes and
description FuzzyComparator@0.6 with clip off, and tags Levenshtein@0.7 with
clip on. On 'alpha beta gamma delta' vs 'omega theta kappa' notes and
description are FD and keep 0.5128, tags is FD at 0.0 (HEAD and dev).

The Score row, architecture.md and understanding-results.md now say 'on a
StructuredModel declared in Python' and link the JSON Schema and zero-config
defaults, as the Bar row does. The runtime match_threshold section said a
primitive list keeps 0.7 for List[str]; the inferred threshold depends on the
field name (0.7 for tags, 0.6 for notes). The CHANGELOG bullet uses the same
scope.
  • Loading branch information
sromoam committed Nov 17, 2026
commit 3218bc4bec520a81eb34d9be67de809388777d27
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Each release links to full notes on the
pair keeps its score, a known defect
([#415](https://github.com/awslabs/stickler/issues/415)).
- `clip_under_threshold` defaults to off, not on, for dict and plain-model
fields declared in Python and for lists of them.
fields and lists of them on a `StructuredModel` declared in Python.
- `aggregate` leaves out FN and FA items beside an accepted sibling, and a
field `threshold` on `List[StructuredModel]` raises `ValueError`.
- A primitive list element row's `weighted_score` in `field_comparisons` is
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/Advanced/classification-logic.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ This table is the single statement of how Stickler treats a list field. Other pa
| Bar | `List[StructuredModel]`: the element class's `match_threshold`; a runtime `match_threshold` does not change it. A field `threshold` there raises `ValueError` in Python, and JSON Schema ignores it. Primitive, dict and plain-model lists on a `StructuredModel` declared in Python: the field's `threshold`, else a threshold named on the comparator, else `0.5` when declared with `ComparableField()`, or the class `match_threshold` (`0.7` unless set) when declared without it (`tags: List[str]`). JSON Schema and the zero-config path have their own defaults ([JSON Schema](../Guides/Evaluation/README.md#extension-reference), [zero-config](../Getting-Started/thresholds-and-metrics.md#4-runtime-match-threshold)). A pair that [meets](../Getting-Started/thresholds-and-metrics.md#meeting-a-threshold) the bar is a TP. |
| Counts (the list node's `overall`) | Paired element: TP if it meets the bar, else FD. Unpaired GT element: FN. Unpaired prediction: FA. An empty, `None` or all-`None` list is null: both null is one TN (score `1.0`); one side null gives one FN or FA per present element (score `0.0`). |
| Recursion | Only TP pairs of `StructuredModel` items are descended into. FD, FN and FA items are atomic. `aggregate` holds the leaves of TP items only, so FD, FN and FA items are left out of it when any sibling was accepted. With no accepted item it falls back to the list node's own counts ([why](aggregate-metrics.md#aggregate-counts-objects-for-an-all-rejected-list)). |
| Score | `sum(pair scores) / max(n_gt, n_pred)`, never clipped as a whole against a field threshold. For primitive, dict and plain-model lists the pair score is the element similarity, zeroed below the bar when `clip_under_threshold` is on. Declared in Python, it defaults to on for primitive lists and off for dict and plain-model lists; JSON Schema has [its own defaults](../Guides/Evaluation/README.md#extension-reference). For `List[StructuredModel]` the pair score is `GT[i].compare_with(Pred[j])["overall_score"]`, which applies each field's own threshold and can differ from the pairing similarity. Currently `clip_under_threshold` has no effect there, so an FD pair keeps its score: a known gap. [Worked example](hungarian-matching.md#step-4-list-score). |
| Score | `sum(pair scores) / max(n_gt, n_pred)`, never clipped as a whole against a field threshold. For primitive, dict and plain-model lists the pair score is the element similarity, zeroed below the bar when `clip_under_threshold` is on. On a `StructuredModel` declared in Python it defaults to on for primitive lists and off for dict and plain-model lists. JSON Schema and the zero-config path have their own defaults ([JSON Schema](../Guides/Evaluation/README.md#extension-reference), [zero-config](../API-Reference/auto.md#inference)). For `List[StructuredModel]` the pair score is `GT[i].compare_with(Pred[j])["overall_score"]`, which applies each field's own threshold and can differ from the pairing similarity. Currently `clip_under_threshold` has no effect there, so an FD pair keeps its score: a known gap. [Worked example](hungarian-matching.md#step-4-list-score). |
| Reports | `field_comparisons`: one row per element of a primitive, dict or plain-model list, whatever its classification (a dict or plain-model element is not expanded into its keys or fields); for `List[StructuredModel]`, one row per leaf of a TP item and one object row per FD, FN or FA item. `non_matches` has the same rows, but only the FD, FN and FA ones. A `field_comparisons` row's `match` is true when its own classification is TP or TN: a value or object row met its bar; a list row had every element paired as a TP, with no FD, FA or FN at the element level. Failures deeper down get their own rows. |

**Known gaps.** Four behaviours are defects, not the contract: `clip_under_threshold` having no effect on `List[StructuredModel]`; inside a list item, a `field_comparisons` row reporting the clipped `score`, and a nested list or object getting one row; a `None` list being reported differently from `[]` in `field_comparisons` (one row for the whole field against a non-empty list, and one row against another `None`, where every other pair of null lists, such as `[]` vs `[]`, gets none); and inside a list item, some value kinds (tuple, set, bytes, whitespace-only string, a list in an `Any` field) counting differently than at top level.
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/Getting-Started/Contributing/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ Weights are configured per-field via `ComparableField` metadata. Default weight

### `clip_under_threshold`

When enabled on a field, a score below the threshold contributes 0.0 instead of its partial similarity. On a field declared in Python it is on by default, except on dict and plain-model fields and lists of them; JSON Schema has [its own defaults](../../Guides/Evaluation/README.md#extension-reference). It holds for every field kind except `List[StructuredModel]`, where it currently has no effect, a known gap (see the warning below); the layer that applies it differs.
When enabled on a field, a score below the threshold contributes 0.0 instead of its partial similarity. On a `StructuredModel` declared in Python it is on by default, except on dict and plain-model fields and lists of them. JSON Schema and the zero-config path have their own defaults ([JSON Schema](../../Guides/Evaluation/README.md#extension-reference), [zero-config](../../API-Reference/auto.md#inference)). It holds for every field kind except `List[StructuredModel]`, where it currently has no effect, a known gap (see the warning below); the layer that applies it differs.

For a primitive or a single nested `StructuredModel`, `FieldComparator` clips when producing `threshold_applied_score`, and the engine's percolation loop uses the already-clipped score:

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/Getting-Started/thresholds-and-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ result = stickler.evaluate(gt, pred, match_threshold=0.8)
spec = stickler.eval_for(Invoice, match_threshold=0.8)
```

**What it gates:** `EvalResult.matched` (`overall_score >= match_threshold`). On a `StructuredModel` class that is all it does: list pairing and field thresholds keep their class values. On a plain pydantic class (the zero-config path) it also decides TP vs FD for `List[Model]` and `List[dict]` elements at every nesting level, and sets the field threshold of nested plain-model and `dict` fields. A primitive list keeps its inferred threshold (`0.7` for `List[str]`). `spec.explain()` shows the resolved values. It never changes a similarity score or `overall_score`.
**What it gates:** `EvalResult.matched` (`overall_score >= match_threshold`). On a `StructuredModel` class that is all it does: list pairing and field thresholds keep their class values. On a plain pydantic class (the zero-config path) it also decides TP vs FD for `List[Model]` and `List[dict]` elements at every nesting level, and sets the field threshold of nested plain-model and `dict` fields. A primitive list keeps the threshold inferred from its element type and field name (`0.7` for `tags: List[str]`, `0.6` for `notes: List[str]`). `spec.explain()` shows the resolved values. It never changes a similarity score or `overall_score`.

**Default:** the class's `match_threshold` on a `StructuredModel`, else `0.7`

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/Guides/Evaluation/understanding-results.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ A weighted average of all field scores, ranging from 0.0 to 1.0. Calculated as:
overall_score = sum(field_score * field_weight) / sum(field_weights)
```

Fields with `clip_under_threshold=True` (the default, except on dict and plain-model fields declared in Python) contribute 0.0 if they score below their threshold, rather than their partial similarity. A list field follows the [Score](../../Advanced/classification-logic.md#list-contract) rule of the list contract instead.
Fields with `clip_under_threshold=True` contribute 0.0 if they score below their threshold, rather than their partial similarity. On a `StructuredModel` declared in Python that is the default, except on dict and plain-model fields. JSON Schema and the zero-config path have their own defaults ([JSON Schema](README.md#extension-reference), [zero-config](../../API-Reference/auto.md#inference)). A list field follows the [Score](../../Advanced/classification-logic.md#list-contract) rule of the list contract instead.

A field absent on both sides scores `1.0` and carries its full weight: a value the model correctly left blank is a value it got right. On a schema where most fields are usually empty this makes `overall_score` behave more like accuracy than like a hit rate. See [Sparse Objects](../../Getting-Started/thresholds-and-metrics.md#sparse-objects) for which metric answers which question.

Expand Down