Show & Tell: Designing Fault Tolerance for the CognitiveCycle — Circuit Breakers, Retry Budgets, and Graceful Degradation #140
web3guru888
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
The Problem
A real-time cognitive cycle that runs 29 modules every tick will fail. Modules timeout. Networks blip. GPU OOMs. The question isn't whether failures happen — it's how the system responds when they do.
After designing the CognitiveCycle tick pipeline, the module dependency graph, and parallel tier execution, we now need to close the loop on fault tolerance. This post walks through the three-layer resilience architecture we're building.
Layer 1: Retry Budget (Issue #139)
The innermost layer. When a module call fails, we don't immediately give up — but we also don't retry forever.
Exponential backoff within a hard wall-clock budget. Safety modules (Tier 0) get
max_attempts=1— no retry. If the safety gate fails once, we want immediate escalation, not a 10ms later second guess.Layer 2: Circuit Breaker (Issue #137)
The middle layer. When the retry budget is exhausted repeatedly, the circuit breaker opens and the module is skipped in future ticks.
The key insight: the circuit breaker operates on ticks, not individual exceptions. It counts retry-budget-exhaustion events, not individual failures. A module that transiently spikes and recovers within its retry budget never trips the breaker.
circuit.<name>.openedcircuit.<name>.probingLayer 3: Graceful Degradation (Issue #134)
The outermost layer. Even with circuit breakers, some module combinations are load-bearing. If Tier 1 modules that feed Tier 2 are all open, Tier 2 has no inputs to work with.
We're considering three strategies:
A. Last-Known-Good Cache
When a module is skipped (OPEN), the CognitiveCycle uses the most recent successful output for that module's Blackboard keys, with a staleness TTL:
B. Partial Tick Execution
Rather than aborting the whole tick when a tier partially fails, run the remaining modules with
Nonefor missing upstream inputs. Modules must handleNonegracefully.C. Emergency Minimal Mode
If the safety module (Tier 0) circuit opens, immediately enter emergency mode: skip all non-safety modules, run only the safety pipeline with last-known-good inputs, send
EMERGENCY_STOPto all actuators if safety can't be confirmed.The Failure Taxonomy
Not all failures are equal:
Observability
All three layers write to the Blackboard for observability:
The
CycleProfiler(#126) tracksCycleFaultSummaryper tick and exposes percentile breakdowns: what fraction of ticks have 0 / 1+ / 5+ open circuits, median retry count per module.Open Questions
Related issues: #137 (circuit breaker), #139 (retry budget), #134 (fault tolerance strategies), #133 (parallel tiers), #126 (profiler)
All reactions