MCP create_element can't produce <id>.md files for id-identified types (and writes packages as Name.md)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 52/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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"
- Lingua principale
- JavaScript
- Stelle
- 8
- Fork
- 1
- Merge medio
- 1h
- PR unite (30g)
- 83
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di sjames/syscribe
-
Format-preserving writes for structural frontmatter (features, connections, layout, shapes, edges)Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
sjames/syscribe#405 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
sjames/syscribe#398 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di sjames/syscribe
Issue simili
-
enhancement p2 setup
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
vercel/eve#5419 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Query Log shows "Upstream" for CNAME cloaking, schedule, NXDOMAIN hijack and response IP blocksApertabug good first issue query-log web
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
ferrous-networking/ferrous-dns#326 ·
I maintainer di solito rispondono entro 1 giorno
-
type: typos
Difficoltà 1/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 4 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
Ylianst/MeshCentral#8294 ·
I maintainer di solito rispondono entro 1 giorno