Skip to content

fix(slug): avoid parent repo identity in subdirs#1621

Open
jbetala7 wants to merge 1 commit into
garrytan:mainfrom
jbetala7:oss/fix-1125-gstack-slug-subdir
Open

fix(slug): avoid parent repo identity in subdirs#1621
jbetala7 wants to merge 1 commit into
garrytan:mainfrom
jbetala7:oss/fix-1125-gstack-slug-subdir

Conversation

@jbetala7
Copy link
Copy Markdown
Contributor

Fixes #1125

Summary

  • ignore parent repository remotes when gstack-slug is run from a subdirectory that is not the git root
  • let a .gstack-slug file in the current directory or an ancestor pin the project slug before cache/git inference
  • treat slug cache as a fallback for transient inference failures, not as an immutable source of truth when current inference or an override is available

Root cause

gstack-slug trusted git remote get-url origin before checking whether the current directory was actually the repository root. In a standalone project nested under a larger git repo, Git walked up to the parent repo, so the child project inherited the parent repo slug. Because cache lookup happened first, a bad slug-cache entry could keep that mistake alive indefinitely.

Verification

  • bun test test/skill-validation.test.ts -t gstack-slug
  • bun test test/review-log.test.ts test/gstack-learnings-search.test.ts
  • bun test test/skill-validation.test.ts
  • direct repro: nested directory under a parent repo with remote now returns the child basename instead of me-workspace
  • git diff --check origin/main...HEAD
  • git merge-tree --write-tree HEAD origin/main

Collision check

Searched open PRs/issues for 1125 gstack-slug outer repo subdirectory, gstack-slug subdirectory outer repo, bin/gstack-slug subdirectory slug-cache, slug-cache, and .gstack-slug.

Closest open PR is #564, but that is an older missing-git-context fallback patch. Current origin/main already has basename/unknown fallback behavior; #564 does not address parent-repo inheritance, .gstack-slug overrides, or stale cache recovery.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gstack-slug inherits outer-repo slug when project is a subdirectory; cache is unrecoverable

1 participant