Skip to main content

Module gate

Module gate 

Source
Expand description

Edit-time code-health gate — shared by ctx_edit, ctx_patch, and the native-edit hook.

Drift prevention is the lever lean-ctx has that a post-hoc scanner does not: it sits in the edit path, so it can catch a complexity regression at the moment it is introduced. The gate is pure except for reading [code_health] config, and its notice text is deterministic (#498-safe).

Enums§

GateOutcome
Decision of the edit-gate for one edit.

Functions§

evaluate
Evaluate the gate for an edit from oldnew source in a file with ext, using the active [code_health] config (threshold + mode).
evaluate_with
Pure gate evaluation with explicit mode/threshold — the unit-tested core.