From 736743698033d870be93fb82fc0ed498f3fedeaa Mon Sep 17 00:00:00 2001 From: "Claude Opus 5.5 (claude-opus-5-5)" Date: Mon, 23 Nov 2026 21:16:01 +0100 Subject: [PATCH] chore: drop Entire hooks from the init template Entire is retired on every machine and project. Sessions, not git commits, are the artifact worth keeping, and the agentsview session archive keeps them. Commit-anchored checkpoints did not survive jj rewrites and squash merges. The init template restores its original pre-push hook and drops the Entire capture hooks, so new projects no longer inherit Entire. The repository hooks drop the same capture hooks, the Entire-only pre-push.local, and the unused pre-push.pre-entire backup. CLI-0009 is marked superseded. Co-Authored-By: Martin Zeman --- .githooks/commit-msg | 4 -- .githooks/post-commit | 4 -- .githooks/post-rewrite | 4 -- .githooks/pre-push.local | 6 -- .githooks/pre-push.pre-entire | 10 --- .githooks/prepare-commit-msg | 3 - .../CLI-0009 Entire Git-Hook Coexistence.md | 10 ++- src/cli/init/tests.rs | 69 ++++++++----------- templates/init/.githooks/commit-msg | 4 -- templates/init/.githooks/post-commit | 4 -- templates/init/.githooks/post-rewrite | 4 -- templates/init/.githooks/pre-push | 44 +++++++++--- templates/init/.githooks/pre-push.pre-entire | 36 ---------- templates/init/.githooks/prepare-commit-msg | 3 - 14 files changed, 72 insertions(+), 133 deletions(-) delete mode 100755 .githooks/commit-msg delete mode 100755 .githooks/post-commit delete mode 100755 .githooks/post-rewrite delete mode 100755 .githooks/pre-push.local delete mode 100755 .githooks/pre-push.pre-entire delete mode 100755 .githooks/prepare-commit-msg delete mode 100755 templates/init/.githooks/commit-msg delete mode 100755 templates/init/.githooks/post-commit delete mode 100755 templates/init/.githooks/post-rewrite delete mode 100644 templates/init/.githooks/pre-push.pre-entire delete mode 100755 templates/init/.githooks/prepare-commit-msg diff --git a/.githooks/commit-msg b/.githooks/commit-msg deleted file mode 100755 index 15897e73..00000000 --- a/.githooks/commit-msg +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# Entire CLI hooks -# Commit-msg hook: strip trailer if no user content (allows aborting empty commits) -if command -v entire >/dev/null 2>&1; then entire hooks git commit-msg "$1" || true; else printf '%s\n' '[entire] Entire CLI is enabled but not installed or not on PATH. Skipping Entire Git hook; continuing. Installation guide: https://docs.entire.io/cli/installation#installation-methods' >&2 || :; fi diff --git a/.githooks/post-commit b/.githooks/post-commit deleted file mode 100755 index d5396a87..00000000 --- a/.githooks/post-commit +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# Entire CLI hooks -# Post-commit hook: condense session data if commit has Entire-Checkpoint trailer -if command -v entire >/dev/null 2>&1; then entire hooks git post-commit 2>/dev/null || true; else :; fi diff --git a/.githooks/post-rewrite b/.githooks/post-rewrite deleted file mode 100755 index 2c65d91c..00000000 --- a/.githooks/post-rewrite +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# Entire CLI hooks -# Post-rewrite hook: remap session linkage after amend/rebase rewrites -if command -v entire >/dev/null 2>&1; then entire hooks git post-rewrite "$1" 2>/dev/null || true; else :; fi diff --git a/.githooks/pre-push.local b/.githooks/pre-push.local deleted file mode 100755 index dd6c0b57..00000000 --- a/.githooks/pre-push.local +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash -# Session capture rides the baseline hook's extension point: Entire uploads -# checkpoint state before the push checks run. -if command -v entire >/dev/null 2>&1; then - entire hooks git pre-push "$@" || true -fi diff --git a/.githooks/pre-push.pre-entire b/.githooks/pre-push.pre-entire deleted file mode 100755 index caad57d7..00000000 --- a/.githooks/pre-push.pre-entire +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -# Pre-push hook: runs the pre-push-staged checks (gitleaks, semgrep). - -if command -v prek >/dev/null 2>&1; then - prek run --all-files --stage pre-push -else - "$(dirname "$0")/rune-here" validate -fi diff --git a/.githooks/prepare-commit-msg b/.githooks/prepare-commit-msg deleted file mode 100755 index 7fa38423..00000000 --- a/.githooks/prepare-commit-msg +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -# Entire CLI hooks -if command -v entire >/dev/null 2>&1; then entire hooks git prepare-commit-msg "$1" "$2" 2>/dev/null || true; else :; fi diff --git a/docs/decisions/CLI-0009 Entire Git-Hook Coexistence.md b/docs/decisions/CLI-0009 Entire Git-Hook Coexistence.md index 910a33c1..c27395c4 100644 --- a/docs/decisions/CLI-0009 Entire Git-Hook Coexistence.md +++ b/docs/decisions/CLI-0009 Entire Git-Hook Coexistence.md @@ -7,9 +7,9 @@ tags: - cli - hooks - entire -status: accepted +status: superseded created: 2026-06-23 -updated: 2026-06-23 +updated: 2026-11-23 author: "@N4M3Z" project: rune-cli related: @@ -24,6 +24,12 @@ upstream: # Entire Git-Hook Coexistence +> **Superseded on 2026-11-23.** We retired Entire on every machine and project. Agent sessions, not git commits, are +> the artifact worth keeping, and the agentsview session archive keeps them. Commit-anchored checkpoints did not +> survive jj rewrites and squash merges. The `rune init` template and this repository no longer include Entire hooks, +> and `pre-push` runs the pre-push validation check directly again. The rest of this record describes the arrangement +> as it was. + ## Context and Problem Statement rune sets `core.hooksPath = .githooks` and tracks its git hooks as source. Entire (a per-developer AI-session recorder) installs hooks into that same directory and wraps the tracked `pre-push`: it backs the rune pre-push validation check up to `pre-push.pre-entire`, then replaces `pre-push` with a marked shim that calls `entire hooks git pre-push` and chains to the backup. Because `pre-push` is tracked, that modification surfaces as working-tree drift on every machine running Entire and has been accidentally committed. A `.gitignore` entry cannot suppress a modification to an already-tracked file. diff --git a/src/cli/init/tests.rs b/src/cli/init/tests.rs index 763fc288..fc5dfa90 100644 --- a/src/cli/init/tests.rs +++ b/src/cli/init/tests.rs @@ -180,31 +180,6 @@ fn init_creates_all_files() { assert!(temp_directory.path().join(".githooks/pre-commit").is_file()); assert!(temp_directory.path().join(".githooks/pre-push").is_file()); assert!(temp_directory.path().join(".githooks/jj-push").is_file()); - assert!( - temp_directory - .path() - .join(".githooks/pre-push.pre-entire") - .is_file() - ); - assert!(temp_directory.path().join(".githooks/commit-msg").is_file()); - assert!( - temp_directory - .path() - .join(".githooks/post-commit") - .is_file() - ); - assert!( - temp_directory - .path() - .join(".githooks/post-rewrite") - .is_file() - ); - assert!( - temp_directory - .path() - .join(".githooks/prepare-commit-msg") - .is_file() - ); assert!(temp_directory.path().join("agents/.mdschema").is_file()); assert!(temp_directory.path().join("rules/.mdschema").is_file()); assert!(temp_directory.path().join("skills/.mdschema").is_file()); @@ -362,27 +337,15 @@ fn init_uses_already_exists_skip_reason() { } #[test] -fn init_pre_push_is_entire_wrapper_chaining_to_gate() { +fn init_pre_push_is_validation_check() { let temp_directory = TempDir::new().unwrap(); execute(&temp_directory.path().to_string_lossy()).unwrap(); - let wrapper = - std::fs::read_to_string(temp_directory.path().join(".githooks/pre-push")).unwrap(); - assert!( - wrapper.contains("Entire CLI hooks"), - "scaffolded pre-push should be the Entire wrapper" - ); - assert!( - wrapper.contains("pre-push.pre-entire"), - "wrapper should chain to the pre-push validation check" - ); - let pre_push_check = - std::fs::read_to_string(temp_directory.path().join(".githooks/pre-push.pre-entire")) - .unwrap(); + std::fs::read_to_string(temp_directory.path().join(".githooks/pre-push")).unwrap(); assert!( pre_push_check.contains("validate.sh"), - "pre-push.pre-entire should run the Rune pre-push validation check" + "scaffolded pre-push should run the Rune pre-push validation check" ); assert!( !pre_push_check.contains("${VALIDATE_SH_SHA}"), @@ -390,6 +353,32 @@ fn init_pre_push_is_entire_wrapper_chaining_to_gate() { ); } +#[test] +fn init_ships_no_entire_hooks() { + let temp_directory = TempDir::new().unwrap(); + execute(&temp_directory.path().to_string_lossy()).unwrap(); + + for removed in [ + "pre-push.pre-entire", + "commit-msg", + "post-commit", + "post-rewrite", + "prepare-commit-msg", + ] { + let path = temp_directory.path().join(".githooks").join(removed); + assert!(!path.exists(), "init must not scaffold .githooks/{removed}"); + } + + for hook in ["pre-commit", "pre-push", "jj-push"] { + let content = + std::fs::read_to_string(temp_directory.path().join(".githooks").join(hook)).unwrap(); + assert!( + !content.contains("Entire CLI hooks"), + ".githooks/{hook} must not be an Entire wrapper" + ); + } +} + #[test] fn the_executable_bit_follows_the_shebang_not_the_path() { // ruff enforces the same pair in the generated project: EXE001 for a diff --git a/templates/init/.githooks/commit-msg b/templates/init/.githooks/commit-msg deleted file mode 100755 index 15897e73..00000000 --- a/templates/init/.githooks/commit-msg +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# Entire CLI hooks -# Commit-msg hook: strip trailer if no user content (allows aborting empty commits) -if command -v entire >/dev/null 2>&1; then entire hooks git commit-msg "$1" || true; else printf '%s\n' '[entire] Entire CLI is enabled but not installed or not on PATH. Skipping Entire Git hook; continuing. Installation guide: https://docs.entire.io/cli/installation#installation-methods' >&2 || :; fi diff --git a/templates/init/.githooks/post-commit b/templates/init/.githooks/post-commit deleted file mode 100755 index d5396a87..00000000 --- a/templates/init/.githooks/post-commit +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# Entire CLI hooks -# Post-commit hook: condense session data if commit has Entire-Checkpoint trailer -if command -v entire >/dev/null 2>&1; then entire hooks git post-commit 2>/dev/null || true; else :; fi diff --git a/templates/init/.githooks/post-rewrite b/templates/init/.githooks/post-rewrite deleted file mode 100755 index 2c65d91c..00000000 --- a/templates/init/.githooks/post-rewrite +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# Entire CLI hooks -# Post-rewrite hook: remap session linkage after amend/rebase rewrites -if command -v entire >/dev/null 2>&1; then entire hooks git post-rewrite "$1" 2>/dev/null || true; else :; fi diff --git a/templates/init/.githooks/pre-push b/templates/init/.githooks/pre-push index 4505584a..67379937 100644 --- a/templates/init/.githooks/pre-push +++ b/templates/init/.githooks/pre-push @@ -1,10 +1,36 @@ -#!/bin/sh -# Entire CLI hooks -# Pre-push hook: push session logs alongside user's push -# $1 is the remote name (e.g., "origin") -if command -v entire >/dev/null 2>&1; then entire hooks git pre-push "$1" || true; else :; fi -# Chain: run pre-existing hook -_entire_hook_dir="$(dirname "$0")" -if [ -x "$_entire_hook_dir/pre-push.pre-entire" ]; then - "$_entire_hook_dir/pre-push.pre-entire" "$@" +#!/usr/bin/env bash +set -euo pipefail + +# forge module pre-push hook — runs the pre-push-staged gates (gitleaks, semgrep). +# Canonical source: https://github.com/N4M3Z/forge-cli/blob/main/templates/init/.githooks/pre-push + +SCRIPT_URL="https://raw.githubusercontent.com/N4M3Z/forge-cli/main/scripts/validate.sh" +SCRIPT_SHA="${VALIDATE_SH_SHA}" + +if command -v prek >/dev/null 2>&1; then + prek run --all-files --stage pre-push +elif command -v forge >/dev/null 2>&1; then + forge validate +else + echo "" + echo " ⚠ Neither prek nor forge found — using validate.sh fallback" + echo " Install: cargo install --locked forge-cli or cargo binstall prek" + echo "" + + tmpdir=$(mktemp -d) + trap 'rm -rf "$tmpdir"' EXIT + + curl --max-time 30 -sfL "$SCRIPT_URL" -o "$tmpdir/validate.sh" 2>/dev/null \ + || { echo "validate.sh unreachable — install forge-cli or check connectivity"; exit 1; } + + actual=$(sha256sum "$tmpdir/validate.sh" 2>/dev/null || shasum -a 256 "$tmpdir/validate.sh") + actual=${actual%% *} + + if [ "$actual" != "$SCRIPT_SHA" ]; then + echo "validate.sh hash mismatch (expected $SCRIPT_SHA, got $actual)" + echo " update SCRIPT_SHA after verifying the new script" + exit 1 + fi + + bash "$tmpdir/validate.sh" . fi diff --git a/templates/init/.githooks/pre-push.pre-entire b/templates/init/.githooks/pre-push.pre-entire deleted file mode 100644 index 67379937..00000000 --- a/templates/init/.githooks/pre-push.pre-entire +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -# forge module pre-push hook — runs the pre-push-staged gates (gitleaks, semgrep). -# Canonical source: https://github.com/N4M3Z/forge-cli/blob/main/templates/init/.githooks/pre-push - -SCRIPT_URL="https://raw.githubusercontent.com/N4M3Z/forge-cli/main/scripts/validate.sh" -SCRIPT_SHA="${VALIDATE_SH_SHA}" - -if command -v prek >/dev/null 2>&1; then - prek run --all-files --stage pre-push -elif command -v forge >/dev/null 2>&1; then - forge validate -else - echo "" - echo " ⚠ Neither prek nor forge found — using validate.sh fallback" - echo " Install: cargo install --locked forge-cli or cargo binstall prek" - echo "" - - tmpdir=$(mktemp -d) - trap 'rm -rf "$tmpdir"' EXIT - - curl --max-time 30 -sfL "$SCRIPT_URL" -o "$tmpdir/validate.sh" 2>/dev/null \ - || { echo "validate.sh unreachable — install forge-cli or check connectivity"; exit 1; } - - actual=$(sha256sum "$tmpdir/validate.sh" 2>/dev/null || shasum -a 256 "$tmpdir/validate.sh") - actual=${actual%% *} - - if [ "$actual" != "$SCRIPT_SHA" ]; then - echo "validate.sh hash mismatch (expected $SCRIPT_SHA, got $actual)" - echo " update SCRIPT_SHA after verifying the new script" - exit 1 - fi - - bash "$tmpdir/validate.sh" . -fi diff --git a/templates/init/.githooks/prepare-commit-msg b/templates/init/.githooks/prepare-commit-msg deleted file mode 100755 index 7fa38423..00000000 --- a/templates/init/.githooks/prepare-commit-msg +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -# Entire CLI hooks -if command -v entire >/dev/null 2>&1; then entire hooks git prepare-commit-msg "$1" "$2" 2>/dev/null || true; else :; fi