Skip to content

Health Gating Enforcement for Context-Aware Ratchet #203

@mojoatomic

Description

@mojoatomic

Overview

Implement health gating enforcement based on the context-aware ratchet telemetry that was introduced in issue #198. This builds on the successful telemetry burn-in phase to add actual enforcement.

Background

The context-aware ratchet now provides:

  • Composite Code Health score (0-100)
  • Intent classification (refactor/suspect/neutral)
  • Weighted violation analysis
  • Violation density metrics

Currently running as non-blocking telemetry for burn-in. Need to add enforcement mechanisms.

Implementation Tasks

Core Health Gating

  • Add configurable health score thresholds in .ai-coding-guide.json
  • Implement health score enforcement in ratchet script
  • Add bypass mechanisms for emergency fixes
  • Configure different thresholds for different change types (refactor vs normal)

CI Integration

  • Remove continue-on-error from context-aware telemetry job
  • Add health gating as required branch protection rule
  • Configure appropriate failure modes and messaging

Configuration Schema

  • Extend .ai-coding-guide.json with health gating config:
    • Minimum health scores by intent type
    • Bypass keywords/patterns
    • Enforcement modes (strict/lenient/disabled)
    • Threshold adjustments for file types

Documentation

  • Update CONTEXT-AWARE-LINTING.md with gating details
  • Add troubleshooting guide for health gate failures
  • Document bypass procedures for urgent fixes
  • Add calibration guidance for teams

Testing & Validation

  • Test enforcement with various code changes
  • Validate bypass mechanisms work correctly
  • Ensure emergency override procedures
  • Add tests for health gating logic

Success Criteria

  • Health gating prevents merging of code that degrades quality metrics significantly
  • Emergency bypass mechanisms work when needed
  • Clear feedback helps developers understand and fix issues
  • Configuration is flexible enough for different project needs

Dependencies

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions