Commit 3d29f00
authored
Fix observer augmentation scoping, wire 039 case 3 (#193)
* Fix fan-out dispatch and augmentation scoping
Two observer corrections surfaced while wiring the nested-lineage
conformance fixture (proposal 0045):
- The augmentation walk's same-namespace arm now skips shared-parent
fan-out / parallel-branches NODE spans, in both the OTel and Langfuse
observers. A key set via set_invocation_metadata inside a fan-out
instance or branch was wrongly applied to the shared fork NODE when
the augmenting context executed at that node's own namespace, in
addition to the dispatch span where it belongs. This violated the
observability 3.4 MUST-NOT; the strict-ancestor arm already skipped
shared parents. Per-instance / per-branch dispatch spans and lineage
ancestors are unaffected.
- The Langfuse per-instance fan-out dispatch synthesis and parent
resolution are now prefix-general, so a fan-out nested below the top
namespace level (inside a serial subgraph wrapper) gets its dispatch
observation synthesized and its inner observations parented under it,
matching the OTel observer.
* Wire 039 case 3 conformance, defer cases 1+2
Activate the nested-lineage fixture (039) in the Langfuse conformance
runner. Case 3 (a fan-out inside a serial subgraph wrapper) is built by
a dedicated hand-built runner -- the generic adapter cannot construct
nested fan-out graphs -- and asserted against the fixture's expected
trace. A ContextVar-scoped negative check enforces proposal 0045's
MUST-NOT: an augmented key absent from an observation's expected
metadata must be absent in the actual, which the subset matcher alone
cannot catch.
Cases 1 and 2 are temporarily deferred via _DEFERRED_CASES. Both need a
shared observer fix: dispatch keys do not encode the enclosing fan-out
instance, so a dispatch inside an outer instance collides across
instances. Tracked as a separate effort.
* Keep detached dispatch synthesis top-level
From CoPilot review of #193: the prefix-general change over-generalized
the detached subgraph / fan-out synthesis arms to any depth, but
_trace_id_for still routes detached events by namespace[:1]. A nested
detached fan-out would partially detach -- its dispatch in the new Trace
but inner nodes in the main one. Re-gate both detached arms to depth ==
1; only the non-detached fan-out arm and the dedup need to be
prefix-general (what case 3 exercises). A nested detached fan-out now
gets no synthesis, consistent with the prior behavior, until the
deferred nested-dispatch-keying fix generalizes _trace_id_for too.1 parent b942d7d commit 3d29f00
4 files changed
Lines changed: 255 additions & 77 deletions
File tree
- src/openarmature/observability
- langfuse
- otel
- tests/conformance
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
669 | 669 | | |
670 | 670 | | |
671 | 671 | | |
672 | | - | |
673 | | - | |
674 | | - | |
675 | | - | |
676 | | - | |
| 672 | + | |
677 | 673 | | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
678 | 680 | | |
679 | 681 | | |
680 | 682 | | |
| |||
914 | 916 | | |
915 | 917 | | |
916 | 918 | | |
917 | | - | |
918 | | - | |
919 | | - | |
920 | | - | |
921 | | - | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
922 | 930 | | |
923 | 931 | | |
924 | 932 | | |
925 | | - | |
926 | | - | |
927 | | - | |
928 | | - | |
929 | | - | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
930 | 937 | | |
931 | 938 | | |
932 | 939 | | |
| |||
1007 | 1014 | | |
1008 | 1015 | | |
1009 | 1016 | | |
1010 | | - | |
1011 | | - | |
1012 | | - | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
1013 | 1021 | | |
1014 | | - | |
1015 | | - | |
| 1022 | + | |
1016 | 1023 | | |
1017 | 1024 | | |
1018 | 1025 | | |
1019 | | - | |
1020 | | - | |
1021 | | - | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
1022 | 1031 | | |
1023 | 1032 | | |
1024 | 1033 | | |
1025 | | - | |
1026 | | - | |
1027 | | - | |
1028 | | - | |
1029 | | - | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
1030 | 1038 | | |
1031 | 1039 | | |
1032 | 1040 | | |
1033 | | - | |
1034 | | - | |
1035 | | - | |
1036 | | - | |
1037 | | - | |
1038 | | - | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
1039 | 1046 | | |
1040 | | - | |
1041 | | - | |
1042 | | - | |
| 1047 | + | |
| 1048 | + | |
1043 | 1049 | | |
1044 | 1050 | | |
1045 | 1051 | | |
| |||
1440 | 1446 | | |
1441 | 1447 | | |
1442 | 1448 | | |
1443 | | - | |
1444 | | - | |
1445 | | - | |
1446 | | - | |
1447 | | - | |
1448 | | - | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
1449 | 1457 | | |
1450 | | - | |
| 1458 | + | |
1451 | 1459 | | |
1452 | 1460 | | |
1453 | 1461 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1190 | 1190 | | |
1191 | 1191 | | |
1192 | 1192 | | |
1193 | | - | |
1194 | | - | |
1195 | | - | |
1196 | | - | |
1197 | | - | |
1198 | | - | |
| 1193 | + | |
1199 | 1194 | | |
1200 | | - | |
1201 | | - | |
1202 | | - | |
1203 | | - | |
1204 | | - | |
1205 | | - | |
1206 | | - | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
1207 | 1204 | | |
1208 | 1205 | | |
1209 | 1206 | | |
| |||
0 commit comments