From 36184d4a73ef360aecc7cca63b252932d6dcad57 Mon Sep 17 00:00:00 2001 From: hyperpolymath <6759885+hyperpolymath@users.noreply.github.com> Date: Sun, 31 May 2026 08:20:49 +0100 Subject: [PATCH] =?UTF-8?q?feat(rules):=20:nodejs=5Fdetected=20=E2=80=94?= =?UTF-8?q?=20add=20/bindings/rescript/=20carve-out=20(parallel=20to=20/bi?= =?UTF-8?q?ndings/{javascript,typescript}/)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Surfaced during 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). ## Carve-out class 5c updated Old: - `/bindings/javascript/` - `/bindings/typescript/` New: - `/bindings/javascript/` - `/bindings/typescript/` - `/bindings/rescript/` Comment block updated to reflect the rescript variant + reference the standards#275 STEP 7 surfacing context. ## Test coverage Adds 1 new test case `"exempts */bindings/{javascript,typescript,rescript}/ consumer exports"` to `cicd_rules_rescript_npm_js_test.exs` `nodejs_detected rule` describe block. Asserts that lockfiles under any of the three sibling consumer-export bindings paths are exempt. After this lands, the standards#253 closeout (PR #325 merged 2026-05-31) declaration "zero `:nodejs_detected` flags outside carve-outs" becomes exactly true estate-wide (was 19/20 prior). Refs standards#253 (umbrella npm → Deno campaign, closed 2026-05-31) Refs standards#275 (STEP 7 workspace finalisation, closed 2026-05-31) Refs hypatia#405 (predecessor — first batch of class-5c carve-outs) Co-Authored-By: Claude Opus 4.7 (1M context) --- lib/rules/cicd_rules.ex | 15 +++++++++++---- test/rules/cicd_rules_rescript_npm_js_test.exs | 13 +++++++++++++ 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/lib/rules/cicd_rules.ex b/lib/rules/cicd_rules.ex index 4d72a91..76b6ae1 100644 --- a/lib/rules/cicd_rules.ex +++ b/lib/rules/cicd_rules.ex @@ -305,12 +305,19 @@ defmodule Hypatia.Rules.CicdRules do # ship via npm because the Office host loads `.js` from a # Node-packaged manifest). Parallel to VSCode extension carve-out. "/office-addin/", - # (5c) Estate "bindings/{javascript,typescript,deno}/" subdirs are - # consumer-facing exports of estate-internal proven libraries - # to npm-consuming downstreams (parallel to /bindings/deno/ - # under :typescript_detected). NOT estate-internal npm use. + # (5c) Estate "bindings/{javascript,typescript,rescript,deno}/" + # subdirs are consumer-facing exports of estate-internal proven + # libraries to npm-consuming downstreams (parallel to + # /bindings/deno/ under :typescript_detected). NOT + # estate-internal npm use. 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). Surfaced during standards#275 STEP 7 closeout + # estate-wide scan (proven-servers/bindings/rescript/ was the + # single uncarved hit). "/bindings/javascript/", "/bindings/typescript/", + "/bindings/rescript/", # (6) Example / test fixtures "/example/", "/examples/", diff --git a/test/rules/cicd_rules_rescript_npm_js_test.exs b/test/rules/cicd_rules_rescript_npm_js_test.exs index 2d624b1..aec89c5 100644 --- a/test/rules/cicd_rules_rescript_npm_js_test.exs +++ b/test/rules/cicd_rules_rescript_npm_js_test.exs @@ -188,6 +188,19 @@ defmodule Hypatia.Rules.CicdRules.RescriptNpmJsTest do assert Enum.find(results, &(&1.rule == :nodejs_detected)) == nil, "example/fixture lockfiles demonstrate npm consumer — not own toolchain" end + + test "exempts */bindings/{javascript,typescript,rescript}/ consumer exports" do + files = [ + "proven-servers/bindings/javascript/package-lock.json", + "proven-servers/bindings/typescript/package-lock.json", + "proven-servers/bindings/rescript/package-lock.json" + ] + + results = CicdRules.check_commit_blocks(files) + + assert Enum.find(results, &(&1.rule == :nodejs_detected)) == nil, + "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" + end end # ---------------------------------------------------------- Unnecessarily-JS