{"record":{"id":"68981189e3936e61","repo":"nautechsystems/nautilus_trader","slug":"continuous-future-chain-discontinuity-for-target","errorCode":null,"errorMessage":"Continuous future chain discontinuity for {target_bar_type}: previous post {previous} != current pre {pre_instrument_id}","messagePattern":"Continuous future chain discontinuity for (.+?): previous post (.+?) != current pre (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/data/src/engine/requests.rs","lineNumber":564,"sourceCode":"        }\n        previous_transition_time_ns = Some(transition_time_ns);\n\n        let pre_instrument_id =\n            parse_transition_instrument_id(row.get(\"pre_instrument_id\"), target_bar_type)?;\n        let post_instrument_id =\n            parse_transition_instrument_id(row.get(\"post_instrument_id\"), target_bar_type)?;\n        if pre_instrument_id.venue != target_venue || post_instrument_id.venue != target_venue {\n            anyhow::bail!(\n                \"Continuous future segment venue mismatch for {target_bar_type}: target venue {target_venue}, segment venues pre={}, post={}\",\n                pre_instrument_id.venue,\n                post_instrument_id.venue,\n            );\n        }\n\n        if let Some(previous) = previous_post_instrument_id\n            && pre_instrument_id != previous\n        {\n            anyhow::bail!(\n                \"Continuous future chain discontinuity for {target_bar_type}: previous post {previous} != current pre {pre_instrument_id}\",\n            );\n        }\n        previous_post_instrument_id = Some(post_instrument_id);\n\n        let pre_price = parse_transition_price(row.get(\"pre_price\"), row_value, \"pre_price\")?;\n        let post_price = parse_transition_price(row.get(\"post_price\"), row_value, \"post_price\")?;\n        if is_ratio && (pre_price <= Decimal::ZERO || post_price <= Decimal::ZERO) {\n            anyhow::bail!(\n                \"Continuous future ratio adjustment requires positive prices, was {row_value}\"\n            );\n        }\n\n        transitions.push(ContinuousFutureTransition {\n            transition_time_ns,\n            pre_instrument_id,\n            post_instrument_id,\n            pre_price,","sourceCodeStart":546,"sourceCodeEnd":582,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/data/src/engine/requests.rs#L546-L582","documentation":"The transition chain must be continuous: each row's pre_instrument_id must equal the previous row's post_instrument_id. A gap or jump between consecutive rolls breaks the stitched continuous series and is rejected.","triggerScenarios":"parse_transitions finds a row whose pre_instrument_id differs from the previous row's post_instrument_id — a missing intermediate roll, duplicated roll skipping a contract, or rows out of order after fixing timestamps.","commonSituations":"Deleting a roll row by accident; concatenating quarterly roll tables with a gap; sorting rows by time but one roll timestamp is wrong so the chain no longer lines up.","solutions":["Insert the missing transition row so each post connects to the next pre.","Re-sort rows by transition_time_ns after correcting any wrong timestamps, then re-verify the chain.","Programmatically assert transitions[i].pre == transitions[i-1].post before sending."],"exampleFix":"// before\nrows = [ ...ESZ5->ESH6, ESM6->ESU6 ] // missing ESH6->ESM6\n// after\nrows = [ ...ESZ5->ESH6, ESH6->ESM6, ESM6->ESU6 ]","handlingStrategy":"validation","validationCode":"for w in transitions.windows(2) {\n    assert_eq!(w[1].pre_instrument_id, w[0].post_instrument_id, \"chain discontinuity\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify chain linkage whenever roll data is assembled or merged","Check for missing rolls after deleting or filtering rows","Re-sort by time first; a wrong timestamp shows up as a chain break"],"tags":["validation","data-integrity","continuous-futures"],"backgroundTag":"schema-validation-failed","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}