Skip to content

chore: drop Entire hooks from the init template - #90

Draft
N4M3Z wants to merge 1 commit into
mainfrom
chore/remove-entire
Draft

N4M3Z wants to merge 1 commit into
mainfrom
chore/remove-entire

Conversation

@N4M3Z

@N4M3Z N4M3Z commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Note

Remove Entire git hooks from the init template

  • Deletes the Entire wrapper hooks (commit-msg, post-commit, post-rewrite, prepare-commit-msg, pre-push.pre-entire) from both the repo's .githooks and the init templates
  • The scaffolded pre-push hook now runs the validation script directly: prek's pre-push stage when available, forge validate when available, otherwise downloads validate.sh and checks its SHA-256
  • Marks CLI-0009 (Entire Git-Hook Coexistence) as superseded in CLI-0009 Entire Git-Hook Coexistence.md
  • Updates init tests in tests.rs: pre-push now asserts the substituted validation-script SHA, and a new test confirms no Entire hook files or wrapper markers are scaffolded
  • Behavioral Change: new projects get a single direct pre-push hook instead of the Entire wrapper chain to pre-push.pre-entire; existing repos keep their current hooks

Macroscope summarized 7367436.

Plan

Changes

Testing

Release Notes

  • N/A

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 <N4M3Z@users.noreply.github.com>
@github-actions github-actions Bot added area:docs auto: documentation and markdown area:hooks auto: git hooks size:med auto: changed-lines bucket labels Nov 23, 2026
@runeseer

runeseer Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

review/correctness round 1 started on 73674369 at ledger generation 1.

@runeseer

runeseer Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @N4M3Z's task in 2m 58s —— View job


Review

  • Read lane inputs, ledger, and previous verdict
  • Review the diff (736743698033d870be93fb82fc0ed498f3fedeaa, 14 files)
  • Judge other lanes' findings
  • Write verdict, findings, and summary files

Request changes. The template pre-push that now runs the validation check directly still names the wrong project, so its download fallback checks a forge-cli script against rune's embedded hash and always fails.

Medium — scaffolded pre-push fallback can never pass its hash check

templates/init/.githooks/pre-push:7 fetches validate.sh from N4M3Z/forge-cli, while line 8's SCRIPT_SHA resolves to rune::VALIDATE_SH_SHA — the sha256 of this repository's scripts/validate.sh (build.rs:30, src/cli/validate/templates.rs:16). A successful download therefore mismatches and the hook exits 1 with update SCRIPT_SHA after verifying the new script. Line 12 probes forge rather than rune, so a machine with rune installed but no prek drops into that dead fallback instead of running rune validate. The sibling templates/init/.githooks/pre-commit:7 uses runedeck/rune and rune.

The wrong-project text is carried over verbatim from the deleted pre-push.pre-entire, not introduced here — but it now sits on the hook every scaffolded module invokes. Fix this →

Checked and clean

  • Hook removals are safe: rune init enumerates the template directory through rust_embed (src/cli/validate/templates.rs:3-5) with no hardcoded hook list, so the deleted files simply stop shipping.
  • Deleting .githooks/pre-push.local does not break this repo's own hook — .githooks/pre-push:41 guards the extension point with -x.
  • ${VALIDATE_SH_SHA} substitution is path-independent, so moving the placeholder from pre-push.pre-entire to pre-push keeps init_pre_push_is_validation_check sound.
  • ADR status: superseded is a valid enum value in schemas/rune-adr.schema.json:61, with no conditional superseded-by requirement.

No findings from other reviewers to adjudicate and no open review threads.
· branch chore/remove-entire

Comment on lines +4 to +24
# 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; }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [runeseer] reported by reviewdog 🐶
Medium — The scaffolded pre-push fallback fetches validate.sh from N4M3Z/forge-cli and checks it against this repository's embedded SHA, so the hash comparison can never pass and every push from a scaffolded module without prek aborts with a misleading "update SCRIPT_SHA" message.

  • templates/init/.githooks/pre-push:8 SCRIPT_SHA resolves to rune::VALIDATE_SH_SHA, the sha256 of this repository's scripts/validate.sh.
  • templates/init/.githooks/pre-commit:7 the sibling template fetches the same script from runedeck/rune and probes rune, not forge.
Suggested change
# 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; }
# rune module pre-push hook — runs the pre-push-staged gates (gitleaks, semgrep).
# Canonical source: https://github.com/runedeck/rune/blob/main/templates/init/.githooks/pre-push
SCRIPT_URL="https://raw.githubusercontent.com/runedeck/rune/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 rune >/dev/null 2>&1; then
rune validate
else
echo ""
echo " ⚠ Neither prek nor rune found — using validate.sh fallback"
echo " Install: cargo install --locked rune-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 rune-cli or check connectivity"; exit 1; }

@github-actions github-actions Bot added the issue:rune Review lane requires intervention label Nov 23, 2026
@runeseer

runeseer Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Runeseer needs attention — invalid review output

Runeseer received a verdict, but deterministic validation rejected it.

Inspect the validation error. Then request a new review round.

Rerun this workflow only when the pull request head is unchanged. Otherwise, clear issue:rune and request a new round.

Affected head: 73674369.

Open the failed workflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:docs auto: documentation and markdown area:hooks auto: git hooks issue:rune Review lane requires intervention size:med auto: changed-lines bucket

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant