Skip to content

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

Merged
clay-good merged 3 commits into
Fission-AI:mainfrom
mc856:fix/template-archive-date-dedup
Jul 22, 2026
Merged

fix(templates): stop instructing a second date prefix on dated archive names#1388
clay-good merged 3 commits 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 in the walkthrough now shows <target-name>, with the keep-as-is rule stated inline.
  • 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.
  • opsx-archive-skill spec: the successful-archive scenario still specified the unconditional current-date rule; now carries the same keep-as-is clause cli-archive picked up in fix(archive): keep an existing date prefix instead of stacking a new one #1316.

Notes:

Fixes #1317

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

Summary by CodeRabbit

  • Bug Fixes
    • Prevented archive destinations from receiving duplicate YYYY-MM-DD- prefixes when the change name already includes a date.
    • Updated both single-change and bulk-archive workflows to use the corrected archive path naming consistently.
  • Documentation
    • Clarified onboarding and workflow/guide instructions for how the Archived to: path is formed when names already start with YYYY-MM-DD-.
    • Updated examples/spec text to reflect the new destination path format.
  • Tests
    • Refreshed template parity expectations and added coverage to ensure the “no double date stacking” guidance appears in generated instructions.

@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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 38ba72bb-2048-4dfc-a9f4-db3cbd80a61c

📥 Commits

Reviewing files that changed from the base of the PR and between 076827d and 53dfe10.

📒 Files selected for processing (1)
  • openspec/specs/opsx-archive-skill/spec.md

📝 Walkthrough

Walkthrough

Archive workflow templates, generated skill instructions, onboarding guidance, the archive specification, 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, openspec/specs/opsx-archive-skill/spec.md
Archive and bulk-archive templates preserve existing date prefixes, derive a target-name, and use the corresponding archive path; the archive specification documents the same rule.
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 issues

  • #863: Modifies the same /opsx:archive skill and command templates, with overlapping archive-path behavior.

Possibly related PRs

Suggested reviewers: tabishb, clay-good, alfred-openspec

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 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: preventing double date prefixes in archive template instructions.
Linked Issues check ✅ Passed The changes match issue #1317 by preserving existing YYYY-MM-DD prefixes and updating archive/onboard templates accordingly.
Out of Scope Changes check ✅ Passed The extra updates to committed skills, hashes, tests, and spec text are all directly tied to the archive-template behavior change.
✨ 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

@alfred-openspec alfred-openspec left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

mc856 added 2 commits July 21, 2026 11:44
…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.
@mc856
mc856 force-pushed the fix/template-archive-date-dedup branch from e46d9f8 to 076827d Compare July 21, 2026 11:57
@mc856

mc856 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

Done in 076827d. The single-archive summary and failure examples and the bulk per-change rows now print the derived target name, and the committed skills and hashes are regenerated.

The regression guard widened from the mv target to any YYYY-MM-DD- appearing as a path segment. That covers the output examples while leaving the rule statements intact — they name the prefix but never put it in a path. Each of the twelve example sites fails the test when reverted on its own.

Two judgment calls, both cheap to reverse. onboard's Phase 10 SHOW: block got the same treatment even though you named only single and bulk, since it's a printed example and the parity test's surface list already includes onboard. The bulk Guardrails bullets I left alone — rule statements that already state both branches. I also updated opsx-archive-skill/spec.md, which still specified the unconditional current-date rule the first commit removed from the template.

Rebased onto main on the way through; #1392 had landed in the same test file.

@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.

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

📥 Commits

Reviewing files that changed from the base of the PR and between e46d9f8 and 076827d.

📒 Files selected for processing (9)
  • .changeset/fix-template-archive-date-dedup.md
  • openspec/specs/opsx-archive-skill/spec.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
🚧 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

Comment thread openspec/specs/opsx-archive-skill/spec.md
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 alfred-openspec left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

@clay-good
clay-good added this pull request to the merge queue Jul 22, 2026
Merged via the queue into Fission-AI:main with commit 9b5d2cd Jul 22, 2026
11 checks passed
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

3 participants