From 17a36cc83980d278a8cab5132bf14de731b352ca Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Mon, 16 Mar 2026 19:46:44 +0000 Subject: fix: repair test regressions and add pre-commit/pre-push verification gates Fix four pre-existing bugs exposed after resolving a build failure: - sandboxCloneSource: accept any URL scheme for origin remote (was filtering out https://) - setupSandbox callers: fix := shadow variable so sandboxDir is set on BlockedError - parseGeminiStream: parse result lines to return execution errors and cost - TestElaborateTask_InvalidJSONFromClaude: stub Gemini fallback so test is hermetic Add verification infrastructure: - scripts/verify: runs go build + go test -race, used by hooks and deploy - scripts/hooks/pre-commit: blocks commits that don't compile - scripts/hooks/pre-push: blocks pushes where tests fail - scripts/install-hooks: symlinks version-controlled hooks into .git/hooks/ - scripts/deploy: runs scripts/verify before building the binary Co-Authored-By: Claude Sonnet 4.6 --- scripts/deploy | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'scripts/deploy') diff --git a/scripts/deploy b/scripts/deploy index c7ff734..206087d 100755 --- a/scripts/deploy +++ b/scripts/deploy @@ -31,21 +31,22 @@ if [ "$DIRTY" = false ] && [ -n "$(git status --porcelain)" ]; then trap 'if [ "$STASHED" = true ]; then echo "==> Popping stash..."; git stash pop; fi' EXIT fi +echo "==> Verifying (build + tests)..." +"${REPO_DIR}/scripts/verify" + echo "==> Building claudomator..." export GOCACHE="${SITE_DIR}/cache/go-build" export GOPATH="${SITE_DIR}/cache/gopath" mkdir -p "${GOCACHE}" "${GOPATH}" go build -o "${BIN_DIR}/claudomator" ./cmd/claudomator/ +chown www-data:www-data "${BIN_DIR}/claudomator" +chmod +x "${BIN_DIR}/claudomator" echo "==> Copying scripts..." mkdir -p "${SITE_DIR}/scripts" -cp "${REPO_DIR}/scripts/"* "${SITE_DIR}/scripts/" +cp -p "${REPO_DIR}/scripts/"* "${SITE_DIR}/scripts/" chown -R www-data:www-data "${SITE_DIR}/scripts" -chmod +x "${SITE_DIR}/scripts/"* - -echo "==> Fixing permissions..." -chown www-data:www-data "${BIN_DIR}/claudomator" -chmod +x "${BIN_DIR}/claudomator" +find "${SITE_DIR}/scripts" -maxdepth 1 -type f -exec chmod +x {} + if [ -f "${BIN_DIR}/claude" ]; then echo "==> Fixing Claude permissions..." -- cgit v1.2.3