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
Merge origin/dev into docs/lists-contract
Resolve conflicts with #577 in CHANGELOG.md and thresholds-and-metrics.md.

- CHANGELOG.md: keep both Documentation entries under [Unreleased].
- thresholds-and-metrics.md: keep #577's per-declaration default table and
  this branch's list rows. Runtime match_threshold takes dev's
  List[StructuredModel] carve-out plus this branch's zero-config scope,
  primitive-list and overall_score wording. The primitive/dict/plain-model
  list pairing row now points at the declaration table instead of restating
  it. The example keeps the measured data and verdicts; the cheat sheet
  merges both rows.
  • Loading branch information
sromoam committed Nov 17, 2026
commit 69e178c26b56b894684e102b5a9a276ccdecf459
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,15 @@ Each release links to full notes on the

### Documentation

- Corrected the default field threshold on Thresholds and Metrics. The page
gave `0.5` for every field, which holds only for `ComparableField()`. A bare
annotation on a `StructuredModel` (`name: str`) takes the class
`match_threshold`, `0.7` unless set, and a bare `StructuredModel` field takes
`0.9`. At a raw similarity of `0.6`, `name: str` scores `0.0` and
`name: str = ComparableField()` scores `0.6`. The page also said a runtime
`match_threshold` overrides the element class's for list pairing; on a
`StructuredModel` it sets only `EvalResult.matched`. Scoring is unchanged
([#484](https://github.com/awslabs/stickler/issues/484))
- The list contract is stated once, as a table in `classification-logic.md`
(pairing, bar, counts, recursion, score, reports), and other pages link to
it instead of restating it. Scoring is unchanged. Claims corrected against
Expand Down
12 changes: 6 additions & 6 deletions docs/docs/Getting-Started/thresholds-and-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,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 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`.
**What it gates:** The document-level `EvalResult.matched` verdict (`overall_score >= match_threshold`). On a `StructuredModel` class that is all it does: field thresholds, list element pairing and every score 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 `List[StructuredModel]` field keeps the element class's `match_threshold`, and 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]`). It never changes a similarity score or `overall_score`.

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

Expand All @@ -88,7 +88,7 @@ When multiple thresholds could apply, here's which one wins:
| **Nested object comparison** | Recurses into fields; each field uses its own field threshold |
| **List element pairing** (`List[StructuredModel]`) | The element class's `match_threshold`; a runtime value does not override it |
| **List element pairing** (zero-config `List[BaseModel]` and `List[dict]`) | Runtime match threshold if provided, else `0.7` |
| **List element pairing** (primitive, dict, plain-model lists on a `StructuredModel`) | Field threshold, else a threshold named on the comparator, else `0.5` with `ComparableField()` or the class `match_threshold` without it ([Bar](../Advanced/classification-logic.md#list-contract)) |
| **List element pairing** (primitive, dict, plain-model lists on a `StructuredModel`) | Field threshold, else a threshold named on the comparator, else the default for how the field is declared ([Precedence, in one line](#precedence-in-one-line)) |
| **Score clipping** | Field threshold (when `clip_under_threshold=True`); lists follow the [Score](../Advanced/classification-logic.md#list-contract) rule |
| **Binary classification (TP/FD)** for primitives | Field threshold |
| **Binary classification (TP/FD)** for list pairs | The list element pairing bar above |
Expand All @@ -97,8 +97,8 @@ When multiple thresholds could apply, here's which one wins:
### Key Rules

1. **Field threshold** controls primitive-level TP/FD classification and score clipping.
2. **Match threshold** controls object-level TP/FD classification for list matching.
3. **Runtime match threshold** sets `matched`. On the zero-config path it also sets the `List[Model]` and `List[dict]` pairing bar and the threshold of nested plain-model and `dict` fields. It does not override a `StructuredModel` class's own `match_threshold`.
2. **Match threshold** on the element class controls object-level TP/FD classification for list matching.
3. **Runtime match threshold** sets the `matched` verdict. On a `StructuredModel` it reaches nothing else. On the zero-config path it also sets the `List[Model]` and `List[dict]` pairing bar and the threshold of nested plain-model and `dict` fields.
4. **Comparator threshold** fills in for the field threshold when the field does not set one. A threshold on the field always wins, and a comparator's own default is never adopted.

### Example: All Four in Action
Expand Down Expand Up @@ -453,8 +453,8 @@ Recall (with FD) = TP / (TP + FN + FD) = 5 / (5 + 1 + 1) = 0.714
|-----------|-----------|------------------|---------|
| Comparator | `Comparator(threshold=...)` | TP/FD and clipping when the field sets no threshold; `binary_compare()` | varies, and a default is not adopted |
| Field | `ComparableField(threshold=...)` | TP/FD for primitives, clipping | 0.5 |
| Model | `match_threshold = ...` on class | Hungarian pairing | 0.7 |
| Runtime | `evaluate(..., match_threshold=...)` | `matched`; on the zero-config path also `List[Model]` and `List[dict]` pairing and nested plain-model and `dict` field thresholds | class `match_threshold`, else 0.7 |
| Model | `match_threshold = ...` on class | Hungarian pairing of its instances, bare-field default, `matched` verdict | 0.7 |
| Runtime | `evaluate(..., match_threshold=...)` | `matched` verdict only on a `StructuredModel`; on the zero-config path also `List[Model]` and `List[dict]` pairing and nested plain-model and `dict` field thresholds | class `match_threshold`, else 0.7 |

### Metric Formulas

Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.