fix(hooks): short-circuit immediately when disabled

main

Commit

suhaanthayyil2mo ago

Agent hook execution (entire hooks <agent> <verb>) gated on IsEnabled(), which failed OPEN on any settings read error: err == nil && !enabled only short-circuited when the read succeeded. A corrupted or otherwise unreadable .entire/settings.json (or a repo that was never entire enabled, since loadFromFile defaults Enabled to true) made every hook invocation fall through to full lifecycle dispatch instead of exiting fast — for Stop hooks this includes a multi-second wait on the transcript-flush sentinel.

Git hooks already gated on settings.IsSetUpAndEnabled, which fails closed (false) on any load error, so they were unaffected. Switch the agent hook path to the same fail-closed gate for consistency: any settings read error is now treated as disabled.

Fixes #524