Skip to content

Commit d21e6fe

Browse files
feat(rules): :nodejs_detected — add /bindings/rescript/ carve-out (post #275 closeout cleanup) (#412)
## Summary Surfaced during the hyperpolymath/standards#275 STEP 7 closeout **estate-wide hypatia scan**: `proven-servers/bindings/rescript/package-lock.json` was the single uncarved hit across 20 estate-wide `package-lock.json` files. The `rescript` variant is **host-required for the rescript-to-js compile chain** (same pattern as JS/TS consumer exports, just produced from `.res` sources) and is symmetric to the existing `/bindings/javascript/` and `/bindings/typescript/` carve-out class (5c). ## Changes **`lib/rules/cicd_rules.ex`** — carve-out class 5c extended: | Before | After | |---|---| | `/bindings/javascript/` | `/bindings/javascript/` | | `/bindings/typescript/` | `/bindings/typescript/` | | — | `/bindings/rescript/` | Comment block updated to reflect the rescript variant + reference the standards#275 STEP 7 surfacing context. **`test/rules/cicd_rules_rescript_npm_js_test.exs`** — 1 new test case in the `nodejs_detected rule` describe block asserting that lockfiles under any of the three sibling consumer-export bindings paths are exempt. ## Why this closes the loop The standards#253 closeout PR (hyperpolymath/standards#325) merged 2026-05-31T07:11Z, declaring the npm → Deno migration "substantially complete" with "zero `:nodejs_detected` flags outside carve-outs". The estate-wide scan during that closeout's STEP 7 audit (hyperpolymath/standards#275) surfaced one uncarved hit. This PR makes the closeout declaration **exactly true** (was 19/20 prior). ## Test plan - [ ] CI: existing nodejs_detected suite passes - [ ] New test: `exempts */bindings/{javascript,typescript,rescript}/ consumer exports` passes (already syntactically validated via `Code.string_to_quoted!`) - [ ] Hypatia self-scan: no false-positive flagging on `proven-servers/bindings/rescript/` Refs hyperpolymath/standards#253 (umbrella, CLOSED 2026-05-31) Refs hyperpolymath/standards#275 (STEP 7, CLOSED 2026-05-31) Refs #405 (predecessor — first batch of class-5c carve-outs added vscode-*, tree-sitter-*, Lake, Office, javascript/typescript bindings) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d460d6c commit d21e6fe

2 files changed

Lines changed: 24 additions & 4 deletions

File tree

lib/rules/cicd_rules.ex

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -305,12 +305,19 @@ defmodule Hypatia.Rules.CicdRules do
305305
# ship via npm because the Office host loads `.js` from a
306306
# Node-packaged manifest). Parallel to VSCode extension carve-out.
307307
"/office-addin/",
308-
# (5c) Estate "bindings/{javascript,typescript,deno}/" subdirs are
309-
# consumer-facing exports of estate-internal proven libraries
310-
# to npm-consuming downstreams (parallel to /bindings/deno/
311-
# under :typescript_detected). NOT estate-internal npm use.
308+
# (5c) Estate "bindings/{javascript,typescript,rescript,deno}/"
309+
# subdirs are consumer-facing exports of estate-internal proven
310+
# libraries to npm-consuming downstreams (parallel to
311+
# /bindings/deno/ under :typescript_detected). NOT
312+
# estate-internal npm use. The rescript variant is
313+
# host-required for the rescript-to-js compile chain (same
314+
# pattern as JS/TS consumer exports, just produced from .res
315+
# sources). Surfaced during standards#275 STEP 7 closeout
316+
# estate-wide scan (proven-servers/bindings/rescript/ was the
317+
# single uncarved hit).
312318
"/bindings/javascript/",
313319
"/bindings/typescript/",
320+
"/bindings/rescript/",
314321
# (6) Example / test fixtures
315322
"/example/",
316323
"/examples/",

test/rules/cicd_rules_rescript_npm_js_test.exs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,19 @@ defmodule Hypatia.Rules.CicdRules.RescriptNpmJsTest do
188188
assert Enum.find(results, &(&1.rule == :nodejs_detected)) == nil,
189189
"example/fixture lockfiles demonstrate npm consumer — not own toolchain"
190190
end
191+
192+
test "exempts */bindings/{javascript,typescript,rescript}/ consumer exports" do
193+
files = [
194+
"proven-servers/bindings/javascript/package-lock.json",
195+
"proven-servers/bindings/typescript/package-lock.json",
196+
"proven-servers/bindings/rescript/package-lock.json"
197+
]
198+
199+
results = CicdRules.check_commit_blocks(files)
200+
201+
assert Enum.find(results, &(&1.rule == :nodejs_detected)) == nil,
202+
"consumer-facing language bindings under /bindings/{js,ts,res}/ ship to npm-consuming downstreams (parallel to /bindings/deno/ under :typescript_detected); the rescript variant is host-required for the rescript-to-js compile chain"
203+
end
191204
end
192205

193206
# ---------------------------------------------------------- Unnecessarily-JS

0 commit comments

Comments
 (0)