feat(436): wire validate-wardley-math hook + add owm fence alias#477
Merged
Conversation
Closes #436 step 1 of the owner's suggested scope: wire the existing (but unregistered) `validate-wardley-math.mjs` so Wardley artefacts are checked before they hit disk. Changes: - Refactor hook from Stop-mode (disk mtime scan) to PreToolUse:Write reading `tool_input.{file_path,content}`. Removes the 5-minute mtime window and stop_hook_active loop-guard since neither apply now. - Register under PreToolUse:Write with `if: "Write(/projects/**/wardley-maps/**)"`, matching the validate-arc-filename and score-validator pattern. - Recognise `owm` fence alias alongside `wardley` (the wardley-mapping skill examples use the OWM alias; templates use the wardley alias). - Enforce the OWM unit-square coordinate range on `component` lines inside the OWM block, not only on Component Inventory table rows. - README: clarify the hook entry with its event/scope and what it checks. Out of scope (follow-up on #436): - Dangling references, annotation index reuse, pipeline visibility, and style-name typos need a real parser (`wardley-script-parser`) — not this PR. - Mermaid block validator is the sibling issue #435. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes step 1 of the owner-suggested scope on #436 — the existing
validate-wardley-math.mjshook (271 lines, four checks) was sitting inarckit-claude/hooks/unregistered. This PR wires it up so Wardley artefacts are validated before the Write tool puts a broken map on disk.tool_input.{file_path, content}. Removes the 5-minute mtime window andstop_hook_activeloop-guard — neither apply on PreToolUse.hooks.jsonunder PreToolUse:Write withif: \"Write(/projects/**/wardley-maps/**)\", matching the existingvalidate-arc-filename/score-validatorpattern.owmfence alias alongsidewardley. The wardley-mapping skill examples use```owm; templates use```wardley. Both now lint.[0, 1]coordinate range oncomponentlines inside the OWM block too — previously only Component Inventory table rows were range-checked.hooks/README.md: spell out the hook's event/scope and what it checks.Blocks via
{decision: \"block\", reason}so the model sees the validation report and self-corrects, instead of hitting a hard permission error the user has to read.Out of scope (follow-ups on #436)
link/evolve/pipeline, annotation-index reuse, pipeline visibility, and style-name typos — these need a real parser (wardley-script-parser). Captured in the issue.wardley-betabare-digit check already in this hook is the only Mermaid coverage; that's incidental because it's inside the same artefact.Test plan
reasonfieldmarkdownlint-cli2on touched README → 0 errors/arckit:wardleyrun in a test repo (recommendarckit-test-project-v48-arckit-as-a-serviceper the issue) — block path should surface the reason and let the model self-correct on retry🤖 Generated with Claude Code