fix(agent-hypervisor): report ring 0 in the current ring gauge #4586
All Vouch review confidence checks passed
Residual risk 0.22 = Change Risk (0.40) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 316 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.345
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #4586"
general
weight: 0.35
MohammadHaroonAbuomar
Related Issue
Fixes #4585
Problem & Solution
RingMetricsCollectorread the new ring withpayload.get("to_ring") or payload.get("ring"). Ring 0 (ExecutionRing.RING_0_ROOT) is falsy, so a{"to_ring": 0}event fell through to"ring", gotNone, and the current-ring gauge kept the previous ring. Now it falls back to"ring"only when"to_ring"is missing.Impact on Your Work
The
agent_hypervisor_ring_currentgauge (andexport_to_prometheus) showed the wrong ring for any agent whose last move was to ring 0.Timeline
None
Alternatives Considered
None; this is the minimal change.
Type of Change
Package(s) Affected
Testing
Unit Testing
Added
test_current_ring_updates_to_ring_zerointests/unit/test_prometheus_collector.py(ring 2, then ring 0, expects 0).Before the fix:
After:
ruff checkandruff format --checkpass on the changed files.Manual Testing
Ran the repro from #4585: printed
{'a': 2}before,{'a': 0}after.Checklist
Attribution & Prior Art
AI Assistance
AI note: an AI coding agent (Claude Code) helped find the bug, write the fix and test, and prepare this PR.
IP, Patents, and Licensing