{
  "schema_version": "1.3.0",
  "slug": "how-should-agents-detect-and-recover-from-silent-partial-results-during-streaming-inference",
  "title": "How should agents detect and recover from silent partial results during streaming inference?",
  "date_of_record": "2026 October 20",
  "scope": "* **Applies when:** The stream can terminate before completion, the agent cannot reliably distinguish complete from partial from the bytes alone, and downstream consumers care about completeness. * **Does not apply when:** The stream has an",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-agents-detect-and-recover-from-silent-partial-results-during-streaming-inference.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-agents-detect-and-recover-from-silent-partial-results-during-streaming-inference.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-agents-detect-and-recover-from-silent-partial-results-during-streaming-inference.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 977,
    "python_slice_tokens": 251,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The separation between **stream termination** (the connection closed) and **stream completion** (the producer actually finished the stream intentionally). Relying on termination alone creates the **Partial Result Acceptance**: the stream closes prematurely (network blip, server timeout, or proxy kill), the agent treats the partial output as complete, and dow...",
    "what_was_observed": "In streaming agent architectures, failing to detect partial results produces three primary failure modes: 1. **Silent Truncation:** An LLM streams a response, the connection drops after 100 tokens (not the full 500), and the agent proceeds as if the response were complete. 2. **Mid-Token Cutting:** The stream is cut mid-token, producing malformed JSON or invalid UTF-8, which the agent either silently repairs or misin...",
    "condition_of_validity": "* **Applies when:** The stream can terminate before completion, the agent cannot reliably distinguish complete from partial from the bytes alone, and downstream consumers care about completeness. * **Does not apply when:** The stream has an explicit completion signal that is included in every response (e.g., HTTP chunked transfer with proper close semantics,...",
    "decision_boundary": "1. **Did the stream include a `stream_completion_signal_receipt`?** If yes, standard processing applies. If no, the stream may be partial. 2. **Does the received stream length match the `expected_stream_length_hint`?** If yes, the stream is likely complete. If no, the stream is truncated. 3. **Was the terminal byte of the stream a valid boundary (end of toke...",
    "operational_effect": "1. **Silent Truncation Detection:** Prevents partial results from being treated as complete. 2. **Malformed Boundary Detection:** Catches mid-token truncation before parsing fails downstream. 3. **Deterministic Recovery:** Provides a recovery predicate for re-fetching the complete stream."
  },
  "matched_failure_symptoms": [
    "OOM_KILL_OR_MEMORY_EXHAUSTION"
  ],
  "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": "35491cfc154d7fe3080ec33bdc012beec5ab0692db0bdc56cb8013b1950e2dca",
    "verified_classes": [
      "PartialStreamVerdict",
      "StreamState",
      "StreamPolicy",
      "StreamManifest",
      "PartialStreamGuard"
    ],
    "verified_functions": [
      "_hash",
      "evaluate_stream"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 0,
    "raised_exceptions": [],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "hashlib",
      "json"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
