Skip to content

feat(436): OWM parser-class lint (dangling refs, annotation reuse, pipeline range, style typos)#480

Merged
tractorjuice merged 1 commit into
mainfrom
feat/436-wardley-parser-checks
May 15, 2026
Merged

feat(436): OWM parser-class lint (dangling refs, annotation reuse, pipeline range, style typos)#480
tractorjuice merged 1 commit into
mainfrom
feat/436-wardley-parser-checks

Conversation

@tractorjuice
Copy link
Copy Markdown
Owner

Replaces #479, which auto-closed when its base branch was deleted on #477's merge. Rebased onto main; single commit.

Covers items 2 (parser-class failures) and 4 (coexistence with #435) from the owner's suggested scope on #436.

Parser choice (why no npm dep)

The wardley-script-parser package the issue referenced doesn't exist on npm. The real upstream wmlandscape (v3.0.1) is the full OnlineWardleyMaps React renderer — 894 KB, depends on React/MUI/Next/lodash. Not usable from a Node hook, and pulling it in would blow the millisecond budget the issue called out.

Implemented as inline state-machine checks: zero install, fits the budget, keeps the plugin self-contained.

New checks (all run inside the single OWM-block walk)

  1. Dangling referencesevolve / pipeline / edge endpoints must target a name declared by component / anchor / note / submap / market earlier in the same block. Reports first-seen line per (name, kind).
  2. Annotation index reuse — each annotation N [...] ID must be unique; duplicates report the prior line number.
  3. Pipeline rangepipeline NAME [v1, v2] endpoints both in [0.00, 1.00] and v1 < v2. Coord regexes updated to accept a leading - so out-of-range negatives trigger the range check instead of silently failing the pattern match.
  4. OWM style whiteliststyle NAME must be one of wardley, colour, plain, handwritten, dark. Catches the typos called out in the issue (wardely, handritten, …).

Coexistence with #435 (item 4)

Doc-only:

Spelled out in both the hook docstring and arckit-claude/hooks/README.md.

Test plan

  • Clean OWM block → empty output (allow)
  • Every new check triggers when expected → categorised block report
  • TechnoGadget example from the wardley-mapping skill → no false positives
  • Pipeline [-0.1, 1.5] → range error captured
  • Component [-0.3, 0.85] → range error captured
  • markdownlint-cli2 arckit-claude/hooks/README.md → 0 errors
  • Integration: /arckit:wardley against a test repo

🤖 Generated with Claude Code

Adds the four parser-class checks called out in the issue's failure-class
list, plus an explicit coexistence note describing how this hook divides
work with the future Mermaid block validator from sibling issue #435.

Background on the parser choice: the `wardley-script-parser` package the
issue referenced does not exist on npm; the real upstream `wmlandscape`
ships the full OnlineWardleyMaps React renderer (894 KB, depends on
React/MUI/Next/lodash) — not usable from a Node hook. Pulling that in
would also conflict with the "millisecond budget" the issue called out.
Implemented as inline state-machine checks so the hook stays self-
contained and zero-install for plugin distribution.

New checks (all run inside the single OWM-block walk):

1. Dangling references — `evolve` / `pipeline` / edge endpoints must
   target a name declared by `component` / `anchor` / `note` / `submap` /
   `market` earlier in the same block. Reports first-seen line per
   (name, kind) to keep output short.
2. Annotation index reuse — each `annotation N [...]` ID must be unique;
   duplicates report the prior line number.
3. Pipeline range — `pipeline NAME [v1, v2]` endpoints must both sit in
   [0.00, 1.00] and `v1 < v2`. Coord regexes updated to accept a leading
   `-` so out-of-range negative values trigger the range check instead of
   silently failing the pattern match.
4. OWM style whitelist — `style NAME` must be one of `wardley`, `colour`,
   `plain`, `handwritten`, `dark`. Catches the typos called out in the
   issue (`wardely`, `handritten`, …).

Coexistence with #435 (item 4 of the suggested scope):

- This hook owns OWM / `wardley`-fenced blocks.
- The narrow `wardley-beta` Mermaid bare-digit check stays here — it
  targets a Wardley-template-specific rendering trap, not general
  Mermaid correctness.
- General Mermaid validation (ER, flowchart, sequence, etc.) belongs to
  #435's `mermaid-block-scanner`. The two hooks parse different blocks
  within the same Wardley template, with no overlap.

Documented in the hook docstring and in `arckit-claude/hooks/README.md`.

Smoke tests:
- Clean OWM block: no output (allow)
- Every new check trigger: blocks with categorised report
- TechnoGadget example from the wardley-mapping skill: no false positives
- Pipeline `[-0.1, 1.5]`: range error captured (regex no longer hides it)
- Component `[-0.3, 0.85]`: range error captured

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tractorjuice tractorjuice merged commit 9fddad0 into main May 15, 2026
1 check passed
@tractorjuice tractorjuice deleted the feat/436-wardley-parser-checks branch May 15, 2026 12:45
royster70 added a commit to royster70/arc-kit that referenced this pull request May 16, 2026
Round-3 review (tractorjuice#441 comment 4459176602) flagged converter drift on the PR
branch ~2 days behind main. Rebased onto upstream/main (v4.21.0 release set:
tractorjuice#460-462, tractorjuice#463-465, tractorjuice#467, tractorjuice#470-477, tractorjuice#480) and re-ran `python scripts/converter.py`
to regenerate the 5 extension formats from current sources.

Drifts picked up:

- AU command/prompt/skill files brought into consistency with current
  `project_template_overrides` rewrite (`.arckit/templates/` ->
  `.arckit/templates-custom/` in the "Then" row; CA/UAE files already
  reflect this pattern)
- `pages`, `framework`, `uae-priorities-alignment` extension outputs
  regenerated from upstream source updates
- Skill SKILL.md files (`architecture-workflow`, `mermaid-syntax`,
  `plantuml-syntax`, `wardley-mapping`) regenerated for tractorjuice#455/tractorjuice#480 changes
- `config/doc-types.mjs`, `docs/guides/custom-commands.md`,
  `templates/pages-template.html`, `plugin.json`, and
  `arckit-paperclip/src/data/commands.json` propagated

CHANGELOG conflict resolved: AU round-2/AI6 entries moved to the
re-opened [Unreleased] section above the new [4.21.0] block.

Reviewer's "neighbourly fix" (`.arckit/templates/data-source-profile-template.md`)
no longer needed — already tracked in upstream/main.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant