Skip to content

fix(templates): pick up manual edits when regenerating artifacts#1368

Merged
clay-good merged 2 commits into
mainfrom
fix/reread-dependencies-before-regenerating
Jul 17, 2026
Merged

fix(templates): pick up manual edits when regenerating artifacts#1368
clay-good merged 2 commits into
mainfrom
fix/reread-dependencies-before-regenerating

Conversation

@clay-good

@clay-good clay-good commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Status: Ready for review. Tests green (the 17 zsh-installer failures locally are the known oh-my-zsh environment issue; unaffected in CI).

What was wrong: Edit spec.md, delete design.md/tasks.md, run /opsx:continue — and the regenerated files ignore your edits. The workflow instructions say to "read dependency files for context," but an agent that already saw those files earlier in the session treats them as read and regenerates from its stale in-context copy. Reported in discussion #909, and it's why the delete-and-continue workaround people land on in #600, #1291, and #705 feels unreliable.

How it was fixed: The continue, propose, and fast-forward instructions (skill + command variants) and the <dependencies> block emitted by openspec instructions now say explicitly: re-read dependency files from disk before creating the next artifact, even if you saw them earlier in the conversation — the user may have edited them.

Proof: Guidance-only change — no behavior code touched. npm run build regenerated the templates and the golden hashes in skill-templates-parity.test.ts were updated from dist/; the parity suite and the full test suite pass (1,858 tests).

Notes: This doesn't add staleness detection or a regeneration command (that's issue #705 / the add-artifact-regeneration-support proposal). It just makes the existing "delete the downstream file and continue" path reliably see current file contents.

Discussion: #909

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Continue, propose, and fast-forward workflows now re-read dependency artifacts from disk before creating the next artifact, preventing stale conversation content from overriding manual edits or deleted files.
  • Documentation
    • Updated the on-screen dependency guidance to explicitly instruct re-reading the current dependency file contents from disk.
  • Tests
    • Updated template/parity validation baselines to match the tightened workflow guidance.
  • Chores
    • Refreshed release metadata for the patch update.

…g the next one

The continue/propose/ff workflow instructions said to "read dependency
files for context," but an agent that already saw those files earlier in
the session treats them as read and regenerates downstream artifacts
from its stale in-context copy. Editing spec.md and deleting
design.md/tasks.md to regenerate them silently produced artifacts based
on the pre-edit spec.

The step guidance, the guardrails, and the `openspec instructions`
dependency block now say explicitly: re-read dependency files from disk
even if seen earlier in the conversation, because the user may have
edited them.

Discussion: #909

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@clay-good
clay-good requested a review from TabishB as a code owner July 15, 2026 15:35
@coderabbitai

coderabbitai Bot commented Jul 15, 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: c7e60661-2d2a-4823-948b-952302610ffc

📥 Commits

Reviewing files that changed from the base of the PR and between 1f7c50e and b915b55.

📒 Files selected for processing (1)
  • test/core/templates/skill-templates-parity.test.ts

📝 Walkthrough

Walkthrough

Workflow instructions and continue, fast-forward, and propose templates now require rereading dependency artifacts from disk before generating subsequent artifacts. Template parity hashes and patch release metadata were updated accordingly.

Changes

Dependency reread guidance

Layer / File(s) Summary
Workflow dependency reread instructions
src/commands/workflow/instructions.ts, src/core/templates/workflows/*
Shared instructions and continue, fast-forward, and propose templates explicitly require rereading dependency files from disk before creating artifacts.
Template parity and release metadata
test/core/templates/skill-templates-parity.test.ts, .changeset/reread-dependencies-before-regenerating.md
Expected template hashes and generated skill content hashes were updated, and patch release metadata was added.

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

Possibly related PRs

Suggested reviewers: tabishb

🚥 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 matches the main change: templates now re-read dependencies so manual edits are picked up when regenerating artifacts.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/reread-dependencies-before-regenerating

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.

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

Verified that the skill and command variants plus the instructions dependency block all require a fresh disk read, with parity baselines updated and full CI green. This fixes stale regeneration without widening runtime scope.

Resolve parity-hash conflicts by unioning both sides: ff-change hashes
from this branch, sync-specs/archive hashes from main (#1360).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

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

Verified the rebased head carries the fresh disk-read guidance across continue, propose, fast-forward, and the CLI dependency block, with parity hashes correctly retaining main’s #1360 updates. The diff is clean and CI is green.

@clay-good
clay-good added this pull request to the merge queue Jul 17, 2026
Merged via the queue into main with commit de78c31 Jul 17, 2026
14 checks passed
@clay-good
clay-good deleted the fix/reread-dependencies-before-regenerating branch July 17, 2026 19:40
clay-good added a commit to clay-good/OpenSpec that referenced this pull request Jul 17, 2026
Regenerate the parity hashes and the committed skills/ distribution from
the merged templates, picking up the store-aware archive/sync paths
(Fission-AI#1360) and the re-read-dependencies guidance (Fission-AI#1368) alfred flagged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

2 participants