Skip to content

FPFNFIXAPEX: recognize CommonJS Node port utilities - #2192

Draft
aidenybai wants to merge 9 commits into
fix/typed-redux-store-ref-initializationfrom
fix/commonjs-node-port-process-utility
Draft

aidenybai wants to merge 9 commits into
fix/typed-redux-store-ref-initializationfrom
fix/commonjs-node-port-process-utility

Conversation

@aidenybai

@aidenybai aidenybai commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Why

An async CLI calling a local useTerminal() utility receives a hook-order warning because the import starts with use. The utility allocates a port, launches a process and logs its output.

What changed

Recognize a bounded CommonJS utility shape from its complete local implementation and declared Node API roles. Require the exact JavaScript provider and closed bindings, callbacks and supported native operations.

Keep warnings for React hooks, unknown providers, mutable bindings, alternate loaders and unsupported resolution. Record provider, manifest and configuration dependencies through the same rule predicate. Reuse the provider traversal and identifier lookups, and dispatch validation by AST kind while preserving validator bodies and dependency-probe behavior.

Add synthetic regressions, a fuzz fixture and a patch changeset. This PR stacks on #2190.

Test plan and results

Current commit: b41daa82337c28a31503cf051fbeef8b03e81af9.

  • Native validation passed 73 cases, 153 comparisons using the same AST objects, validation order and dependency probes, and eight additional controls for unusual node kinds.
  • Five focused files passed 521 assertions, with two pending. All seven package suites passed 35,081 assertions, with 1,119 pending.
  • All seven typechecks, lint, formatting, generator checks, JSON schema smoke and published-dependency checks passed. The fresh five-package build produced 175 owned artifacts.
  • Strict fuzzing used 500 iterations, seed 42 and required target firing. The target fired 244 times.
  • Normal Git hooks passed. All current-head checks passed, including automatic commit previews.
  • Prior-head parity evidence records 1,991 complete repository pairs, with zero added diagnostics and one intended warning removed. Nine pairs remain unavailable or incomplete. The earlier repository-level wall-time flag remains under review.

Performance validation in progress

Current commit b41daa82337c28a31503cf051fbeef8b03e81af9 completed the frozen first-two isolated default-pool comparisons against the original 2d11cfd base. Activation and timing both preserved the expected 128 warnings → 0, with full diagnostic records retained. The timing case used five samples and one warmup per cache cohort, with the original thresholds unchanged.

Median Cold: base → current Hot: base → current
Total CPU 1.50s → 1.61s (+7.33%) 1.03s → 0.80s (−22.33%)
Wall time 883.25ms → 766.72ms 464.90ms → 366.99ms
Maximum single-process RSS +9.12% −14.71%

Both cache cohorts pass the frozen first128 wall, CPU and RSS criteria. The wall comparison uses the existing sum-of-MAD noise heuristic, not a confidence interval. RSS measures the maximum single process, not concurrent aggregate memory. Dedicated CPU profiles use a separate explicit child process; hot rule-time attribution is unavailable. Three freshly built Linux runtimes, all raw results and exact cleanup receipts were retained and independently checked.

The next frozen capture completed 35 additional activation comparisons, preserving all 140 expected records, before the command response stream ended unexpectedly. The following activation comparison has one completed base warmup and a cancelled head warmup; neither receives completed-comparison credit. Its raw results, command interruption and cleanup records remain preserved.

117 comparisons still require completion, including that partial activation case. All six remaining timing workloads are unstarted. The continuation keeps the original schedule, including the general control’s nine timing samples, and excludes the first two and all 35 completed activation comparisons. Command transport validation and resource checks must pass before it starts; no completed timing result is being retried.

The previous commit 7df004eb61d75afbaf1eefc2f3de8955e10b0b78 reached the first128 barrier and stopped on a flag. A run-directory mismatch prevented raw-data retrieval before sandbox cleanup. Its detailed metrics and profiles are unavailable, so the triggering criterion and size cannot be independently checked.

The earlier commit ffb04463a1851ea7bed285dde5918ef3a650a4bf recorded cold CPU increasing from 2.11s to 2.48s (+17.54%), above the 10% review threshold. Its cold wall median fell from 1,222.48ms to 1,186.76ms; maximum single-process RSS increased 9.17%. Hot CPU improved from 1.51s to 1.19s. Those measurements belong to that earlier source and remain preserved, along with the earlier repository-level wall-time flag.

This PR remains a draft pending the remaining performance comparisons and incomplete parity pairs. The new first-two result does not waive historical flags or establish readiness.

@pkg-pr-new

pkg-pr-new Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/eslint-plugin-react-doctor@2192
npm i https://pkg.pr.new/oxlint-plugin-react-doctor@2192
npm i https://pkg.pr.new/react-doctor@2192

commit: b41daa8

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant