fix(server): treat all-silent comply tracks as passing, not degraded#4068
Draft
fix(server): treat all-silent comply tracks as passing, not degraded#4068
Conversation
…4065) When all active (non-skip) tracks return 'silent' (all scenarios passed with no advisory observations), the SDK reports overall_status='partial'. This mapped to ComplianceStatus='degraded', showing "Compliance: Degraded" for fully-clean agents. Added effectiveRunStatus() to override the SDK's 'partial' to 'passing' when all active tracks are 'pass' or 'silent', and recompute track counters (passed/failed/partial) for a consistent DB record. Frontend: map 'silent' track pills to the pass CSS class in five locations across agents.html and dashboard-agents.html (card, detail modal, history panel, and track-detail drawer). https://claude.ai/code/session_014sRTVL1uWrZJUj6TiJWcBS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4065
Summary
When
comply()returnssilentfor every track (all scenarios passed, zero failures — the best possible outcome), the SDK reportsoverall_status: 'partial'. The server mapped'partial'→ComplianceStatus: 'degraded', so the dashboard showed "Compliance: Degraded" for fully-clean agents.Added
effectiveRunStatus()incompliance-testing.tsto intercept at the DB-adapter boundary: when all active (non-skip) tracks are'pass'or'silent', override to'passing'and recomputetracks_passed,tracks_failed, andtracks_partialso stored run records stay consistent. The SDK result itself is untouched. Frontend: five locations inagents.htmlanddashboard-agents.html(card, detail modal, history panel, track-detail drawer) now map'silent'track pills to the pass CSS class.Non-breaking justification: Server-internal status computation correction. No schema, API, or protocol changes. ComplianceStatus values are unchanged; only their mapping from SDK output is corrected. Existing DB records stay as-is until the next heartbeat cycle.
Downstream effects (all correct behavior):
streak_daysadvances correctly)last_passed_atis now set on all-silent heartbeats (was NULL, blocking badge eligibility)Known secondary gap (not fixed here):
member-tools.ts:3533recordsoverall_passed: result.overall_status === 'passing'using the raw SDK string, which stays'partial'for all-silent runs. Thequality_evaluationtool'srecordTestcall will incorrectly storeoverall_passed: falseuntil a follow-up PR.Deploy consideration: Agents currently stored as
status='degraded'due to this bug will trigger a one-time "recovery" status notification on their next heartbeat post-deploy (transitiondegraded → passing). This is a one-off spurious recovery DM, not a regression notification. Operators receiving it may be briefly confused; the message will show correct data about the agent's healthy state.Pre-PR review
First review pass (before addressing blockers):
silentmapping (not 4), flagged missing unit tests foreffectiveRunStatus, and flaggedtracks_failedinconsistency. All addressed.silent = passingdisplay is semantically correct; streak/last_passed_atfix is correct and load-bearing.Fixes applied after first pass:
silent→'Passing'mapping in dashboard-agents.html track-detail drawer (line 2602)tracks_failed: 0to the override branch ofeffectiveRunStatusserver/tests/unit/compliance-testing-effective-run-status.test.ts) covering: all-silent, mixed pass+silent, at-least-one-fail, skip-track exclusion, all-skip no-promotionSession: https://claude.ai/code/session_014sRTVL1uWrZJUj6TiJWcBS
Generated by Claude Code