-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconformance.toml
More file actions
912 lines (817 loc) · 80.6 KB
/
Copy pathconformance.toml
File metadata and controls
912 lines (817 loc) · 80.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
# Conformance manifest for openarmature-python.
#
# Records which openarmature-spec proposals are implemented in this
# package, and starting at which release version. Intended to be read
# by external consumers (notably the openarmature-spec docs build,
# which surfaces a per-implementation status column on the proposals
# index page).
#
# Stable URL (read-only, fetched at docs-build time):
# https://raw.githubusercontent.com/LunarCommand/openarmature-python/main/conformance.toml
#
# Maintenance: keep in sync with CHANGELOG.md. The CI guard at
# scripts/check_conformance_manifest.py validates this file against the
# pinned spec submodule's proposals/ directory on every PR and release
# build; any Accepted proposal lacking an entry (or any entry pointing
# at a non-existent / non-Accepted proposal) fails the build.
#
# Scope: this file lists ONLY proposals visible in the pinned spec
# submodule (openarmature-spec at the SHA pinned by this repo's
# submodule). Proposals accepted on the spec's main branch after this
# repo's last spec bump are intentionally absent — surfacing the gap
# between pinned-spec and spec-head is the consumer's job (e.g., the
# spec docs site computes the difference and renders accordingly).
#
# Convention: this file is updated as part of release PRs AND as part
# of feature PRs that bump the spec submodule pin (the manifest guard
# requires entries for every Accepted proposal in the pinned spec, so
# a submodule bump forces this file to update too). Such bump PRs set
# `since` to the upcoming release version; between the bump PR and the
# matching tag, external readers will see a `since` referring to the
# upcoming, unreleased version.
[manifest]
implementation = "openarmature-python"
spec_pin = "v0.88.0"
# Status values:
# implemented — shipped behavior matches the proposal's contract
# partial — partial impl; consult `note` for what's missing
# textual-only — accepted proposal is purely textual (reframe,
# clarification, template) with no module-level
# change required; CHANGELOG note explains why
# not-yet — accepted in spec, not yet shipped in this package
#
# Drafts and Superseded proposals are deliberately absent from this
# file. The CI guard requires entries only for proposals whose spec
# header reads `Status: Accepted`.
[proposals."0001"]
status = "implemented"
since = "0.5.0"
[proposals."0002"]
status = "implemented"
since = "0.5.0"
[proposals."0003"]
status = "implemented"
since = "0.5.0"
[proposals."0004"]
status = "implemented"
since = "0.5.0"
[proposals."0005"]
status = "implemented"
since = "0.5.0"
[proposals."0006"]
status = "implemented"
since = "0.5.0"
[proposals."0007"]
status = "implemented"
since = "0.5.0"
[proposals."0008"]
status = "implemented"
since = "0.5.0"
[proposals."0009"]
status = "implemented"
since = "0.9.0"
[proposals."0010"]
status = "implemented"
since = "0.9.0"
[proposals."0011"]
status = "implemented"
since = "0.6.0"
[proposals."0012"]
status = "implemented"
since = "0.5.0"
[proposals."0013"]
status = "implemented"
since = "0.5.0"
[proposals."0014"]
status = "implemented"
since = "0.6.0"
[proposals."0015"]
status = "implemented"
since = "0.6.0"
[proposals."0016"]
status = "implemented"
since = "0.6.0"
[proposals."0017"]
status = "implemented"
since = "0.6.0"
[proposals."0018"]
status = "implemented"
since = "0.6.0"
[proposals."0019"]
status = "textual-only"
since = "0.9.0"
note = "Purely textual reframe of llm-provider §8 as a catalog of wire-format mappings (OpenAI-compatible body nested under §8.1). No module-level change required."
[proposals."0024"]
status = "implemented"
since = "0.8.0"
[proposals."0025"]
status = "implemented"
since = "0.9.0"
[proposals."0026"]
status = "textual-only"
since = "0.9.0"
note = "Purely textual §8 framing paragraph; the existing OpenAI §8.1 mapping is the template's reference shape, so no module-level work was needed."
[proposals."0027"]
status = "implemented"
since = "0.9.0"
[proposals."0028"]
status = "implemented"
since = "0.9.0"
[proposals."0029"]
status = "implemented"
since = "0.9.0"
[proposals."0030"]
status = "textual-only"
since = "0.9.0"
note = "Drain snapshot semantic and timeout-input validation already implemented as part of the proposal 0010 impl PR (v0.9.0); no additional module-level work needed."
# Spec v0.23.0-v0.27.1 batch (proposals 0031, 0032, 0033, 0034, 0035,
# 0036), all shipped in the v0.10.0 release.
[proposals."0031"]
status = "implemented"
since = "0.10.0"
[proposals."0032"]
status = "implemented"
since = "0.10.0"
[proposals."0033"]
status = "implemented"
since = "0.10.0"
[proposals."0034"]
status = "implemented"
since = "0.10.0"
[proposals."0035"]
status = "implemented"
since = "0.10.0"
[proposals."0036"]
status = "implemented"
since = "0.10.0"
# Spec v0.28.0-v0.31.0 (proposals 0037, 0039, 0040, 0041).
[proposals."0037"]
status = "not-yet"
[proposals."0039"]
status = "implemented"
since = "0.11.0"
[proposals."0040"]
status = "implemented"
since = "0.11.0"
[proposals."0041"]
status = "implemented"
since = "0.11.0"
# Spec v0.32.0-v0.34.0 (proposals 0038, 0020, 0042).
[proposals."0038"]
status = "not-yet"
[proposals."0020"]
status = "not-yet"
# Spec (proposal 0021). Suspension capability — async-pause +
# resume primitive (``suspend()`` + ``resume()``) layering on the
# graph engine. Python has not yet shipped suspension; v0.13.0
# leaves the capability not-yet-implemented.
[proposals."0021"]
status = "not-yet"
# Spec v0.49.0 (proposal 0022). Harness capability — abstract
# contract for wrapping the engine in deployment runtimes
# (HTTP / event-bus / queue / CLI / streaming). Python has not
# yet shipped a harness binding; v0.13.0 leaves the capability
# not-yet-implemented. Composes with 0056 (chat sub-spec).
[proposals."0022"]
status = "not-yet"
# Spec v0.52.0 (proposal 0023). Canonical state reducers — three
# new factory-style reducers (``bounded_append``, ``dedupe_append``,
# ``merge_by_key``) extending the graph-engine §2 baseline set.
# Python has not yet shipped the new reducers; v0.13.0 leaves the
# capability not-yet-implemented. Conformance fixtures 035-038
# stay parser-deferred until the implementation lands.
[proposals."0023"]
status = "not-yet"
[proposals."0042"]
status = "implemented"
since = "0.11.0"
# Spec v0.35.0 (proposal 0043).
[proposals."0043"]
status = "implemented"
since = "0.11.0"
# Spec v0.36.0 (proposal 0044).
[proposals."0044"]
status = "implemented"
since = "0.11.0"
# Spec v0.37.0 (proposal 0045). Engine-side per-depth lineage chains
# + observer-side three-step boundary decision tree implemented.
# Single-level fixtures 029 / 030 / 034 stay unchanged per 0045's
# backward-compat note. Nested-case fixture 039 stays deferred in the
# Langfuse harness — needs runtime-state item-list lookup for nested
# fan-outs plus an ``augment_metadata_from_outer_item`` directive.
# Behavioral contract verified at unit level via
# ``test_nested_fan_out_augmentation_reaches_outer_instance_dispatch_span``.
[proposals."0045"]
status = "implemented"
since = "0.11.0"
# Spec v0.38.0 (proposal 0046). Multi-message chat-prompt rendering.
# Adds ``ChatPrompt`` alongside the existing ``TextPrompt`` (renamed
# from ``Prompt``); ``Prompt`` is now the discriminated-union alias.
# Chat-prompt segments (content + placeholder) and content-block
# templates (text + image-URL + image-inline) ship in
# ``openarmature.prompts``. ``PromptManager.render`` accepts a new
# ``placeholders`` kwarg for variable-length message-list injection.
# Conformance fixtures 017-031 activate against the existing
# prompt-management harness with a chat-template parser extension.
[proposals."0046"]
status = "implemented"
since = "0.11.0"
# Spec v0.39.0 (proposal 0047). Implicit prefix-cache wire-byte
# stability. Cross-capability proposal landed end-to-end in the
# v0.13.0 cycle across three pieces, all post-v0.12.0:
# (1) ``Response.usage`` cache-stat fields (``cached_tokens`` /
# ``cache_creation_tokens``) sourced from the OpenAI
# ``prompt_tokens_details`` payload, with conditional emission
# preserved (absent-vs-zero distinction stays observable) — landed
# in PR #136 as the proposal's payload-side prerequisite;
# (2) OTel observer emits ``openarmature.llm.cache_read.input_tokens``
# (and optional ``openarmature.llm.cache_creation.input_tokens``)
# when the corresponding usage field is populated — landed in
# PR #140; (3) §8.1 intra-impl wire-byte canonicalization in the
# OpenAI adapter — landed in PR #145. The canonicalizer recursively
# sorts dict keys at every nesting level while preserving caller-
# supplied array order, applied at the four user-input boundaries
# (``tool.parameters`` / ``tool.function`` record top-level per
# spec Q5, ``response_format.json_schema.schema``, ``RuntimeConfig``
# extras, ``tool_call.arguments`` JSON encoding) plus a top-level
# belt-and-suspenders pass over the assembled request body.
# Downstream-observable wire-byte shift on
# ``tool_call.arguments``: the encoded string now uses
# ``sort_keys=True`` (functionally equivalent — parses to the same
# dict — but byte-different for golden-file / audit-snapshot
# consumers). Scope is the Chat Completions endpoint only; the
# OpenAI Responses API endpoint is deferred to a future cycle (no
# python consumer today). Prompt-management §13 cross-variable
# substring stability is satisfied by the existing Jinja2
# ``StrictUndefined`` render path; pinned by
# ``tests/unit/test_prompts.py::
# test_cross_variable_substring_stability_text_prompt`` and
# ``test_cross_variable_substring_stability_chat_prompt``.
# Anthropic / Gemini wire-byte conformance fixtures stay deferred
# — neither provider is implemented in python today.
[proposals."0047"]
status = "implemented"
since = "0.13.0"
# Spec v0.40.0 (proposal 0048). Read-symmetric invocation metadata.
# Adds ``get_invocation_metadata()`` symmetric to the existing
# ``set_invocation_metadata()`` write API. The python implementation
# satisfies the §3.4 read contract via the pre-existing
# ``current_invocation_metadata`` machinery: returns ``MappingProxyType``
# snapshot of the current async context's view, silent no-op outside
# an invocation, no observer emission, per-async-context scoping under
# fan-out and parallel-branches (inherited from 0034/0040/0045),
# per-attempt scoping under retry (engine-side reset of
# ``_invocation_metadata_var`` around each ``RetryMiddleware`` iteration,
# landed in the same release cycle as 0048).
# ``get_invocation_metadata`` lands as the canonical spec-idiomatic
# public name; ``current_invocation_metadata`` stays as a stable
# alias (Option A per the proposal-0048-implementation coord thread).
# Plus a new §9 *Queryable observer pattern* section in
# ``docs/concepts/observability.md`` covering the §9.1 read-method
# contract, §9.2 async-safety, §9.3 three-channel guidance, §9.4
# lifecycle. §9 is convention-only per spec — no new abstract
# surface on ``Observer``.
#
# Conformance fixtures 043-049 introduce new directive shapes
# (augment_metadata / capture_invocation_metadata_into /
# capture_queryable_observer_read_into / per_attempt_behavior +
# queryable_observers / inner_subgraphs / caller_metadata /
# direct_call / sequential_invocations top-level keys) that the
# cross-capability parser doesn't model; fixture-shape activation is
# queued for a future PR slotted after the upcoming spec
# conformance-adapter capability ratifies the directive vocabulary.
# The shipped contract is pinned by explicit unit tests:
# - alias identity + roundtrip + immutable-mapping return:
# ``tests/unit/test_observability_metadata.py::
# test_get_invocation_metadata_is_same_callable_as_current``,
# ``::test_get_invocation_metadata_roundtrip_baseline_plus_augment``,
# ``::test_get_invocation_metadata_returns_immutable_mapping_outside_invocation``;
# - mid-invocation augmentation visible to subsequent reads:
# ``::test_mid_invocation_augmentation_persists_to_next_node``;
# - outside-invocation empty:
# ``::test_current_invocation_metadata_empty_outside_invocation``;
# - per-attempt scoping under retry (mirrors spec fixture 045):
# ``::test_per_attempt_scoping_under_retry_discards_failed_attempt_writes``,
# ``::test_terminal_failure_discards_final_failed_attempt_writes``,
# ``::test_cancellation_discards_in_flight_attempt_writes``.
[proposals."0048"]
status = "implemented"
since = "0.12.0"
# Spec v0.41.0 (proposal 0049). Typed LLM Completion Event — first
# typed event variant on the observer event union. Shipped fully in
# v0.13.0 across PRs #141 (typed-event definition + provider
# emission + 0057 field-set extension), #142 (OTel observer migration
# to type discrimination), #143 (Langfuse observer migration +
# success-side sentinel emission dropped), and #144 (0058 typed
# LlmFailedEvent + sentinel-namespace NodeEvent emission for LLM
# events retired entirely from the bundled OpenAIProvider).
# LlmCompletionEvent carries identity/scoping/outcome fields per
# the spec field table. Both bundled observers (OTel + Langfuse)
# consume the typed events via isinstance discrimination on both
# outcome paths. Conformance fixtures 050-056 activated by the
# typed_event_collector harness directive. Fixtures 057-068
# (proposal 0057 request-side fields) and 069-073 (proposal 0058
# typed failure event) stay parser-deferred pending the harness's
# typed_event_collector directive schema catch-up + the event_counts
# list directive introduced by fixture 071; behavior pinned by
# unit tests in tests/unit/test_llm_provider.py +
# test_observability_otel.py + test_observability_langfuse.py.
[proposals."0049"]
status = "implemented"
since = "0.13.0"
# Spec v0.42.0 (proposal 0050). Retry & degradation primitives —
# failure-isolation middleware (§6.3) + call-level retry (§7),
# including §7.1's per-attempt span surface. Implemented across the
# v0.14.0 + v0.15.0 cycles: FailureIsolationMiddleware (distinct
# FailureIsolatedEvent + CaughtException) and the call-level ``retry``
# parameter on ``Provider.complete()`` — an in-call loop over transient
# §7 errors reusing the §6.1 RetryConfig record. §7.1's per-attempt
# span surface now ships: a call-level ``retry`` emits N
# ``openarmature.llm.complete`` spans — one per attempt — each carrying
# ``openarmature.llm.attempt_index`` (0-based, call-level, independent
# of the node-level attempt_index). A python-internal
# LlmRetryAttemptEvent dispatched once per attempt is the SOLE source of
# the OTel LLM span (including single no-retry calls, at index 0); the
# terminal LlmCompletionEvent / LlmFailedEvent stay one-per-call
# (payload, latency, Langfuse Generation, fixture-072 mutual exclusion)
# and no longer drive the OTel span. Langfuse renders one terminal
# Generation per call. llm-provider fixtures 056-058 (per-attempt
# spans) are validated in tests/unit/test_observability_otel.py through
# the provider + OTel observer; observability fixture 057
# (single-attempt attempt_index) is wired in test_observability.
# Failure-isolation fixtures (058-063) are all wired + passing: the
# FailureIsolatedEvent's attempt_index reports the final / exhausting
# attempt per §6.3's lineage-correlation rule (spec ruled this in the
# attempt-index coord thread; RetryMiddleware now records the final
# attempt in a terminal-attempt scope the outer isolation reads, rather
# than the post-reset baseline).
[proposals."0050"]
status = "implemented"
since = "0.15.0"
# Spec v0.43.0 (proposal 0051). Langfuse trace.input/trace.output
# implementation-surface caveat. Purely textual: documents that the
# Langfuse SDK's ``LangfuseClient`` API requires a trace object
# round-trip to project caller-side ``trace.input`` / ``trace.output``
# updates onto the wire. No module-level change required; the python
# implementation's existing v0.11.0 (proposal 0043) shape already
# matches the documented behavior.
[proposals."0051"]
status = "textual-only"
since = "0.12.0"
# Spec v0.44.0 (proposal 0052). Implementation attribution attributes
# on every invocation span (§5.1) + every Langfuse Trace (§8.4.1).
# The OTel observer emits ``openarmature.implementation.name`` +
# ``openarmature.implementation.version`` on the invocation span
# alongside the existing ``openarmature.graph.spec_version``; inner
# spans do NOT carry them (per §5.1 they are invocation-span-only,
# not cross-cutting §5.6). The Langfuse observer mirrors with
# ``trace.metadata.implementation_name`` +
# ``trace.metadata.implementation_version`` rows on both trace-open
# paths (the proposal 0043 boundary-event lazy-open path and the
# legacy NodeEvent path). Always-emit invariant: neither
# ``disable_state_payload`` nor any other privacy knob gates these
# attributes — they describe runtime identity, not runtime data.
#
# Source: ``__implementation_name__`` ("openarmature-python") added
# to ``openarmature/__init__.py`` alongside the existing version
# constants; ``__version__`` is the package version source.
# Configurable via dataclass fields on both observers for test
# parameterization.
#
# §3.4 reserved-key set grows 24 -> 26 names: ``implementation_name``
# and ``implementation_version`` reject caller-supplied collision at
# the ``invoke()`` API boundary.
#
# Conformance fixtures: 058 (OTel) parses cleanly via the existing
# ``span_tree`` + ``attributes_absent`` directive shapes — its
# cross-capability parser test passes; runtime exec is gated by
# ``_SUPPORTED_FIXTURES`` in ``test_observability.py`` until the
# harness wires up the canonical-value parameterization. 059
# (Langfuse) stays deferred from the cross-capability parser
# pending the upcoming conformance-adapter capability — same Path A
# reasoning as the 0048 / 0054 fixtures. Behavior is pinned by unit
# tests:
# - reserved-key rejection (validate / set_invocation_metadata /
# invoke() boundary for both names):
# ``tests/unit/test_observability_metadata.py::
# test_validate_rejects_reserved_implementation_name``,
# ``::test_validate_rejects_reserved_implementation_version``,
# ``::test_set_invocation_metadata_rejects_reserved_implementation_name``,
# ``::test_set_invocation_metadata_rejects_reserved_implementation_version``,
# ``::test_invoke_rejects_reserved_implementation_name_at_boundary``,
# ``::test_invoke_rejects_reserved_implementation_version_at_boundary``;
# - OTel invocation span carries the attributes; inner spans do
# not:
# ``tests/unit/test_observability_otel.py::
# test_invocation_span_carries_implementation_attribution_attributes``;
# - OTel always-emit invariant under ``disable_provider_payload``,
# ``disable_genai_semconv``, ``disable_llm_spans``:
# ``::test_invocation_span_attribution_emits_under_disable_provider_payload``;
# - OTel attributes emit on every invocation span across a
# reused observer (3 sequential invocations):
# ``::test_invocation_span_attribution_emits_on_every_invocation``;
# - Langfuse Trace metadata carries the rows + always-emit
# invariant under ``disable_state_payload=True``:
# ``tests/unit/test_observability_langfuse.py::
# test_trace_metadata_carries_implementation_attribution_rows``,
# ``::test_implementation_attribution_rows_emit_with_disable_state_payload_enabled``;
# - Langfuse rows emit on every Trace across a reused observer (3
# sequential invocations):
# ``::test_implementation_attribution_rows_emit_on_every_trace``.
#
# Fixture 058 case 2 ("detached_subgraph_attribution_propagates_
# _to_child_trace_invocation_span") expects two ``openarmature.invocation``
# spans (parent + detached child trace), but fixture 008 establishes
# that detached subgraphs root in their subgraph-dispatch span — NOT
# in a separate invocation span. The two fixtures appear inconsistent.
# Not deferring 058's parsing (it parses cleanly), but the runtime
# exec contract for the detached-child-invocation-span case needs
# coord-thread resolution before activation. The python implementation
# emits the attribution attributes on every invocation span it opens
# (pinned by the multi-invocation test above), so the 0052 contract
# itself is honored.
[proposals."0052"]
status = "implemented"
since = "0.12.0"
# Spec v0.45.0 (proposal 0053). §3.4 shared-parent boundary
# clarification. Purely textual: tightens the structural-shared-parent
# classification to predicate the invocation span on whether at least
# one fan-out or parallel-branches dispatch is on the augmenter's
# call-stack path. Implementation-side: behavior already matches the
# clarified contract via fixtures 034 (outermost-serial augmentation
# reaches the invocation span) and 039 (nested cases do not). No
# module-level change required.
[proposals."0053"]
status = "textual-only"
since = "0.12.0"
# Spec v0.46.0 (proposal 0054). Per-invocation observer event drain
# (``CompiledGraph.drain_events_for(invocation_id, *, timeout) ->
# DrainSummary``). Shipped in v0.12.0 — the architectural pair to
# 0048's §9.4 queryable observer accumulator lifecycle. Engine
# implementation: per-invocation waker Futures on the existing
# ``_DrainCounters``; ``deliver_loop`` fulfils waiters whose target
# delivered-count has been reached. Reuses the existing
# ``DrainSummary`` shape verbatim per the
# discuss-per-invocation-event-drain coord thread's Q4 direction.
# Default timeout is 5.0 seconds (recommended-value nudge per the
# coord-thread Q3 direction; spec leaves the default to the
# implementation).
#
# Key divergence from process-wide ``drain()``: per-invocation drain
# MUST NOT cancel the deliver worker on timeout (the graph remains
# active and other invocations may still be in flight); ``drain()``
# cancels because it's a shutdown primitive.
#
# Conformance fixtures (graph-engine/028-033) stay deferred from the
# cross-capability parser pending the upcoming spec conformance-
# adapter capability — same Path A reasoning as the 0048 fixtures.
# Behavior is pinned by unit tests:
# - basic synchronization (mirrors fixture 028):
# ``tests/unit/test_drain.py::
# test_drain_events_for_basic_synchronization``;
# - snapshot semantic / no-deadlock-on-own-completed-event
# (mirrors fixture 029):
# ``::test_drain_events_for_snapshot_semantic_does_not_wait_for_own_completed_event``;
# - worker-NOT-cancelled-on-timeout (mirrors fixture 030, the
# load-bearing divergence-from-drain contract):
# ``::test_drain_events_for_timeout_does_not_cancel_worker``;
# - invocation-scope isolation (mirrors fixture 031):
# ``::test_drain_events_for_invocation_scope_isolation``;
# - fan-out coverage (mirrors fixture 032; subgraph descents share
# parent counters):
# ``::test_drain_events_for_covers_fan_out_instance_events``;
# - parallel-branches coverage (mirrors fixture 033):
# ``::test_drain_events_for_covers_parallel_branches_events``;
# - zero-timeout non-blocking check:
# ``::test_drain_events_for_zero_timeout_is_non_blocking_check``;
# - unknown invocation_id returns clean summary:
# ``::test_drain_events_for_unknown_invocation_returns_clean_summary``;
# - negative + NaN timeout rejected at boundary:
# ``::test_drain_events_for_rejects_negative_timeout``,
# ``::test_drain_events_for_rejects_nan_timeout``.
[proposals."0054"]
status = "implemented"
since = "0.12.0"
# Spec v0.47.0 (proposal 0055). Conformance-adapter capability —
# descriptive ratification of the existing fixture / directive
# system. No code change; python's adapter is already structured
# per the spec text by virtue of having grown alongside the
# fixtures since proposal 0001. Matches the Textual impl-tracking
# precedent (0019 / 0026 / 0030 / 0051 / 0053).
[proposals."0055"]
status = "textual-only"
since = "0.13.0"
# Spec v0.48.0 (proposal 0056). Harness-chat capability — new
# harness sub-spec ratifying the chat-loop deployment shape
# (ChatMessage, conversation-history convention, send() callable,
# send_streaming() forward-looking surface, error-bucket → user-
# facing-reply mapping). Python does not yet ship a chat-harness
# binding; v0.13.0 leaves the capability not-yet-implemented.
[proposals."0056"]
status = "not-yet"
# Spec v0.51.0 (proposal 0057). LlmCompletionEvent field-set
# extension — eight additive request-side fields on the typed
# event variant + ``request_id`` → ``response_id`` rename + new
# ``response_model`` field. Python lands the field-set extension
# + rename + provider population in v0.13.0 PR 3a; OTel + Langfuse
# observers continue driving their §5.5 surface off the sentinel
# NodeEvent pair through this PR (observer migration to type
# discrimination is queued for follow-up PRs 3b / 3c against the
# same v0.13.0 release).
[proposals."0057"]
status = "implemented"
since = "0.13.0"
# Spec v0.53.0 (proposal 0058). Typed LLM failure event — second
# spec-normatively-typed event variant on the observer event union
# alongside LlmCompletionEvent. Field set mirrors LlmCompletionEvent's
# identity / scoping / request-side surface (17 fields) plus three
# failure-specific fields (error_category from the §7 normative
# category enumeration, optional vendor-specific error_type, always-
# present error_message). Dispatched alongside the §7 exception on
# the observer queue — caller-side exception flow unchanged.
# Mutually exclusive with LlmCompletionEvent on the same call. Python
# lands the typed variant + provider emission + OTel/Langfuse
# consumer migration in v0.13.0; same PR also drops sentinel-namespace
# NodeEvent emission for LLM events entirely from the bundled
# OpenAIProvider.
[proposals."0058"]
status = "implemented"
since = "0.13.0"
# Spec v0.54.0 (proposal 0059). Retrieval-provider capability —
# the ``EmbeddingProvider`` protocol + ``EmbeddingEvent`` /
# ``EmbeddingFailedEvent`` typed variants + OTel/Langfuse embedding
# mapping.
[proposals."0059"]
status = "implemented"
since = "0.16.0"
note = "Retrieval-provider embedding capability. The EmbeddingProvider protocol (retrieval-provider §3) ships as OpenAIEmbeddingProvider against POST /v1/embeddings (protocol fixtures 001-005 pass). The provider dispatches the typed EmbeddingEvent / EmbeddingFailedEvent (graph-engine §6) per embed() call, mutually exclusive, alongside the §7-category exception on failure. Both bundled observers render them: the OTelObserver emits an openarmature.embedding.complete span (observability §5.5.8) parented lineage-aware under the calling node, carrying the GenAI semconv subset (gen_ai.system / request.model / response.model / response.id / usage.input_tokens, gated by disable_genai_semconv) + the OA openarmature.embedding.input_count / .dimensions identity attrs + the payload-gated (disable_provider_payload) .input.strings / .request.extras -- no gen_ai.operation.name (deferred per the stable-only adoption policy), not gated by disable_llm_spans; failure renders ERROR status + error.type + an exception event + openarmature.error.category. The LangfuseObserver renders a dedicated Embedding observation (asType embedding, §8.4.5) with model = response_model-or-model, usageDetails.input, the openarmature_input_count / _dimensions / _response_id metadata, and the payload-gated input strings + output vectors (the output sourced from EmbeddingEvent.output_vectors per proposal 0089); failure renders an ERROR-level Embedding observation with error_category as statusMessage, error_type / error_message in metadata, and no output. Conformance fixtures 074-083 + 137 pass. The §11 embedding-metrics path (fixture 089) is proposal 0067's metrics surface (one GenAI instrument across LLM + embedding calls), tracked and deferred under 0067, not part of 0059's own observability surface. Wire-format details (0079) + input_type (0077) + rerank (0060) are separate proposals."
# Spec v0.70.0 (proposal 0060). Retrieval-provider rerank protocol — the
# ``RerankProvider`` surface + ``RerankEvent`` / ``RerankFailedEvent`` typed
# variants + OTel ``openarmature.rerank.complete`` span / Langfuse Retriever
# observation / rerank metrics. Sibling to the embedding surface (0059).
[proposals."0060"]
status = "implemented"
since = "0.16.0"
note = "Retrieval-provider rerank protocol. The RerankProvider protocol (retrieval-provider §5) + the RerankResponse / ScoredDocument / RerankUsage / RerankRuntimeConfig response types (§6) + the RerankRuntimeConfig runtime config (§2) ship, alongside the CohereRerankProvider reference reranker against POST /v2/rerank (§8.4, Cohere-shape): the request body is {model, query, documents (string array), top_n from top_k}, return_documents is a silent no-op (the Cohere wire has no such field), and max_tokens_per_doc rides the extras pass-through bag. The provider parses {id, model?, results: [{index, relevance_score, document?}], meta.billed_units.{search_units, input_tokens}}, sorts results by relevance_score descending, reads the document echo only when present (never auto-filled), builds a RerankUsage record only when the provider surfaces >= 1 usage figure (else usage = null, never fabricated), and enforces the §6 invariants -- valid index into the input documents, no duplicate index, len(results) <= top_k when supplied -- raising provider_invalid_response otherwise. Pre-send validation raises provider_invalid_request on an empty query, an empty documents list, or top_k <= 0 (top_k MAY exceed len(documents)). The provider dispatches the typed RerankEvent / RerankFailedEvent (graph-engine §6) per rerank() call, mutually exclusive, alongside the §7-category exception on failure; RerankEvent.output_results is populated unconditionally on success (proposal 0089). The §7 categories reuse the shared llm-provider taxonomy. Both bundled observers render the rerank events (0060b): the OTelObserver emits an openarmature.rerank.complete span (observability §5.5.13, SpanKind.CLIENT) parented lineage-aware under the calling node, carrying the GenAI semconv subset (gen_ai.system / request.model / response.model / response.id + the conditional usage.input_tokens, gated by disable_genai_semconv) + the OA openarmature.rerank.query_length (UTF-8 bytes) / .document_count / .top_k (omitted when null) / .result_count identity attrs + the conditional .search_units + the payload-gated (disable_provider_payload) .query / .documents / .results (the results sourced from RerankEvent.output_results per proposal 0089) -- no gen_ai.operation.name (deferred, no upstream rerank coverage), not gated by disable_llm_spans; failure renders ERROR status + error.type + an exception event + openarmature.error.category. The LangfuseObserver renders a dedicated Retriever observation (asType retriever, §8.4.7) with model = response_model-or-model, usageDetails.{input, searchUnits} (omitted when usage = null), the openarmature_query_length / _document_count / _top_k / _result_count / _response_id metadata, and the payload-gated input {query, documents} + output results; failure renders an ERROR-level Retriever observation with error_category as statusMessage, error_type / error_message in metadata, and no output. Protocol fixtures 006-012 + observability fixtures 099-108 / 138 / 141 / 142 pass. The §11 rerank-metrics path (fixture 109) is proposal 0067's metrics surface (one GenAI instrument across LLM + embedding + rerank calls), tracked and deferred under 0067 (cf. 089), not part of 0060's own observability surface. Wire-format details (0090 Cohere rerank fixtures 028-031) are a separate proposal."
# Spec v0.55.0 (proposal 0065; repo pins v0.55.1). Failure-isolation
# cause fidelity at non-node placements (pipeline-utilities §6.3 /
# §11.7). At instance (§9.7), branch (§11.7), and parent-node
# middleware sites the engine wraps the originating error as a §4
# ``node_exception`` carrier before isolation catches it;
# ``FailureIsolatedEvent.caught_exception.category`` now resolves
# THROUGH that carrier to the originating cause instead of reporting the
# masking ``node_exception``. Fixture 064 (three cases) passes;
# node-level placement (fixture 061) was already faithful. The pin is
# v0.55.1 rather than v0.55.0 because v0.55.1 adds an observability §11
# span-links text reconciliation (no proposal, no python-observable
# change).
[proposals."0065"]
status = "implemented"
since = "0.14.0"
# Spec v0.56.0 (proposal 0066). Fan-out failure-isolation degrade
# contribution (pipeline-utilities §9.3 / §9.8 / §11.7). A degraded
# fan-out instance is a success whose contribution IS its degraded_update
# (subgraph-space, read by subgraph field name; ``extra_outputs`` keyed by
# subgraph field too, fixing a latent drop). A static degraded_update
# omitting collect_field is a compile error
# (``fan_out_degraded_update_missing_collect_field``); a callable that omits
# it yields a graceful null slot (no raise). The §11.7 parallel-branches
# counterpart skips an uncovered projected field. Fixture 065 (four
# cases) passes.
[proposals."0066"]
status = "implemented"
since = "0.14.0"
# Spec v0.68.0 (proposal 0067). OTel GenAI metrics (observability §11 new
# Metrics section + conformance-adapter §6.9 metric-capture primitive).
[proposals."0067"]
status = "partial"
since = "0.15.0"
note = "OTel GenAI metrics (observability §11): an opt-in enable_metrics flag (default off, normative name) on the bundled OTelObserver, independent of span emission (§11.1). When on, two OA-namespaced histograms record per provider-call ATTEMPT from the python-internal LlmRetryAttemptEvent (the per-attempt LLM-span source since 0050): openarmature.gen_ai.client.token.usage ({token}; two observations -- input + output token counts from the response usage record, openarmature.gen_ai.token.type dim) and openarmature.gen_ai.client.operation.duration (s; once per attempt INCLUDING failed attempts, error.type dim on failure), both configured with the §11.2 explicit bucket advisories. Dimensions: openarmature.gen_ai.operation ('chat'), gen_ai.request.model + gen_ai.system (recognized-core, used directly), openarmature.gen_ai.token.type, error.type. The Meter comes from the configured MeterProvider (injectable; falls back to the OTel global, which is the no-op meter when none is set). PARTIAL: the embedding-call metrics (the §11 embedding path, fixture 089) are deferred -- the embedding capability (proposal 0059, observability §5.5.8 / §5.5.9) now ships (v0.16.0) and dispatches EmbeddingEvent, so the remaining gap is wiring the §11 metric instruments to the embedding event (they record from the LLM per-attempt event only today). The LLM path (fixtures 088 / 090 / 091) is implemented and wired via a private MeterProvider + InMemoryMetricReader (the §6.9 metric-capture primitive). No Langfuse change (metrics are OTel-only). Streaming / server / rerank metrics + the cutover to the upstream gen_ai.client.* instrument names are out of scope per the proposal."
# Spec v0.57.0 (proposal 0068). Failure-isolation event structured cause
# chain (pipeline-utilities §6.3). ``caught_exception`` gains a ``chain`` of
# cause links (``{category, message, carrier}``, outermost->innermost), with
# graph-engine §4 ``node_exception`` carriers flagged. The existing
# ``category`` / ``message`` are redefined as a derivation over the chain (the
# outermost non-carrier link carrying a category), superseding 0065's single
# "originating cause" prose; the derivation reproduces 0065's values, so
# fixture 064 is unchanged. Fixture 066 (three cases: instance-site carrier
# chain, node-level single link, uncategorized null category) passes.
[proposals."0068"]
status = "implemented"
since = "0.14.0"
# Spec v0.58.0 (proposal 0070). Conformance-adapter crash/resume vocabulary,
# crash-injection, and cause-chaining (conformance-adapter §5.1 / §5.6 / §5.8).
# Two new adapter capabilities: ``crash_injection`` (``after_fan_out_instance``
# + ``after_node``) simulates a crash at a checkpoint boundary independent of
# an instance failure, and a recursive mock ``cause`` chains a failure mock's
# raised error to an originating cause. The crash/resume + saved-record +
# resume-outcome directives the proposal formalizes were already implemented.
# Fixture 067 (crash-injection fan-out resume) drives after_fan_out_instance
# end-to-end; after_node has a unit test (no fixture exercises it). Fixture
# 068 (failure-mock cause chain) pins 0068's outermost-wins derivation via the
# mock ``cause``.
[proposals."0070"]
status = "implemented"
since = "0.14.0"
# Spec v0.59.0 (proposal 0069). Fan-out degrade contribution refinements
# (pipeline-utilities §9.3, refining 0066). Three refinements python already
# satisfied: (1) an omitted ``extra_outputs`` source contributes NULL at the
# instance's positional slot (index-aligned with target_field), not "not
# contributed"; (2) an absent ``collect_field`` on any fan-in path is a null
# slot and the fan-in MUST NOT raise -- with the caveat that under a strict-
# element reducer (``concat_flatten`` / ``merge_all``) a null contribution
# still raises ``ReducerError`` (python does not suppress it; the reducer runs
# in the engine merge); (3) a degraded slot survives a checkpoint + resume
# round-trip. No library behavior change. Fixture 069's FI-degrade cases run
# in test_pipeline_utilities, its crash_injection/resume case in
# test_checkpoint; the strict-reducer caveat has a focused unit test.
[proposals."0069"]
status = "implemented"
since = "0.14.0"
# Spec v0.60.0 (proposal 0071). Conformance-adapter failure-mock directive
# catalog (conformance-adapter §5.1) -- descriptive documentation of the
# failure-mock family the adapter already implements.
[proposals."0071"]
status = "textual-only"
since = "0.14.0"
note = "Descriptive catalog of the failure-mock family (flaky + failure_sequence, flaky_by_index, flaky_per_index, flaky_instance_only, flaky_resume_aware) that the adapter already implements and the existing retry / failure-isolation / checkpoint-resume fixtures exercise; no new behavior, no new fixtures, no code change. Mirrors 0055's textual-only treatment of the conformance-adapter capability. The success-state naming drift (success_update / on_success / success_compute) is documented as-is by the proposal and left unchanged."
# Spec v0.61.0 (proposal 0061). Detached-trace invocation span
# (observability §4.4 / §4.3 / §4.1 / §4.2 / §5.1).
[proposals."0061"]
status = "implemented"
since = "0.15.0"
note = "The OTel observer synthesizes an openarmature.invocation span at the root of each detached trace (a detached subgraph + each detached fan-out instance), carrying the parent's SHARED invocation_id (detached mode is observer-side trace rendering, not a new run) and the detached unit's own entry_node; the detached subgraph / instance span nests under it. A raising detached subgraph surfaces ERROR + the category + an OTel exception event on BOTH the parent dispatch span and the detached invocation span. Observer-side only -- no graph-engine change; the Langfuse observer is unchanged (its Trace entity already plays the invocation-level-container role). Fixtures 008 (rewritten) and 058 (newly wired) run in test_observability."
# Spec v0.69.0 (proposal 0063). Tool-execution observability (graph-engine
# §6 instrumentation scope + two typed events; observability §5.5.11 OTel tool
# span + §8.4.6 Langfuse Tool observation).
[proposals."0063"]
status = "implemented"
since = "0.15.0"
note = "A node-body tool-call instrumentation scope (with_tool_call, a sync context manager modelled on with_active_prompt) the caller wraps a tool execution in; OA observes (does NOT run / select / loop / feed back). On result it dispatches ToolCallEvent; on raise it dispatches ToolCallFailedEvent and RE-RAISES (observe, don't swallow). The two typed §6 events carry identity/scoping + tool_name / tool_call_id (links back to LlmCompletionEvent.output_tool_calls, null for a standalone instrumented function) / arguments / latency_ms / call_id; ToolCallEvent adds result, ToolCallFailedEvent adds error_type + error_message and deliberately NO error_category (tool code has no closed §7 taxonomy). OTel: an openarmature.tool.call span (note .call, not .complete) parented under the calling node, OA-namespace openarmature.tool.{name,call.id,call.arguments,call.result} attrs + standard error.type on failure (ERROR status + exception event); the Development gen_ai.tool.* / execute_tool surface is mirrored, NOT emitted in v1. Langfuse: the dedicated Tool observation (asType=tool) -- python's first non-Span/Generation observation type -- input=arguments, output=result, tool_name/tool_call_id in metadata, ERROR level + error fields on failure. arguments/result are payload, gated by disable_provider_payload (no new flag); disable_llm_spans does not gate the tool span. v1 ships the inline bracketing form; the deferred start/complete split is a spec MAY, not yet needed. Fixtures 092-098 run in test_observability (092-095 typed-event-collector, 096/097 OTel span_tree, 098 Langfuse Tool observation)."
# Spec v0.62.0 (proposal 0064). Langfuse trace.sessionId / trace.userId
# population (observability §8.4.1 / §8.10).
[proposals."0064"]
status = "partial"
since = "0.15.0"
note = "The Langfuse observer promotes a recognized userId caller-metadata key to the first-class trace.userId (additive: the key also stays in trace.metadata.userId), and sets trace.sessionId from openarmature.session_id when present. trace.userId is LIVE (sourced from 0034 caller metadata): fixture 084 cases 2/3/4 (not-session-bound, userId present additive, userId absent) pass. partial because trace.sessionId is DORMANT -- openarmature.session_id is established by the sessions capability (0020, observability §5.6), unimplemented in python until v0.19.0, so there is no session_id source yet; the trace(session_id=) plumbing is wired end to end but the observer passes None. Fixture 084 session-bound cases 1 + 5 are deferred (per-case) pending 0020. Langfuse-only: no OTel change (the OTel side already carries openarmature.session_id + openarmature.user.* as span attributes; no trace-level OTel equivalent)."
# Spec v0.63.0 (proposal 0072). Per-fetch cache_ttl_seconds read-side
# control (prompt-management §5 / §6 + conformance-adapter §6.8).
[proposals."0072"]
status = "implemented"
since = "0.15.0"
note = "PromptBackend.fetch / PromptManager.fetch / get gain an optional cache_ttl_seconds read-side control (absent / None = current behavior; 0 = force a fresh read past any cache; N > 0 = bound a served entry's staleness to N seconds; negative is rejected). It governs only which cached entry MAY be served for this fetch, not whether / how the result is cached. python's bundled backends (filesystem, in-memory) are cacheless and treat it as a no-op; the manager threads it through the §9 fallback chain and rejects negatives. render is unchanged. The TTL semantics are exercised by a caching prompt-backend conformance-harness primitive (§6.8: caches by (name, label), source_read_count, advance_clock controllable clock); fixtures 033/034 pass. No production caching backend ships (per §5, cacheless backends no-op). The v0.63.1 pin also wires pipeline-utilities coverage fixtures 070/071 (already-implemented 0069/0070 behavior; no new proposal)."
# Spec v0.64.0 (proposal 0073). GenAI semconv adoption reconciliation
# (GOVERNANCE External-dependency adoption + observability §5.5 rationale).
[proposals."0073"]
status = "textual-only"
since = "0.15.0"
note = "Governance + observability §5.5 rationale change: reconciles the gen_ai.* adoption with upstream reality (the whole GenAI semconv surface is at Development status, and gen_ai.system was removed upstream in favor of gen_ai.provider.name). Adds a GenAI-scoped de-facto-interoperability carve-out (OA adopts the recognized core gen_ai.* names directly even at Development; peripheral attributes are mirrored to openarmature.*) and a post-adoption RETENTION rule (an adopted name is kept through an upstream rename / removal). No emitted-attribute change and no conformance-expectation change: python already emits the recognized core gen_ai.* set (including gen_ai.system, now RETAINED despite the upstream rename), so the existing gen_ai.* observability fixtures (e.g. 019-021) stand as the retention regression coverage. No python code and no new fixtures. The gen_ai.system -> gen_ai.provider.name migration is a deferred follow-on."
# Spec v0.65.0 (proposal 0074). Failure-isolation `catch` cause-chain category
# gate (§6.3) + public cause-chain classification primitive (§6.4).
[proposals."0074"]
status = "implemented"
since = "0.15.0"
note = "FailureIsolationMiddleware gains an optional `catch` set of error categories (§6.3): an exception is caught only if the DERIVED category of its cause chain (the outermost non-carrier link, resolved THROUGH node_exception carriers -- the same value reported as caught_exception.category) is in the set, composing with `predicate` as a conjunction (both default permissive, both unset = catch-all; a null derived category never matches a non-empty set). This classifies a carrier-wrapped failure correctly at a wrapping placement where a surface check sees only the carrier. The §6.4 cause-chain classification walk is promoted to a public primitive classify_cause_chain(exc) -> CaughtException (the existing failure-isolation record: chain + derived category + message) in openarmature.graph, shared by the catch gate, the emitted event, and any consumer. §6.1: the default retry classifier's single-level depth is documented as deliberate (re-run granularity vs §6.3 full-chain degrade); no behavior change. Fixture 072 (catch matches through an instance-placement carrier and degrades; a non-matching catch propagates with no event). The optional native-exception-type catch sugar (spec MAY) is not shipped."
[proposals."0075"]
status = "implemented"
since = "0.15.0"
note = "ParallelBranchesNode gains two additive branch forms. (1) Inline-callable branches (§11.1.1): a BranchSpec may give its work as `call` (an async function over the parent state returning a parent-shaped partial update) instead of a compiled `subgraph` + inputs/outputs projection; the contribution is the returned partial directly, merged via the parent reducer with no projection (§11.4). Exactly one of subgraph/call per branch, and a callable branch declares no inputs/outputs, else parallel_branches_invalid_branch_spec (a new compile-time category); a node MAY mix subgraph and callable branches. Per-leg failure isolation on a callable branch is the existing §11.7 branch-middleware contract (wrap the callable in FailureIsolationMiddleware). (2) Conditional branches (§11.10): a BranchSpec may carry an optional `when` predicate (parent_state) -> bool, evaluated once at dispatch; false skips the branch entirely (no dispatch, contribution, observer events, or span). All-branches-skipped is a valid no-op, distinct from the compile-time parallel_branches_no_branches (empty declared mapping). graph-engine §6 / observability §5.7: a callable branch is the unit -- it emits one started/completed pair keyed by branch_name (rendered as a branch span via the existing §5.7 machinery), a skipped branch emits nothing. Fixtures 073 (two callable branches merge to disjoint fields), 074 (when false skips / true dispatches), 075 (callable branch + FailureIsolationMiddleware degrades, sibling completes, category resolves through the chain)."
# Spec v0.67.0 (proposal 0076). Tool-call request observability on the
# LLM completion span (observability §5.5.1 / §5.5.10 / §5.5.5,
# graph-engine §6).
[proposals."0076"]
status = "implemented"
since = "0.15.0"
note = "The model's output tool calls get an output-side home on the openarmature.llm.complete span. observability §5.5.10 adds the UNGATED identity projections openarmature.llm.output.tool_calls.count / .names / .ids (the class of openarmature.llm.model / attempt_index; emitted only on a tool-calling completion, omitted entirely otherwise -- not count=0); .names and .ids are index-aligned in request order, .count equals their length. §5.5.1 adds the GATED openarmature.llm.output.tool_calls, the full [{id, name, arguments}] serialization (reusing the §5.5.5 input tool-call encoding) carrying the arguments, suppressed under disable_provider_payload and subject to the truncation contract. graph-engine §6: LlmCompletionEvent gains an output_tool_calls field (the ToolCall records, populated unconditionally). python carries the field on BOTH the terminal LlmCompletionEvent (spec-conformance + the Langfuse/consumer path) and the python-internal per-attempt LlmRetryAttemptEvent, and the OTel observer renders the span attributes from the per-attempt event (the LLM-span source since 0050) -- mirroring how output_content already works. OA-namespace, no gen_ai.* mirror (the attempt_index precedent). Langfuse request-side mapping is OUT OF SCOPE (proposal defers it as future work); no Langfuse change. Fixtures 085 (two calls -> count/names/ids), 086 (no calls -> family absent), 087 (payload-gating: identity survives off, gated full present only on)."
# Spec v0.71.0 (proposal 0062). LLM completion streaming -- an opt-in
# stream flag on complete() emitting a per-chunk LlmTokenEvent plus the
# §6 streaming-assembly reassembly into the atomic Response. Python has
# not yet shipped streaming; v0.16.0 leaves it not-yet. llm-provider
# fixtures 059/060 and observability fixtures 111-118 defer with it.
[proposals."0062"]
status = "not-yet"
# Spec v0.72.0 (proposal 0077). Retrieval-provider TEI wire mapping
# (§8 / §8.1) plus the input_type embedding knob (§2 / §3). The first
# concrete §8 mapping; introduces the conformance wire-capture directive
# family reused by 0078 / 0079 / 0090 / 0091.
[proposals."0077"]
status = "implemented"
since = "0.16.0"
note = "Retrieval-provider TEI (Text Embeddings Inference) wire mapping (§8 / §8.1) -- the first concrete §8 mapping. EmbeddingRuntimeConfig gains the declared input_type field (§2 / §3, the cross-vendor query/document knob; absent = symmetric), flowed into EmbeddingEvent.request_params with absence-is-meaningful semantics (graph-engine §6). Two bundled providers ship: TeiEmbeddingProvider posts POST {base_url}/embed with {inputs[, prompt_name][, dimensions]} -- input_type is realized as TEI's native prompt_name looked up from the construction input_type -> prompt_name map (server-side prompts), or a client-side query_prefix / document_prefix prepend when only prefixes are configured; absent input_type sends neither (byte-identical to the symmetric path). TEI /embed returns a bare vector array in input order and no usage object, so EmbeddingResponse.usage = null (never fabricated). TeiRerankProvider posts POST {base_url}/rerank with {query, texts, truncate: false, return_text} -- texts maps directly onto documents, return_documents -> return_text; it parses the bare [{index, score, text?}] response, reads the text echo only when present, sorts by score descending, and carries response_id + usage null. It implements the MANDATORY rerank chunk-and-stitch (§8.1): when len(documents) exceeds the construction chunk_size (default 32, TEI's max-client-batch-size) it splits into consecutive <= chunk_size slices, issues one /rerank per slice (same query), re-bases each chunk's response index to its absolute position, concatenates, then applies §6 -- a GLOBAL sort by score descending and top_k AFTER the stitch, never per-chunk. truncate: false is sent explicitly on /rerank (fail-loud); the resulting TEI over-length error (HTTP 413 / 422) maps to provider_invalid_request (§7), joined by 400; other statuses map like the sibling providers (401/403 auth, 429 rate_limit, 404 invalid_model, else unavailable). Both providers dispatch the typed EmbeddingEvent / RerankEvent (graph-engine §6) per call, mutually exclusive with the failure variant. genai_system = 'tei'. Conformance fixtures 013-017 pass, driven through a new general wire-capture harness (mapping directive; tei_embedding_provider / tei_rerank_provider construction blocks; expected_wire_request as a single body or a per-chunk list + expected_wire_request_count + expected_wire_request_absent_keys, asserting the exact wire key set and the /embed / /rerank path) reused by the deferred 0078 / 0079 / 0090 / 0091 fixtures. The embed client-side chunk-and-stitch (0092, fixture 038) stays deferred."
# Spec v0.73.0 (proposal 0078). Retrieval-provider Jina hosted wire
# mapping (§8.2), in the §8 mapping family established by 0077.
[proposals."0078"]
status = "implemented"
since = "0.16.0"
note = "Retrieval-provider Jina hosted wire mapping (§8 / §8.2) -- a §8 mapping in the family established by 0077. Two bundled providers ship, distinct instances (one model each) sharing the hosted endpoint: base_url defaults to https://api.jina.ai (origin only; the provider appends /v1/embeddings / /v1/rerank), and the required api_key is sent as Authorization: Bearer <key> (§8.2 *Construction*). JinaEmbeddingProvider posts POST {base_url}/v1/embeddings with {model, input, task?, dimensions?, truncate: false} -- input_type is realized as Jina's native `task` per the closed set (query -> retrieval.query, document -> retrieval.passage); absent input_type omits `task` (the symmetric default), and an unrecognized input_type is a pre-send provider_invalid_request (§7, no request issued). dimensions -> Jina's dimensions (Matryoshka) when set; truncate: false is sent explicitly (fail-loud). It parses the object envelope {model, usage: {total_tokens}, data: [{index, embedding}]}, orders the vectors by data[i].index into input order, and maps usage.total_tokens -> EmbeddingUsage.input_tokens (Jina reports usage, unlike TEI's null -- a record when the body surfaces it, never fabricated). JinaRerankProvider posts POST {base_url}/v1/rerank with {model, query, documents, top_n?, return_documents, truncation: false} -- documents maps directly onto the string array (no per-document wrapping), top_n <- top_k (omitted when None), and return_documents is sent EXPLICITLY (Jina's wire default is true but OA's is False, §2, so the mapping sends the resolved OA value). truncation: false is sent explicitly (fail-loud). It parses {model, usage: {total_tokens}, results: [{index, relevance_score, document?}]} (Cohere-shaped relevance_score), reads the document echo only when present (never auto-filled), sorts by relevance_score descending, enforces the §6 invariants (valid index, no duplicate, len(results) <= top_k), and maps usage.total_tokens -> RerankUsage.input_tokens with search_units null (Jina meters by tokens). raw is the verbatim response dict on both surfaces. Errors map per §8.2: 401/403 -> provider_authentication, 429 -> provider_rate_limit (NOT provider_unavailable), 404 -> provider_invalid_model, 422 (over-length / malformed) -> provider_invalid_request, else -> provider_unavailable. Jina enforces no per-call embed cap (server-side batching), so there is no client-side chunk-and-stitch. Both providers dispatch the typed EmbeddingEvent / RerankEvent (graph-engine §6) per call, mutually exclusive with the failure variant; input_type flows into EmbeddingEvent.request_params with absence-is-meaningful semantics, and RerankEvent.output_results is populated unconditionally on success (proposal 0089). genai_system = 'jina'. Conformance fixtures 018-022 pass, driven through the general wire-capture harness (0077) extended with an expected_wire_headers subset assertion locking the Authorization: Bearer <api_key> header on the outbound request."
# Spec v0.74.0 (proposal 0079). Retrieval-provider OpenAI-compatible
# embeddings wire mapping (§8.3), in the §8 mapping family established by
# 0077.
[proposals."0079"]
status = "implemented"
since = "0.16.0"
note = "Retrieval-provider OpenAI-compatible embeddings wire mapping (§8 / §8.3) -- a §8 mapping in the family established by 0077, formalized over the OpenAIEmbeddingProvider that shipped with the embedding capability (0059). base_url defaults to https://api.openai.com (origin only; the provider appends /v1/embeddings) and is overridable for any OpenAI-compatible backend (vLLM / LocalAI / TEI's OpenAI surface) -- gen_ai.system 'openai' names the WIRE SURFACE, not the backing deployment (fixture 025); the api_key is sent as Authorization: Bearer <key> (§8.3 *Construction*). OpenAIEmbeddingProvider posts POST {base_url}/v1/embeddings with {model, input, dimensions?} -- input is always the array form (§3), and dimensions -> the wire dimensions field (Matryoshka) when set. input_type is a NO-OP on the base wire: the OpenAI /v1/embeddings wire has no query/document field, so an absent input_type is the correct symmetric default and the mapping does not error on a supplied one -- the wire body is byte-identical to the no-input_type request, input sent verbatim (fixture 026). input_type STILL flows into EmbeddingEvent.request_params with absence-is-meaningful semantics (empty when absent), decoupled from the wire body so it never leaks onto the wire. For an asymmetric model behind a compatible endpoint the construction MAY bind the §8.1 client-side query_prefix / document_prefix -- input_type then selects which prefix to prepend to each input client-side, the only way to express the query/document distinction on a wire with no input_type field (fixture 027); the un-prefixed caller intent is what reaches the event. encoding_format ('base64') rides the extras-pass-through bag (the mapping does not send it by default; OpenAI's wire default is 'float'). It parses the object envelope {object, data: [{object, index, embedding}], model, usage: {prompt_tokens, total_tokens}}, orders the vectors by data[i].index into input order, and maps usage.prompt_tokens -> EmbeddingUsage.input_tokens (total_tokens == prompt_tokens; embedding has no output tokens); response_id is null (OpenAI embeddings carry no id). Errors map per §8.3: 401/403 -> provider_authentication, 429 -> provider_rate_limit, 404 -> provider_invalid_model, 400/422 (malformed / oversized) -> provider_invalid_request, else (5xx) -> provider_unavailable. The client-side embed chunk-and-stitch over OpenAI's 2048-input cap (0092) stays out of scope here. genai_system = 'openai'. Conformance fixtures 023-027 pass, driven through the general wire-capture harness (0077) with the expected_wire_headers Authorization: Bearer assertion (0078). The §8.1 client-side prefix lookup is now a shared retrieval helper (client_side_prefix), adopted by both TEI (0077) and OpenAI."
# Spec v0.75.0 (proposal 0080). PromptGroup arity enforcement
# (prompt-management §10 / §11 -- construct-time raise plus the new
# prompt_group_invalid error category). Implemented since 0.17.0;
# prompt-management fixture 035 pins it.
[proposals."0080"]
status = "implemented"
since = "0.17.0"
note = "PromptGroup already rejected fewer than two members, but as a bare ValueError (pydantic folds it into a ValidationError, which has no category). Now raises a categorized PromptGroupInvalid (new category prompt_group_invalid, prompt-management §11) at construction: PromptGroupInvalid is a PromptError (not a ValueError), so pydantic propagates it unwrapped from the model validator and the caller sees .category. Non-transient, not in PROMPT_TRANSIENT_CATEGORIES; exported from openarmature.prompts. Fixture 035 (single-member + empty group, each asserting raises.category = prompt_group_invalid) is un-deferred. Harness: PromptManagementFixture.backends is now optional (035 is cases-only with per-case backends, one case needing none) and the cases-runner builds per-case backends when a case declares its own backends key (else shares the top-level, preserving 016) and runs a manager-less case's direct-target calls instead of skipping them (035's empty-group construct_prompt_group needs no manager)."
# Spec v0.76.0 (proposal 0081). Conformance-adapter value-matcher
# vocabulary (§5.10) -- ratifies the fixture matcher tokens already in
# use. Descriptive (no fixture changes); the one tightening with teeth
# (<any-string> = non-empty) is already enforced by the adapter
# (tests/conformance/test_observability.py _value_matches rejects the
# empty string). No module-level change required; matches the
# conformance-adapter textual-only precedent (0055 / 0071).
[proposals."0081"]
status = "textual-only"
since = "0.16.0"
# Spec v0.77.0 (proposal 0082). Structured-output failure diagnostics
# (graph-engine §6 -- LlmFailedEvent response-side surface for
# structured_output_invalid + llm-provider §7 finish_reason / usage).
# Implemented since 0.17.0 across the 3-PR split: the event + error surface
# (PR A), the OTel error-span rendering + §11 token metric (PR B), and the
# Langfuse failed-Generation rendering (PR C).
[proposals."0082"]
status = "implemented"
since = "0.17.0"
note = "The graph-engine §6 event surface + llm-provider §7 error surface (PR A). LlmFailedEvent gains five response-side fields (output_content / finish_reason / usage / response_id / response_model), populated ONLY for structured_output_invalid (None for every other category); output_content is payload-bearing, the other four are not gated. StructuredOutputInvalid gains finish_reason / usage (the §7-mandated pair) plus response_id / response_model (internal, for the event builder), attached at the OpenAI provider's parse/validate call site where the intact wire response is in hand; the failed-event builder reads them off the enriched error. Un-defers observability fixtures 120 (truncation, finish_reason=length) / 121 (schema-mismatch, finish_reason=stop) / 122 (null-on-non-body companion), driven via the typed-event collector with a new calls_llm.response_schema harness lever; and llm-provider fixtures 022 / 023, whose carries block now asserts finish_reason + usage (the carries reader gained subset matching for a mapping-valued field like usage). PR B adds the OTel rendering + the metric: the per-attempt LlmRetryAttemptEvent now carries the same response-side surface on a structured_output_invalid failed attempt, so the OTel error span renders it (a structured_output_invalid failure falls through the failed-attempt early-return to render finish_reason / usage / gated output.content / response id+model while keeping ERROR status + category) and the §11.2 token-usage histogram records the failure's usage (the metric already recorded whenever usage was present; a structured failure now carries it). Un-defers observability fixtures 124 (OTel error span, payload on/off) and 125 (token metric on the failure). PR C completes it with the Langfuse failed-Generation rendering: _handle_typed_llm_failed renders output (payload-gated) + usage on the ERROR Generation and _typed_event_metadata renders finish_reason / response id+model for a structured_output_invalid failure (the isinstance(LlmCompletionEvent) guard widened to include it), alongside the existing level=ERROR + statusMessage=category. Un-defers observability fixture 123, driven in the dedicated test_observability_langfuse harness (calls_llm.response_schema threaded + expected_error handled). 0082 now fully implemented."
# Spec v0.78.0 (proposal 0083). Per-prompt token-budget observability
# (prompt-management §3 / graph-engine §6 / observability §5.5.15 / §7 / §8.4.3
# / §11.2). Implemented across three PRs; all six fixtures 126-131 run.
[proposals."0083"]
status = "implemented"
since = "0.17.0"
note = "Advisory, observability-only per-prompt token budget. PR A (completion path): a TokenBudget sub-record ({input_max_tokens?, total_max_tokens?}, non-negative) on Prompt / PromptResult, sourced from the same config sidecar as sampling (filesystem + langfuse backends); carried on LlmCompletionEvent / LlmFailedEvent / LlmRetryAttemptEvent (the OTel span + §11 metrics render from the per-attempt event). The OTel LLM span gains openarmature.prompt.token_budget.input_max_tokens / .total_max_tokens (each only when declared) + the reactive openarmature.llm.token_budget.exceeded boolean (emitted only when a bound is declared AND usage is present -- absent, not false, otherwise); two opt-in §11.2 instruments: openarmature.gen_ai.client.token_budget.exceeded counter (per breached bound) + .utilization histogram (actual / max per declared bound on every budgeted call), both dimensioned by openarmature.gen_ai.token_budget.kind = input | total. Evaluation gates each bound on its reported count being present (mirrors token.usage, does NOT coerce a missing count to 0); a declared bound of 0 is exceeded by any positive usage (strict >) but its utilization sample is skipped (ratio undefined). Un-defers fixtures 126-129. PR B (WARNING surfaces): the shared _token_budget_evaluations helper lifted to observability/llm_event.py; the Langfuse success Generation ends at level WARNING + statusMessage naming the breached bound(s) + metadata.token_budget on a breach (a hard ERROR still wins on the failure path); a §7 WARNING log per over-budget attempt on the openarmature.observability logger, dispatched independently of the disable_llm_spans / enable_metrics gates (correlates via correlation_id -- OA never activates spans, so no trace_id/span_id). Un-defers fixture 130. PR C (failure path): the budget evaluates on a usage-bearing structured_output_invalid failure exactly as on a completion (span + metrics + §7 log fall out of the generic per-attempt handling), and is populated-but-not-evaluated on a no-usage failure (provider_unavailable); the token-budget runner gained expected_error handling + the without-usage invariants. Un-defers fixture 131 (both cases). 0083 now fully implemented."
# Spec v0.81.0 (proposal 0084). Nested-fan-out span lineage chain
# (graph-engine §6 fan_out_index_chain / branch_name_chain +
# observability §4 / §5.5 lineage-resolved parent). Not-yet; graph-
# engine fixture 039 and observability fixtures 132-134 defer with it.
[proposals."0084"]
status = "not-yet"
# Spec v0.80.0 (proposal 0085). Nested-fan-out checkpoint resume
# lineage (pipeline-utilities §10.11 enclosing_fan_out_lineage).
[proposals."0085"]
status = "partial"
since = "0.16.0"
note = "The SAVE-side enclosing_fan_out_lineage keying (pipeline-utilities §10.11) shipped in #194: a fan-out instance's checkpoint tracking key carries the enclosing fan-out instance lineage in the in-memory dict and through the checkpoint projection / lookup / cleanup / restore, so concurrent outer instances no longer collide. partial because the RESUME consume-side is not yet shipped: a fan-out nested inside an outer instance re-runs rather than skipping on resume, since the saved record format carries no lineage (tracked as a follow-up). pipeline-utilities fixture 076 is not collected by the test_pipeline_utilities.py _LAST_DRIVEN_FIXTURE number gate (it is not deferred); the resume consume-side plus its fixture wiring land in a later PR."
# Spec v0.79.0 (proposal 0086). Service-wide default cache_ttl_seconds
# on PromptManager (prompt-management §6). Implemented since 0.17.0;
# prompt-management fixture 036 pins it.
[proposals."0086"]
status = "implemented"
since = "0.17.0"
note = "PromptManager construction gains an optional default_cache_ttl_seconds (prompt-management §6). fetch/get resolve cache_ttl_seconds by precedence: an explicit per-call value (including 0 force-fresh) wins; else the manager default; else None (the backend's own caching governs). An omitted or explicit-None per-call value both select the default, so resolution does not depend on argument-presence semantics. A negative default is rejected at construction; the per-call negative rejection from 0072 is unchanged and applies to the per-call value before resolution. get() delegates to fetch, so it inherits the chain unchanged; the bundled caching backends already honor a resolved cache_ttl_seconds (0072), so no backend change. Fixture 036 (default applied on omit + advance-clock aging + per-call 0 override) is un-deferred and driven via a manager: {default_cache_ttl_seconds} construction slot + target: {manager: true} fetches."
# Spec v0.82.0 (proposal 0087). Conformance-adapter within-node
# directive execution order (§8.3). Implemented since 0.17.0;
# observability fixture 135 pins it.
[proposals."0087"]
status = "implemented"
since = "0.17.0"
note = "Within-node directive execution order (conformance-adapter §8.3): a node's sibling directives execute in fixture-document order (mapping insertion order, not sorted-by-key). Python was already conformant -- the fixture loader uses yaml.safe_load, which preserves mapping insertion order, and the hand-built metadata driver (_apply_metadata_directives) iterates a node's directives in key order, so fixtures 043 / 045 (augment-then-capture vs capture-then-augment) already passed. This proposal ratifies that rule; the dedicated pin fixture observability/135 (the SAME two order-sensitive directives -- augment_metadata write + capture_invocation_metadata_into read -- in opposite document order across two cases, the captured snapshot diverging) is un-deferred and wired onto the existing metadata driver. No src change: the order-preserving load + key-order execution already satisfy §8.3, and a loader guard-comment pins the safe_load dependence per §8.2."
# Spec v0.83.0 (proposal 0088). Langfuse parallel-branches mapping
# parity (observability §8.4.8). Not-yet; observability fixture 136
# defers with it.
[proposals."0088"]
status = "not-yet"
# Spec v0.84.0 (proposal 0089). Embedding / rerank typed-event output
# (graph-engine §6 EmbeddingEvent.output_vectors / RerankEvent.
# output_results + observability output mappings).
[proposals."0089"]
status = "implemented"
since = "0.16.0"
note = "The embedding half shipped in 0059b (#198): EmbeddingEvent.output_vectors is populated by OpenAIEmbeddingProvider and rendered as the Langfuse Embedding observation output (observability §8.4.5), sourced event-side per 0089; observability fixtures 083 (re-sourced) + 137 pass. The rerank half now ships with the 0060b rerank observability: RerankEvent.output_results is populated unconditionally on success by CohereRerankProvider and rendered as both the OTel openarmature.rerank.results attribute (observability §5.5.13, payload-gated) and the Langfuse Retriever observation output (§8.4.7), sourced event-side per 0089; observability fixtures 108 + 138 pass. This completes 0089 across the embedding + rerank surfaces."
# Spec v0.85.0 (proposal 0090). Cohere rerank wire mapping
# (retrieval-provider §8.4, POST /v2/rerank; backs 0060's Cohere-shaped
# reference reranker).
[proposals."0090"]
status = "implemented"
since = "0.16.0"
note = "Retrieval-provider Cohere /v2/rerank wire mapping (§8.4) -- formalizes the wire the CohereRerankProvider reference reranker (shipped in 0060) already implements. POST {base_url}/v2/rerank with {model, query, documents (string array), top_n from top_k (omitted when None)}; documents sent as the string-array form (Cohere v2 takes strings only -- no per-document object / rank_fields). return_documents is NOT realized: the /v2/rerank wire has no such field and never echoes document text, so it is a silent no-op (ScoredDocument.document stays null on every result regardless of the config value, and the mapping does not error) -- the §8.3 'knob with no wire to land on' pattern. max_tokens_per_doc / truncation has no fail-loud option (Cohere truncates server-side to its 4096 default), so unlike §8.1 TEI / §8.2 Jina no truncate flag is sent; max_tokens_per_doc rides the extras-pass-through bag. The response {id, results: [{index, relevance_score}], meta.billed_units.search_units} maps onto §6: index / relevance_score to ScoredDocument, meta.billed_units.search_units to RerankUsage.search_units (input_tokens null), id to response_id; Cohere echoes no model field, so RerankResponse.model is the bound model; results sorted descending with the §6 valid-index / no-duplicate / result-count invariants enforced. base_url defaults to https://api.cohere.com per §8.4 (was a required arg), sent with api_key as Authorization: Bearer. Conformance fixtures 028-031 pass via the general wire-capture harness (cohere_rerank_provider block; request-origin asserted against base_url). The error map + rerank observability ride 0060 / 0060b."
# Spec v0.86.0 (proposal 0091). Cohere embeddings wire mapping
# (retrieval-provider §8.4, POST /v2/embed) extending §8.4 to both
# Cohere endpoints.
[proposals."0091"]
status = "implemented"
since = "0.16.0"
note = "Retrieval-provider Cohere /v2/embed wire mapping (§8.4) -- the embed half of §8.4, extending the vendor section to both Cohere endpoints (the §8.2 Jina embed+rerank pattern). CohereEmbeddingProvider posts POST {base_url}/v2/embed with {model, input_type, texts (string array), embedding_types: [float], truncate: NONE, output_dimension?}; base_url defaults to https://api.cohere.com (origin only; the provider appends /v2/embed), sent with api_key as Authorization: Bearer. input_type is a MANDATORY wire field (Cohere v2 requires it), so the mapping always sends a value from the closed set: query -> search_query, document -> search_document, and an ABSENT OA input_type -> search_document (the bulk-indexing default -- the case no other embed mapping has, since §8.1 / §8.2 omit the field when absent and §8.3 has none); an unrecognized OA input_type is a pre-send provider_invalid_request (§7, no request issued), NOT silently coerced to the default. Cohere's other input_type values (classification / clustering / image) are outside OA's {query, document} value space and not reachable through this mapping (input_type is a declared field, so it cannot ride the extras bag; widening it is a deferred change). embedding_types: [float] is sent EXPLICITLY (so the type-keyed response is guaranteed to carry the embeddings.float key the mapping reads); other precisions (int8 / uint8 / binary / base64) ride extras. dimensions -> Cohere's output_dimension (Matryoshka) when set, omitted otherwise. truncate: NONE is sent explicitly (fail-loud -- an over-length input errors rather than being silently truncated; the 400 maps to provider_invalid_request, the point where §8.4's embed half diverges from its rerank half). It parses {id, embeddings: {float: [[float, ...], ...]}, texts, meta: {billed_units: {input_tokens}}}: embeddings.float assembles to EmbeddingResponse.vectors IN INPUT ORDER (positional -- Cohere returns them in request order, NOT index-keyed like OpenAI / Jina data[]); meta.billed_units.input_tokens -> EmbeddingUsage.input_tokens (a record when the body surfaces it, else usage = null, never fabricated); top-level id -> response_id; Cohere echoes no model field, so EmbeddingResponse.model is the bound id. The §4 cross-impl invariants (one vector per input, uniform dimensionality) are enforced against the stitched result. It implements the MANDATORY batch chunk-and-stitch (§8.4 96-input cap / the §8 general embed rule): when len(input) exceeds 96 it splits into consecutive <=96 slices, issues one /v2/embed per slice with identical per-call params (only texts differs), concatenates the per-chunk embeddings.float in input order, sums input_tokens across chunks, and takes response_id from the first chunk; raw is the verbatim response object for a single call or the list of per-chunk objects for a chunked call (proposal 0096). One EmbeddingEvent per embed() call (the whole stitched call, not per chunk); input_type flows into EmbeddingEvent.request_params with absence-is-meaningful semantics (the caller's original query / document value, NOT the resolved search_document default the wire carries). Errors map per §8.4: 401/403 -> provider_authentication, 429 -> provider_rate_limit, 404 -> provider_invalid_model, 400/422 (malformed / over-length) -> provider_invalid_request, else -> provider_unavailable. genai_system = 'cohere'. Conformance fixtures 032-037 pass via the general wire-capture harness (cohere_embedding_provider block; request-origin asserted against base_url; the per-chunk expected_wire_request list + count for 037). The embedding observability + usage-nullable contract ride 0059b / 0093."
# Spec v0.87.0 (proposal 0092). Embedding-mapping batch chunking, the
# general §8 rule (consecutive <=cap chunks, one request each, vectors
# concatenated in input order, usage combined record-aware).
[proposals."0092"]
status = "implemented"
since = "0.16.0"
note = "Retrieval-provider general §8 *Batch chunking* rule for the embedding side + fixture 038 (TEI /embed chunk-and-stitch by the construction chunk_size). The shared chunk_and_stitch_embed helper in _wire.py realizes the rule mapping-agnostically: split the inputs into consecutive <=cap slices preserving order, issue one request per slice via a per-mapping closure (every field other than the chunked input list identical across slices), concatenate the per-chunk vectors in input order (so §4's one-vector-per-input + input-order invariants hold across the whole call, enforced against the stitched result), combine the per-chunk usage all-or-nothing (sum EmbeddingUsage.input_tokens only when EVERY chunk reports a figure, else usage = null -- a mixed report is an unaccountable total, never a partial sum or a fabricated figure), take response_id from the first chunk, and set raw to the single response for a single-request call or the list of per-chunk responses in request order (proposal 0096). TeiEmbeddingProvider.embed() adopts it with cap = its construction chunk_size (TEI's max-client-batch-size, default 32): an over-cap embed call chunk-and-stitches (fixture 038: chunk_size 2 over 5 inputs -> 3 /embed requests sized 2/2/1 with identical per-call params), and since TEI /embed reports no usage and no id the stitched usage is null and response_id is null; the len(input) <= chunk_size path issues a single /embed request (the pre-0092 behavior preserved). CohereEmbeddingProvider migrates its existing 96-input chunk path (0091, fixture 037) onto the same helper (cap = 96, closure POSTs /v2/embed) with identical behavior. OpenAIEmbeddingProvider adopts it at §8.3's fixed 2048-input cap (closure POSTs /v1/embeddings): an over-2048 embed call now chunk-and-stitches instead of sending one over-cap request the wire rejects. OpenAI's summed-token ceiling is NOT addressed by the count-based rule -- an over-token chunk still fails loud as provider_invalid_request. Jina is the cap-free mapping the rule exempts (server-side batching), so it does not chunk. The per-chunk vector count is validated before stitching so a positional misalignment cannot pass on a compensating total, and the response identity (response_id + response_model) is taken from the FIRST chunk -- the model falls back to the bound identifier for the wires that carry none (TEI's bare array, Cohere /v2/embed), while OpenAI reports the body's model per §4. Conformance fixtures 037 (Cohere, unchanged) + 038 (TEI) pass via the general wire-capture harness; no retrieval fixtures remain deferred. The spec ships NO §8.3 over-cap fixture, so the OpenAI chunking is covered by unit tests only (2049 inputs -> 2 requests sized 2048/1) -- flagged to spec as a fixture-set gap."
# Spec v0.88.0 (proposal 0093). Nullable provider usage records:
# EmbeddingResponse.usage / RerankResponse.usage become record|null and
# the embedding usage emission (OTel §5.5.8 gen_ai.usage.input_tokens,
# Langfuse §8.4.5 usageDetails.input) is conditional. One uniform model
# for "the provider reported no usage" across both responses and both
# typed events: no usage => usage = null, never fabricated.
[proposals."0093"]
status = "implemented"
since = "0.16.0"
note = "One uniform model across all four surfaces: a provider that reports no usage yields usage = null, never a fabricated record / zero / client-side estimate (§4 / §6). The response types were already widened (RerankResponse.usage is record | null from 0060a; EmbeddingResponse.usage from 0077), and both bundled observers already emitted the usage conditionally (OTel §5.5.8 gen_ai.usage.input_tokens guarded by `event.usage is not None`; Langfuse §8.4.5 usageDetails.input built only when a record is present), landed with the embedding observability in 0059b. Completed here: the OpenAIEmbeddingProvider no longer FABRICATES an EmbeddingUsage(input_tokens=0) when the OpenAI usage block is absent or malformed -- it surfaces usage = null (a *reported* zero still yields a record carrying 0; a malformed figure reads as not-reported rather than failing the call, since the vectors are sound and usage is secondary accounting -- the posture the Cohere and Jina mappings already took, and deliberately unlike the §6 document echo of 0097, where the corrupt field IS the payload). The other three embedding mappings were already conformant: TEI /embed and /rerank surface usage = null (§8.1 -- neither endpoint returns a usage object), and Cohere / Jina return null when the body reports no figure. The shared nonneg_int helper (one figure out of a vendor usage block: a non-negative int is reported, anything else is not) lifts into _wire.py and is adopted by all three of Cohere, Jina, and OpenAI. Conformance: the no-usage rendering fixtures 139 (OTel embedding span omits gen_ai.usage.input_tokens) + 140 (Langfuse embedding usageDetails carries no `input` key) are un-deferred and pass, joining the rerank pair 141 / 142 (wired with 0060b); retrieval fixtures 017 / 038 already assert usage: null for TEI /embed. Fixture 143 (embedding no-usage token METRIC not observed) stays deferred, and NOT for a 0093 reason: the OTelObserver records §11 GenAI metrics from the LLM per-attempt event only, so the embedding metric path does not exist yet -- 143 defers behind the same gate as 089, whose implementation (proposal 0067) realizes it. 0093 itself changes nothing in §11 or graph-engine §6 (both were already null-usage-aware), so no part of THIS proposal is left unimplemented by that carve-out; cf. 0060, marked implemented with the sibling metric fixture 109 deferred on the same grounds."