fix(archive): keep an existing date prefix instead of stacking a new one#1316
fix(archive): keep an existing date prefix instead of stacking a new one#1316mc856 wants to merge 3 commits into
Conversation
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
|
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 (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughUpdates archive naming so an already date-prefixed change name is not prefixed again, and synchronizes the specification, regression tests, and changeset with that behavior. ChangesArchive Date Prefix Dedup
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related issues
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Tools execution failed with the following error: Failed to run tools: 14 UNAVAILABLE: read ECONNRESET 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 |
…efix-dedup # Conflicts: # src/core/archive.ts
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 additionalYYYY-MM-DD-prefix when the provided change name already includes one, preventing incorrect archive folder names and sorting.YYYY-MM-DD-prefix.YYYY-MM-DD-and partial date-prefix change-name inputs to verify correct archive folder naming behavior.