chore(hooks): add Claude Code session hooks + drift-guard (P4)#70
Merged
Conversation
Vendor attune-ai's canonical Claude Code session hooks into attune-gui, completing the sibling-claude-hooks rollout (P1 rag, P2 author, P3 help). Vendors the current 8-file closure (includes _sdk_gate.py / the SDK-subprocess fix), so no re-sync is needed. - .claude/hooks/: 8 hooks byte-identical from attune-ai/plugin/hooks - .canonical-sha256 manifest (8 entries); sync-hooks target merged into the existing Makefile alongside regen-all (ATTUNE_AI_ROOT default ../attune-ai) - .claude/settings.json hooks block - .gitattributes pins LF on the hook tree - .gitignore: track .claude/hooks/ + settings.json, ignore the rest - sidecar/tests/: drift-guard + behavior smoke tests (parents[2] — gui tests live under sidecar/tests/). Behavior test noqa's S603 (trusted subprocess: sys.executable + a vendored hook path) Refs specs/sibling-claude-hooks (P4). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The behavior tests spawn `python .claude/hooks/<hook>.py` subprocesses. Under `--cov` (gui coverage uses branch=true), pytest-cov's COV_CORE_* env vars make those children auto-start *statement* coverage, whose data file can't combine with the parent's branch data at finish() — "Can't combine statement coverage data with branch data" (574 passed, then coverage combine crashes the run). Strip COV_CORE_*/COVERAGE_PROCESS_START in _run_hook so the spawned hooks never start coverage. Zero coverage loss: the hooks live in .claude/hooks/, outside source=["sidecar/attune_gui"]. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
What
Vendor attune-ai's canonical Claude Code session hooks into attune-gui — P4, the final layer of
specs/sibling-claude-hooks(P1 rag #151, P2 author #59/#68, P3 help #13).Vendors the current 8-file canonical (includes
_sdk_gate.py, the SDK-subprocess-isolation fix) — no re-sync debt.Changes
.claude/hooks/— 8 hooks byte-identical fromattune-ai/plugin/hooks/(verified 8/8).canonical-sha256(8 entries);sync-hookstarget merged into the existing Makefile alongsideregen-all(not overwritten).claude/settings.jsonhooks block;.gitattributesLF pin;.gitignoretracks.claude/hooks/+settings.jsonsidecar/tests/test_claude_hooks_{drift,behavior}.py— gui tests live undersidecar/tests/, so the path usesparents[2]gui-specific notes
sidecar/tests/sotestpaths+ CI'spytest sidecar/tests/pick them upruff check sidecar/lints the test files (not the hooks) — behavior test# noqa: S603(trusted subprocess:sys.executable+ a vendored hook path)SPECS_DIRdivergence: P0 discovery probes bothspecs/anddocs/specs/, and gui has bothVerification
ruff check sidecar/tests/...under gui config: clean🤖 Generated with Claude Code