exec(unified): sync local build — kernel_port + dialect §11 + friction §12 + size threading

Lands the /root/dev local increments (share was ENOSPC; now writable) into the canonical repo:
- kernel_port.py: real ExecPort over the DITAv2 kernel (duck-typed; injected to_kernel_intent).
- dialect.py §11: BingX boundary — clientOrderId(H4)/dash/quantize/payload (PostOnly=timeInForce).
- friction.py §12: effective-bps + naive-baseline savings; side-lane journal that can't raise
  (b46ebd2); BingX commission-sign flip. DDL ships with code (register in applier verify-set).
- drive_loop/executor/working: Decimal size threaded through plan/working types (exit size cap).
All pure stdlib+Decimal, mutation-litmus RED on the two load-bearing asserts. 132 tests green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Codex
2026-07-15 08:05:26 +02:00
parent 21419b03d0
commit ec95bd6663
9 changed files with 968 additions and 5 deletions

View File

@@ -114,13 +114,14 @@ class UnifiedExecutor:
maker_plan = OrderPlan(
request_id=rid0, base_request_id=base, asset=request.asset, side=request.side,
action=action, method=ExecutionMethod.MAKER, limit_price=placement.limit_price,
attempt=0, reduce_only=reduce_only,
attempt=0, reduce_only=reduce_only, size=request.size,
)
await self.port.submit(maker_plan)
wo = build_working_order(
request_id=rid0, base_request_id=base, asset=request.asset, side=request.side,
action=action, limit_price=placement.limit_price, decision=decision,
clock=self.port.clock(), ttl_s=_ttl_seconds(request, decision), attempt=0,
clock=self.port.clock(), ttl_s=_ttl_seconds(request, decision),
size=request.size, attempt=0,
)
rejected = self.port.slot_view().stage in REJECTED_STAGES
cls = self.dl.after_submit(wo, rejected=rejected)
@@ -139,7 +140,7 @@ class UnifiedExecutor:
plan = OrderPlan(
request_id=rid0, base_request_id=base, asset=request.asset, side=request.side,
action=action, method=ExecutionMethod.TAKER, limit_price=Decimal(0),
attempt=0, reduce_only=reduce_only,
attempt=0, reduce_only=reduce_only, size=request.size,
)
await self.port.submit(plan)
await self.port.pump() # a market cross settles fast; drain it before returning