Skip to content

[campaign #254] STEP 2 — TRIAGE TOOLING: automated JS-API-surface classifier (LOAD-BEARING) #266

@hyperpolymath

Description

@hyperpolymath

Part of #254. Blocked by step 1.

Goal

Build the triage tool that makes the rest of this campaign tractable. Without it, the migration is open-ended: 1,609+ .js/.jsx files cannot be hand-classified at scale. The tool enumerates JS API surface per file, cross-checks against the current AffineScript stdlib catalog, and outputs three buckets so STEPs 3-5 can proceed by data rather than by guess.

This is the LOAD-BEARING step — every downstream step depends on its output.

Inventory note

Umbrella body lists "1,609 .js/.jsx files" from the 2026-05-28 inventory. A fresh find on 2026-05-30 returned 1,724 with similar excludes. Treat 1,609 as informational only; the triage tool must re-enumerate with documented excludes (record exclude-list in tool docstring or sibling config file) so the bucket counts are reproducible.

Acceptance

  • Tool enumerates JS API surface per file (acorn-style AST walk preferred; simple regex sufficient for v0 — record choice in tool docs)
  • Cross-checks surface against the current AffineScript stdlib catalog (Deno.affine, json.affine, collections.affine, string.affine, Vscode.affine, etc.)
  • Outputs three buckets per file: portable now / blocked on binding X / keep as JS
  • For the blocked on binding X bucket: tool emits the specific missing binding name so STEP 4 can group by binding
  • For the keep as JS bucket: tool emits the carve-out class (1-8 from [campaign] Unnecessarily-JavaScript → AffineScript estate migration (UMBRELLA) #254) that applies
  • Bucket counts published as a comment on [campaign] Unnecessarily-JavaScript → AffineScript estate migration (UMBRELLA) #254 (totals + per-repo breakdown for top-20 repos)
  • Triage script committed to a documented path. Suggested location: standards/scripts/js-triage/ (or equivalent under hypatia repo if that's the better seam — record decision in commit message)
  • Documented exclude-list reproducible: re-running the enumeration yields the same file count given the same excludes
  • Per-PR ownership gate on the standards/hypatia PR that lands the tool

Definition of done

The comment on #254 makes the next two steps obvious: STEP 3 has a concrete file list (portable-now bucket), STEP 4 has a concrete binding-gap list (grouped by missing AS binding).

Sequencing

Blocks: STEPs 3, 4, 5 all consume this tool's output.
Blocked by: STEP 1 (carve-out taxonomy from :javascript_detected rule is the source of truth for the keep as JS bucket classification).

Metadata

Metadata

Assignees

No one assigned

    Labels

    campaignMulti-PR multi-session estate campaignjs-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