From 45d8f19e5634e9cdf1a061be5985f241acd35009 Mon Sep 17 00:00:00 2001 From: Defame1297 Date: Mon, 21 Sep 2026 19:40:50 +0000 Subject: [PATCH] test(lint): back the Vale 3.15.2 behaviour claims with a committed test The `house-vale-3-15-2-repro` provenance entry claimed behaviours were reproduced against purpose-built fixtures, but no fixtures existed, so the earlier commit in this PR removed it. Commit the fixtures. tests/test-vale-3-15-2-behaviours.sh builds its fixtures in a temp dir and runs the real Vale. It exits 77 (skipped) when vale is missing or is not 3.15.2. It asserts the six vale-config behaviours and the vale-run ones (unmapped .mdx, `vale off` variants, the spelling ignore file, and the ls-* commands never naming a rule). Restore the entry in both sources.md files as `Research doc: none` with `Basis:` naming the test, and re-add its source_keys. Two behaviours are not asserted: the native-MDX suppression column (needs mdx2vast) and the `vale sync` row that adds to Packages (needs the network). The wording in configuration-reference.md and troubleshooting.md now says so. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01EGHFJextYtVQseaHPDDhxB --- plugins/lint/.apm/skills/vale-config/SKILL.md | 1 + .../references/configuration-reference.md | 5 +- .../skills/vale-config/references/sources.md | 9 + plugins/lint/.apm/skills/vale-run/SKILL.md | 1 + .../skills/vale-run/references/sources.md | 9 + .../vale-run/references/troubleshooting.md | 6 +- tests/test-vale-3-15-2-behaviours.sh | 220 ++++++++++++++++++ 7 files changed, 246 insertions(+), 5 deletions(-) create mode 100755 tests/test-vale-3-15-2-behaviours.sh diff --git a/plugins/lint/.apm/skills/vale-config/SKILL.md b/plugins/lint/.apm/skills/vale-config/SKILL.md index 345c5c6..caaafce 100644 --- a/plugins/lint/.apm/skills/vale-config/SKILL.md +++ b/plugins/lint/.apm/skills/vale-config/SKILL.md @@ -11,6 +11,7 @@ metadata: version: "0.1.4" source_keys: - context7-websites-vale-sh + - house-vale-3-15-2-repro --- ## Gotchas diff --git a/plugins/lint/.apm/skills/vale-config/references/configuration-reference.md b/plugins/lint/.apm/skills/vale-config/references/configuration-reference.md index 5b890b6..c448b71 100644 --- a/plugins/lint/.apm/skills/vale-config/references/configuration-reference.md +++ b/plugins/lint/.apm/skills/vale-config/references/configuration-reference.md @@ -2,6 +2,7 @@ topic: configuration-reference source_keys: - context7-websites-vale-sh + - house-vale-3-15-2-repro --- ## Core Settings @@ -81,7 +82,7 @@ Only *package* styles need fetching. A style whose YAML rule files are already c - `Vale.Avoid` — enforces the project's rejected vocabulary terms. - `Vale.Repetition` — flags repeated words (e.g. "the the"). -`Packages` (top-level, what `vale sync` downloads) and `BasedOnStyles` (per-glob, what activates) are separate keys: a style lints a file only once it is in both. Every row below reproduced against Vale 3.15.2: +`Packages` (top-level, what `vale sync` downloads) and `BasedOnStyles` (per-glob, what activates) are separate keys: a style lints a file only once it is in both. Every row below is asserted against Vale 3.15.2 by `tests/test-vale-3-15-2-behaviours.sh` (slug `house-vale-3-15-2-repro`) except the `vale sync` row that adds the name to `Packages`, which needs the network and is not covered: | Configuration | Result | |---|---| @@ -97,7 +98,7 @@ Only *package* styles need fetching. A style whose YAML rule files are already c ## Frontmatter Scopes -House-verified behaviour, not documented on vale.sh — reproduced locally against Vale 3.15.2. +House-verified behaviour, not documented on vale.sh — asserted against Vale 3.15.2 by `tests/test-vale-3-15-2-behaviours.sh` (slug `house-vale-3-15-2-repro`). A rule scoped to `text.frontmatter.` (e.g. `text.frontmatter.description`) matches reliably when that field's value is a single physical line, and breaks on most — not all — multi-line forms. Multi-line forms spanning 2+ lines: diff --git a/plugins/lint/.apm/skills/vale-config/references/sources.md b/plugins/lint/.apm/skills/vale-config/references/sources.md index 854fe15..940ea44 100644 --- a/plugins/lint/.apm/skills/vale-config/references/sources.md +++ b/plugins/lint/.apm/skills/vale-config/references/sources.md @@ -7,3 +7,12 @@ - **Research doc:** plugins/lint/docs/research/docs/vale/sources.md - **Contributing files:** SKILL.md, references/configuration-reference.md - **Status:** `extracted` + +## house-vale-3-15-2-repro + +- **URL:** (house-verified — reproduced against the `vale` binary by a committed test, not an external source) +- **Description:** Behaviour of Vale 3.15.2 asserted by the committed test (purpose-built fixtures, real `vale` run), where vale.sh documents nothing: the `E100 [loadStyles]` / exit-2 failure for a `BasedOnStyles` name absent from `StylesPath`, `vale sync` reporting `Synced 0 package(s)` for a name not declared in `Packages`, the `E201` / exit-2 failure when the `StylesPath` directory does not exist, the exit-0 no-op of an empty style directory, the `E201` / exit-2 failure when a core option is written below a `[glob]` header (with `Packages` as the silent exception), the `E100 [lintMDX]` failure of an unmapped `.mdx` without `mdx2vast`, and the `text.frontmatter.` scope matrix across multi-line YAML forms. +- **Research doc:** none +- **Basis:** tests/test-vale-3-15-2-behaviours.sh +- **Contributing files:** SKILL.md, references/configuration-reference.md +- **Status:** `extracted` diff --git a/plugins/lint/.apm/skills/vale-run/SKILL.md b/plugins/lint/.apm/skills/vale-run/SKILL.md index 0aa7294..e54a39f 100644 --- a/plugins/lint/.apm/skills/vale-run/SKILL.md +++ b/plugins/lint/.apm/skills/vale-run/SKILL.md @@ -10,6 +10,7 @@ metadata: category: lint source_keys: - context7-websites-vale-sh + - house-vale-3-15-2-repro --- ## Gotchas diff --git a/plugins/lint/.apm/skills/vale-run/references/sources.md b/plugins/lint/.apm/skills/vale-run/references/sources.md index 279ef95..85592bc 100644 --- a/plugins/lint/.apm/skills/vale-run/references/sources.md +++ b/plugins/lint/.apm/skills/vale-run/references/sources.md @@ -7,3 +7,12 @@ - **Research doc:** plugins/lint/docs/research/docs/vale/sources.md - **Contributing files:** SKILL.md, references/troubleshooting.md - **Status:** `extracted` + +## house-vale-3-15-2-repro + +- **URL:** (house-verified — reproduced against the `vale` binary by a committed test, not an external source) +- **Description:** Behaviour of Vale 3.15.2 asserted by the committed test (purpose-built fixtures, real `vale` run), where vale.sh documents nothing or documents it wrongly: an unmapped `.mdx` needs an external `mdx2vast` binary (absent, the whole invocation exits 2 with `E100 [lintMDX]`), under `[formats] mdx = md` the HTML-comment suppression form works and the JSX-comment form does not, the `spelling` check's `ignore` paths resolve against `StylesPath` or the working directory but never against the rule file's own directory and fail silently when they resolve nowhere, `ls-config` and the other `ls-*` subcommands report styles and paths but never rules, and the `text.frontmatter.` scope matrix across multi-line YAML forms. Not asserted: the native-MDX column of the suppression table, which needs `mdx2vast` installed. +- **Research doc:** none +- **Basis:** tests/test-vale-3-15-2-behaviours.sh +- **Contributing files:** SKILL.md, references/troubleshooting.md +- **Status:** `extracted` diff --git a/plugins/lint/.apm/skills/vale-run/references/troubleshooting.md b/plugins/lint/.apm/skills/vale-run/references/troubleshooting.md index d2f6dcd..e6cfbd7 100644 --- a/plugins/lint/.apm/skills/vale-run/references/troubleshooting.md +++ b/plugins/lint/.apm/skills/vale-run/references/troubleshooting.md @@ -1,6 +1,7 @@ --- source_keys: - context7-websites-vale-sh + - house-vale-3-15-2-repro --- # Vale troubleshooting reference @@ -50,8 +51,7 @@ suppression syntax: | `[formats]` maps `mdx = md` (what `vale-config` recommends) | none | Markdown | `` | | no `mdx` mapping (native MDX) | `npm install -g mdx2vast` | MDX | `{/* vale off */}` | -Key the markup to that config row, never to the file extension. Verified against Vale 3.15.2, same -three fixtures under each config: +Key the markup to that config row, never to the file extension. Asserted against Vale 3.15.2 by `tests/test-vale-3-15-2-behaviours.sh` (slug `house-vale-3-15-2-repro`) for the mapped column; the native-MDX column was observed with `mdx2vast` installed and is not covered by that test (it needs the binary): | File | Mapped `mdx = md` | Native MDX (`mdx2vast` installed) | |---|---|---| @@ -119,7 +119,7 @@ ignore: **Where the file goes, and why a wrong answer is invisible.** Each entry resolves against the `StylesPath` root, or against the working directory `vale` is invoked from. It does **not** resolve against the rule file's own directory — which is the natural reading of the YAML above, since the -path sits inside the rule, and it is wrong. Verified against Vale 3.15.2 across four fresh trees, +path sits inside the rule, and it is wrong. Asserted against Vale 3.15.2 by the same test across four fresh trees, each with the same rule and the same unknown word: | Where `ignore1.txt` was placed | Result | diff --git a/tests/test-vale-3-15-2-behaviours.sh b/tests/test-vale-3-15-2-behaviours.sh new file mode 100755 index 0000000..c78ac5b --- /dev/null +++ b/tests/test-vale-3-15-2-behaviours.sh @@ -0,0 +1,220 @@ +#!/usr/bin/env bash +# Reproduction fixtures for the Vale 3.15.2 behaviours the lint plugin's vale-config and vale-run +# skills state as house-verified (provenance key house-vale-3-15-2-repro). Each case builds a +# purpose-built fixture in a temp dir, runs the real `vale` binary and asserts exit code plus +# output. A behaviour that changes in a later Vale release fails here, which is the point: the +# skill text is only backed while this test passes. +# +# Not reproducible here (mdx2vast is not installed in CI): the native-MDX halves of the mdx +# suppression table. Only the mdx2vast-absent E100 and the `[formats] mdx = md` column are asserted. +set -uo pipefail + +if ! command -v vale &>/dev/null; then + echo "SKIP: vale is not installed" + exit 77 +fi +EXPECTED="3.15.2" +GOT="$(vale --version | awk '{print $3}')" +if [[ "$GOT" != "$EXPECTED" ]]; then + echo "SKIP: behaviours are pinned to Vale $EXPECTED, found $GOT" + exit 77 +fi + +PASS=0 +FAIL=0 +pass() { echo " PASS: $1"; PASS=$((PASS + 1)); } +fail() { echo " FAIL: $1"; FAIL=$((FAIL + 1)); } + +WORK="$(mktemp -d)" +trap 'rm -rf "$WORK"' EXIT + +OUT="" RC=0 +# run : run vale from , capture combined output and exit code. +run() { + local dir="$1"; shift + OUT="$(cd "$dir" && vale --no-wrap "$@" 2>&1)"; RC=$? + OUT="$(sed $'s/\x1b\\[[0-9;]*m//g' <<<"$OUT")" +} +# expect