Skip to content

Stop wiring the version.gradle.kts Edit-block hook#700

Merged
alexander-yevsyukov merged 2 commits into
masterfrom
drop-version-edit-block-hook
Jun 18, 2026
Merged

Stop wiring the version.gradle.kts Edit-block hook#700
alexander-yevsyukov merged 2 commits into
masterfrom
drop-version-edit-block-hook

Conversation

@alexander-yevsyukov

Copy link
Copy Markdown
Contributor

What

Removes the Edit|Write|MultiEdit → protect-version-file.sh PreToolUse entry from the .claude/settings.json template. Because migrate clobber-copies this template into every consumer's .claude/settings.json on each ./config/pull, dropping the entry here removes the block from all consumers on their next pull — no per-repo edits needed.

The Bash publish gate (pre-pr-gate.sh, publish-version-gate.sh), the PostToolUse hooks (sanitize-source-code.sh, update-copyright.sh), and the SessionStart init-submodules hook are all left intact.

Why

The hook blocked agents from editing version.gradle.kts, forcing all version changes through the bump-version skill. It was friction without protection: it blocked the Edit tool but left a Bash sed write open, so it never actually prevented editing — it just diverted agents onto a path that then needed a permission prompt, defeating the autonomy the skill exists to provide.

The protections that matter are outcome-based and stay in place:

  • publish-version-gate.sh still blocks a build/publish unless the branch is bumped above base.
  • CI's checkVersionIncrement still rejects an already-published version.

Companion change

The shared agents repo deletes the now-unreferenced script: SpineEventEngine/agents#21.

Rollout

Merge this PR first: it removes the wiring everywhere on the next ./config/pull, and the script lingering unused in .agents/shared is harmless. Then merge the agents PR (deletes the script). Merging in the other order leaves a brief window where a consumer's settings reference a deleted script — a non-blocking stderr note on edits, not a real break.

The `Edit|Write|MultiEdit -> protect-version-file.sh` PreToolUse hook
blocked agents from editing `version.gradle.kts`, forcing all version
changes through the `bump-version` skill. It was friction without
protection: it blocked the Edit tool but left a Bash `sed` write open,
so it never actually prevented editing — it just diverted agents onto a
path that then needed a permission prompt, defeating the autonomy the
skill exists to provide. The protections that matter are outcome-based
and stay in place: the `Bash` gate (`publish-version-gate.sh`) still
blocks a build/publish unless the branch is bumped above base, and CI's
`checkVersionIncrement` still rejects an already-published version.

Because `migrate` clobber-copies this template into every consumer's
`.claude/settings.json`, dropping the entry here removes the block from
all consumers on their next `./config/pull`. The companion change
deletes `protect-version-file.sh` from the shared `agents` repo.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@alexander-yevsyukov alexander-yevsyukov self-assigned this Jun 18, 2026
@alexander-yevsyukov alexander-yevsyukov changed the title Stop wiring the version.gradle.kts Edit-block hook Stop wiring the version.gradle.kts Edit-block hook Jun 18, 2026
@alexander-yevsyukov alexander-yevsyukov moved this to 🏗 In progress in v2.0 Jun 18, 2026

Copilot AI left a comment

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.

Pull request overview

This PR updates the config repository’s Claude settings template to stop invoking the version-file protection hook on edit/write operations, relying instead on the existing publish/version gates to enforce correct versioning outcomes across consumer repositories.

Changes:

  • Removed the PreToolUse hook that ran protect-version-file.sh for Edit|Write|MultiEdit in .claude/settings.json.
  • Kept the existing Bash pre-PR/publish gates and the PostToolUse sanitization/copyright hooks unchanged.
Comments suppressed due to low confidence (1)

.claude/settings.json:70

  • The PR description calls protect-version-file.sh “now-unreferenced”, but this repo still wires it via .codex/hooks.json (PreToolUse apply_patch|Edit|Write). After the companion agents change deletes the script, Codex hook execution will reference a missing file (at least causing stderr / hook failure) even though .claude/settings.json no longer does. Consider removing the protect-version hook from .codex/hooks.json as part of this rollout (or explicitly scoping the PR description/rollout to Claude-only settings).
    "PreToolUse": [
      {
        "matcher": "Bash",
        "hooks": [
          {

@alexander-yevsyukov alexander-yevsyukov merged commit d93220a into master Jun 18, 2026
2 checks passed
@alexander-yevsyukov alexander-yevsyukov deleted the drop-version-edit-block-hook branch June 18, 2026 19:29
@github-project-automation github-project-automation Bot moved this from 🏗 In progress to ✅ Done in v2.0 Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants