Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

已关闭 适合新手
#2,117 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

已经有一个关联 PR 被合并了。

  • #2120 来自 @surlymochan —— 已合并

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
84/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript, yaml
领域
cli

调研方向

从 src/commands/workflow/new-change.ts 以及 src/core/root-selection.ts 中的 schema 选择路径开始;将其与 src/commands/workflow/instructions.ts 中的配置读取路径进行比较。验证当 openspec/config.yaml 选择自定义 schema 时,.openspec.yaml 中显示的 schema 和持久化保存的 schema,包括没有 override 时的 fallback 检查。

由索引模型根据 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 小时
30 天内合并 PR
72

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Fission-AI/OpenSpec 的其他 Issue

查看 Fission-AI/OpenSpec 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。