# TA9 Safe Pre-HardStop Runtime Slot Design Freeze Audit

Updated: 2026-06-18 22:44:07

Scope:
- Static design review only.
- No EA trading logic, close logic, runtime gate, close priority, HardStop, HTE, Recovery, BasketClose, order sending, mq5/mqh source, or production logging was changed.
- The reviewed EA source SHA is 30490B2D7AAC6C0197CC65B326A7728E82A8E62759E7E9202741EF851430CA9B.
- Input latest.zip SHA matched expected value 7A8008A27F20184188423E18193F27BD918D0003B404A814092BB7FEF5DC1C24.

Decision:
- selected_design: TA9_SHADOW_SAME_TICK_SNAPSHOT_PRE_HARDSTOP_SLOT
- decision_class: TA9_SHADOW_DESIGN_READY
- P1_implementation_allowed: false
- shadow_logging_implementation_allowed: true

Why this is not P1-ready:
- A real TA9 close would require a pre-HardStop structural slot before the existing HardStop side-effect gate.
- That is a HardStop-relative order change for actual order sending, even if HardStopNow=true is never preempted.
- The six-log TA9 safe result is not a production safety proof; RECOVERY_CLOSE and BASKET_CLOSE were 0 in the sample.

What is design-ready:
- A non-intervening Shadow Logging evaluator can be inserted at a single source location:
  KOUCHA_GOLD_KIWAMI_SURVIVAL_TICK.mq5 / OnTick() / after lines 2155-2163 and before lines 2164-2171.
- It must send no orders.
- It must compute one immutable same-tick snapshot per basket/eval cycle and reuse it for TA9, existing-close eligibility, and HardStop parity fields.
- It must not rely on earlier EVAL_STAGE_TRACE fields that pass hardStop=false for diagnostic pre-HardStop stages.

TA5 fallback resolution:
- TA5 is not a valid fallback if the rule is "no pre-HardStop slot / no HardStop-relative order change".
- TA5 also needs the same structural slot to rescue HardStop baskets before the existing HardStop close gate.
- TA5 remains a lower-effect, simpler-condition fallback only if a pre-HardStop shadow/exit slot is already accepted.

Final recommendation:
- Do not implement TA9 or TA5 Exit yet.
- Next permitted step: implement Shadow Logging only, with the schema in ta9_shadow_logging_spec.txt and ta9_shadow_logging_schema.csv.
- After shadow logs prove same-tick distance/HardStop parity out-of-sample, revisit whether an actual pre-HardStop emergency close is acceptable.
