Wire 044 get_invocation_metadata fan-out scoping#192
Merged
Conversation
Wire fixture 044 (get-invocation-metadata-fan-out-scoping) into the YAML conformance harness, completing the proposal 0048 read-access family. Refactor the runner into a build dispatcher (simple node chain vs fan-out). For 044, each instance augments item_id via a runtime-state middleware (029's shape), the inner node captures its read into a synthesized field the fan-out collects (list-append) into the outer per_instance_metadata, and a post-join serial node captures outermost_metadata (baseline only -- per-instance writes don't flow back across the join). Move 044 from _UNIT_TESTED to _SUPPORTED. Test-only.
There was a problem hiding this comment.
Pull request overview
Wires spec conformance fixture 044-get-invocation-metadata-fan-out-scoping into the observability YAML harness, completing the proposal 0048 get_invocation_metadata read-access fixture set (043/044/045/046) within the Python conformance runner.
Changes:
- Adds fixture 044 to
_SUPPORTED_FIXTURESand routes it through the existing metadata fixture runner. - Refactors the metadata fixture runner to dispatch between a simple node-chain graph build and a specialized fan-out graph build for 044.
- Implements a dedicated 044 fan-out harness path with per-instance metadata augmentation middleware and inner-subgraph capture collection.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
From CoPilot review of #192: make the 044 build's shape assumptions explicit so a fixture-shape drift fails loudly. - Assert exactly one fan-out node (was: silently use the first). - Assert the inner node's keys are exactly {capture_invocation_metadata_into} (was: only checked the key's presence, dropping any extra directive).
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
Wires fixture 044 (
get-invocation-metadata-fan-out-scoping) into the YAML conformance harness, completing the proposal 0048 read-access family (043/044/045/046 are now all wired). Follow-up to #191, which deferred 044's fan-out shape.How
Refactors the metadata runner into a build dispatcher (
_build_and_invoke_metadata_graph) that picks the simple node-chain build or the fan-out build by detecting afan_outnode.The 044 fan-out path:
augment_metadata_from_fieldmiddleware (the 029-style runtime-state read: read the item from itsitem_fieldslot,set_invocation_metadata(item_id=...)before the inner read).read_in_instancecapturesget_invocation_metadata()into a synthesized inner field, which the fan-out collects (list-append) into the outerper_instance_metadata.after_fan_out_nodecapturesoutermost_metadata, which sees the caller baseline only (per-instance writes do not flow back across the join).This asserts the fixture's per-instance isolation (
[{tenantId,item_id:A},{...B}]) and outermost-baseline-only shape ({tenantId}), which depend on the engine's per-instance metadata scoping. The inner-subgraph shape is asserted (a single capture node) so a future divergent shape fails loudly.Scope
Moves 044 from
_UNIT_TESTEDto_SUPPORTED_FIXTURES. Test-only.Test plan
tests/conformance/test_observability.py -k "043 or 044 or 045 or 046"-> 4 passed.tests/-> 1468 passed; coverage guard green. ruff + pyright clean.