{
  "schema_version": "1.3.0",
  "slug": "what-exact-cursor-offsets-must-be-persisted-when-halting-large-stream-ingestions",
  "title": "What exact cursor offsets must be persisted when halting large stream ingestions?",
  "date_of_record": "2026 October 20",
  "scope": "* **Applies when:** The ingestion pipeline decouples source reading from sink writing (via buffering, batching, or asynchronous commits), and an interruption can leave a measurable gap between the two boundaries. * **Does not apply when:** ",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-exact-cursor-offsets-must-be-persisted-when-halting-large-stream-ingestions.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-exact-cursor-offsets-must-be-persisted-when-halting-large-stream-ingestions.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-exact-cursor-offsets-must-be-persisted-when-halting-large-stream-ingestions.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1364,
    "python_slice_tokens": 430,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The separation between **source read offset** (the exact position the consumer reached in the upstream stream partition) and the **durable sink commit watermark** (the exact record ID or offset that has been safely and durably persisted to the downstream sink). The source offset confirms what was *read*; the sink watermark confirms what was *saved*. Failing ...",
    "what_was_observed": "In streaming data pipelines and log-shipping agents, failing to bind source and sink offsets at halt produces three primary failure modes: 1. **Silent Data Loss:** The instance reads 1,000 records, buffers them, and saves the source offset `1000`. It crashes before flushing the buffer to the sink. The successor resumes at `1000`, and the 1,000 buffered records are permanently lost. 2. **Duplicate Re-Ingestion:** The ...",
    "condition_of_validity": "* **Applies when:** The ingestion pipeline decouples source reading from sink writing (via buffering, batching, or asynchronous commits), and an interruption can leave a measurable gap between the two boundaries. * **Does not apply when:** The pipeline uses exactly-once, transactional streaming (e.g., Kafka Connect with exactly-once semantics) where the sour...",
    "decision_boundary": "1. **Was the stream halted mid-ingestion?** If no, record standard completion. If yes, proceed to record both boundaries. 2. **Is the `sink_durable_commit_id` recorded?** If no, the successor has no ground truth for what was actually persisted. The instance must fail closed and escalate for manual reconciliation. 3. **Does the `source_partition_cursor` match...",
    "operational_effect": "1. **Data Loss Prevention:** Guarantees that no records are dropped by forcing the successor to resume from the last durable sink commit, not the last read offset. 2. **Idempotent Re-Play:** Allows the successor to safely re-ingest the gap records using the `idempotency_partition_key`, avoiding duplicate primary keys. 3. **Deterministic Reconciliation:** Rep..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "2325ae0f87355de20a86a90b16cb545c7e48d2ab6fa5c6ab04cc20dfc257f05c",
    "verified_classes": [
      "ResumptionVerdict",
      "StreamCursorState",
      "CursorManifest",
      "StreamCursorBinder"
    ],
    "verified_functions": [
      "_hash",
      "evaluate_halt_state",
      "verify_successor_resumption"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ValueError"
    ],
    "sample_fail_closed_invariants": [
      "An idempotency partition key is required to safely replay the gap.",
      "Source is ahead of sink but no uncommitted_buffer_hash was provided. Cannot guarantee gap integrity."
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "hashlib",
      "json"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
