fix(templates): stop instructing a second date prefix on dated archive names - #1388
Conversation
|
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 (1)
📝 WalkthroughWalkthroughArchive workflow templates, generated skill instructions, onboarding guidance, the archive specification, and parity tests now avoid adding a second ChangesArchive date-prefix deduplication
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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/core/templates/workflows/archive-change.ts (1)
80-87: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueUpdate mock outputs to reflect
<target-name>.The new
target-namederivation logic successfully prevents stacking date prefixes. However, theOutput On Successmock examples further down in these templates still hardcode the old format (e.g.,YYYY-MM-DD-<name>orYYYY-MM-DD-<change-1>). While the LLM will likely substitute the actual path correctly based on themvcommand, updating these placeholders ensures perfect consistency and removes any speculative chance of the LLM hallucinating a double date in its summary.
src/core/templates/workflows/archive-change.ts#L80-L87: update the mock output placeholders (e.g., around lines 106, 224, 237) to use<target-name>instead ofYYYY-MM-DD-<name>.src/core/templates/workflows/archive-change.ts#L198-L205: apply the same placeholder update to the OPSX command template's output examples.src/core/templates/workflows/bulk-archive-change.ts#L133-L138: update the mock output placeholders (e.g., around lines 211, 225) to use<change-n-target-name>(or similar) instead ofYYYY-MM-DD-<change-n>.src/core/templates/workflows/bulk-archive-change.ts#L385-L390: apply the same placeholder update to the bulk archive OPSX command template.(Note: Updating these templates will require regenerating the skill files and updating the corresponding Vitest hashes).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/core/templates/workflows/archive-change.ts` around lines 80 - 87, Update all archive workflow mock output placeholders to use the derived target-name values rather than hardcoded date-prefixed names: in src/core/templates/workflows/archive-change.ts at lines 80-87 and 198-205, use <target-name>; in src/core/templates/workflows/bulk-archive-change.ts at lines 133-138 and 385-390, use per-change placeholders such as <change-n-target-name>. Regenerate the corresponding skill files and update the affected Vitest hashes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/core/templates/workflows/archive-change.ts`:
- Around line 80-87: Update all archive workflow mock output placeholders to use
the derived target-name values rather than hardcoded date-prefixed names: in
src/core/templates/workflows/archive-change.ts at lines 80-87 and 198-205, use
<target-name>; in src/core/templates/workflows/bulk-archive-change.ts at lines
133-138 and 385-390, use per-change placeholders such as <change-n-target-name>.
Regenerate the corresponding skill files and update the affected Vitest hashes.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 8fa9e7b3-d9f0-4951-8d7e-002de945b881
📒 Files selected for processing (8)
.changeset/fix-template-archive-date-dedup.mdskills/openspec-archive-change/SKILL.mdskills/openspec-bulk-archive-change/SKILL.mdskills/openspec-onboard/SKILL.mdsrc/core/templates/workflows/archive-change.tssrc/core/templates/workflows/bulk-archive-change.tssrc/core/templates/workflows/onboard.tstest/core/templates/skill-templates-parity.test.ts
alfred-openspec
left a comment
There was a problem hiding this comment.
The target-name derivation is correct, but the single and bulk success summaries still emit archive/YYYY-MM-DD- paths, so an already-dated change can still be reported with the exact stacked date this PR is meant to eliminate. Please switch those source-template examples to the derived target-name placeholders, regenerate the committed skills and hashes, and cover the output examples in the regression test.
…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.
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.
e46d9f8 to
076827d
Compare
|
Done in The regression guard widened from the Two judgment calls, both cheap to reverse. onboard's Phase 10 Rebased onto main on the way through; #1392 had landed in the same test file. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@openspec/specs/opsx-archive-skill/spec.md`:
- Line 97: Update the earlier successful-archive scenario to use <target-name>
for the archive directory instead of unconditionally constructing
archive/YYYY-MM-DD-<name>/. Preserve the existing target-name rule in the
archive behavior requirements, including retaining an existing YYYY-MM-DD-
prefix, so both scenarios share one consistent contract.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 0484e7b3-586a-46fd-b0b2-3a17ccf65d76
📒 Files selected for processing (9)
.changeset/fix-template-archive-date-dedup.mdopenspec/specs/opsx-archive-skill/spec.mdskills/openspec-archive-change/SKILL.mdskills/openspec-bulk-archive-change/SKILL.mdskills/openspec-onboard/SKILL.mdsrc/core/templates/workflows/archive-change.tssrc/core/templates/workflows/bulk-archive-change.tssrc/core/templates/workflows/onboard.tstest/core/templates/skill-templates-parity.test.ts
🚧 Files skipped from review as they are similar to previous changes (6)
- skills/openspec-archive-change/SKILL.md
- .changeset/fix-template-archive-date-dedup.md
- skills/openspec-bulk-archive-change/SKILL.md
- src/core/templates/workflows/archive-change.ts
- test/core/templates/skill-templates-parity.test.ts
- src/core/templates/workflows/bulk-archive-change.ts
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.
alfred-openspec
left a comment
There was a problem hiding this comment.
The derived-target fix now covers the single, bulk, onboarding, generated-skill, and OPSX spec surfaces, including the previously stale success/error examples. I regenerated skills cleanly, passed strict spec validation plus 21 focused template/parity tests, and confirmed exact-head CI is green.
The agent workflow templates carry the same double-dating bug as the CLI (#1309, fixed in #1316): the archive-change and bulk-archive-change instructions tell agents to unconditionally build the archive target as
YYYY-MM-DD-<name>, so a change already named2026-07-04-voice-copilot-v1comes out asarchive/2026-07-07-2026-07-04-voice-copilot-v1— whatever the CLI does, because the behavior is baked into instruction text.This mirrors #1316's keep-as-is rule in the templates:
YYYY-MM-DD-prefix, otherwise prepend the current date; the literalmvtarget becomes<target-name>so an agent copying the command verbatim cannot stack dates.mvmoved to<target-name>, and the "Archive directory target uses current date" guardrail carries the caveat.<target-name>, with the keep-as-is rule stated inline.skills/distribution and updated the pinned template hashes; a new parity test asserts every archive-instructing template carries the caveat and never reinstates the raw stackedmvtarget.cli-archivepicked up in fix(archive): keep an existing date prefix instead of stacking a new one #1316.Notes:
skills/mirror, so the fix also flows throughpnpm generate:skills.mvtarget alone to anyYYYY-MM-DD-appearing as a path segment. The rule statements name the prefix but never place it in a path, so they stay untouched — as do the bulk Guardrails bullets, which already state both branches. onboard wasn't named in the review; its Phase 10**SHOW:**block is swept too because it's a printed example and the parity test's surface list already covers onboard — trivial to revert if you'd rather keep this to single and bulk.Fixes #1317
Written and reviewed with Claude Code using claude-fable-5
Summary by CodeRabbit
YYYY-MM-DD-prefixes when the change name already includes a date.Archived to:path is formed when names already start withYYYY-MM-DD-.