mirror of
https://github.com/garrytan/gstack.git
synced 2026-09-09 22:48:57 +02:00
Branch-name-to-filename had incompatible rules across writer and readers: gstack-review-log WRITES <branch>-reviews.jsonl with the gstack-slug canonical form (tr '/' '-' then tr -cd 'a-zA-Z0-9._-', bin/gstack-slug:178), but Context Recovery PROBED it with raw $_BRANCH from git branch --show-current — so for any branch containing a '/' the REVIEWS line never fired (#1851's reader half of #1127). The probe now uses ${BRANCH:-unknown}, the canonical value the gstack-slug eval on the block's first line already sets. review.ts's plan content-search BRANCH gains the missing tr -cd half so it matches the same canonical pipeline. Full audit of the 5 raw $_BRANCH interpolation sites in scripts/resolvers/ (E3): generate-context-recovery.ts:16 (reviews.jsonl path) -> canonical BRANCH; :19/:21 (timeline.jsonl content greps) KEEP raw $_BRANCH because the timeline writer (preamble's gstack-timeline-log call) stores the raw branch in the "branch" field — slugging the reader would break that pairing; generate-preamble-bash.ts:29 (display echo) and :97 (timeline data write) keep raw by design. The *-$BRANCH-design-*.md family (review.ts:313 + 3 plan-review templates) is a consistent tr '/' '-' writer/reader pair and is deliberately untouched. test/branch-slug-hygiene.test.ts pins the discipline: a rendered-output sweep forbids raw $_BRANCH adjacent to a path separator or as a filename prefix in ANY generated SKILL.md/section, and a live round-trip on a feat/slash branch proves gstack-review-log's write is found by the rendered probe (with the raw-form shape as a negative control). Reader-side fix folded from PR #1851. Contributed by @harjothkhara. Fixes #2550 Fixes #1127 Co-authored-by: harjothkhara <harjothkhara@users.noreply.github.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>