exec(unified): drive loop §7 — PINK _handle_expired_working ported + audit build items

drive_loop.py transcribes pink_direct.py:1089 (the 10-step expiry sequence) warts-and-all
against injected ports (ExecPort seam: clock+kernel+venue), so no ambient state (C1). Carries
the scar tissue: pump-before-cancel, re-classify-after-cancel (fill races cancel), EXIT never
strands→MARKET, slot-busy double-entry guard, fail-safe venue-truth requote gate. SEAM
learnings preserved as referenced comments (zero-silent-suppression rule). Decimal sizes (H1).

- working.py: WorkingRegistry + WorkingOrder, injected clock, rejected→expire_now (one shared
  path). contract.py: client_order_id_core(attempt) — unique per attempt (audit H4/FIX).
- _constants.py: REQUOTE_HOT_WINDOW_S=5.0 (prov: 2026-06-10 double-entry).
- inventory §6: audit build items BI-1..5 folded in.
- test_drive_loop.py: 15 scar-tissue tests. Mutation-verified RED under exit-no-escalate
  (kills 3) and no-hot-window (kills double-entry guard). Full exec_unified suite: 77 green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Codex
2026-07-14 23:51:04 +02:00
parent a7cf3f5976
commit 670b739a83
6 changed files with 655 additions and 5 deletions

View File

@@ -28,3 +28,9 @@ ACQUIRE_MAX_CHASES: int = 0
# Dead-man's stop default multiple of software SL distance (spec §10, §17 open
# question: 2× vs ATR-scaled). PROVISIONAL default.
PROTECTIVE_STOP_MULT_DEFAULT: Decimal = Decimal("2.0")
# Requote hot-window: after an OWN fill, refuse to re-quote for this long because the
# REST venue reconcile lags the WS fill by seconds — re-quoting inside it double-enters.
# Provenance: live double-entry, pink_direct.py:1055 / :1323 (2026-06-10). Measured in
# injected-clock seconds; the loop reads it, never a hardcoded literal in the branch.
REQUOTE_HOT_WINDOW_S: float = 5.0