feat(sync): ensure front matter consistency for monorepo specs#844
feat(sync): ensure front matter consistency for monorepo specs#844TimJi wants to merge 3 commits intoFission-AI:mainfrom
Conversation
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughAdded a new "Ensure front matter consistency" step to sync-specs workflows and referenced that step from archive-change and bulk-archive-change templates; introduced an optional Changes
Sequence Diagram(s)(omitted) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment Tip CodeRabbit can enforce grammar and style rules using `languagetool`.Configure the |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/core/templates/workflows/sync-specs.ts`:
- Around line 75-76: Replace hardcoded "openspec/config.yaml" writes in the
sync-specs template with logic that detects and updates the repo's existing
config file extension (.yml or .yaml) instead of creating a new file; locate the
string occurrences "openspec/config.yaml" in
src/core/templates/workflows/sync-specs.ts (both template blocks) and change the
template to determine the existing file name (check for openspec/config.yml
first, then openspec/config.yaml) and write updates to that discovered filename
(fall back to the repo's prevailing convention if neither exists). Ensure both
template blocks use the same configFileName variable so the opt-out update and
any other writes modify the existing config file in place rather than creating a
second file.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: ff6741d8-bace-4e99-b089-652b9245eb45
📒 Files selected for processing (3)
src/core/templates/workflows/archive-change.tssrc/core/templates/workflows/bulk-archive-change.tssrc/core/templates/workflows/sync-specs.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/core/templates/workflows/sync-specs.ts`:
- Around line 74-84: The template references a non-existent opt-out config field
monorepoAppLabel which is not part of ProjectConfigSchema and is ignored by
readProjectConfig(); fix by either (A) fully implementing the opt-out: add
monorepoAppLabel?: boolean to ProjectConfigSchema, update readProjectConfig() to
parse and return it via the ProjectConfig type, and then use that returned value
in the front-matter logic in sync-specs.ts (and archive-change.ts) where
monorepoAppLabel is currently checked; or (B) remove all monorepoAppLabel
references from sync-specs.ts and archive-change.ts and update the template text
to use an alternative opt-out (e.g., a flag file or CLI option) instead—choose
one approach and make consistent changes to the ProjectConfig type,
readProjectConfig(), and the front-matter prompt/logic (symbols to update:
ProjectConfigSchema, readProjectConfig, ProjectConfig type, and the
monorepoAppLabel checks in sync-specs.ts / archive-change.ts).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 7c5ebdba-f1fb-49f5-8fae-86f67c192e14
📒 Files selected for processing (1)
src/core/templates/workflows/sync-specs.ts
…ectConfigSchema Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Problem
In monorepo projects, specs need YAML front matter (e.g.,
app: web-dashboard,app: api-server) to indicate which app/package they belong to. When syncing delta specs to main specs viaopsx:syncoropsx:archive, newly created specs don't inherit thisconvention — leading to inconsistent specs that are missing their app label.
Solution
Add a front matter consistency step (step 3e) to the sync workflow. After syncing, it checks whether existing main specs use front matter and applies the same pattern to newly synced specs.
Decision flow:
openspec/config.yaml has monorepoAppLabel: false?
→ skip (user opted out)
Existing specs have front matter?
→ yes: apply same pattern to new specs
→ no + single-app project: skip
→ no + monorepo detected: prompt user
→ "Establish convention": apply app: , future syncs auto-detect
→ "Skip and don't ask again": write monorepoAppLabel: false to config.yaml
Changes
sync-specs.tsarchive-change.tsbulk-archive-change.tsDesign decisions
monorepoAppLabel: falseinopenspec/config.yamlprevents repeated promptsSummary by CodeRabbit