Skip to content

refactor(hooks)!: gate evolution hooks behind evolution.enabled + delete phantom evolution-quality-gate (P2.3) - #69

Merged
klpanagi merged 2 commits into
devfrom
refactor/p2.3-evolution-gating
Sep 9, 2026
Merged

refactor(hooks)!: gate evolution hooks behind evolution.enabled + delete phantom evolution-quality-gate (P2.3)#69
klpanagi merged 2 commits into
devfrom
refactor/p2.3-evolution-gating

Conversation

@klpanagi

@klpanagi klpanagi commented Sep 8, 2026

Copy link
Copy Markdown
Owner

Summary

P2.3 evolution gating (plan: .matrixx/plans/p2.3-evolution-gating.md, 5 tasks / 3 waves). Two changes:

  1. Registration gatingevolution-watcher, evolution-compressor, evolution-hitl now only register when evolution.enabled: true (default false = zero per-tool-call overhead). Previously they registered on every session and invoked handlers on every tool call / message transform, early-returning inside. In-handler config?.enabled checks kept as defense-in-depth.
  2. Phantom fixevolution-quality-gate was never a hook (pure passesQualityGate() fn, no factory, no registration). Removed from HookNameSchema 61→60 with no shim (P2.1 ghost precedent). Pure function, barrel re-export, and pipeline usage kept.

BREAKING CHANGE

disabled_hooks containing "evolution-quality-gate" now fails Zod validation with an actionable enum error (the name never had any effect). Real quality-gate lint 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.tsconst evolutionEnabled = pluginConfig.evolution?.enabled === true, gates compressor + hitl
  • src/plugin/hooks/create-tool-guard-hooks.ts — same const, gates watcher
  • docs/configurations.md — hook count 60, gating + BREAKING notes
  • docs/evolution.md — gating note, quality gate clarified as pure function
  • assets/matrixx.schema.json — regenerated via bun run build:schema (60 enum values)

Kept as-is: features/evolution/ (~600 LOC), /evolution command, docs/evolution.md body, evolution tests, real quality-gate hook.

Verification

  • bun run typecheck → exit 0; bun run lint → 959 files clean; bun run build → success + schema regen
  • bun test tests/features/evolution/ → 23 pass, 0 fail
  • rg "evolution-quality-gate" src/ tests/ (quoted) → no matches; passesQualityGate still in barrel + pipeline
  • HookNameSchema.safeParse('evolution-watcher') → true; ('evolution-quality-gate') → false with enum error; ('quality-gate') → true
  • All edited source files ≤200 LOC (75/164/184)

Checklist

  • Targets dev (never master), merge commit only
  • Branch refactor/p2.3-evolution-gating, Bun 1.4.0
  • No as any / @ts-ignore, no src/index.ts exports, no todo-continuation-enforcer touch
  • Rollback: revert merge commit, restore schema entry, build:schema (see plan §Rollback)

…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
@klpanagi
klpanagi merged commit 1d95b8a into dev Sep 9, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant