diff --git a/molecule_runtime/scripts/pre-commit-block-internal-paths.sh b/molecule_runtime/scripts/pre-commit-block-internal-paths.sh index 0a5682c..29a49d8 100644 --- a/molecule_runtime/scripts/pre-commit-block-internal-paths.sh +++ b/molecule_runtime/scripts/pre-commit-block-internal-paths.sh @@ -27,6 +27,22 @@ if [ -z "${GIT_AUTHOR_NAME:-}${GIT_COMMITTER_NAME:-}" ]; then exit 0 fi +# Skip during rebase / cherry-pick / merge / revert — these REPLAY existing +# commits and the staged file set is whatever was already committed +# upstream. Blocking those forces the agent to manually rewrite history +# (interactive rebase + manual file deletion + commit amend) which most +# agents won't do — net effect was 15+ DIRTY PRs sitting unmergeable on +# molecule-core after the hook landed (cycle 107 trace, 2026-04-24). +# +# Detection via .git state directories. These exist only during the +# corresponding operation and get cleaned up at the end. +GIT_DIR=$(git rev-parse --git-dir 2>/dev/null || echo .git) +for state_dir in rebase-merge rebase-apply CHERRY_PICK_HEAD MERGE_HEAD REVERT_HEAD; do + if [ -e "${GIT_DIR}/${state_dir}" ]; then + exit 0 + fi +done + # Determine if we're in a public Molecule-AI repo. `git remote get-url` # returns nothing in repos without a remote (fine — exit clean). REMOTE=$(git remote get-url origin 2>/dev/null || echo "") diff --git a/pyproject.toml b/pyproject.toml index 20cbb25..f8c38cb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta" [project] name = "molecule-ai-workspace-runtime" -version = "0.1.13" +version = "0.1.14" description = "Molecule AI workspace runtime — shared infrastructure for all agent adapters" requires-python = ">=3.11"