Skip to content

[campaign #254] STEP 1 — POLICY: Hypatia :javascript_detected rule design + standards docs #263

@hyperpolymath

Description

@hyperpolymath

Part of #254.

Goal

Design and ship the Hypatia :javascript_detected rule (parallel to :typescript_detected and :rescript_detected) plus matching standards-docs language so that new .js/.jsx outside documented carve-outs is automatically flagged estate-wide.

Open design question — SHIP-MODE

JavaScript is allowed in policy "only where AffineScript cannot reach", so unlike TS/RS the JS rule has a permanently-legitimate residue. Two ship modes are on the table:

  • Mode A (WARNING first): rule emits informational finding on every new .js/.jsx outside carve-outs; flip to HARD-BLOCK only after STEP 2 triage has classified the bulk of the backlog. Lower false-positive blast radius during the long-tail phase.
  • Mode B (HARD-BLOCK first): rule blocks merges immediately; carve-outs do the work of staying out of the way. Higher signal, higher operator cost if carve-outs prove incomplete.

Decision required as part of this step, not silently. Recommend Mode A unless operator overrides.

Carve-out classes to encode

From #254 umbrella table, the rule must allow JS in:

# Class Pattern
1 host-required by ecosystem MCP servers, plugin entry points
2 tooling configs *.config.{js,cjs,mjs}
3 bootstrap shims affinescript-{deno-test,cli}/
4 upstream forks .fork == true repos
5 archived hyperpolymath-archive/**
6 vendored deps **/deps/**, **/node_modules/**
7 compiled output **/out/**, **/lib/js/**, **/.deno/**
8 host extension entry **/vscode/**, **/extensions/vscode/**

Acceptance

  • New Hypatia rule :javascript_detected in hypatia repo with the 8 carve-out classes encoded as path_allow_prefixes (or equivalent)
  • Ship mode (WARNING vs HARD-BLOCK) explicitly recorded in rule docstring and standards LANGUAGE-POLICY.adoc (or equivalent)
  • Standards prose updated: language-policy doc references the new rule and clarifies JS-allowed-only-where-AS-cannot
  • Smoke test: rule fires on a fresh .js in src/, does NOT fire on *.config.js, vscode/**/*.js, node_modules/**/*.js
  • Per-PR ownership gate on the standards/hypatia PRs

Seam — batch with sibling rule work

Sibling campaigns #252 (ReScript) and #253 (npm) also need new/extended hypatia rules. Strongly suggest batching the three rule additions into a single hypatia PR (one schema bump, three rule definitions, one set of standards-doc updates) to amortise review cost and keep the carve-out vocabulary consistent across all three campaigns.

Sequencing

Blocks: STEP 2 leans on this rule's path-allow taxonomy when classifying the inventory. STEPs 3-5 cannot mass-merge ports safely without it.
Blocked by: nothing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    campaignMulti-PR multi-session estate campaigndocumentationImprovements or additions to documentationjs-to-affinescriptTracks the Unnecessarily-JavaScript → AffineScript migration campaign (umbrella #254)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions