Skip to content

Commit afabba4

Browse files
feat(rules): :nodejs_detected — add vscode-*, tree-sitter-*, Lake, Office, bindings carve-outs (standards#253) (#405)
## Summary STEP 3 of campaign #253 (npm → Deno estate migration). Carve-out gap-fix surfaced during the smallest-first batch. Expands `:nodejs_detected` `path_allow_prefixes` to cover ~10 false-positive manifest classes: - `vscode-` substring — VSCode-* extension repos / subdirs not under `/vscode/` segment - `tree-sitter-` substring — tree-sitter grammar npm-publish targets with `node-gyp` native binding (Class C) - `/.lake/` — Lean4 vendored packages - `/office-addin/` — Office.js add-in host-required toolchain - `/bindings/javascript/`, `/bindings/typescript/` — consumer-facing estate exports These are all legitimate non-migrate-able npm manifest cases. Adding them as carve-outs prevents incorrect migration PRs against e.g. `vscode-k9`, `tree-sitter-a2ml`, `proven/bindings/typescript/`. ## Test plan - [ ] Hypatia rule-engine unit tests pass. - [ ] Re-scan against the estate produces zero flags for the named carve-out classes. - [ ] Truly migrate-able manifests (e.g. `coq-jr/package.json`, `civic-connect/indieweb2-bastion/package.json`) still flag — verified by current STEP-3 batch (~13 PRs filed against repos NOT in the new carve-out classes). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 9ed7611 commit afabba4

1 file changed

Lines changed: 43 additions & 6 deletions

File tree

lib/rules/cicd_rules.ex

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -238,18 +238,30 @@ defmodule Hypatia.Rules.CicdRules do
238238
# Node.js / npm ban (org policy 2026-05-25). Matches `package-lock.json`
239239
# as the canonical npm-toolchain signal. In-flight estate migration to
240240
# Deno tracked under hyperpolymath/standards#253 + STEPS #261-#275.
241-
# Path-prefix allowlist covers six classes of legitimate lockfile
241+
# Path-prefix allowlist covers eight classes of legitimate lockfile
242242
# presence:
243243
#
244-
# (1) VSCode extension host-required — `**/vscode/**`; VSCode
245-
# extension toolchain runs under Node, so its lockfile is
246-
# contractually required by the host (parallel to TS class 9).
244+
# (1a) VSCode extension host-required — `**/vscode/**` (segment match);
245+
# VSCode extension toolchain runs under Node, so its lockfile is
246+
# contractually required by the host (parallel to TS class 9).
247+
# (1b) VSCode-* extension repos / subdirs — `vscode-` substring covers
248+
# `vscode-extension/`, `editors/vscode-007/`, repo-root manifests
249+
# for `vscode-a2ml`, `vscode-k9` etc. Same host-required rationale
250+
# as (1a); separate prefix because the path segment varies.
251+
# (1c) tree-sitter grammar npm-publish targets — `tree-sitter-` substring
252+
# covers `tree-sitter-a2ml/`, `tree-sitter-k9/`,
253+
# `editors/tree-sitter-ephapax/` etc. Class C consumer artifact:
254+
# tree-sitter grammars ship via npm with `node-gyp` native binding
255+
# because consumers (Atom/Neovim/VSCode) link the native addon.
247256
# (2) Bootstrap shims — `affinescript-deno-test/`, `affinescript-cli/`
248257
# parallel to TS class 5.
249258
# (3) Upstream forks not estate-authored — `rescript/`, `servers/`,
250259
# `repos-monorepo/`, `linguist/`.
251260
# (4) Archived repos — `hyperpolymath-archive/**`.
252-
# (5) Vendored package-manager deps — `**/deps/**`, `**/node_modules/**`.
261+
# (5) Vendored package-manager deps — `**/deps/**`, `**/node_modules/**`,
262+
# `**/.lake/**` (Lean4 vendored), `**/office-addin/**` (Office.js
263+
# host-required), `**/bindings/{javascript,typescript}/**`
264+
# (consumer-facing estate exports).
253265
# (6) Example/test fixtures — `**/example/**`, `**/examples/**`,
254266
# `**/test-fixtures/**`, `**/fixtures/**` may legitimately ship
255267
# a lockfile demonstrating an npm consumer.
@@ -259,8 +271,20 @@ defmodule Hypatia.Rules.CicdRules do
259271
reason:
260272
"Node.js banned -- use Deno (org policy 2026-05-25; in-flight migration tracked under standards#253)",
261273
path_allow_prefixes: [
262-
# (1) VSCode extension host-required
274+
# (1a) VSCode extension host-required (/vscode/ as path segment)
263275
"/vscode/",
276+
# (1b) VSCode-* extension repos / subdirs (vscode-extension/, vscode-007/,
277+
# vscode-a2ml, vscode-k9, etc. — host-required toolchain runs under
278+
# Node; lockfile is contractually required by the VSCode extension
279+
# host). Substring match covers paths like editors/vscode-007/ +
280+
# repo-root manifests for vscode-* extension repos.
281+
"vscode-",
282+
# (1c) tree-sitter grammar npm-publish targets — these ship via npm
283+
# with `node-gyp` native binding because every tree-sitter
284+
# consumer (Atom, Neovim's nvim-treesitter, VSCode TextMate, etc.)
285+
# links against the native addon. Class C: npm-publishable
286+
# consumer artifact, NOT estate-internal npm toolchain use.
287+
"tree-sitter-",
264288
# (2) Bootstrap shims
265289
"affinescript-deno-test/",
266290
"affinescript-cli/",
@@ -274,6 +298,19 @@ defmodule Hypatia.Rules.CicdRules do
274298
# (5) Vendored deps
275299
"/deps/",
276300
"/node_modules/",
301+
# (5a) Vendored Lake (Lean4) packages — `.lake/packages/**` mirrors the
302+
# `/deps/` carve-out class for Lean4's package manager
303+
"/.lake/",
304+
# (5b) Office add-in host-required toolchain (Office.js extensions
305+
# ship via npm because the Office host loads `.js` from a
306+
# Node-packaged manifest). Parallel to VSCode extension carve-out.
307+
"/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.
312+
"/bindings/javascript/",
313+
"/bindings/typescript/",
277314
# (6) Example / test fixtures
278315
"/example/",
279316
"/examples/",

0 commit comments

Comments
 (0)