From 8ab770c38bf4dd593ee2ca43d46a9865635b3225 Mon Sep 17 00:00:00 2001 From: Timothy Place Date: Wed, 22 Jul 2026 18:24:17 +0000 Subject: [PATCH 1/3] Sync the Claude Code web SessionStart hook from TapHouse Fresh web-session containers clone bare (no submodules, no pre-commit hook), so agent commits could bypass the local format layer and fail the clang-format gate only in CI. The canonical TapHouse hook closes the gap at session start: recursive submodule init, pre-commit install against the pinned config, and a hook-environment warm for the container snapshot. Synced via taphouse/scripts/sync.sh; the hook script is drift-guarded once the TapHouse tag advances past v4. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01BuUawafae7RR2ySWabuJcs --- .claude/hooks/session-start.sh | 36 ++++++++++++++++++++++++++++++++++ .claude/settings.json | 14 +++++++++++++ .gitignore | 4 +++- 3 files changed, 53 insertions(+), 1 deletion(-) create mode 100755 .claude/hooks/session-start.sh create mode 100644 .claude/settings.json diff --git a/.claude/hooks/session-start.sh b/.claude/hooks/session-start.sh new file mode 100755 index 0000000..b7c2a49 --- /dev/null +++ b/.claude/hooks/session-start.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# Canonical Tap House SessionStart hook for Claude Code on the web. +# +# Fresh web-session containers clone the repo bare: no submodules, no +# pre-commit hook installed — so `git commit` runs unformatted and the +# clang-format CI gate fails on code a local clone would have fixed at commit +# time. This hook closes that gap at session start: +# +# 1. init submodules recursively (kernels, SDKs, vendored test harnesses) +# 2. install pre-commit and register the repo's canonical hook +# (.pre-commit-config.yaml — the Tap-wide pinned clang-format) +# 3. warm the pinned clang-format binary so the first commit doesn't +# pay the download (the container snapshot caches it) +# +# Canonical copy: taphouse (distributed by scripts/sync.sh alongside +# .clang-format / .clang-tidy / .pre-commit-config.yaml; drift-guarded where +# present). Web-only; local clones are untouched. +set -euo pipefail + +if [ "${CLAUDE_CODE_REMOTE:-}" != "true" ]; then + exit 0 +fi + +cd "$CLAUDE_PROJECT_DIR" + +echo "session-start: initializing submodules ..." +git submodule update --init --recursive + +echo "session-start: installing pre-commit ..." +if ! python3 -m pre_commit --version >/dev/null 2>&1; then + python3 -m pip install --quiet pre-commit +fi +python3 -m pre_commit install +python3 -m pre_commit install-hooks + +echo "session-start: done." diff --git a/.claude/settings.json b/.claude/settings.json new file mode 100644 index 0000000..e06b033 --- /dev/null +++ b/.claude/settings.json @@ -0,0 +1,14 @@ +{ + "hooks": { + "SessionStart": [ + { + "hooks": [ + { + "type": "command", + "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/session-start.sh" + } + ] + } + ] + } +} diff --git a/.gitignore b/.gitignore index 9bcf3dd..0461d61 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,8 @@ compile_commands.json CMakeUserPresets.json .vscode/ .idea/ -.claude/ +.claude/* +!.claude/settings.json +!.claude/hooks/ book/book/ __pycache__/ From eef93f27fa7ab077fb59d8434af1ff31dcdadec1 Mon Sep 17 00:00:00 2001 From: Timothy Place Date: Wed, 22 Jul 2026 18:55:00 +0000 Subject: [PATCH 2/3] Bump TapHouse drift pin to v5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit v5 canonicalizes the Claude Code web SessionStart hook (tap/TapHouse#4 merged); this branch already carries the synced hook, so the v5 drift guard — which now covers it — passes by construction. Both the reusable workflow ref and the comparison ref move together. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01BuUawafae7RR2ySWabuJcs --- .github/workflows/style.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index a18d4ef..9178d13 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -7,9 +7,9 @@ on: [push, pull_request] jobs: drift: - uses: tap/taphouse/.github/workflows/drift-check.yml@v4 + uses: tap/taphouse/.github/workflows/drift-check.yml@v5 with: - ref: v4 + ref: v5 clang-tidy: runs-on: ubuntu-latest From 067780354ebbb9b436534dca4901c4009c650232 Mon Sep 17 00:00:00 2001 From: Timothy Place Date: Wed, 22 Jul 2026 19:42:33 +0000 Subject: [PATCH 3/3] Re-run CI: TapHouse v5 tag now published The style workflow references taphouse@v5, which did not exist when the ref bump was pushed; this empty commit re-triggers the runs now that the tag is live. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01BuUawafae7RR2ySWabuJcs