Repository navigation
Resolve archived changes by their original slug - #143
Merged
Merged
Conversation
openspec archive renames a change's folder with a date prefix (changes/archive/<YYYY-MM-DD>-<slug>), but specsync assumed slug resolution against that folder was always an exact match: - LoadChangeBySlug's archived fallback checked only the exact changes/archive/<slug> path, so `specsync -change <slug>` errored with "no change found" for any already-archived change. - LoadChange derived Change.Slug from the folder's literal basename, so an archived change's logical identity silently became its date-prefixed name instead of staying the slug it was created and worked under. - resolveEntry (links.md slug resolution) had the identical exact-path bug, so a links.md entry naming a sibling change went silently unresolved the moment that sibling was archived. - Because Find/ResolveLiveRefs search for an issue's identity marker keyed off Change.Slug, the same date-prefix drift broke live GitHub resolution on any checkout with no local ref cache — every fresh CI run. This is what silently emptied v0.13.0's changelog/release notes and caused sync.yml to create a duplicate issue (#141) for sync-design-notes (#139) instead of finding its existing one. Fixes all four: LoadChange now strips a leading date prefix from an archived change's Slug (Dir keeps the real path), and LoadChangeBySlug/resolveEntry both fall back to a date-prefix-aware glob when the exact archive path doesn't exist, erroring on ambiguous matches instead of guessing. Closes #128
Deploying specsync with
|
| Latest commit: |
a84ff37
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://f6503d4c.specsync.pages.dev |
| Branch Preview URL: | https://fix-archived-slug-resolution.specsync.pages.dev |
androidand
added a commit
that referenced
this pull request
Aug 28, 2026
…resolution Left behind by a `git reset --hard origin/main` between archiving the change locally and committing the archive move — it restored the pre-archive folder (already merged via #143) alongside the new archived copy, so both existed on main at once and doubled the v0.13.1 changelog entry (same normalized slug, counted twice). Refs #128
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #128.
openspec archiverenames a change's folder with a date prefix (changes/archive/<YYYY-MM-DD>-<slug>); specsync assumed slug resolution against that folder was always an exact match. That broke four related things:LoadChangeBySlugerrored with "no change found" for any already-archived change.Change.Slugsilently became the date-prefixed folder name instead of staying stable across the active → archived transition.resolveEntry(links.md slug resolution) had the identical exact-path bug.Find/ResolveLiveRefssearch for an issue by its marker keyed offChange.Slug, so the same drift broke live GitHub resolution on any checkout with no local ref cache — every fresh CI run. This is what silently emptied v0.13.0's changelog/release notes and causedsync.ymlto create a duplicate issue ([duplicate of #139] Sync design.md into the issue body #141) forsync-design-notes(Sync design.md into the issue body #139) instead of finding its existing one.Fix
LoadChangestrips a leading date prefix from an archived change'sSlug(Dirkeeps the real, date-prefixed path).LoadChangeBySlugandresolveEntryboth fall back to a date-prefix-aware glob againstchanges/archive/*when the exact path doesn't exist, erroring on ambiguous matches rather than guessing.Testing
Find/ResolveLiveRefslocating an archived change's issue by its pre-archive marker with no local ref cache.specsync -change <slug>(same original slug) no longer errors.go build,go vet,go test ./...,release-plan -fail-on-archive-candidates,changelog -fail-on-unlinked-commits,audit-tasks -fail-on-mismatch, andvalidateall pass locally.🤖 Generated with Claude Code