Skip to content

Commit 1a5f68a

Browse files
Clarify 0087 directive-order harness comments (#226)
* Clarify 0087 directive-order harness comments Address CoPilot review on #225 (both threads resolved there but the edits landed after the squash-merge). - test_observability.py: reword the 135 support-comment from "key order" to "document (dict insertion) order", matching the loader guard-comment and removing the sorted-by-key ambiguity. - test_fixture_parsing.py: correct the 135 parse-deferral reason. It read "not implemented", but 0087 is implemented -- only the parse shape is deferred, because 135 reuses the augment/capture directive shapes the cross-cap parser does not model (as siblings 043-046), runtime-driven in test_observability. Comment-only; no behavior change. * Align directive-order wording in the pointer target Address CoPilot review on #226: the _SUPPORTED_FIXTURES comment points readers at _apply_metadata_directives for the document-order behavior, but that function's own comment still said "IN KEY ORDER" / "YAML key order" -- the sorted-by-key ambiguity this branch removes at the call site. Reword it to "document order" so both spots agree. Comment-only; no behavior change.
1 parent 3d500a4 commit 1a5f68a

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

tests/conformance/test_fixture_parsing.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,8 +628,13 @@ def _id(case: tuple[str, Path]) -> str:
628628
"Proposal 0084 nested-fan-out span lineage; not implemented"
629629
),
630630
# Proposal 0087 (within-node directive execution order, v0.82.0).
631+
# 135 reuses the augment_metadata / capture_invocation_metadata_into
632+
# directive shapes (as 043-046 above) the cross-cap parser does not
633+
# model; runtime-driven via test_observability, so parse stays deferred.
631634
"observability/135-within-node-directive-execution-order": (
632-
"Proposal 0087 within-node directive execution order; not implemented"
635+
"Proposal 0087 implemented; reuses the 043-046 augment/capture "
636+
"directive shapes the cross-cap parser does not model, "
637+
"runtime-driven in test_observability"
633638
),
634639
# Proposal 0086 (PromptManager default cache_ttl_seconds, v0.79.0) -- the
635640
# manager default-cache-ttl directive shape.

tests/conformance/test_observability.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ def _reset_otel_global_tracer_provider(restore_to: object) -> None:
105105
# metadata_into in opposite document order across two cases; the
106106
# captured snapshot diverges only if a node's sibling directives
107107
# run in fixture order. Reuses the 043/045 metadata driver, which
108-
# iterates node directives in key order -- see
109-
# _apply_metadata_directives.
108+
# iterates node directives in document (dict insertion) order --
109+
# see _apply_metadata_directives.
110110
"135-within-node-directive-execution-order",
111111
"001-otel-basic-trace",
112112
"002-otel-subgraph-hierarchy",
@@ -1590,8 +1590,9 @@ def _apply_metadata_directives(
15901590
) -> tuple[dict[str, Any], bool]:
15911591
"""Run a node's (or per-attempt's) in-node metadata directives, returning the
15921592
resulting state update and whether the node should then raise."""
1593-
# Directives run IN KEY ORDER -- 043 augments then captures, 045 attempt 1
1594-
# captures then augments, and the YAML key order encodes that. The capture
1593+
# Directives run IN DOCUMENT ORDER -- 043 augments then captures, 045
1594+
# attempt 1 captures then augments, and the YAML document order encodes
1595+
# that. The capture
15951596
# records the read's type so the immutability invariant can verify it was a
15961597
# MappingProxyType. ``raises`` is terminal (a real node body that raises runs
15971598
# nothing after), so stop at it rather than processing later directives.

0 commit comments

Comments
 (0)