PINK DITAv2: fix 4 Critical/High flaws (I1, G2, G3, I13, I18)
- I1 (Critical/Rust): apply_fill accumulated partial fills instead of overwriting. WS events carry lastFilledQty (incremental); previous code set slot.size = fill_size each time. Now accumulates via prev_filled. initial_size set from intended_size on first fill, not from fill amount. - G2 (Critical/Rust): into_c_string unwrap() panicked on any NUL byte in serialized JSON. Now sanitizes NUL bytes before CString construction; never panics. - G3 (Critical/Rust): EXIT intent transition hardcoded prev_state= POSITION_OPEN. Captured actual fsm_state before mutation so audit trail is accurate when EXIT is received from non-standard states. - I13 (High/Rust): stray venue event could reactivate a closed slot. Added explicit slot.closed guard in on_venue_event — returns TERMINAL_STATE with accepted=false before any FSM mutation. - I18 (High/Python): sys.path.insert(0, ...) in real_zinc_plane.py and real_control_plane.py gave Zinc adapter directory highest import priority. Changed to sys.path.append() so existing path entries take precedence. 35/35 offline tests pass. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -21,7 +21,7 @@ from .control import KernelControlSnapshot
|
||||
|
||||
_ZINC_ADAPTER_PATH = Path(__file__).resolve().parents[3] / "zinc" / "adapters" / "python"
|
||||
if _ZINC_ADAPTER_PATH.exists() and str(_ZINC_ADAPTER_PATH) not in sys.path:
|
||||
sys.path.insert(0, str(_ZINC_ADAPTER_PATH))
|
||||
sys.path.append(str(_ZINC_ADAPTER_PATH))
|
||||
|
||||
try: # pragma: no cover - exercised in integration tests
|
||||
from zinc import SharedRegion
|
||||
|
||||
Reference in New Issue
Block a user