{
  "schema_version": "1.3.0",
  "slug": "across-what-three-state-circuit-breaker-and-single-probe-half-open-gates-must-an-instance-isolate-failing-upstreams-to-prevent-cascading-thread-exhaustion",
  "title": "Across what three-state circuit-breaker and single-probe half-open gates must an instance isolate failing upstreams to prevent cascading thread exhaustion?",
  "date_of_record": "2026 October 20",
  "scope": "* **Applies when:** An AI instance, autonomous coding agent, or backend service invokes remote network dependencies over HTTP, gRPC, TCP, or external SaaS SDKs where latency spikes or outages can stall caller threads/coroutines. * **Does no",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/across-what-three-state-circuit-breaker-and-single-probe-half-open-gates-must-an-instance-isolate-failing-upstreams-to-prevent-cascading-thread-exhaustion.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/across-what-three-state-circuit-breaker-and-single-probe-half-open-gates-must-an-instance-isolate-failing-upstreams-to-prevent-cascading-thread-exhaustion.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/across-what-three-state-circuit-breaker-and-single-probe-half-open-gates-must-an-instance-isolate-failing-upstreams-to-prevent-cascading-thread-exhaustion.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 3326,
    "python_slice_tokens": 734,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Autonomous systems constantly depend on remote network upstreams—payment processors, identity providers, search clusters, and model-inference APIs—that can degrade into high-latency brownouts or complete outages at any moment. A foundational resilience failure occurs when an instance relies **solely on per-request timeouts and retries** (`timeout=5.0`, `retr...",
    "what_was_observed": "In microservice meshes, third-party API integrations, and automated agent tool callers, instances operating without explicit fault-classified and probe-gated circuit breakers exhibit four primary failure modes: 1. **Timeout-Wait Cascading Pool Starvation:** An external enrichment or billing API suffers a database lockup and stops responding. Because the caller has a 10-second socket timeout and no circuit breaker, ev...",
    "condition_of_validity": "* **Applies when:** An AI instance, autonomous coding agent, or backend service invokes remote network dependencies over HTTP, gRPC, TCP, or external SaaS SDKs where latency spikes or outages can stall caller threads/coroutines. * **Does not apply when:** Calling pure in-memory functions, reading local static files, or accessing an embedded in-process librar...",
    "decision_boundary": "1. **What happens in your circuit breaker if a user looks up 10 nonexistent records in a row and the upstream API returns `404 Not Found`?** Make sure your fault classifier ignores `400`, `401`, `403`, `404`, and `422` responses—only timeouts, connection errors, `429`, and `5xx` server errors should count toward opening the circuit. 2. **When your circuit br...",
    "operational_effect": "1. **Selective Infrastructure Fault Counting:** Across all generated circuit breakers, the instance distinguishes infrastructure/availability failures (`TimeoutError`, `ConnectionError`, `5xx`, `429`) from client-side domain errors (`4xx`), preventing bad user inputs from tripping shared upstream breakers. 2. **Single-Probe `HALF_OPEN` Admission Control:** T..."
  },
  "matched_failure_symptoms": [
    "HTTP_502_503_504_CASCADE"
  ],
  "composition_edges": {
    "primary_domain": "network_timeout_and_idempotent_retries",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/beneath-what-concurrency-and-backpressure-ceilings-must-an-instance-throttle-fan-out-tasks-to-prevent-file-descriptor-and-connection-pool-starvation.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"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/across-what-readiness-unregistration-and-in-flight-drain-gates-must-an-instance-sequence-sigterm-shutdown-to-prevent-dropped-requests-and-truncated-writes.md",
      "https://corpusfetch.com/c/across-what-bounded-queue-admission-control-and-load-shedding-gates-must-an-instance-manage-concurrency-to-prevent-unbounded-memory-growth-and-tail-latency-collapse.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/across-what-deadline-propagation-and-cancellation-cascade-gates-must-an-instance-govern-grpc-and-http2-calls-to-prevent-zombie-worker-exhaustion-and-wasted-compute.md",
      "https://corpusfetch.com/c/across-what-durable-step-ledger-and-reverse-compensation-gates-must-an-instance-orchestrate-multi-service-sagas-to-prevent-orphaned-partial-mutations.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "a8af79f8d1aa7ed97ba08ad7c0751a68fcc92b49369b6c10cf09061f5ebabeaa",
    "verified_classes": [
      "CircuitState",
      "CircuitOpenError",
      "RollingCircuitBreaker"
    ],
    "verified_functions": [
      "is_default_infrastructure_fault",
      "__init__",
      "__init__",
      "state",
      "_acquire_permission_locked",
      "_record_success_locked",
      "_record_infra_failure_locked",
      "call"
    ],
    "verified_functions_count": 8,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "CircuitOpenError",
      "ValueError"
    ],
    "sample_fail_closed_invariants": [
      "Invalid circuit breaker thresholds"
    ],
    "stdlib_dependencies": [
      "collections",
      "dataclasses",
      "enum",
      "threading",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
