Skip to content

fix(workflow): keep no-spec schema changes valid - #1655

Merged
clay-good merged 3 commits into
mainfrom
codex/fix-no-spec-schema-scaffold
Aug 19, 2026
Merged

fix(workflow): keep no-spec schema changes valid#1655
clay-good merged 3 commits into
mainfrom
codex/fix-no-spec-schema-scaffold

Conversation

@clay-good

@clay-good clay-good commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Risk: low. Only affects changes created under a schema that has no spec artifact. Spec-producing schemas behave exactly as before.

What was wrong

If a custom schema defined no artifact under specs/, openspec new change created the change without the skip_specs marker. Validation then failed immediately with "Change must have at least one delta" — for a schema that could never produce one. Users had to hand-edit every new .openspec.yaml.

What changes

Change creation checks the selected schema's artifact paths and writes skip_specs: true only when none of them land under specs/. The path check is shared with instruction loading so the two can't disagree.

Why it's safe

A review found that comparing raw paths would misread Windows-style specs\**\*.md as a no-spec schema; paths are normalized first, with a test covering that case. Schemas that do produce specs get no new metadata.

Proof

Reproduced on main (create exits 0, validate exits 1), then fixed. End-to-end CLI regression plus POSIX/Windows/dot-prefixed path coverage. CI green on all three platforms.

Fixes #1638

@clay-good
clay-good requested a review from a team as a code owner August 14, 2026 19:10
@clay-good
clay-good requested review from TabishB and removed request for a team August 14, 2026 19:10
@coderabbitai

coderabbitai Bot commented Aug 14, 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 Plus

Run ID: 2c1415d7-d7e6-4237-bad6-a54e47aba9ac

📥 Commits

Reviewing files that changed from the base of the PR and between 8980c42 and 230d6ad.

📒 Files selected for processing (5)
  • src/core/artifact-graph/instruction-loader.ts
  • src/core/artifact-graph/outputs.ts
  • src/utils/change-utils.ts
  • test/commands/artifact-workflow.test.ts
  • test/core/artifact-graph/outputs.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/utils/change-utils.ts

📝 Walkthrough

Walkthrough

createChange now resolves the selected schema and adds skip_specs: true when no artifact generates files under specs/. A shared helper recognizes POSIX and Windows-style paths. Tests cover metadata generation, status detection, and validation.

Changes

Schema-aware change creation

Layer / File(s) Summary
Specification path classification
src/core/artifact-graph/outputs.ts, src/core/artifact-graph/instruction-loader.ts, test/core/artifact-graph/outputs.test.ts
isSpecsArtifactPath normalizes generated paths and identifies files under specs/. Instruction loading uses the helper. Tests cover POSIX and Windows-style paths and reject unrelated paths.
Conditional change metadata and workflow validation
src/utils/change-utils.ts, test/commands/artifact-workflow.test.ts
createChange resolves the selected schema and persists skip_specs: true when it has no specification artifact. Tests verify standard schemas omit the field, no-specification schemas validate, and Windows-style specification paths remain detected.

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

Merge Risk: ⚪ Minimal · up to 230d6

The change adds metadata for no-spec schemas while preserving existing behavior for schemas that generate specs; no actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: tabishb, alfred-openspec

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes implement issue #1638 by adding skip_specs for schemas without specs artifacts and validating both supported path formats.
Out of Scope Changes check ✅ Passed The changes are limited to schema detection, artifact-path handling, and focused regression tests required by issue #1638.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: keeping changes valid for schemas without a specs artifact.
✨ 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 codex/fix-no-spec-schema-scaffold

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.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 19, 2026

Copy link
Copy Markdown

Deploying openspec-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 569b345
Status: ✅  Deploy successful!
Preview URL: https://6edf9393.openspec-docs.pages.dev
Branch Preview URL: https://codex-fix-no-spec-schema-sca.openspec-docs.pages.dev

View logs

@clay-good
clay-good added this pull request to the merge queue Aug 19, 2026
Merged via the queue into main with commit a2b965a Aug 19, 2026
18 checks passed
@clay-good
clay-good deleted the codex/fix-no-spec-schema-scaffold branch August 19, 2026 20:25
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.

Feedback: new change should emit skip_specs when the schema declares no specs artifact

2 participants