Repository navigation
Description
Summary
Branches with a / in the name (the conventional feat/*, fix/*, chore/*) are sanitized three different ways across the gstack codebase. Writers and the reader use different transforms, so the same branch's review history gets split across up to two files on disk and the review-readiness dashboard reads from only one of them.
Three transforms coexist
All three are run against a bare git rev-parse --abbrev-ref HEAD / git branch --show-current, to produce a $BRANCH that then gets used in $GSTACK_HOME/projects/$SLUG/$BRANCH-reviews.jsonl:
- Strip form (
tr -cd 'a-zA-Z0-9._-') —feat/foo→featfoo.
bin/gstack-slug:44. This is whatbin/gstack-review-log(writer) andbin/gstack-review-read(reader) both use, because they botheval "$(gstack-slug)". - Dash form (
tr '/' '-') —feat/foo→feat-foo.
ship/SKILL.md:1624(Step 8 plan audit), and other skill steps that do their owngit branch --show-current | tr '/' '-'inline. - Bare slash (no transform) —
feat/foostaysfeat/foo.
context-restore/ship/review/ every skill's Context Recovery block sets_BRANCH=$(git branch --show-current ...)and then uses it ingrep "\"branch\":\"${_BRANCH}\""against jsonl files and as"$_PROJ/${_BRANCH}-reviews.jsonl"existence checks.
Evidence — same branch, multiple files on disk
~/.gstack/projects/invoice_approval/ on my machine, after a handful of ship cycles:
feat-ocr-monorepo-migration-reviews.jsonl ← branch "feat/ocr-monorepo-migration"
featocr-monorepo-migration-reviews.jsonl ← SAME branch, different sanitizer
feat-clerk-v7-webhooks-reviews.jsonl ← branch "feat/clerk-v7-webhooks"
featclerk-v7-webhooks-reviews.jsonl ← SAME branch, different sanitizer
feat-characterization-tolerance-reviews.jsonl ← branch "feat/characterization-tolerance" (only dash form exists)
fixocr-conftest-aws-env-isolation-reviews.jsonl ← branch "fix/ocr-conftest-aws-env-isolation" (only strip form)
Two branches have the review history split across two files. For the others, only one transform wrote any entries this time around, so only one file exists — but the historical record is incomplete either way.
Impact
- Review-readiness dashboard undercounts reviews. Step 1 of
/shipcallsbin/gstack-review-read, which reads via the strip form. Reviews written by any caller using the dash form (including parts of /ship itself via inlinetr '/' '-') are invisible to the dashboard. - Cross-review finding dedup is broken for slashed branches.
ship/SKILL.md:2481(Step 9.3) callsgstack-review-read(strip form) and compares against the current HEAD's findings. Entries written under the dash form never participate in "skipped findings shouldn't be re-flagged" dedup. - context-restore's 'LAST_SESSION' and 'RECENT_PATTERN' checks use bare-slash
$_BRANCHto greptimeline.jsonl.timeline.jsonlappears to use the bare form consistently (those greps do work), but any jsonl-writing skill that uses a different transform leaves entries that context-restore can't cross-reference. - Silent by design. Every call site pipes to
2>/dev/null || true, so failed writes never surface. Users don't notice their review history is being split until they look at disk.
Suggested fix
Normalize branch in exactly one place and use it everywhere. Options:
- Preferred: single sanitizer in
bin/gstack-slug, switch the output to dash form (feat/foo→feat-foo) since it's more readable on disk and reversible-ish. Update thetrcommand onbin/gstack-slug:44and remove all ad-hoctr '/' '-'and bare$BRANCHuses across the skill files; everyone doeseval "$(gstack-slug)"and uses$BRANCH. - Add
mkdir -p "$(dirname "$TARGET_FILE")"before everyecho ... >> ...-reviews.jsonlas a backstop, so the bare-slash case at least creates thefix/subdir instead of silently failing (this would catch users who write their own inline ship steps). - Ship a one-time migration in
setup/gstack-upgrade: for eachfeatfoo-*.jsonl+feat-foo-*.jsonlpair in~/.gstack/projects/*/, merge to one canonical filename. Without migration, existing users' history stays split forever.
Repro
# On a fresh project, check out a branch with a slash
git checkout -b feat/demo-bug
# Run /review then /ship. Both complete successfully.
# Now look at disk:
ls -la ~/.gstack/projects/<your-project>/*reviews.jsonl
# Expect to see at least one "featdemo-bug-reviews.jsonl" (strip form)
# and possibly a "feat-demo-bug-reviews.jsonl" (dash form) depending on
# which skills got run.Env
- gstack version: whatever the current upstream was as of 2026-04-21
- macOS 25.4.0, zsh
- Git with SSH remote
Discovery context
Noticed while running /ship on fix/ocr-conftest-aws-env-isolation. Ran gstack-review-read at Step 1 — got NO_REVIEWS despite a prior gstack-review-log call from Step 9 that reported success. Disk inspection showed the review went into fixocr-conftest-aws-env-isolation-reviews.jsonl (strip form) while the read attempt was checking the wrong path.
Activity
kkru-labs commentedon Apr 21, 2026
The three-transform coexistence is a real headache — when
feat/add-memory-hookgets written asfeat-add-memory-hook.jsonlby one writer andfeat_add_memory_hook.jsonlby another, you end up with ghost history that is invisible to the dashboard but still clutters~/.gstack/projects/$SLUG/. A canonical normalizer function that all callers import from would fix the root cause and make the fix auditable. One thing worth deciding before the fix: are forward slashes in branch names worth supporting at all? A lot of teams use them but they complicate filesystem pathing everywhere — might be simpler to canonicalize to a single form (e.g. replace/with-) and document it as the standard.time-attack commentedon Jul 15, 2026
@marcosmoova Inconsistent branch sanitization, split review files, and missing dashboard entries remain unresolved until the selected implementation lands.
3322242 commentedon Jul 29, 2026
Confirming the bare-slash form (transform 3) failing in the wild today, on gstack 1.60.1.0 — a concrete instance of the
mkdir -pbackstop this issue proposes.What happened.
/shipon branchfeat/4-posting-servicecompleted normally: PR created, everything green. Step 20's metrics write silently did nothing:ship/SKILL.md:1356interpolates$BRANCHstraight into the path:With
BRANCH=feat/4-posting-servicethe redirect targets…/projects/3322242-lad-erp/feat/4-posting-service-reviews.jsonl, and nofeat/directory exists. The write fails,/retronever sees this ship, and nothing surfaces to the user.The inconsistency is inside a single skill file.
ship/sections/plan-completion.md:19sanitizes for the same project directory:BRANCH=$(git branch --show-current 2>/dev/null | tr '/' '-')while
ship/SKILL.md:1356does not. Step 8 and Step 20 of the same workflow disagree about the filename.Scope on disk: 53 files under
~/.claude/skills/gstack/reference$BRANCH-reviews.jsonl/${_BRANCH}-reviews.jsonlin an unsanitized form, spanning ~20 skills (autoplan,canary,codex,context-save,context-restore,design-*,devex-review,document-*,health,investigate,ios-*, …).Why this hits most users: gstack's own routing guidance recommends
<type>/<issue#>-<slug>branch names, so the slash is the norm rather than an edge case. Every ship from a conventionally-named branch loses its metrics row.Happy to send a PR for the
mkdir -pbackstop if that's the increment you want first — it's independent of the larger single-sanitizer normalization and would stop the silent data loss immediately.ShuratCode commentedon Aug 6, 2026
Confirming this is still live on 1.60.1.0, and picking up the writer side.
Fresh evidence from one project directory today: 20 branches are split across
two files each, and the pattern is perfectly consistent. The dash-form file
holds only the
shiprow; the strip-form file holds only the other skills'rows. Not one of the 20 is mixed.
Clearest single case, branch
feat/cdk-app-scaffold-R-1053:feat-cdk-app-scaffold-R-1053-reviews.jsonl(dash form) — the/shiprowfeatcdk-app-scaffold-R-1053-reviews.jsonl(strip form) — the/reviewrow,written three hours earlier the same day
feat/partners-list-page-R-620is the same shape with more on the strip side:/shipin the dash file,/reviewand/plan-eng-reviewin the strip file.One nuance worth recording: transform 3 has two distinct failure modes, and
which one you get depends on the machine.
feat/directory exists → the redirect dies (no such file or directory,as @3322242 reported above) and the row is lost.
feat/directory already exists → the write succeeds into it, and therow is simply invisible to every flat glob. That is this machine: 5 rows sit in
projects/<slug>/feat/.So "rows are lost" and "rows are fragmented" are both correct reports of the same
bug. Scale here: 303 of 308 rows (98.4%) are top-level and reachable; 5 are
stranded in the subdirectory. All 5 are
shiprows — they carry acoverage_pct, but none carry plan-item counts (four are0, one is-1), sothere is very little history actually worth recovering.
Scoping my PR to the writer side only —
bin/gstack-slugplus ship Step 20 —since #1851 already covers the read path. Re @kkru-labs's canonical-normalizer
suggestion: aligning
gstack-slugto the dash form is the minimal version ofthat (one authority instead of three), and extracting a shared helper is a clean
follow-up.
v1.64.0.0 fix wave: full tracker audit — 90 fixes, 52 issues closed, …