fix(schemas): honor canonical root selection - #1616
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe ChangesSchema root selection
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant CLI as schemas CLI
participant Resolver as resolveRootForCommand
participant Lister as listSchemasWithInfo
CLI->>Resolver: resolve root from store and project context
Resolver-->>CLI: resolved root or diagnostics
CLI->>Lister: list schemas from resolved root
Lister-->>CLI: schema results
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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 `@skills/openspec-onboard/SKILL.md`:
- Line 14: Remove view from the shared store-scoped command list in the
generator source while retaining schemas, then regenerate the committed skill
artifacts. Apply the resulting change to skills/openspec-onboard/SKILL.md (line
14), skills/openspec-propose/SKILL.md (line 28),
skills/openspec-sync-specs/SKILL.md (line 16),
skills/openspec-update-change/SKILL.md (line 14), and
skills/openspec-verify-change/SKILL.md (line 14); all listed files require the
same generated update.
In `@src/commands/workflow/schemas.ts`:
- Around line 25-29: Update the resolveRootForCommand options in schemasCommand
to set allowImplicitRoot: true, enabling schema discovery without an OpenSpec
root while preserving strict handling of explicit store failures.
In `@test/commands/schemas.test.ts`:
- Around line 117-132: Strengthen the successful JSON assertions in the schemas
CLI test by validating the complete entry for store-only, including its
documented description, artifacts, and source fields and their expected values.
Keep the existing exit, stderr, inclusion, and exclusion assertions, and use the
parsed schema result from parseSchemas rather than only checking the name.
🪄 Autofix
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 Plus
Run ID: 6e375e19-a242-4f60-b1cf-8b329573ab96
📒 Files selected for processing (29)
docs/agent-contract.mddocs/cli.mddocs/stores-beta/user-guide.mdopenspec/changes/fix-schemas-root-selection/.openspec.yamlopenspec/changes/fix-schemas-root-selection/design.mdopenspec/changes/fix-schemas-root-selection/proposal.mdopenspec/changes/fix-schemas-root-selection/specs/schema-resolution/spec.mdopenspec/changes/fix-schemas-root-selection/tasks.mdskills/openspec-apply-change/SKILL.mdskills/openspec-archive-change/SKILL.mdskills/openspec-bulk-archive-change/SKILL.mdskills/openspec-continue-change/SKILL.mdskills/openspec-explore/SKILL.mdskills/openspec-ff-change/SKILL.mdskills/openspec-new-change/SKILL.mdskills/openspec-onboard/SKILL.mdskills/openspec-propose/SKILL.mdskills/openspec-sync-specs/SKILL.mdskills/openspec-update-change/SKILL.mdskills/openspec-verify-change/SKILL.mdsrc/cli/index.tssrc/commands/workflow/schemas.tssrc/core/completions/command-registry.tssrc/core/templates/workflows/propose.tssrc/core/templates/workflows/store-selection.tstest/commands/schemas.test.tstest/core/completions/command-registry.test.tstest/core/templates/propose.test.tstest/core/templates/skill-templates-parity.test.ts
Summary
openspec schemasthrough the canonical OpenSpec root-selection precedence.--store <id>and the standard hidden--store-pathrejection path while preserving successful human output and the bare JSON array.Root cause
schemasCommand()always read schemas fromprocess.cwd(), and the command did not expose--store. As a result, schema discovery ignored an explicitly selected registered store and could disagree with the canonical root chosen by the rest of the workflow.Impact
Schema discovery now follows the same authoritative root as other root-scoped commands. Existing successful output shapes remain compatible; ambiguous registered-store environments fail closed with actionable diagnostics instead of silently reading the wrong directory.
Validation
pnpm run lintpnpm run buildpnpm test— 3,867 tests passedpnpm exec openspec validate fix-schemas-root-selection --strictgit diff --checkWindows/pwsh path behavior, including the store path containing spaces, remains gated by the repository CI matrix.
AI disclosure
Generated and verified with Codex using
gpt-5.6-solat max reasoning effort.Summary by CodeRabbit
New Features
openspec schemasnow supports--store <id>and standard project/store root selection.Bug Fixes
Documentation
Tests