Repository navigation
feat(agent): enforce unresolved-conflict escalation to the coordinator - #86
Merged
Merged
Conversation
Closes #82. ConflictRecord defaults resolution="unresolved" and the schema states sub-agents must never silently resolve a conflict; they hand it to the coordinator. But escalate() routed purely by report.severity and never looked at diagnosis.conflicts, so a diagnosis carrying contradictory evidence could pass at LOW/MEDIUM and be logged-and-forgotten. Acting autonomously on contradictory evidence is the exact failure mode the contract exists to stop. escalate() now, whenever the diagnosis has unresolved conflicts: - surfaces them first (ERROR log + prominent printout), before any severity prompt, so the audit trail never shows a silent pass; - forces a human acknowledgment gate for non-CRITICAL incidents (CRITICAL already gates, and the conflicts are surfaced before that prompt, so no double-prompt); - records unresolved_conflict_count and conflicts_acknowledged in the audit entry. Degrades gracefully with no stdin (automated run): the conflict is still surfaced and audited, acknowledgment recorded as None, never dropped. Tests (6): surfaced + gated + audited on accept/reject/no-stdin, resolved conflicts not gated, no-conflict path unchanged, and CRITICAL+conflict prompts once not twice. Full suite 222 passed; ruff + mypy clean.
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 #82.
Problem
ConflictRecorddefaultsresolution="unresolved"and its docstring states sub-agents must never silently resolve a conflict; they mark it unresolved and hand it to the coordinator. Butescalate()routed purely byreport.severityand never looked atdiagnosis.conflicts. A diagnosis carrying contradictory evidence could pass at LOW/MEDIUM and be logged-and-forgotten. Acting autonomously on contradictory evidence is the exact failure mode the contract exists to stop.Fix
escalate()now, whenever the diagnosis has unresolved conflicts:unresolved_conflict_countandconflicts_acknowledgedin the audit entry.Degrades gracefully with no stdin (automated run): the conflict is still surfaced and audited, acknowledgment recorded as
None, never dropped.Tests (6)
Surfaced + gated + audited on accept / reject / no-stdin; resolved conflicts not gated; no-conflict path unchanged; CRITICAL+conflict prompts once, not twice.
Full suite 222 passed; ruff + mypy clean.
https://claude.ai/code/session_01R5VygSzbGTggW7mHd3PVwE