From f2948df63992edee64d72742829eb003e96abe84 Mon Sep 17 00:00:00 2001 From: Bastien Chanot Date: Mon, 6 Jul 2026 21:48:14 +0200 Subject: [PATCH] job4: seam session-start.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Env-var-only seam (§3.2), zero logic change (diff is one added condition): the version-check `git fetch` at :215 now skips when SESSION_START_OFFLINE is set (non-empty), leaving _remote_ver empty (same as any other offline/fetch-failure path already handled) instead of hitting the network. Unlocks (BACKLOG, not built here): a HOME-injected truth-table + smoke test for session-start.sh (J4-14), without every run paying a network round-trip or depending on origin/main being reachable. Verified: bash -n clean, shellcheck clean (pre-existing SC1091 info only, unrelated). Behavioral: SESSION_START_OFFLINE=1 runs in ~15ms (no fetch) vs ~740ms unset (fetch attempted) — identical banner output either way (v4.0.0 == CONFIG_VERSION, no update line in both). Full `make test` exit 0. --- hooks/session-start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hooks/session-start.sh b/hooks/session-start.sh index ba89d8d..4aa57f7 100644 --- a/hooks/session-start.sh +++ b/hooks/session-start.sh @@ -211,7 +211,7 @@ if [ -n "$REPO_DIR" ] && [ -f "$REPO_DIR/CLAUDE.md" ]; then fi # Version check: compare local vs remote (non-blocking) _remote_ver="" -if [ -n "$REPO_DIR" ] && [ -d "$REPO_DIR/.git" ]; then +if [ -n "$REPO_DIR" ] && [ -d "$REPO_DIR/.git" ] && [ -z "${SESSION_START_OFFLINE:-}" ]; then _remote_ver=$(cd "$REPO_DIR" 2>/dev/null && git fetch origin --quiet 2>/dev/null && git show origin/main:version.txt 2>/dev/null) || _remote_ver="" fi if [ -n "$_remote_ver" ] && [ "$_remote_ver" != "$CONFIG_VERSION" ]; then