Problem
ArcKit Wardley commands (/arckit:wardley, /arckit:wardley.value-chain, /arckit:wardley.doctrine, /arckit:wardley.gameplay, /arckit:wardley.climate) emit OnlineWardleyMaps (OWM) DSL inside fenced ```wardley / ```owm blocks. There is no parse-time validation, so syntactically broken maps are written, committed, and indexed by the docs/pages site before anyone notices.
This is the sibling issue to #435 (Mermaid syntax validation). Same hook architecture, different parser.
Why this needs its own validator
The Mermaid validator from #435 covers the Mermaid blocks that appear alongside OWM in the Wardley templates (templates/wardley-map-template.md mixes both languages). It does not cover the OWM blocks themselves — they need an OWM parser.
Concrete failure classes the model produces
- Out-of-range coordinates — OWM plane is unit square
[0, 1]; LLM-generated maps occasionally write 0.45, 1.2 or negative values.
- Dangling references —
link A -> B, evolve C 0.7, or pipeline [Foo] referencing components that were never declared (or were renamed earlier in the block).
- Inertia / evolve syntax mix-ups —
evolve A 0.7 vs evolve+>> A 0.7 vs trailing inertia.
- Annotation drift —
annotation 1 [0.4, 0.5] text where annotation index 1 is reused or annotations [0.6, 0.1] block coordinates outside the plane.
- Pipeline bracketing —
pipeline [Foo] with no matching declared component, or coordinates that put pipeline endpoints below visibility 0.
- Style typos —
style wardely / style handritten / unknown style names.
These all parse cleanly as text but fail when OnlineWardleyMaps actually tries to render them.
Suggested approaches
(Mirroring #435 — pick whichever fits the existing hook architecture.)
- PreToolUse:Write hook (
owm-block-scanner.mjs) — extract every ```wardley and ```owm block, parse via the OWM parser, block on parse failure with line-anchored error messages. Same JSON-blocking contract as secret-file-scanner.mjs.
- Post-generation validation in the Wardley commands — each
/arckit:wardley.* command runs its emitted block through the parser before writing.
- CI / pre-commit walker — scan
projects/**/*.md for OWM blocks and validate.
- Template-level guard rails — augment
skills/wardley-mapping/references/mapping-examples.md and the wardley template prompts with explicit cautions: declare-before-link, coordinates ∈ [0,1], one annotation index per map.
(1) or (2) gives the fastest feedback loop. (4) is cheap and complementary.
Parser options
wardley-script-parser (npm — extracted from OnlineWardleyMaps source) — produces a JSON AST and surfaces parser errors with line numbers.
@owm/parser — same upstream, packaged differently.
- Vendored copy of OnlineWardleyMaps' parser — if avoiding an npm dependency in hooks is preferred.
All three are MIT-compatible.
Scope clarification vs #435
Environment
Related
Problem
ArcKit Wardley commands (
/arckit:wardley,/arckit:wardley.value-chain,/arckit:wardley.doctrine,/arckit:wardley.gameplay,/arckit:wardley.climate) emit OnlineWardleyMaps (OWM) DSL inside fenced```wardley/```owmblocks. There is no parse-time validation, so syntactically broken maps are written, committed, and indexed by the docs/pages site before anyone notices.This is the sibling issue to #435 (Mermaid syntax validation). Same hook architecture, different parser.
Why this needs its own validator
The Mermaid validator from #435 covers the Mermaid blocks that appear alongside OWM in the Wardley templates (
templates/wardley-map-template.mdmixes both languages). It does not cover the OWM blocks themselves — they need an OWM parser.Concrete failure classes the model produces
[0, 1]; LLM-generated maps occasionally write0.45, 1.2or negative values.link A -> B,evolve C 0.7, orpipeline [Foo]referencing components that were never declared (or were renamed earlier in the block).evolve A 0.7vsevolve+>> A 0.7vs trailinginertia.annotation 1 [0.4, 0.5] textwhere annotation index1is reused orannotations [0.6, 0.1]block coordinates outside the plane.pipeline [Foo]with no matching declared component, or coordinates that put pipeline endpoints below visibility 0.style wardely/style handritten/ unknown style names.These all parse cleanly as text but fail when OnlineWardleyMaps actually tries to render them.
Suggested approaches
(Mirroring #435 — pick whichever fits the existing hook architecture.)
owm-block-scanner.mjs) — extract every```wardleyand```owmblock, parse via the OWM parser, block on parse failure with line-anchored error messages. Same JSON-blocking contract assecret-file-scanner.mjs./arckit:wardley.*command runs its emitted block through the parser before writing.projects/**/*.mdfor OWM blocks and validate.skills/wardley-mapping/references/mapping-examples.mdand the wardley template prompts with explicit cautions: declare-before-link, coordinates ∈ [0,1], one annotation index per map.(1) or (2) gives the fastest feedback loop. (4) is cheap and complementary.
Parser options
wardley-script-parser(npm — extracted from OnlineWardleyMaps source) — produces a JSON AST and surfaces parser errors with line numbers.@owm/parser— same upstream, packaged differently.All three are MIT-compatible.
Scope clarification vs #435
Environment
templates/wardley-map-template.md,templates/wardley-value-chain-template.md, plus the wardley-mapping skill examples.tractorjuice/arckit-test-project-v48-arckit-as-a-service.Related