You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wire subgraph_identity through engine + observers (Option A)
Implements the coord-thread `clarify-subgraph-name-semantics`
resolution (msg 02): `metadata.subgraph_name` carries the compiled
subgraph's identity rather than the wrapper node name.
Engine surface:
- `SubgraphNode` gains `subgraph_identity: str | None = None`
(optional, BC-preserving).
- `FanOutConfig` gains `subgraph_identity: str | None = None` for
the symmetric fan-out case; threaded through
`GraphBuilder.add_fan_out_node`.
- `_InvocationContext` gains `subgraph_identities:
tuple[str | None, ...]`, parallel to `namespace_prefix` — index
`i` is the identity of the wrapper at `namespace_prefix[i]`.
`descend_into_subgraph` / `descend_into_fan_out_instance` /
`descend_into_parallel_branch` extend the chain.
- `NodeEvent.subgraph_identities: tuple[str | None, ...] = ()`
carries the chain at event-emission time so observers can read
the identity at each wrapper depth.
Observer surface:
- Langfuse `LangfuseObserver` and OTel `OTelObserver` both gain
`_subgraph_identity_at(event, depth)` and emit identity (or empty
string when None) as `metadata.subgraph_name` / `openarmature.
subgraph.name` on wrapper observations / spans, per-instance
fan-out dispatch observations, and detached-trace wrapper
observations.
- Detached subgraph's wrapper observation name now also uses the
identity (falling back to the wrapper node name when None).
- Langfuse wrapper observation synthesis now carries `namespace`,
`step`, and `attempt_index` metadata (step from the first inner
event; attempt_index hardcoded 0 since wrappers don't retry).
Conformance adapter:
- `_TracingSubgraphNode` and `_add_fan_out_node` set
`subgraph_identity` from the fixture's `subgraphs:` block key
when compiling, so every fixture-built subgraph carries its
declared identity.
Updates the pre-existing OTel-side test on fixture 002 to assert
`openarmature.subgraph.name == "inner"` (identity) rather than
`"outer_sub"` (wrapper node name) — the prior assertion was
inconsistent with Option A semantics; the spec-side fixture 002
YAML doesn't assert this attribute, so the python test was a
stricter local check that needed correction.
Langfuse fixtures 031/032/033 stay deferred pending two additional
spec/fixture ambiguities surfaced while wiring this up: (a) the
`step` value on `outer_out` (fixture 031 says 2, but graph-engine
§6 says inner-subgraph node executions increment the same counter
so the engine emits 3) and (b) whether the `namespace` metadata
on detached-trace inner observations should be rewritten to use
the subgraph identity at the wrapper position. Both queued in
coord thread `clarify-subgraph-name-semantics` msg 03.
0 commit comments