From 7e0d291d98c228546541fd253eacdd22323cdd43 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Tue, 17 Mar 2026 20:56:30 -0700 Subject: [PATCH] fix: add gstack-review-log and gstack-review-read atomic helpers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Branch names with `/` (e.g. garrytan/design-system) break review log filepaths when Claude Code runs multi-line bash blocks as separate shell invocations — eval sets $SLUG/$BRANCH in shell 1, but they're gone by the time mkdir and echo run in shells 2+3. These two scripts encapsulate the full operation (slug detection + mkdir + file I/O) in a single command, eliminating the variable persistence problem. Both support GSTACK_HOME env var override for testability. Co-Authored-By: Claude Opus 4.6 (1M context) --- bin/gstack-review-log | 9 +++++++++ bin/gstack-review-read | 10 ++++++++++ 2 files changed, 19 insertions(+) create mode 100755 bin/gstack-review-log create mode 100755 bin/gstack-review-read diff --git a/bin/gstack-review-log b/bin/gstack-review-log new file mode 100755 index 00000000..ad29c172 --- /dev/null +++ b/bin/gstack-review-log @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +# gstack-review-log — atomically log a review result +# Usage: gstack-review-log '{"skill":"...","timestamp":"...","status":"..."}' +set -euo pipefail +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +eval $("$SCRIPT_DIR/gstack-slug" 2>/dev/null) +GSTACK_HOME="${GSTACK_HOME:-$HOME/.gstack}" +mkdir -p "$GSTACK_HOME/projects/$SLUG" +echo "$1" >> "$GSTACK_HOME/projects/$SLUG/$BRANCH-reviews.jsonl" diff --git a/bin/gstack-review-read b/bin/gstack-review-read new file mode 100755 index 00000000..8c4650dd --- /dev/null +++ b/bin/gstack-review-read @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +# gstack-review-read — read review log and config for dashboard +# Usage: gstack-review-read +set -euo pipefail +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +eval $("$SCRIPT_DIR/gstack-slug" 2>/dev/null) +GSTACK_HOME="${GSTACK_HOME:-$HOME/.gstack}" +cat "$GSTACK_HOME/projects/$SLUG/$BRANCH-reviews.jsonl" 2>/dev/null || echo "NO_REVIEWS" +echo "---CONFIG---" +"$SCRIPT_DIR/gstack-config" get skip_eng_review 2>/dev/null || echo "false"