Skip to content

fix(templates): use store-aware root for main specs in sync/archive#1360

Merged
clay-good merged 1 commit into
Fission-AI:mainfrom
clay-good:fix/store-aware-main-spec-paths
Jul 17, 2026
Merged

fix(templates): use store-aware root for main specs in sync/archive#1360
clay-good merged 1 commit into
Fission-AI:mainfrom
clay-good:fix/store-aware-main-spec-paths

Conversation

@clay-good

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

Copy link
Copy Markdown
Collaborator

Status: Ready. Closes #1358.

What was wrong
OpenSpec 1.5.0 added --store <id> to target a registered store, but two workflow instructions still assumed the main specs always live in the current repository:

  • sync-specs read and created openspec/specs/<capability>/spec.md
  • archive-change compared delta specs against that same hardcoded path before offering to sync

With a store selected, the change and its main specs belong to the store, while the repo may also have its own openspec/. So a sync could update the repo's specs instead of the store's, the store could stay out of date, and archive could report "already synced" based on the wrong location.

How it was fixed
The CLI already returns a store-aware planningHome.root in openspec status --json. The instructions now derive every main-spec path from it:

<planningHome.root>/openspec/specs/<capability>/spec.md
  • sync-specs: both the main-spec read path and the new-main-spec creation path derive from planningHome.root (added a note in the "Resolve change context" step so the agent uses it).
  • archive-change: the sync-assessment comparison uses that same derived path.
  • Dropped the "repo-local" label on CLI-returned delta paths, since they may belong to a selected store.

Repo-local behavior (no store) is unchanged: planningHome.root is the repo root there.

Proof it works
Generated-content and function-payload golden hashes in test/core/templates/skill-templates-parity.test.ts were regenerated and pass, confirming the intended (and only the intended) instruction text changed. Full suite green except the 17 pre-existing environment-only zsh-installer failures (oh-my-zsh), which are unrelated.

✓ test/core/templates/skill-templates-parity.test.ts (6 tests)
✓ test/vocabulary-sweep.test.ts (2 tests)
Tests  1858 passed | 17 failed (zsh-installer, env-only)

Notes
Scope is the source workflow templates only. The committed skills/ distribution (PR #1357) isn't on main yet; when it lands, npm run generate:skills will pick up this text automatically.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved specification synchronization and archiving workflows to correctly locate main specifications in the configured planning store.
    • Updated workflow guidance to support specifications stored outside the repository’s default path.
  • Tests
    • Updated template integrity checks to reflect the revised workflow instructions.

The sync-specs and archive-change workflow instructions hardcoded
`openspec/specs/<capability>/spec.md` for main specs, assuming they always
live in the current repository. With `--store <id>` the change and its main
specs belong to the selected store, so sync could write the repo's specs
instead of the store's, and archive could report specs as already synced
based on the wrong location.

Derive the main-spec path from the store-aware `planningHome.root` the CLI
already returns, and stop labeling CLI-returned delta paths "repo-local"
since they may belong to a store. Repo-local behavior is unchanged.

Fixes Fission-AI#1358

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@clay-good
clay-good requested a review from TabishB as a code owner July 15, 2026 11:13
@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: 0d7208bf-3fc3-4b57-8e21-fe02537f4e30

📥 Commits

Reviewing files that changed from the base of the PR and between 0a99f41 and 5c89c61.

📒 Files selected for processing (3)
  • src/core/templates/workflows/archive-change.ts
  • src/core/templates/workflows/sync-specs.ts
  • test/core/templates/skill-templates-parity.test.ts

📝 Walkthrough

Walkthrough

Updated generated sync and archive workflow instructions to resolve main-spec paths through planningHome.root, including store-scoped delta handling and new-spec creation. Updated parity test hashes for the affected templates and generated skills.

Changes

Store-aware workflow paths

Layer / File(s) Summary
Sync and archive path guidance
src/core/templates/workflows/sync-specs.ts, src/core/templates/workflows/archive-change.ts, test/core/templates/skill-templates-parity.test.ts
Sync and archive templates now use <planningHome.root>/openspec/specs/<capability>/spec.md for main-spec reads, comparisons, and creation; parity hashes were updated accordingly.

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

Possibly related PRs

Suggested reviewers: tabishb, alfred-openspec

🚥 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 core change: making sync/archive templates use a store-aware root.
Linked Issues check ✅ Passed The PR implements the linked requirements by using planningHome.root for main-spec paths, updating archive comparisons, and removing repo-local wording.
Out of Scope Changes check ✅ Passed The test hash updates appear to support the template changes and no unrelated code changes are introduced.
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.

@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 templates consistently derive main-spec paths from planningHome.root for both sync and archive while leaving repo-local behavior unchanged. Parity checks and full CI are green.

@clay-good
clay-good added this pull request to the merge queue Jul 17, 2026
Merged via the queue into Fission-AI:main with commit 15ef3bc Jul 17, 2026
11 checks passed
@clay-good
clay-good deleted the fix/store-aware-main-spec-paths branch July 17, 2026 18:16
clay-good added a commit that referenced this pull request Jul 17, 2026
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>
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.

Store-aware workflows still use repo-local main spec paths

2 participants