Skip to content

fix(templates): stop instructing a second date prefix on dated archive names#1388

Open
mc856 wants to merge 1 commit into
Fission-AI:mainfrom
mc856:fix/template-archive-date-dedup
Open

fix(templates): stop instructing a second date prefix on dated archive names#1388
mc856 wants to merge 1 commit into
Fission-AI:mainfrom
mc856:fix/template-archive-date-dedup

Conversation

@mc856

@mc856 mc856 commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

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 named 2026-07-04-voice-copilot-v1 comes out as archive/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:

  • archive-change (skill + command): the generate-target-name step now says use the change name as-is when it already starts with a YYYY-MM-DD- prefix, otherwise prepend the current date; the literal mv target becomes <target-name> so an agent copying the command verbatim cannot stack dates.
  • bulk-archive-change (skill + command): same target-name rule added to the execute step, mv moved to <target-name>, and the "Archive directory target uses current date" guardrail carries the caveat.
  • onboard: the archived-path example notes that an already-dated name is kept as-is.
  • Regenerated the committed 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 stacked mv target.

Notes:

Fixes #1317

Written and reviewed with Claude Code using claude-fable-5

Summary by CodeRabbit

  • Bug Fixes

    • Prevented archive paths from receiving duplicate date prefixes when change names already begin with YYYY-MM-DD-.
    • Applied the corrected naming consistently to single-change and bulk archive workflows.
    • Added safeguards to report an error when the destination archive path already exists.
  • Documentation

    • Clarified archive destination behavior in onboarding guidance and workflow instructions.

…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.
@mc856
mc856 requested a review from TabishB as a code owner July 19, 2026 04:43
@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Archive workflow templates, generated skill instructions, onboarding guidance, and parity tests now avoid adding a second YYYY-MM-DD- prefix when archiving already-dated change names. A patch changeset documents the correction.

Changes

Archive date-prefix deduplication

Layer / File(s) Summary
Update archive target generation
src/core/templates/workflows/archive-change.ts, src/core/templates/workflows/bulk-archive-change.ts
Archive and bulk-archive templates preserve existing date prefixes, derive a target-name, and move changes into the corresponding archive path.
Align workflow guidance
skills/openspec-archive-change/SKILL.md, skills/openspec-bulk-archive-change/SKILL.md, skills/openspec-onboard/SKILL.md, src/core/templates/workflows/onboard.ts
Skill and onboarding instructions document that already-prefixed names are used as-is.
Update parity validation and release notes
test/core/templates/skill-templates-parity.test.ts, .changeset/fix-template-archive-date-dedup.md
Expected template hashes are updated, a regression parity test checks for the no-stacking rule, and the patch changeset records the fix.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: tabishb, clay-good

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: removing the extra date prefix from archive names for dated changes.
Linked Issues check ✅ Passed The PR matches #1317 by updating archive-change, bulk-archive-change, and onboard templates to preserve existing YYYY-MM-DD prefixes and adding parity coverage.
Out of Scope Changes check ✅ Passed The changes stay within the archive-template fix and related regeneration/test updates, with no clear unrelated additions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/core/templates/workflows/archive-change.ts (1)

80-87: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Update mock outputs to reflect <target-name>.

The new target-name derivation logic successfully prevents stacking date prefixes. However, the Output On Success mock examples further down in these templates still hardcode the old format (e.g., YYYY-MM-DD-<name> or YYYY-MM-DD-<change-1>). While the LLM will likely substitute the actual path correctly based on the mv command, 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 of YYYY-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 of YYYY-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

📥 Commits

Reviewing files that changed from the base of the PR and between 596d6ba and e46d9f8.

📒 Files selected for processing (8)
  • .changeset/fix-template-archive-date-dedup.md
  • skills/openspec-archive-change/SKILL.md
  • skills/openspec-bulk-archive-change/SKILL.md
  • skills/openspec-onboard/SKILL.md
  • src/core/templates/workflows/archive-change.ts
  • src/core/templates/workflows/bulk-archive-change.ts
  • src/core/templates/workflows/onboard.ts
  • test/core/templates/skill-templates-parity.test.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

opsx archive workflow templates stack a date prefix on already-dated change names

1 participant