refactor(hooks)!: gate evolution hooks behind evolution.enabled + delete phantom evolution-quality-gate (P2.3) - #69
Merged
Conversation
…ete phantom evolution-quality-gate (P2.3) BREAKING CHANGE: `evolution-quality-gate` was never a functional hook (pure passesQualityGate() fn, no factory/registration) — removed from HookNameSchema 61->60 with no shim (P2.1 ghost precedent). `disabled_hooks` listing it now fails validation with actionable enum error. Evolution watcher/compressor/hitl now only register when `evolution.enabled: true` (default false = zero per-tool-call overhead); in-handler enabled checks kept as defense-in-depth. Real `quality-gate` lint hook untouched. Docs + schema regenerated. Co-Authored-By: internal-model
…n gate on/off) 3 tests, 16 assertions, no mock.module (no mock-heavy-list change): schema rejects evolution-quality-gate while keepers + real quality-gate parse; watcher/compressor/hitl null unless evolution.enabled is true. Co-Authored-By: internal-model
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
P2.3 evolution gating (plan:
.matrixx/plans/p2.3-evolution-gating.md, 5 tasks / 3 waves). Two changes:evolution-watcher,evolution-compressor,evolution-hitlnow only register whenevolution.enabled: true(defaultfalse= zero per-tool-call overhead). Previously they registered on every session and invoked handlers on every tool call / message transform, early-returning inside. In-handlerconfig?.enabledchecks kept as defense-in-depth.evolution-quality-gatewas never a hook (purepassesQualityGate()fn, no factory, no registration). Removed fromHookNameSchema61→60 with no shim (P2.1 ghost precedent). Pure function, barrel re-export, and pipeline usage kept.BREAKING CHANGE
disabled_hookscontaining"evolution-quality-gate"now fails Zod validation with an actionable enum error (the name never had any effect). Realquality-gatelint hook is untouched (schema, factory, bench, tool-execute wiring).What changed (6 files, +13/-8)
src/config/schema/hooks.ts— 1 line deleted (61→60)src/plugin/hooks/create-continuation-hooks.ts—const evolutionEnabled = pluginConfig.evolution?.enabled === true, gates compressor + hitlsrc/plugin/hooks/create-tool-guard-hooks.ts— same const, gates watcherdocs/configurations.md— hook count 60, gating + BREAKING notesdocs/evolution.md— gating note, quality gate clarified as pure functionassets/matrixx.schema.json— regenerated viabun run build:schema(60 enum values)Kept as-is:
features/evolution/(~600 LOC),/evolutioncommand,docs/evolution.mdbody, evolution tests, realquality-gatehook.Verification
bun run typecheck→ exit 0;bun run lint→ 959 files clean;bun run build→ success + schema regenbun test tests/features/evolution/→ 23 pass, 0 failrg "evolution-quality-gate" src/ tests/(quoted) → no matches;passesQualityGatestill in barrel + pipelineHookNameSchema.safeParse('evolution-watcher')→ true;('evolution-quality-gate')→ false with enum error;('quality-gate')→ trueChecklist
dev(nevermaster), merge commit onlyrefactor/p2.3-evolution-gating, Bun 1.4.0as any/@ts-ignore, nosrc/index.tsexports, notodo-continuation-enforcertouchbuild:schema(see plan §Rollback)