Skip to content

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

Open
clay-good wants to merge 1 commit into
mainfrom
fix/reread-dependencies-before-regenerating
Open

fix(templates): pick up manual edits when regenerating artifacts#1368
clay-good wants to merge 1 commit 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

    • Workflows now re-read dependency artifacts from disk before generating subsequent artifacts.
    • Prevents stale conversation content from overriding manual edits or deleted files during continue, propose, and fast-forward workflows.
  • Documentation

    • Updated workflow instructions to clearly require using the latest dependency file contents.
  • Chores

    • Updated release metadata and template validation baselines.

…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: d730f5dd-c1dc-4c20-a195-94421dfb7caf

📥 Commits

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

📒 Files selected for processing (6)
  • .changeset/reread-dependencies-before-regenerating.md
  • src/commands/workflow/instructions.ts
  • src/core/templates/workflows/continue-change.ts
  • src/core/templates/workflows/ff-change.ts
  • src/core/templates/workflows/propose.ts
  • 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 summarizes the main change: regenerating artifacts now picks up manual edits instead of stale in-memory dependency content.
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.

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.

1 participant