fix(archive): keep an existing date prefix instead of stacking a new one#1316
Merged
Merged
Conversation
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughUpdates archive naming so fully date-prefixed change names are preserved, with corresponding specification updates, regression tests, and a patch changeset. ChangesArchive Date Prefix Dedup
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related issues
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Archiving unconditionally prepended today's date to the change name, so a change already named with the common YYYY-MM-DD- convention came out double-dated (2026-07-07-2026-07-04-voice-copilot-v1) — and when archived on a later day, the folder sorted under a day on which the change did not happen. Detect a full YYYY-MM-DD- prefix and archive the change under its own name. Names without one (including partial dates like 2026-07-feature) keep the current behavior. This also makes the naming idempotent. Nothing in src/ parses the date back out of archive folder names — the prefix only drives human chronological sorting — so keeping the original date is the minimal, non-breaking choice. The cli-archive spec wording is updated to match. Fixes Fission-AI#1309
mc856
force-pushed
the
fix/archive-date-prefix-dedup
branch
from
July 18, 2026 17:11
952d4af to
c9cdf5e
Compare
alfred-openspec
approved these changes
Jul 18, 2026
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
openspec archiveunconditionally prepends today's date to the change name. A change already named with the commonYYYY-MM-DD-convention comes out double-dated, and when archived on a later day the folder sorts under a day on which the change did not happen.Reproduced in a clean sandbox against main:
openspec archive 2026-07-04-voice-copilot-v1 --yes→archived as '2026-07-07-2026-07-04-voice-copilot-v1'.Changes
^YYYY-MM-DD-prefix inArchiveCommandand archive the change under its own name; names without one (including partial dates like2026-07-feature) keep the current behavior. This also makes the naming idempotent, per the issue's expectation.src/parses the date back out of archive folder names — the prefix only drives human chronological sorting — so keeping the original date is the minimal, non-breaking choice.openspec/specs/cli-archive/spec.mdlines that describe target-name generation and the date-prefixing rationale to match (direct spec edits alongsidesrc/follow the precedent of fix: detect hidden requirements in main specs #966).Testing
test/core/archive.test.ts: an existing-prefix name is archived as-is; a partial-date name (2026-07-feature) still gets today's prefix (asserted as a pattern to avoid a UTC-midnight race). The existing first case covers plain names.vitest run: 1813 passed, 1 pre-existing environment-dependent failure intest/commands/workset.test.ts(fails identically on pristine main when a realclaudebinary is on PATH);eslint src/0 errors (1 pre-existing warning);tsc --noEmitandnode build.jsclean.2026-07-04-voice-copilot-v1now archives under its own name;plain-featurearchives as2026-07-07-plain-feature.Notes
mvtoarchive/YYYY-MM-DD-<name>(src/core/templates/workflows/archive-change.ts:87,205,bulk-archive-change.ts:135,384,onboard.ts:450), so the opsx workflow path can still stack a prefix. Happy to file a follow-up issue.Fixes #1309
Summary by CodeRabbit
openspec archiveto avoid stacking an extraYYYY-MM-DD-prefix when the provided change name already begins with a full date prefix, preventing incorrect archive folder names and sorting.YYYY-MM-DD-and partial date-like prefixes to ensure the archive target folder name is generated correctly.