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
mc856
added a commit
to mc856/OpenSpec
that referenced
this pull request
Jul 21, 2026
…e names The archive-change and bulk-archive-change workflow templates told agents to unconditionally build the archive target as YYYY-MM-DD-<name>, so a change already named with the common YYYY-MM-DD- convention came out double-dated — the template-side twin of the CLI bug fixed in Fission-AI#1316, which a CLI fix cannot reach because the behavior is baked into instruction text. The generate-target-name step and the bulk guardrail now mirror the CLI rule: use the change name as-is when it already starts with a YYYY-MM-DD- prefix, otherwise prepend the current date. The literal mv commands move to <target-name> so an agent copying them verbatim cannot stack dates, and the onboarding walkthrough's archived-path example carries the same caveat. Regenerated skills/ and updated the pinned parity hashes; a new parity test guards the caveat and rejects the raw stacked mv target.
pull Bot
pushed a commit
to ben-vargas/ai-openspec
that referenced
this pull request
Jul 22, 2026
…e names (Fission-AI#1388) * fix(templates): stop instructing a second date prefix on dated archive names The archive-change and bulk-archive-change workflow templates told agents to unconditionally build the archive target as YYYY-MM-DD-<name>, so a change already named with the common YYYY-MM-DD- convention came out double-dated — the template-side twin of the CLI bug fixed in Fission-AI#1316, which a CLI fix cannot reach because the behavior is baked into instruction text. The generate-target-name step and the bulk guardrail now mirror the CLI rule: use the change name as-is when it already starts with a YYYY-MM-DD- prefix, otherwise prepend the current date. The literal mv commands move to <target-name> so an agent copying them verbatim cannot stack dates, and the onboarding walkthrough's archived-path example carries the same caveat. Regenerated skills/ and updated the pinned parity hashes; a new parity test guards the caveat and rejects the raw stacked mv target. * fix(templates): report the derived archive name in success summaries The success and failure summaries still printed archive/YYYY-MM-DD-<name>, so an agent copying them would report a stacked date for a change whose name already carries a YYYY-MM-DD- prefix. Point those examples at <target-name> instead, and widen the regression guard from the mv target to any date used as a path segment, which leaves the rule statements that must keep explaining the derivation untouched. The opsx-archive-skill spec still specified the unconditional current-date rule the previous commit removed from the template, so bring it in line with the wording cli-archive already carries. * fix(specs): name the derived target in the archive scenario The successful-archive scenario still spelled the destination as archive/YYYY-MM-DD-<name>/, the same literal form this PR removed from the templates, so it contradicted the keep-as-is rule the behavior requirements now carry.
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.