Skip to content

Wire 044 get_invocation_metadata fan-out scoping#192

Merged
chris-colinsky merged 2 commits into
mainfrom
feature/wire-044-fan-out-scoping
Jun 25, 2026
Merged

Wire 044 get_invocation_metadata fan-out scoping#192
chris-colinsky merged 2 commits into
mainfrom
feature/wire-044-fan-out-scoping

Conversation

@chris-colinsky

Copy link
Copy Markdown
Member

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 a fan_out node.

The 044 fan-out path:

  • Each instance runs a per-instance augment_metadata_from_field middleware (the 029-style runtime-state read: read the item from its item_field slot, set_invocation_metadata(item_id=...) before the inner read).
  • The inner read_in_instance captures get_invocation_metadata() into a synthesized inner field, which the fan-out collects (list-append) into the outer per_instance_metadata.
  • A post-join serial after_fan_out_node captures outermost_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_TESTED to _SUPPORTED_FIXTURES. Test-only.

Test plan

  • tests/conformance/test_observability.py -k "043 or 044 or 045 or 046" -> 4 passed.
  • Full tests/ -> 1468 passed; coverage guard green. ruff + pyright clean.

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.
Copilot AI review requested due to automatic review settings June 25, 2026 03:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_FIXTURES and 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.

Comment thread tests/conformance/test_observability.py Outdated
Comment thread tests/conformance/test_observability.py
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).
@chris-colinsky chris-colinsky merged commit b942d7d into main Jun 25, 2026
5 checks passed
@chris-colinsky chris-colinsky deleted the feature/wire-044-fan-out-scoping branch June 25, 2026 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants