Expand description
集中 MsgHeader builder (v1.4.110 P0-1)
取代 v1.4.110 之前散落 15+ 处直接 odr_sys_cmn::MsgHeader { ... } /
sim_odr_sys_cmn::MsgHeader { ... } / trade_cmn::CryptoMsgHeader { ... }
构造模式. 普通 real/sim/crypto req_id 走
crate::trade_query::create_backend_req_id 派生;FIN BFF/position-action
命令则必须保留 durable intent owner 提供的 req_id. 两类路径都防止
v1.4.109 P0 类 dedupe bug (req_id 固定 → backend 幂等 cache → 误返 stale
order echo). 见
essentials/2026-05-16-0725-v1.4.109-place-order-msgheader-req-id-not-unique-root-cause-codex-handoff-zh.md.
配套 pre-push Check 6 (.githooks/pre-push, v1.4.110 P0-4) 用 grep 拦截
任何新加的直接构造, 强制走本 module 的 builder.
§四个 shape 差异
build_real→odr_sys_cmn::MsgHeader(real account, 7 fields, 含sub_account_id)build_sim→sim_odr_sys_cmn::MsgHeader(sim account, 7 fields, 含market替代sub_account_id)build_crypto→trade_cmn::CryptoMsgHeader(crypto, 仅 3 fields)build_fin_real→finpb_odr_sys_cmn::MsgHeader(BFF/position action, caller-owned durable request id + optional JP sub-account)
Functions§
- build_
crypto - 构造 crypto
trade_cmn::CryptoMsgHeader(仅 3 字段). - build_
fin_ real - Construct the FIN service real-account header used by Desktop BFF and position-action commands. These commands own a durable request id, so the caller supplies it instead of generating a transport-local id here.
- build_
real - 构造 real-account
odr_sys_cmn::MsgHeader. - build_
real_ trade_ account_ heartbeat - Build the global account-list heartbeat header.
- build_
sim - 构造 sim-account
sim_odr_sys_cmn::MsgHeader.