fix(validate): support workspace planning homes and nested delta specs - #1186
fix(validate): support workspace planning homes and nested delta specs#1186XiaojuCH wants to merge 1 commit into
Conversation
|
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 (4)
📝 WalkthroughWalkthroughThe validate command now resolves changes and specs via planning-home scoping, supporting both repo and workspace planning homes. Item discovery is refactored to extract planning-home–scoped helpers, and delta spec discovery becomes recursive to support nested spec structures within multi-area schemas. ChangesPlanning-home–aware validation with nested spec support
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
alfred-openspec
left a comment
There was a problem hiding this comment.
Reviewed the diff and focused validation paths. The fix shape looks right: top-level validate now resolves through the current planning home, nested delta specs are discovered recursively, and directory-based change discovery is consistent with the workspace-planning direction.
Focused gates passed locally: pnpm install --frozen-lockfile, then pnpm exec vitest run test/commands/validate.test.ts test/core/validation.test.ts.
Deterministic, CLI-enforced prevention of silent spec drop in the spec-driven workflow, addressing one root fault (correctness decisions in agent prompts) across four layers: schema-aware delta gate shared by validate+archive (Fission-AI#997), the non-transitive apply-gate loop fix (incorporates Fission-AI#1250), the keystone (all archive templates call `openspec archive` — Fission-AI#656/Fission-AI#863), and a specced archived-drift audit. Hardened across three review rounds (alfred-openspec, CodeRabbit), an internal adversarial pass, and an open-PR coordination scan: - reconciles Fission-AI#977 (allow-specless) via the schema-aware gate + --skip-specs, deliberately not allowing silent specless archives under spec-driven; - coordinates with Fission-AI#902 (propose/ff spec discovery), the unify-template-generation-pipeline manifest, add-change-stacking-awareness (provides/touches markers + overlap warnings), and add-artifact- regeneration-support (complementary staleness); - rebases onto approved Fission-AI#1186/Fission-AI#1151/Fission-AI#1153/Fission-AI#1252; Fission-AI#1252 is a prerequisite. Closes Fission-AI#1212 Fission-AI#1260 Fission-AI#1222 Fission-AI#1264 Fission-AI#799 Fission-AI#656 Fission-AI#863 Fission-AI#913. Supersedes PRs Fission-AI#1250 Fission-AI#1271 Fission-AI#1241 Fission-AI#1233. Addresses Fission-AI#997 Fission-AI#977 Fission-AI#902 Fission-AI#164 Fission-AI#426 Fission-AI#911. Out of scope Fission-AI#1246 Fission-AI#1112 Fission-AI#1252(prereq) Fission-AI#1120 Fission-AI#827 Fission-AI#1265. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Closing as already fixed on #1182 (openspec validate cannot resolve changes in a workspace planning home) is closed as completed. Both parts of this PR are on 1.
import { resolveRootForCommand, toRootOutput, withStoreFlag, ... } from '../core/root-selection.js';
import { getAvailableChanges } from './workflow/shared.js';The hardcoded 2. Nested delta specs ( // Discover delta specs through the same helper the change parser, show,
// apply, and archive use, so validate never accepts a layout the merge
// path silently skips (#1385). It finds spec.md at any depth, covering
// both specs/<capability>/spec.md and the nested multi-area
// specs/<area>/<capability>/spec.md layout (#1182b).
const specFiles = (await discoverSpecFiles(specsDir)).map(spec => spec.specFile);Note the On the approval: this PR carries an Terminology note: the Reopen if |
Fixes #1182.
This PR makes top-level
openspec validatework correctly for workspace-planning changes created from a workspace root.What changed:
validateresolve change paths through the current planning home instead of assuming repo-localopenspec/changesproposal.mdspecs/<area>/<capability>/spec.mdvalidate <change>andvalidate --changesfrom the workspace rootWhy:
status/instructions/new changealready resolve workspace planning homes correctlyvalidatewas the odd one out and returnedUnknown item '<change>'from the same workspace rootValidation:
node build.jsnode node_modules/vitest/vitest.mjs run test/commands/validate.test.tsnode node_modules/vitest/vitest.mjs run test/commands/artifact-workflow.test.ts --testNamePattern "nested workspace-planning specs"Summary by CodeRabbit
New Features
Bug Fixes