MCP create_element can't produce <id>.md files for id-identified types (and writes packages as Name.md)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start with valid_qname in crates/syscribe-model/src/mutate/mv.rs, then trace the MCP create_element and apply_changes create operations; the issue's reproduction gives a concrete case to run. Check how move_element handles qnames and read the referenced spec sections (§8 and §11.3). Done means id-identified elements use the id as the file stem, packages use _index.md, and the documented MCP behavior matches.
索引モデルが issue の本文から書いたものです。
説明
Problem
For id-identified types (Requirement, TestCase, ADR, PlanningItem, …) the spec says the file is <id>.md and the id is the qualified-name stem (§8 / name scheme), e.g. model_auto/Requirements/Safety/REQ-ENG-SAFE-001.md → Requirements::Safety::REQ-ENG-SAFE-001.
The MCP create_element tool (and the create op in apply_changes) derives the file path directly from a caller-supplied qname, and valid_qname (crates/syscribe-model/src/mutate/mv.rs) only accepts [A-Za-z0-9_] segments. So a hyphenated id can never be the file name:
create_element {qname: "Requirements::Safety::REQ-ENG-SAFE-006", type: Requirement}→ refused,reason: "not a valid basic qualified name".- The workaround is a different qname, e.g.
Requirements::Safety::FaultLogging(orREQ_RL_005), which writesFaultLogging.mdwithid: REQ-ENG-SAFE-006inside. The id is auto-allocated / explicit, but the file name and qname are unrelated to it.
Observed
- In a real agent session (
examples/chat-to-code/, PR #184) the agent hit this and named everythingREQ_RL_005.md,ADR_RL_001.md,TC_RL_001.md,PI_RL_001.md(qnameRequirements::REQ_RL_005, idREQ-RL-005).validateis clean andshow REQ-RL-005resolves, so nothing warns about it. - Related:
create_elementwithtype: PackagewritesDesign.mdnext to aDesign/directory rather thanDesign/_index.md(spec §11.3:_index.mdrepresents the containing directory's package). Validation is clean; not checked whether every consumer treats the two layouts alike.
Impact
- Agent-authored models look different from hand-authored ones (
REQ_RL_005.mdvsREQ-RL-005.md), and the qname no longer matches the id. - The "permalink to
<id>.md" convention (README, spec §1 rationale) doesn't hold for MCP-created elements; people can't find a requirement by its id in the file tree. - No diagnostic tells the author/agent that the file name deviates from the spec.
Suggested direction
- For id-identified types, let
create_elementtake the parent package plus the id (explicit or auto-allocated) and write<parent>/<id>.md, bypassing the basic-name check for the stem (the id is already validated byis_stable_id). Keep the current qname form working for name-identified types. - For
type: Package, create<dir>/_index.mdinstead of<dir>.md. - Optionally: a warning when an id-identified element's file stem differs from its
id(opt-in / draft-suppressed, gateable with--deny), so existing models can be checked. - Update
move_elementaccordingly (its qname rewriting also usesvalid_qname), and thehelp mcp/ MCP tool docs.
Reproduce
cp -r model_auto /tmp/m
# drive `syscribe -m /tmp/m mcp` over stdio, then:
# create_element {"qname":"Requirements::Safety::REQ-ENG-SAFE-006","type":"Requirement","dry_run":true}
# → written:false, reason:"not a valid basic qualified name"
- 主要言語
- Rust
- スター
- 7
- フォーク
- 1
- 平均マージ
- 1時間 25分
- マージ済み PR(30日)
- 27
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
sjames/syscribe のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
feat(show): surface related traceability commands (trace/impact/who-verifies/refs) in show outputオープンenhancement
難易度 4/5 3〜5日 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
sjames/syscribe#116 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
sjames/syscribe の issue をすべて見る
似ている issue
-
agent:triaged bug bughunt pm:npm priority:p1
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
SocketDev/socket-patch#464 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
メンテナーはふだん 3 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
stellar/stellar-cli#2773 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信