ExtensionKind is the enum of tool-extension kinds (Wrapper / Transformer /
Backend). Each kind carries its distinguishing rules as explicit properties —
multiple (cardinality), preserves_schema and declares_schema (the
input-schema rule), preserves_output_shape (whether a minted branch may
inherit the base tool’s output schema), and relocates_execution (whether the
kind moves the tool body to another process) — so generic machinery keys off a
property, never off kind is WRAPPER. The per-kind extension shape is in
tai42_contract.extensions.kinds.
ExtensionKind
tai42_contract.extensions.ExtensionKind
[a, b]) binds one
variant per prefix (tool, tool_a, tool_a_b). No kind replaces a
tool in place.
WRAPPER— presents the wrapped tool’s input schema unchanged (minus its own declaredreserved_params); stackable.TRANSFORMER— presents its OWN composed input schema (a concrete makefun-presented signature, never bare*args/**kwargs); stackable.BACKEND— one execution-backend strategy per tool (multiple=False); no input-schema rule; relocates the tool body’s execution to a worker process (relocates_execution).
Members
multiple
tai42_contract.extensions.ExtensionKind.multiple
preserves_schema
tai42_contract.extensions.ExtensionKind.preserves_schema
declares_schema
tai42_contract.extensions.ExtensionKind.declares_schema
*args/**kwargs).
relocates_execution
tai42_contract.extensions.ExtensionKind.relocates_execution
requires_body_locality (its wrapper only works in the
process running the tool body, e.g. a proxy layer routing egress through
a task-scoped contextvar) must bind INSIDE any relocating extension, so
its wrapper travels with the body to the worker. Bound outside, the
relocating layer ships only the inner callable and the locality-requiring
wrapper stays behind in the submitting process, silently not applying.
preserves_output_shape
tai42_contract.extensions.ExtensionKind.preserves_output_shape
preserves_schema (which is about the INPUT schema): a WRAPPER returns
the wrapped tool’s result unchanged and a BACKEND swaps the execution
strategy but returns the same output shape (both preserve), while a
TRANSFORMER reshapes the result (does not preserve).
