First code of the Unified Execution Layer (SPEC_UNIFIED_EXEC_LAYER_20260714.md). Pure policy, stdlib+Decimal only, zero I/O, zero venue knowledge, zero importers elsewhere — adopting it breaks nothing (freeze-safe; operator unparked the build 2026-07-14). - contract.py: ExecutionRequest input surface (§2.1) + V-TYPES (Side, UrgencyClass, ProtectiveSpec, ExecutionAdvice), frozen, validated-at-construction, illegal states unrepresentable. 'an asset, a size, and a prayer'. - router.py: decide(request) -> RoutingDecision — total pure map of the §6 urgency ladder. Encodes A1 adjudication verdict in the architecture: Router=whether-maker, SmartPlacer=where-in-book via the wants_placement/pre_submit seam. Complementary. - _constants.py: policy magnitudes with provenance; PROVISIONAL ones flagged for L8/L10 calibration (never vibes, never a hardcoded cadence). - test_exec_unified.py: 26 behaviour + mutation-litmus tests. Verified RED under CATASTROPHIC->MAKER and ACQUIRE cross_on_expiry->True mutations. Not yet wired: PINK drive-loop port (§7), venue dialect (§11), telemetry (§12). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
32 lines
928 B
Python
32 lines
928 B
Python
"""Unified Execution Layer — the "T" of DITAv2 (spec SPEC_UNIFIED_EXEC_LAYER_20260714.md).
|
|
|
|
Standalone, pure-policy foundation. Contract (§2) + whether-maker Router (§6). Zero I/O,
|
|
zero venue knowledge, zero importers elsewhere yet — adopting it breaks nothing.
|
|
|
|
Not yet wired: the PINK drive-loop port (§7), the venue dialect (§11), telemetry (§12).
|
|
Those bolt on above/below this pure core. Kill switch discipline (UV_SMART_EXEC=0, §2.3
|
|
promise #5) lives at the wiring layer, not here.
|
|
"""
|
|
from __future__ import annotations
|
|
|
|
from .contract import (
|
|
ExecutionAdvice,
|
|
ExecutionRequest,
|
|
ProtectiveSpec,
|
|
Side,
|
|
UrgencyClass,
|
|
)
|
|
from .router import ExecutionMethod, RoutingDecision, TtlDiscipline, decide
|
|
|
|
__all__ = [
|
|
"ExecutionAdvice",
|
|
"ExecutionMethod",
|
|
"ExecutionRequest",
|
|
"ProtectiveSpec",
|
|
"RoutingDecision",
|
|
"Side",
|
|
"TtlDiscipline",
|
|
"UrgencyClass",
|
|
"decide",
|
|
]
|