Skip to main content

Module operation_context

Module operation_context 

Source
Expand description

Operation-context carrier for the Python endpoint machinery.

Stamps OPERATION_ENDPOINT / OPERATION_ADVERB on outgoing requests so failure surfaces (mailbox log, undeliverable formatter) can name the operation.

§Operation-context invariants (OC-*)

  • OC-1 (request-originated). Stamped at the caller’s request-send site. Only the caller knows the qualified endpoint and adverb.

  • OC-2 (filtered carry). Only keys marked @meta(OPERATION_CONTEXT_HEADER = true) ride this path. Adding another OPERATION_* key joins the vocabulary by declaration alone.

  • OC-3 (carry continuity). Captured headers are preserved onto the reply envelope at the Port capture site via send_with_headers.

Functions§

build_operation_context_attrs
Build an Attrs carrier populated with the operation-context keys an endpoint-send site wants to stamp onto its outgoing request.
stamp_operation_context
Stamp the operation-context subset of attrs onto headers using the shared marker-driven mechanism. Only entries whose declared key carries @meta(OPERATION_CONTEXT_HEADER = true) are written; anything else in attrs is silently skipped (OC-2).