Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

openspec new change prints Schema: spec-driven even when config.yaml selects a custom schema

クローズ 初心者向け
#2,117 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

関連するプルリクエストがすでにマージされています。

  • #2120 @surlymochan による — マージ済み

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
84/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript, yaml
領域
cli

調査の方向性

src/commands/workflow/new-change.ts と src/core/root-selection.ts のスキーマ選択パスから始め、src/commands/workflow/instructions.ts の設定読み込みルートと比較する。openspec/config.yaml がカスタムスキーマを選択したときに、表示されるスキーマと .openspec.yaml に保存されるスキーマの両方を検証する。オーバーライドなしの場合のフォールバックチェックも含める。

索引モデルが issue の本文から書いたものです。

説明

Version

1.14.3 (also present on main @ c794978f)

What happens

With schema: <custom-schema> set in openspec/config.yaml, openspec new change <id> prints

Schema: spec-driven

even though artifact resolution (instructions, status) correctly uses the custom schema.

Why (two root causes)

  1. src/commands/workflow/new-change.ts computes the resolved value but persists the raw flag instead:
146:  const resolvedSchema = options.schema ?? root.defaultSchema;   // spinner only
152:  schema: options.schema,                                        // undefined when no --schema
  1. Fixing line 152 alone is not enough: root.defaultSchema is hardcoded to 'spec-driven' and never reflects config.yaml:
// src/core/root-selection.ts:66 (type at :64, same literal at :127)
defaultSchema: 'spec-driven',

The schema configured in config.yaml is only reachable via readProjectConfig(projectRoot)?.schema, the route instructions.ts already takes.

Fix

Resolve from the project config and persist the resolved value:

const projectConfig = readProjectConfig(projectRoot);
const resolvedSchema = options.schema ?? projectConfig?.schema ?? root.defaultSchema;
...
schema: resolvedSchema,

Cosmetic only, but it misleads agents (and humans) auditing which schema a change was created under; I hit exactly that during a custom-schema run. A version-pinned patch with this fix (verified end to end: JSON payload, persisted .openspec.yaml, and text output) lives at https://github.com/cabi/openspec-cdd (patches/ + smoke test S26).

主要言語
TypeScript
スター
72.3k
フォーク
4.9k
平均マージ
2日 10時間
マージ済み PR(30日)
72

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Fission-AI/OpenSpec のほかの issue

Fission-AI/OpenSpec の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。