Show & Tell: Designing CycleFaultSummary — Per-Tick Health Records, SSE Streaming, and MCP Introspection #146
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.
Following the fault tolerance design in #142 and the health dashboard ideas in #143, here's a complete design walkthrough for the
CycleFaultSummarysystem proposed in #144.The Problem
A
CognitiveCycletick involves up to 29 modules running across 5 parallel tiers. Things that can go wrong:Right now, all of this happens silently inside
tick(). There's no structured output, no way to ask "what went wrong last tick?", and no way to stream health events to an operator dashboard.CycleFaultSummarysolves this.Data Model
Every
tick()call returns aCycleFaultSummary. Zero faults =severity: RECOVERED. One open circuit =severity: CRITICAL.The SSE Stream
The
/cycle/health/streamendpoint streams one Server-Sent Event per tick:Clients can filter by event name:
Three Consumers
1. Operator dashboard
Connects to SSE stream, renders a live module health grid. Green = ok, yellow = degraded (fallback), red = critical (circuit open). Budget violation badges on slow modules.
2. MCP introspection tool
Allows any MCP client (Claude, LangGraph, etc.) to query live cycle health.
3. Blackboard subscribers
Each
CycleFaultSummaryis posted to the Blackboard asentry_type="cycle_fault_summary". The Safety module subscribes and can escalate to emergency stop ifmodules_criticalincludes safety-relevant modules.Implementation Order
ModuleFaultRecord+CycleFaultSummarydataclasses (no deps)CognitiveCycle.tick()(depends on Add parallel tier execution to CognitiveCycle: asyncio.gather() for dependency-independent modules #133/Add circuit breaker pattern to CognitiveCycle: auto-disable persistently failing modules with OPEN/HALF_OPEN/CLOSED health states #137/Add retry budget manager: per-module retry limits with exponential backoff inside CognitiveCycle ticks #139)/cycle/health/streamSSE endpoint (depends on 2)get_cycle_healthMCP tool (depends on 4)Open Questions
CycleFaultSummaryrecords in memory? How many ticks is useful without being a memory leak?overall_severitytransitions fromdegraded→critical? Or is SSE sufficient?modules_criticalcontains"safety", shouldCognitiveCycleautomatically pause ticking and wait for manual reset? Or is that too aggressive?See #144 for the implementation issue and acceptance criteria.
All reactions