Skip to content

fix(vale): ship Vale 3.27.0 with its grammars - #705

Merged
theCodeDrift merged 6 commits into
vale-grammars-packagefrom
fix/vale-3-27-0
Nov 20, 2026
Merged

theCodeDrift merged 6 commits into
vale-grammars-packagefrom
fix/vale-3-27-0

Conversation

@theCodeDrift

@theCodeDrift theCodeDrift commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Stack (root → tip):

Ships Vale 3.27.0 with no change in what any rule reports. This is the second landing of vale-grammars-package, stacked on #704, which publishes the grammar package. It carries #703's pin bump (re-signed) and the fix that makes it green, and it supersedes #703.

The problem #703 hit

Vale 3.27.0 no longer bundles the tree-sitter grammars it uses to read comments in source code. Without them it falls back to finding comments by their delimiters. Six vendor-contract cases failed on #703 as a result: directive comments (//nolint, # noqa, // NOSONAR, …) and docstring :param: lines were linted as prose, one-line CSS /* */ comments were skipped, and every run printed one W101 grammar … is not installed per language.

What this does

  • Pins @taskless/vale-grammars@3.27.0-20261117230017, the same exact version as the six platform packages, as a regular dependency. The lockfile integrity matches the tarball that was verified before the manual publish.
  • Runs every Vale child with VALE_GRAMMARS_PATH set to the resolved package directory (src/rules/vale/grammars.ts, valeEnvironment in run.ts). The value is always replaced, never inherited, because a value from the user's shell would name grammars nobody pinned. If the package doesn't resolve, the variable is dropped, and Vale's own W101 warnings reach the user as notices.
  • Adds a new vale-tree-no-grammars constraint. A .taskless/rules/vale/config/grammars/ directory, which Vale would read ahead of ours, is refused. validate reports it against every Vale rule, and assembly refuses the check run, through one shared check. The directory's presence is what's refused, not its contents.
  • Exports resolveValeGrammars / VALE_GRAMMARS from @taskless/cli/node/runtimes, so a verifier runs Vale rules with the same grammars.
  • Contract coverage: each comment-tier extension is run through the pinned binary with the pinned grammars, and any "not installed" warning fails the test and names the extension. With go.wasm withheld, only the .go case fails, naming the go grammar.
  • engine-version-consistency now reads dependencies, where the grammar pin lives. Before, it silently skipped that pin.
  • Release notes: a 0.13.8 update ledger entry, the grown vale-3-27-0 changeset (patch), .taskless/ reconciled to Vale 3.27.0, and the reference corpus regenerated for the new constraint.
  • Archives the OpenSpec change. All three specs keep every prior scenario: 18→27, 41→48 and 8→10.

Checks

Full CLI suite: 3413 passed. typecheck, lint and the 523 script tests pass. The vendor contract passes 243 of 243 with no VALE_GRAMMARS_PATH in the shell.

Landing

Merge #704 first; the gate already reports all seven packages published, so that merge publishes nothing. Then rebase this onto main. #703 closes when this merges.

Closes #703

github-actions Bot and others added 5 commits November 19, 2026 17:32
Pin @taskless/vale-grammars at the platform packages' exact version and
resolve its grammars directory beside findValeBinary. Every Vale child
gets VALE_GRAMMARS_PATH set to it, always replacing a value inherited
from the user's shell, which would name grammars nobody pinned. The
vendor contract spawns Vale in the same environment, and the six cases
#703 failed pass again.

The resolver and its spec are exported from @taskless/cli/node/runtimes,
so a verifier runs Vale rules with the same grammars check does.
A config/grammars directory in .taskless/rules/vale would hand Vale
grammars ahead of the pinned ones, since that tree is every assembled
config's StylesPath. A new vale-tree-no-grammars constraint refuses it:
validate reports it against every Vale rule, and assembly refuses the
check run through one shared check. Presence is refused, not contents.

The vendor contract now asks the binary whether every comment-tier
extension has a pinned grammar, naming the one that is missing.
engine-version-consistency reads dependencies, where the grammar pin
lives, and holds it to the platform pins' exact version. Regenerate the
reference corpus for the new constraint.
The 0.13.8 ledger entry says no rule reports anything different, and
that a config/grammars directory in .taskless/rules/vale is now
refused. The changeset grows to say the grammars ship as their own
package and what is refused. Reconcile this repository's own rules to
Vale 3.27.0 with update --rules.
Every task is done and every prior scenario in the three standing specs
survives: vale-binary-packages 18 -> 27, cli-vale-rule-engine 41 -> 48,
cli-runtime-binary-export 8 -> 10.
@theCodeDrift

Copy link
Copy Markdown
Member Author

@claude /review

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @theCodeDrift's task in 4m 7s —— View job


Review complete

Review mode: incremental — read 0 prior review thread(s) before reviewing. .prior-review.json held no reviews, review threads, or prior top-level comments beyond the trigger itself, so this is the first review pass on this PR; everything below is assessed fresh.

  • Read prior review data
  • Fetch PR diff and metadata
  • Review grammar resolution logic (grammars.ts, run.ts)
  • Review constraint/assembly changes (constraints.ts, assemble.ts, grammar-tree.ts)
  • Review runtime export (node/runtimes/index.ts)
  • Review tests
  • Review release notes / changeset / openspec
  • Post final review

Summary

The change is well-scoped and consistent with the repo's existing patterns. resolveValeGrammars mirrors resolvePlatformBinary's createRequire(...).resolve("<pkg>/package.json") + process-cache + miss-as-value approach exactly, valeEnvironment correctly strips any shell-inherited VALE_GRAMMARS_PATH before setting the pinned one, and the one place that consumed RefusedValeConfig.refusals (describeValeRefusal in dispatch.ts) was updated for the new treeRejections field — no other reader of that type was missed. engine-version-consistency.test.ts's pinnedVersions("@taskless/vale") prefix match correctly sweeps up @taskless/vale-grammars once it's merged into allPins from dependencies, so the version-parity check isn't vacuous. Docs (changeset, update ledger, reference.json, openspec specs) are all consistent with the code.

Two [New] findings posted inline, both on packages/cli/src/rules/vale/grammar-tree.ts, no blocking issues:

  1. validate/check can disagree on a project with zero Vale rules. check's refusal (assembleValeConfig) computes valeTreeGrammarsViolation unconditionally, before the rule loop; validate's call sits inside validateRuleComponents, which only runs per existing resolved rule. A .taskless/rules/vale/config/grammars/ directory left over after every Vale rule is deleted would pass validate but still fail check — contradicting the file's own comment that "the two cannot disagree about what they found," and untested by either new test (both seed a rule first). Worth confirming this is accepted scope rather than an oversight.
  2. Minor message wording: the violation message says the directory "holds Vale grammars the CLI did not ship" even when it's empty (the "is empty" case is deliberately covered and refused the same way) — slightly overclaims what's actually there.

Everything else — the grammar/binary env wiring, the shared tree-check between validate and assembly, the new vendor-contract coverage asking the binary (rather than a hardcoded map) which grammar each comment-tier extension needs, and the RefusedValeConfig shape change — looks correct and well-tested.

@theCodeDrift
theCodeDrift added this pull request to stack #706 November 20, 2026 01:48
…ectory exists

Review on #705 asked whether validate and check disagree on a project
with no Vale rules and a stale config/grammars directory. Measured: both
fail, because config/ itself is listed as a rule directory and validate
judges it. That held by accident, so a test now pins it.

The message said the directory "holds Vale grammars" even when empty,
which is also refused. It now says the directory exists.
@theCodeDrift

Copy link
Copy Markdown
Member Author

Re: @github-actions — "Claude finished @theCodeDrift's task in 4m 7s… Review complete"
#705 (comment)

Both inline findings are answered in 88d3f4b. The zero-rule case was measured to fail in both validate and check and is now pinned by a test, and the refusal message no longer claims an empty directory holds grammars.

— AI Coding Agent

@theCodeDrift
theCodeDrift merged commit 640eb7c into main Nov 20, 2026
6 checks passed
@theCodeDrift
theCodeDrift deleted the fix/vale-3-27-0 branch November 20, 2026 02:00
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