Skip to content

[P2.1-T06] Implement conflict resolution #43

@RichardHightower

Description

@RichardHightower

Task: Implement conflict resolution

Phase: 2.1 - Core Governance
Estimated: 0.5 day
File: cch_cli/src/hooks/resolver.rs (new file)
Depends on: P2.1-T05

Description

Implement deterministic conflict resolution when multiple rules match.

Acceptance Criteria

  • Create resolve_conflicts(matched_rules: Vec<&Rule>) -> ResolvedOutcome
  • Enforce mode always wins over warn/audit
  • Among same modes, highest priority wins
  • For multiple blocks, use highest priority block message
  • Log conflict resolution decisions
  • Add unit tests for all conflict scenarios

Conflict Resolution Table

Situation Outcome
enforce + warn enforce wins
audit + enforce enforce wins
warn only inject warning
audit only log only
multiple enforce highest priority wins

Tests Required

#[test] fn test_enforce_wins_over_warn() { ... }
#[test] fn test_enforce_wins_over_audit() { ... }
#[test] fn test_higher_priority_wins() { ... }
#[test] fn test_multiple_enforces_highest_priority_message() { ... }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions