Skip to main content

Module hooks

Module hooks 

Source
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§

EnforcementRecord
Record of a single rule enforcement.
EvaluationResult
Result of evaluating all active rules against a hook context.
HookContext
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).