Skip to content

fix(brain): qualify the reviewed 4.3.26 lifecycle hook contract - #224

Merged
pacphi merged 1 commit into
mainfrom
fix/brain-4.3.26-lifecycle-contract
Sep 20, 2026
Merged

pacphi merged 1 commit into
mainfrom
fix/brain-4.3.26-lifecycle-contract

Conversation

@pacphi

@pacphi pacphi commented Sep 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • Brain 4.3.26 declares eight hook events; the inspector only accepted the exact 4.3.17 two-event contract, so every current install showed a Runtime WARN ("Automatic hook declarations differ from the exact 4.3.17 continuity contract").
  • Adds a second exact deep-equal contract, 4.3.26-lifecycle, next to the existing two. It is version-agnostic and rejects any altered, added or removed hook, matcher, command or timeout, so future upstream hook changes still warn until reviewed.
  • Fallback warning text now names both reviewed contracts.

Notes

  • Qualification is registration-only, not a runtime or safety certification. 4.3.26 adds a PreToolUse decision-gate that can refuse Write/Edit until search_ruvnet is consulted, and a Stop grounding gate.
  • Same recurrence class as fix: prevent recurring Codex MCP and Brain warnings #215; each upstream hook expansion needs a newly reviewed contract.

Testing

  • New tests: the exact 4.3.26 declaration qualifies; 8 mutations are rejected. The positive test failed before the change.
  • pnpm run check passes (typecheck, lint, lint:cc, lint:md, build, full test suite).
  • Real ~/.claude install now inspects as 4.3.26-lifecycle with no issues.

🤖 Generated with Claude Code

Brain 4.3.26 legitimately declares eight hook events (SessionStart,
UserPromptSubmit, PreToolUse, PostToolUse, Stop, PreCompact, SessionEnd).
The inspector only knew the exact 4.3.17 two-event contract, so every current
install reported "Automatic hook declarations differ from the exact 4.3.17
continuity contract" as a Runtime WARN.

Add a second exact, deep-equal contract (4.3.26-lifecycle) alongside the
existing ones. It stays version-agnostic and rejects any altered, added or
removed hook, matcher, command or timeout, so a future upstream change still
warns until reviewed. The fallback message now names both reviewed contracts.
@pacphi
pacphi merged commit 611c528 into main Sep 20, 2026
16 checks passed
@pacphi
pacphi deleted the fix/brain-4.3.26-lifecycle-contract branch September 20, 2026 02:30
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