Expand description
Rule execution via hooks.
Rules are NOT context injections (50-70% compliance). They are hooks that block or warn (100% compliance). This module provides the enforcement interface for the bridge hook system.
Execution model:
- PreCommit hook reads rules store -> executes matching checks
- Each active rule’s trigger is matched against the current context
- Matching rules produce either a block (exit 1) or warn (stderr)
Structs§
- Enforcement
Record - Record of a single rule enforcement.
- Evaluation
Result - Result of evaluating all active rules against a hook context.
- Hook
Context - Context for evaluating rules against current operation.
Enums§
- Enforcement
- Action to take when a rule matches.
Functions§
- evaluate_
rules - Evaluate all active rules against the current hook context.
- format_
warnings - Format enforcement results as a warning message for the user.
- record_
matched_ hits - Record hits for all matched rules (updates last_hit and hit count).