Guard against unaccounted observability conformance fixtures#180
Merged
Conversation
The OpenAI provider populates LlmCompletionEvent.active_prompt / active_prompt_group from the with_active_prompt context, but no test drove complete() inside a real prompt context to assert the event carries the record -- only the observer's span rendering of an injected field was covered. Add two provider tests closing that gap (conformance fixtures 064 / 066).
The conformance harness silently pytest.skip-ped any observability fixture not in _SUPPORTED_FIXTURES, so a future unwired spec fixture would not fail CI. Add test_observability_fixture_coverage_is_complete: every pinned fixture must be run or explicitly accounted for; the guard also catches stale entries and supported/not-run overlaps. Restructure the silent skips into three documented buckets: _DEFERRED_FIXTURES (future capability -- the embedding fixtures gated on proposal 0059, plus the nested-lineage case, whose stale "0045 not implemented" reason is corrected), _UNIT_TESTED_FIXTURES (32, each cited to its covering unit-suite file), and _CONVENTION_ONLY_FIXTURES (the 0048 section 9 queryable-observer pattern, doc-satisfied).
There was a problem hiding this comment.
Pull request overview
Adds a completeness guard to the observability conformance harness so newly pinned spec fixtures can’t silently skip CI, and fills two LLM provider event-coverage gaps around prompt context propagation.
Changes:
- Add an explicit accounting/coverage guard for pinned observability fixtures and replace silent “unknown fixture” skips with documented buckets.
- Document deferred, unit-tested, and convention-only observability fixtures (with reasons) and enforce no stale/overlapping entries.
- Add unit tests ensuring
OpenAIProvider.complete()populatesLlmCompletionEvent.active_prompt/active_prompt_groupfrom prompt context.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/unit/test_llm_provider.py | Adds provider unit tests for active_prompt / active_prompt_group on typed completion events. |
| tests/conformance/test_observability.py | Adds fixture coverage guard and explicit “not run here” accounting buckets to prevent silent skips. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
PR #180 review: the active_prompt / active_prompt_group tests asserted object identity (is), coupling them to the provider passing the exact instance through. The contract is the populated record, so a reasonable snapshot/copy refactor would break them. Use pydantic structural equality (==), which is copy-robust and still checks the full record.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The observability conformance harness silently
pytest.skip-ped any pinned fixture not in the positive_SUPPORTED_FIXTURESallowlist, so a future unwired spec fixture would skip rather than fail CI. This adds a fail-on-unknown guard and converts the silent skips into explicit, documented accounting.Changes
test_observability_fixture_coverage_is_completeguard — every pinned observability fixture must be either run (_SUPPORTED_FIXTURES) or explicitly accounted for. Also catches stale entries (documented fixture no longer on disk) and supported/not-run overlaps._DEFERRED_FIXTURES(future capability): the 10 embedding fixtures (074-083) + 089, gated on the embedding capability (proposal 0059, lands v0.16.0); plus the nested-lineage Langfuse case (039), whose stale "0045 not implemented" reason is corrected (0045 is implemented; 039 defers for a nested-case harness limitation)._UNIT_TESTED_FIXTURES(32): implemented behavior covered by the dedicated unit suite rather than the YAML harness, each cited to its covering file._CONVENTION_ONLY_FIXTURES(3): the proposal 0048 section 9 queryable-observer pattern, convention-only and doc-satisfied (no library surface).active_prompt/active_prompt_groupevent-population path was implemented in the provider but only the observer's span rendering of an injected field was tested. Two new provider tests drivecomplete()insidewith_active_prompt/with_active_prompt_groupand assert the emitted event carries the record.Coverage after this change
Of 98 pinned observability fixtures: 51 run in the harness, 32 covered by unit tests, 11 deferred on the embedding capability (v0.16.0), 3 convention-only, 1 fixture-wiring-pending. Behavior-wise, only the 11 embedding fixtures await unimplemented capability; everything else is implemented and tested.
Came out of the v0.15.0 release review (spec finding: the allowlist silent-skip).