fix(slug): avoid parent repo identity in subdirs#1621
Conversation
942e049 to
133c6cb
Compare
|
Rebased onto current This fixes a distinct bug from #1848: #1848 added unconditional cache-value sanitization, while this PR stops a nested standalone project from inheriting its parent repo's identity (it checks Verification:
|
… 401ing
The report job upserts its E2E summary via the REST /issues/{n}/comments
endpoints (gh api), which GITHUB_TOKEN gates behind the issues permission, not
pull-requests. The job only granted pull-requests:write, so the GET 401'd on
every PR that produced eval artifacts (PRs with no artifacts exit early and never
reach the call, which masked it). Pre-existing; surfaced here because this PR
runs evals. Confirmed identical failure on #1188 and #1621.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Fixes #1125
Summary
gstack-slugis run from a subdirectory that is not the git root.gstack-slugfile in the current directory or an ancestor pin the project slug before cache/git inferenceRoot cause
gstack-slugtrustedgit remote get-url originbefore 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-slugbun test test/review-log.test.ts test/gstack-learnings-search.test.tsbun test test/skill-validation.test.tsme-workspacegit diff --check origin/main...HEADgit merge-tree --write-tree HEAD origin/mainCollision 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/mainalready has basename/unknown fallback behavior; #564 does not address parent-repo inheritance,.gstack-slugoverrides, or stale cache recovery.