Files
ECC/scripts/lib
CarbonPyramid d7030abab7 fix(hooks): harden context-gate threshold resolution boundaries
Two boundary cases in threshold resolution raised in review:

- Clamp emergencyPct to at least gatePct+1 in run(). A gate threshold set
  at/above the emergency default (e.g. ECC_CONTEXT_GATE_PCT=98 vs the 96
  default) previously made every fire count as EMERGENCY, permanently
  skipping step 1 (bring in-flight work to a clean stopping point). The
  clamp preserves the two-tier order.

- resolvePct emits a one-time stderr note when an env override is present
  but rejected (e.g. "50.5", "abc", "150"). The return stays the
  deterministic fallback, so the contract is unchanged, but a typo'd
  override no longer silently re-arms the default gate unnoticed.

Regression tests added for both. Full suite 4751/4751.
2026-10-06 10:46:46 -05:00
..