From da3abf9f1bcc41bd585e669484f44e671da81eac Mon Sep 17 00:00:00 2001 From: Bastien Chanot Date: Tue, 7 Jul 2026 00:53:49 +0200 Subject: [PATCH] job5: J5-13 delete pending verbs (v2 hook rejected by BDR-037, J4-17 moot) --- lib/doc-commit.sh | 17 ++--------------- lib/memory-commit.sh | 22 ++++++---------------- 2 files changed, 8 insertions(+), 31 deletions(-) diff --git a/lib/doc-commit.sh b/lib/doc-commit.sh index 536f8b6..323c08c 100755 --- a/lib/doc-commit.sh +++ b/lib/doc-commit.sh @@ -13,7 +13,6 @@ # Caller passes EXACTLY the files doc-sync patched this run. # # Usage (CLI): -# doc-commit.sh pending ... # exit 0 if any passed file has changes, 1 if clean # doc-commit.sh commit "" ... # surgical commit # # Exit codes (commit): 0 ok/no-op · 2 usage · 3 unsafe git state · 4 scope violation · @@ -22,7 +21,7 @@ # commit is the ONLY thing on stdout (empty on no-op/abort), so callers can capture # it: doc_hash=$(doc-commit.sh commit "msg" README.md USAGE.md). # -# Sourceable: docs_pending and commit_docs for the v2 hook. +# Sourceable: `commit_docs`. set -uo pipefail @@ -70,14 +69,6 @@ _changed_paths() { done } -# 0 if any passed path has pending changes, 1 if all clean / absent. -docs_pending() { - _in_git_repo || return 1 - local changed - mapfile -t changed < <(_changed_paths "$@") - [ "${#changed[@]}" -gt 0 ] -} - # Surgical commit of the passed doc paths only. Returns 0 (ok/no-op), 3 (unsafe), # 4 (scope violation), 5 (commit rejected by git). On a real commit, prints the # doc-commit short hash to stdout. @@ -143,16 +134,12 @@ commit_docs() { main() { local cmd="${1:-}" case "$cmd" in - pending) - shift - docs_pending "$@" - ;; commit) shift commit_docs "$@" ;; *) - echo "usage: doc-commit.sh {pending ... | commit ...}" >&2 + echo "usage: doc-commit.sh commit ..." >&2 return 2 ;; esac diff --git a/lib/memory-commit.sh b/lib/memory-commit.sh index e09aae4..1f55f59 100755 --- a/lib/memory-commit.sh +++ b/lib/memory-commit.sh @@ -1,20 +1,19 @@ #!/usr/bin/env bash # memory-commit.sh — surgically commit ONLY .claude/memory + .claude/tasks. # -# Used by the dev-flow capitalize step (and, later, the v2 Stop hook) to couple -# the memory commit to the flow. Safety lives in the PATHSPEC, never in a human -# diff review — automation removes that review, so the scope must be airtight: -# code that happens to be dirty or staged is NEVER embarked. +# Used by the dev-flow capitalize step to couple the memory commit to the +# flow. Safety lives in the PATHSPEC, never in a human diff review — +# automation removes that review, so the scope must be airtight: code that +# happens to be dirty or staged is NEVER embarked. # # Usage (CLI): -# memory-commit.sh pending # exit 0 if memory/tasks have changes, 1 if clean # memory-commit.sh commit "" # surgical commit; exit 0 ok/no-op, 3 unsafe state # # Output contract for `commit`: diagnostics go to stderr; on a real commit the # short hash of the MEMORY commit is the ONLY thing on stdout (empty on no-op or # unsafe), so callers can capture it: `mem_hash=$(memory-commit.sh commit "msg")`. # -# Sourceable: `memory_pending` and `commit_memory` for the v2 hook. +# Sourceable: `commit_memory`. set -uo pipefail @@ -47,14 +46,6 @@ _changed_paths() { done } -# 0 if something is pending under the scoped paths, 1 if clean / absent. -memory_pending() { - _in_git_repo || return 1 - local changed - mapfile -t changed < <(_changed_paths) - [ "${#changed[@]}" -gt 0 ] -} - # Surgical commit of the scoped paths only. Returns 0 (ok or no-op), 3 (unsafe). # On a real commit, prints the memory-commit short hash to stdout (stderr = diag). commit_memory() { @@ -103,13 +94,12 @@ commit_memory() { main() { local cmd="${1:-}" case "$cmd" in - pending) memory_pending ;; commit) shift commit_memory "${1:-}" ;; *) - echo "usage: memory-commit.sh {pending | commit }" >&2 + echo "usage: memory-commit.sh commit " >&2 return 2 ;; esac