Commit 0de2403
committed
Activate proposal 0049 conformance fixtures 050-056
Adds harness support for the typed_event_collector directive introduced
by proposal 0049's seven conformance fixtures (050-056). The directive
declares one or more typed event collectors with optional filter_event_type
and include_caller_metadata flags; the parser aggregates the latter into
the provider's populate_caller_metadata kwarg.
Adds eight assertion shape handlers consumed by the fixtures:
contains_event, contains_exactly_one_event_of_type,
contains_event_of_type, contains_exactly_n_events_of_type,
does_not_contain_event_of_type, captured_event_field_values_cover,
every_captured_event_has, relative_order_of_events_matching. The
captured_event_field_values_cover shape uses set equality (matching
the spec text's "cover" semantic) rather than sorted-by-str (which
silently masks None-vs-primitive ordering ambiguity). An unknown-key
guard rejects fixture typos before any assertion runs.
Three graph builders cover the fixture topologies: a simple entry-ask-END
shape (050, 051, 052, 053, 056), a fan-out builder (054), and a
parallel-branches builder (055). The failure-path runner (053) sources
the calling-node NodeEvent from an unfiltered named collector when one
exists; otherwise attaches an AllEventsCollector specifically for that
assertion. The cause-chain walk handles the NodeException wrapper the
engine layers over the underlying ProviderUnavailable.
Adds tests/conformance/test_typed_event_harness.py with 31 unit tests
covering the harness helpers' edge cases: typo detection in assertion
keys, set-equality semantics, namespace tuple-vs-list normalization,
usage Mapping-vs-Usage comparison, cause-chain walking, populate_caller_metadata
aggregation, and the mock_model resolution. These would otherwise only
surface when a future fixture trips them.
Flips conformance.toml's [proposals."0049"] from not-yet to implemented
since 0.13.0. The leading-comment block notes that the OTel + Langfuse
observers continue driving their span / generation surface off the
sentinel NodeEvent pair during the dual-emit transition window;
type-discrimination migration of those observers waits on the
request-side-fields extension currently being drafted.1 parent 5e98f4e commit 0de2403
3 files changed
Lines changed: 1273 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
298 | | - | |
299 | | - | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
300 | 308 | | |
301 | | - | |
| 309 | + | |
| 310 | + | |
302 | 311 | | |
303 | 312 | | |
304 | 313 | | |
| |||
0 commit comments