Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions conformance.toml
Original file line number Diff line number Diff line change
Expand Up @@ -836,9 +836,9 @@ note = "Advisory, observability-only per-prompt token budget. PR A (completion p
# (graph-engine §6 fan_out_index_chain / branch_name_chain +
# observability §4 / §5.5 lineage-resolved parent).
[proposals."0084"]
status = "partial"
status = "implemented"
since = "0.17.0"
note = "The event-surface chains + the nested-LLM exact-match shipped. graph-engine §6: fan_out_index_chain / branch_name_chain (mirroring NodeEvent) now ride the provider/tool events (LlmCompletionEvent / LlmFailedEvent / LlmRetryAttemptEvent / EmbeddingEvent / EmbeddingFailedEvent / RerankEvent / RerankFailedEvent / ToolCallEvent / ToolCallFailedEvent) and the framework FailureIsolatedEvent, populated from the enclosing-lineage ContextVars at call time. observability §4.3 / §5.5: the OTel node-span key carries the scalars AND the enclosing chains, so an inner node under two concurrent outer fan-out instances no longer collides (no dropped / mis-closed spans), and the LLM-parent exact-match (§5.5 Lineage-resolved parent, fallback 1) resolves under the lineage-disambiguated calling-node span rather than the innermost scalar. observability fixture 132 (nested keying + nested-LLM exact-match, OTel) is un-deferred and driven. partial because the orphan fallback (a wrapper / middleware-issued provider call with no open calling-node span, §5.5) is not yet generalized to nearest-open-ancestor-at-any-depth and the Langfuse resolver is unchanged: observability fixtures 133 (OTel orphan) + 134 (Langfuse) and the graph-engine event-chain fixture 039 tightening defer with the orphan-call conformance-adapter primitive (a later PR)."
note = "Nested-fan-out span lineage. graph-engine §6: fan_out_index_chain / branch_name_chain (mirroring NodeEvent) ride the provider/tool events (LlmCompletionEvent / LlmFailedEvent / LlmRetryAttemptEvent / EmbeddingEvent / EmbeddingFailedEvent / RerankEvent / RerankFailedEvent / ToolCallEvent / ToolCallFailedEvent) and the framework FailureIsolatedEvent, populated from the enclosing-lineage ContextVars at call time. observability §4.3 / §5.5: the OTel node-span key AND the Langfuse node-observation key now carry the scalars plus the enclosing chains, so an inner node under two concurrent outer fan-out instances no longer collides (no dropped / mis-closed spans / observations), while a callable parallel-branch stays distinct from its parallel-branches node. The LLM-parent exact-match (§5.5 Lineage-resolved parent, fallback 1) resolves under the lineage-disambiguated calling-node span / observation rather than the innermost scalar. The §5.5 orphan fallback (a wrapper / middleware-issued provider call with no open calling-node span) is generalized in BOTH observers to the nearest enclosing wrapper on the calling node's lineage via a shared resolver (_resolve_enclosing_wrapper_context on OTel, _resolve_enclosing_wrapper_observation_id on Langfuse), which also now backs FailureIsolatedEvent parenting so the marker resolves consistently across observers. observability fixtures 132 / 133 / 134 all run; the orphan-call primitive calls_llm_from_wrapper is modeled as NodeSpec.calls_llm_from_wrapper so 133 / 134 also parse + round-trip. KNOWN LIMITATION (cross-observer parity, §8.9): the harness realizes the orphan call as fan-out INSTANCE middleware in the POST phase, because a per-node PRE-phase wrapper call does not orphan in the python engine (prepare_sync opens the node span before node middleware). Under the fixtures' declared PRE phase, a Langfuse orphan resolves to the OUTER fan-out instance (Langfuse creates instance observations lazily, so the inner one does not exist when the pre-phase event drains) while OTel resolves to the INNER -- a real pre-phase parity gap the fixtures do not cover. Parity holds for the post-phase realization the fixtures drive (asserted by a live OTel-vs-Langfuse parent comparison in 134). The pre-phase gap is tracked (Langfuse eager instance-observation creation) and flagged to spec."

# Spec v0.80.0 (proposal 0085). Nested-fan-out checkpoint resume
# lineage (pipeline-utilities §10.11 enclosing_fan_out_lineage).
Expand Down
13 changes: 7 additions & 6 deletions src/openarmature/graph/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -1142,12 +1142,13 @@ class FailureIsolatedEvent:
post_state: Mapping[str, Any]
caught_exception: CaughtException
# Proposal 0084 (spec v0.81.0): enclosing fan-out / branch lineage chains
# parallel to ``namespace`` (see LlmCompletionEvent). Carried for surface
# consistency with the provider events. The marker's calling-node span is
# already closed by delivery time (its completed event precedes this one on
# the serial queue), so it parents under the invocation span, not via the
# lineage exact-match -- the chains only disambiguate in the rare case that
# calling-node span is still open.
# parallel to ``namespace`` (see LlmCompletionEvent). The marker's
# calling-node span/observation is already closed by delivery time (its
# completed event precedes this one on the serial queue), so both observers
# take the §5.5 orphan fallback and parent the marker under the nearest
# enclosing wrapper on this lineage (the fan-out instance / branch / subgraph
# span, else the invocation span / Trace). The chains disambiguate that
# enclosing wrapper across concurrent sibling instances.
fan_out_index_chain: tuple[int | None, ...] = ()
branch_name_chain: tuple[str | None, ...] = ()

Expand Down
Loading