Skip to content

Wire 0087 within-node directive execution order#225

Merged
chris-colinsky merged 1 commit into
mainfrom
feature/0087-directive-execution-order
Jul 21, 2026
Merged

Wire 0087 within-node directive execution order#225
chris-colinsky merged 1 commit into
mainfrom
feature/0087-directive-execution-order

Conversation

@chris-colinsky

Copy link
Copy Markdown
Member

First Phase A PR of the v0.17.0 cycle.

Proposal 0087 ratifies a conformance-adapter rule: when a node carries
more than one directive, an adapter must execute them in fixture-document
order (mapping insertion order, not sorted-by-key). Fixtures 043/045
already depended on this incidentally (augment-then-capture sees the
write; capture-then-augment does not); 0087 adds a dedicated fixture
(observability/135) that pins the divergence directly.

Python was already conformant, so this is conformance-wiring only:

  • The fixture loader uses yaml.safe_load, which preserves mapping
    insertion order in Python.
  • The hand-built metadata driver (_apply_metadata_directives) iterates
    a node's directives in key order.

Together those already satisfy the rule, which is why 043/045 passed.

Changes:

  • Un-defer 135-within-node-directive-execution-order, wiring it onto
    the existing get_invocation_metadata driver.
  • Flip conformance.toml 0087 to implemented (since 0.17.0).
  • Add a loader guard-comment pinning the safe_load order-preservation
    dependence, so an order-losing loader can't regress it silently.

No src/ behavior change. Full suite: 1691 passed, 470 skipped.

Ratify the conformance-adapter within-node directive execution-order
rule: a node's sibling directives execute in fixture-document order.
Python was already conformant. The fixture loader uses yaml.safe_load,
which preserves mapping insertion order, and the metadata driver runs a
node's directives in key order, so fixtures 043/045 already passed.

Un-defer the dedicated pin fixture observability/135 onto the existing
get_invocation_metadata driver, flip conformance.toml 0087 to
implemented (since 0.17.0), and add a loader guard-comment pinning the
safe_load order-preservation dependence. No src change.
Copilot AI review requested due to automatic review settings July 21, 2026 01:12

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 conformance proposal 0087 (“within-node directive execution order”) into the Python conformance suite by enabling the dedicated observability fixture and marking the proposal implemented, without changing src/ runtime behavior.

Changes:

  • Un-defer and run observability/135-within-node-directive-execution-order via the existing get_invocation_metadata fixture driver.
  • Add a loader comment documenting the dependency on YAML mapping insertion-order preservation for directive execution order.
  • Mark proposal 0087 as implemented (since 0.17.0) in conformance.toml, with an explanatory note.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
tests/conformance/test_observability.py Adds fixture 135 to the supported inventory and routes it to the get-invocation-metadata driver; removes its prior deferral.
tests/conformance/harness/loader.py Adds an explicit comment warning against switching to an order-losing YAML loader, since directive execution order is fixture-order sensitive.
conformance.toml Marks proposal 0087 as implemented (since 0.17.0) and documents the rationale and related fixture wiring.

Comment thread tests/conformance/test_observability.py
Comment thread conformance.toml
@chris-colinsky
chris-colinsky merged commit 3d500a4 into main Jul 21, 2026
6 checks passed
@chris-colinsky
chris-colinsky deleted the feature/0087-directive-execution-order branch July 21, 2026 01:26
chris-colinsky added a commit that referenced this pull request Jul 21, 2026
* 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.
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