Skip to content

runtime: unify createRequire builtin allowlist with getBuiltinModule — v8 + family audit (#6651) - #6653

Merged
proggeramlug merged 2 commits into
PerryTS:mainfrom
proggeramlug:fix/6651-createrequire-allowlist-family
Jul 19, 2026
Merged

runtime: unify createRequire builtin allowlist with getBuiltinModule — v8 + family audit (#6651)#6653
proggeramlug merged 2 commits into
PerryTS:mainfrom
proggeramlug:fix/6651-createrequire-allowlist-family

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Wall #5 of the pi bring-up (tracker #6564). require('node:v8') through the pi bundle's esbuild createRequire banner threw ERR_PERRY_UNSUPPORTED_CREATE_REQUIRE — same drift family as #6644 (wall #3): three hand-copied builtin lists, each missing a different subset.

Stacks on #6650 (which stacks on #6647#6633); only the last commit is this PR.

Audit

Perry had THREE independently maintained module lists:

  1. supported_require_builtin (module_require.rs) — createRequire's require
  2. supported_builtin_module_name (process.rs) — process.getBuiltinModule
  3. MODULE_BUILTIN_MODULES (process.rs) — module.builtinModules / module.isBuiltin, content-identical to the static-import tables' node-builtin subset (NATIVE_MODULESNODE_SUBMODULES in perry-api-manifest)

Full diff, verified empirically with a compiled probe (before → after; static import was already ✅ for every row — all of these are implemented modules):

module getBuiltinModule createRequire
v8 ❌ → ✅ ❌ → ✅ (the pi wall)
fs/promises ❌ → ✅ ❌ → ✅
stream/consumers ❌ → ✅ ❌ → ✅
stream/web ❌ → ✅ ❌ → ✅
trace_events ❌ → ✅ ❌ → ✅
node:sea ❌ → ✅
node:sqlite ❌ → ✅
tls, dgram, domain, inspector, inspector/promises, repl, wasi, path/posix, path/win32 ❌ → ✅
node:test/reporters ⚠️ method-dead namespace (spec/tap = undefined) → ✅ live exports same ⚠️ → ✅
bare sea / sqlite / test / test/reporters test(+reporters) resolved → now undefined (Node parity: scheme-only) sqlite/test(+reporters) resolved → now throw naming the module (Node: MODULE_NOT_FOUND)
~40 remaining builtins ✅ unchanged ✅ unchanged

Fix

Instead of adding v8 to two lists, both dynamic resolvers now derive from MODULE_BUILTIN_MODULES — the same table module.builtinModules/module.isBuiltin already serve — so the surfaces cannot drift again:

Tests

  • Unit (perry-runtime --lib, 1426 pass, --test-threads=1): resolvers cover every MODULE_BUILTIN_MODULES entry in exactly Node's spellings (incl. scheme-only + _-internal negatives); every submodule route names a registered spec; createRequire's resolver provably matches getBuiltinModule's for all spellings.
  • Integration (crates/perry/tests/createrequire_builtin_modules.rs, 4 pass): minimal node:v8 fixture (serialize typeof + deserialize round-trip + getBuiltinModule) byte-identical to node v26.3.0; a compiled sweep iterates the binary's own module.builtinModules through require + getBuiltinModule in both spellings, asserting resolution, the scheme-only bare rejections, and that unimplemented internals fail with the module named. Both runtime: createRequire rejects node:-prefixed builtins / missing diagnostics_channel — pi wall #3 (require('node:diagnostics_channel') via bundle shim) #6644 tests stay green.
  • Probe of 32 spelling×module combinations diffed against node: identical except (a) Perry's deliberate ERR_PERRY_UNSUPPORTED_CREATE_REQUIRE code where node says MODULE_NOT_FOUND for bare scheme-only names (message names the module in both), and (b) node:test default export is callable in node, an object namespace in Perry (pre-existing shape gap, not reachability).

pi gate

Full pi recompile (old binary kept as pi-native.pre6651): wall #5 is deadpi-native.pre6651 --help still dies on the node:v8 createRequire throw; the new pi-native gets past it (and past the bundle's node:stream/web / node:fs/promises requires, which would have been the next two walls of this family). GATE 1 not yet green: a new, unrelated wall #6 appears during module init, filed as #6652 with a 3-line repro:

TypeError: value is not a function
    at pi-bundle.mjs:203852     (line from a --debug-symbols build)

= bare-global hasOwnProperty.call(o, t4) in @babel/types/lib/definitions/placeholders.js — Perry's unknown-identifier-assume-global path doesn't serve Object.prototype-INHERITED members of the global object (compile warning: unknown identifier 'hasOwnProperty' — assuming global; 14 such sites in the bundle + 2 bare toString). Both --help and --version hit the same line; node prints full usage / 0.0.0 rc=0. Not chased here per the one-wall-per-PR flow.

Fixes #6651

https://claude.ai/code/session_01JuiiePQfrXhAFD9fuCygB9

Summary by CodeRabbit

  • Bug Fixes

    • Improved consistency when resolving built-in modules through require, createRequire, and process.getBuiltinModule.
    • Added support for valid bare and node:-prefixed module names, with correct handling of unsupported legacy and scheme-only modules.
    • Ensured built-in module values and submodules resolve consistently across APIs.
  • Tests

    • Added coverage for built-in module compatibility, including v8, serialization APIs, and all registered built-ins.

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

The runtime now uses MODULE_BUILTIN_MODULES as the shared source for builtin-module recognition and value routing. createRequire and process.getBuiltinModule share normalization and submodule dispatch, with tests covering supported spellings and rejection cases.

Builtin module resolution

Layer / File(s) Summary
Registry-driven builtin resolution
crates/perry-runtime/src/process.rs, crates/perry-runtime/src/node_submodules/mod.rs
Builtin names are normalized from MODULE_BUILTIN_MODULES, routed to registered submodule namespaces when applicable, and validated by runtime tests.
Runtime consumer wiring
crates/perry-runtime/src/module_require.rs, crates/perry-runtime/src/process/node_module.rs
createRequire and process.getBuiltinModule delegate builtin recognition and value resolution to the shared process helpers.
Cross-entrypoint parity coverage
crates/perry/tests/createrequire_builtin_modules.rs, crates/perry-runtime/src/module_require.rs
Regression tests verify v8, accepted node: spellings, legacy internals, scheme-only builtins, and parity across both APIs.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant createRequire
  participant process_getBuiltinModule
  participant builtin_registry
  participant node_submodules
  Caller->>createRequire: require builtin specifier
  createRequire->>builtin_registry: normalize and validate specifier
  builtin_registry-->>createRequire: resolved module name
  createRequire->>node_submodules: resolve submodule-backed value
  node_submodules-->>createRequire: return builtin namespace
  Caller->>process_getBuiltinModule: getBuiltinModule specifier
  process_getBuiltinModule->>builtin_registry: normalize and validate specifier
  builtin_registry-->>process_getBuiltinModule: resolved module name
  process_getBuiltinModule->>node_submodules: resolve submodule-backed value
Loading

Possibly related issues

Possibly related PRs

  • PerryTS/perry#6647 — Modifies the related createRequire and builtin-module resolution paths.
  • PerryTS/perry#6650 — Wires the createRequire devirtualization entrypoint used by this runtime path.

Suggested reviewers: andrewtdiz

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: unifying builtin resolution for createRequire and getBuiltinModule, with the v8 audit.
Description check ✅ Passed The description is detailed and covers summary, changes, related issue, and testing, though it uses custom headings instead of the template.
Linked Issues check ✅ Passed [#6651] The PR implements the allowlist unification, adds v8 and related builtins, and adds regression coverage matching the issue goals.
Out of Scope Changes check ✅ Passed The changes stay focused on builtin resolution unification and tests, with no obvious unrelated edits.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (1)
crates/perry/tests/createrequire_builtin_modules.rs (1)

183-208: 🎯 Functional Correctness | 🔵 Trivial | 🏗️ Heavy lift

Reject unresolved or method-dead namespaces in the exhaustive guard.

Checking only typeof value === "object" || "function" lets an empty unresolved namespace stub pass. Validate a known export contract for each routing family, or expose a test-only predicate that distinguishes unresolved namespaces.

Mirror the strengthened routing assertion in a cargo-test-visible unit test where practical. As per coding guidelines, “Prefer acceptance coverage in cargo-test-visible unit tests because integration suites under crates/*/tests/*.rs do not run on every PR.” <coding_guidelines>

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/perry/tests/createrequire_builtin_modules.rs` around lines 183 - 208,
Strengthen the exhaustive builtin checks around the `resolvable` predicate so
unresolved or method-dead namespace stubs cannot pass based only on `typeof`;
validate an appropriate known export contract for each builtin routing family or
use a test-only predicate that distinguishes valid namespaces. Mirror this
routing assertion in a cargo-test-visible unit test, reusing the relevant
runtime/module-resolution symbols rather than relying solely on
`createrequire_builtin_modules.rs`.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/perry-hir/src/lower/lower_expr/arm_class.rs`:
- Around line 188-205: Ensure every class-expression evaluation region has a
drainable refresh owner: in
crates/perry-hir/src/lower/lower_expr/arm_class.rs:188-205, route module-level
block captures through module-init refresh handling; in
crates/perry-hir/src/lower/expr_function.rs:384-394, preserve refresh entries
for assignments later in expression bodies; and in
crates/perry-hir/src/lower_patterns.rs:1457-1469, retain default-expression
captures until subsequent parameters initialize. Add regressions covering
module-level blocks, expression arrows, and parameter defaults.

In `@crates/perry-runtime/src/process.rs`:
- Around line 123-133: Update the builtin recognition logic around the specifier
normalization to reject any remaining `node:` prefix after stripping one prefix,
including `node:node:test`, before checking `MODULE_BUILTIN_MODULES`. Preserve
acceptance of ordinary builtin names and their single `node:`-prefixed forms,
and apply the same validation to both dynamic resolver paths.

In `@crates/perry-runtime/src/value/dynamic_arith.rs`:
- Around line 718-721: The raw operands in js_dynamic_ushr and throw_mix_bigint
must be rooted across GC-capable calls. Introduce crate::gc::RuntimeHandleScope
for both operands, then re-read each rooted value with get_nanbox_f64() before
the BigInt check and before throw_mix_bigint’s second diagnostic print,
respectively.

---

Nitpick comments:
In `@crates/perry/tests/createrequire_builtin_modules.rs`:
- Around line 183-208: Strengthen the exhaustive builtin checks around the
`resolvable` predicate so unresolved or method-dead namespace stubs cannot pass
based only on `typeof`; validate an appropriate known export contract for each
builtin routing family or use a test-only predicate that distinguishes valid
namespaces. Mirror this routing assertion in a cargo-test-visible unit test,
reusing the relevant runtime/module-resolution symbols rather than relying
solely on `createrequire_builtin_modules.rs`.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 050bb6a3-ee9b-4da3-ab74-76a206b52a3f

📥 Commits

Reviewing files that changed from the base of the PR and between 8d329a8 and 9ae826e.

📒 Files selected for processing (21)
  • crates/perry-codegen/src/codegen/module_globals_emit.rs
  • crates/perry-codegen/src/lower_call/native_table/node_core/module_sea_tls_test.rs
  • crates/perry-codegen/src/runtime_decls/strings.rs
  • crates/perry-hir/src/lower/context.rs
  • crates/perry-hir/src/lower/expr_function.rs
  • crates/perry-hir/src/lower/lower_expr/arm_class.rs
  • crates/perry-hir/src/lower/lowering_context.rs
  • crates/perry-hir/src/lower_decl/block.rs
  • crates/perry-hir/src/lower_patterns.rs
  • crates/perry-runtime/src/module_require.rs
  • crates/perry-runtime/src/node_submodules/mod.rs
  • crates/perry-runtime/src/process.rs
  • crates/perry-runtime/src/process/node_module.rs
  • crates/perry-runtime/src/typedarray/bigint.rs
  • crates/perry-runtime/src/value/dynamic_arith.rs
  • crates/perry/tests/createrequire_builtin_modules.rs
  • crates/perry/tests/module_destructured_globals.rs
  • test-parity/node-suite/bigint/arithmetic/mixed-operand-errors.ts
  • test-parity/node-suite/node-core/module-destructure-function-visibility.ts
  • test-parity/node-suite/object/class-expr-capture-refresh.ts
  • tests/test_class_expr_capture_refresh_6604.sh

Comment on lines 188 to +205
let at_module_top = ctx.scope_depth == 0 && ctx.inside_block_scope == 0;
// #6604: register this capturing class EXPRESSION with the enclosing
// body's end-of-body capture-refresh machinery (#6037/#6052), which
// previously scanned class DECLARATION statements only. Without the
// refresh, a captured var assigned AFTER the class expression (semver's
// `var Comparator = class _Comparator { … }; …; var parseOptions =
// require_parse_options()`) stays `undefined` in the decl-site snapshot,
// and dynamic construction of the escaped class value replays that stale
// snapshot. Recording the RESOLVED registration name here (post
// rename/dedup) sidesteps re-deriving it from the AST at body end. Module
// top is skipped — module-level ids are stripped from capture lists by
// `filter_module_level_captures`, so there is nothing to refresh.
if !at_module_top && !captured_args.is_empty() {
if let Some(ids) = ctx.lookup_class_captures(&synthetic_name) {
ctx.body_class_expr_captures
.push((synthetic_name.clone(), ids.to_vec()));
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Define a refresh owner for every class-expression evaluation region.

The new bookkeeping assumes every registered class expression belongs to a drainable function body, but top-level blocks strand entries while expression arrows and parameter defaults discard entries before later live-binding updates.

  • crates/perry-hir/src/lower/lower_expr/arm_class.rs#L188-L205: route module-level block captures through module-init refresh handling.
  • crates/perry-hir/src/lower/expr_function.rs#L384-L394: preserve refreshes for assignments occurring later in an expression body.
  • crates/perry-hir/src/lower_patterns.rs#L1457-L1469: retain default-expression captures until later parameters have initialized.

Add regressions for all three evaluation shapes.

📍 Affects 3 files
  • crates/perry-hir/src/lower/lower_expr/arm_class.rs#L188-L205 (this comment)
  • crates/perry-hir/src/lower/expr_function.rs#L384-L394
  • crates/perry-hir/src/lower_patterns.rs#L1457-L1469
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/perry-hir/src/lower/lower_expr/arm_class.rs` around lines 188 - 205,
Ensure every class-expression evaluation region has a drainable refresh owner:
in crates/perry-hir/src/lower/lower_expr/arm_class.rs:188-205, route
module-level block captures through module-init refresh handling; in
crates/perry-hir/src/lower/expr_function.rs:384-394, preserve refresh entries
for assignments later in expression bodies; and in
crates/perry-hir/src/lower_patterns.rs:1457-1469, retain default-expression
captures until subsequent parameters initialize. Add regressions covering
module-level blocks, expression arrows, and parameter defaults.

Comment thread crates/perry-runtime/src/process.rs
Comment on lines 718 to +721
pub unsafe extern "C" fn js_dynamic_ushr(a: f64, b: f64) -> f64 {
let a = to_numeric(a);
let b = to_numeric(b);
let a_big = JSValue::from_bits(a.to_bits()).is_bigint();
let b_big = JSValue::from_bits(b.to_bits()).is_bigint();
if a_big || b_big {
if both_bigint_or_throw(a, b) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🔴 Critical | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
rg 'RuntimeHandleScope::' crates/perry-runtime/src/

Repository: PerryTS/perry

Length of output: 38252


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== outline dynamic_arith.rs ==\n'
ast-grep outline crates/perry-runtime/src/value/dynamic_arith.rs --view expanded || true

printf '\n== relevant slices ==\n'
sed -n '1,120p' crates/perry-runtime/src/value/dynamic_arith.rs
printf '\n---\n'
sed -n '680,760p' crates/perry-runtime/src/value/dynamic_arith.rs

printf '\n== RuntimeHandleScope definitions/usages ==\n'
rg -n "struct RuntimeHandleScope|impl RuntimeHandleScope|fn refreshed_nanbox_f64_slice|fn get_nanbox_f64|fn new\(" crates/perry-runtime/src/gc crates/perry-runtime/src | sed -n '1,220p'

Repository: PerryTS/perry

Length of output: 23791


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== runtime_handles.rs ==\n'
sed -n '1,260p' crates/perry-runtime/src/gc/roots/runtime_handles.rs

printf '\n== nearby rooting patterns in dynamic_arith.rs ==\n'
sed -n '280,340p' crates/perry-runtime/src/value/dynamic_arith.rs
printf '\n---\n'
sed -n '340,430p' crates/perry-runtime/src/value/dynamic_arith.rs
printf '\n---\n'
sed -n '430,520p' crates/perry-runtime/src/value/dynamic_arith.rs

printf '\n== other call sites using RuntimeHandleScope in arithmetic-like code ==\n'
rg -n "refreshed_nanbox_f64_slice|get_nanbox_f64|RuntimeHandleScope::new\(" crates/perry-runtime/src/value crates/perry-runtime/src/object crates/perry-runtime/src/builtins | sed -n '1,220p'

Repository: PerryTS/perry

Length of output: 33281


Root the operands across the GC-capable coercions

js_dynamic_ushr and throw_mix_bigint both keep raw NaN-boxed f64s live across calls that can allocate or invoke JS (to_numeric / describe_mix_operand). Root both operands with crate::gc::RuntimeHandleScope, then re-read them with get_nanbox_f64() before the BigInt check / second diagnostic print, so a GC can’t leave stale pointers behind.

📍 Affects 1 file
  • crates/perry-runtime/src/value/dynamic_arith.rs#L718-L721 (this comment)
  • crates/perry-runtime/src/value/dynamic_arith.rs#L58-L67
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/perry-runtime/src/value/dynamic_arith.rs` around lines 718 - 721, The
raw operands in js_dynamic_ushr and throw_mix_bigint must be rooted across
GC-capable calls. Introduce crate::gc::RuntimeHandleScope for both operands,
then re-read each rooted value with get_nanbox_f64() before the BigInt check and
before throw_mix_bigint’s second diagnostic print, respectively.

Source: Learnings

@proggeramlug

Copy link
Copy Markdown
Contributor Author

CodeRabbit findings addressed:

Ralph Küpper added 2 commits July 19, 2026 03:33
…— v8 + family audit (PerryTS#6651)

require('node:v8') through createRequire (the esbuild banner shim in the pi
bundle) threw ERR_PERRY_UNSUPPORTED_CREATE_REQUIRE even though v8 has a full
native module (node_v8.rs, nm dispatch bucket, static-import support). Same
drift family as PerryTS#6644: THREE hand-copied module lists (createRequire's
supported_require_builtin, process.getBuiltinModule's
supported_builtin_module_name, and module.builtinModules'
MODULE_BUILTIN_MODULES) each missing a different subset.

Instead of adding v8 to two lists, both dynamic resolvers now derive from
MODULE_BUILTIN_MODULES — the same table module.builtinModules and
module.isBuiltin already serve — with Node's exact carve-outs:

- `_`-prefixed legacy internals stay unresolvable (Perry has no
  implementation; the error keeps naming the module).
- Scheme-only builtins (node:sea, node:sqlite, node:test,
  node:test/reporters — stored WITH the prefix, as Node spells them) resolve
  only with the node: prefix; the bare spelling is an npm package name in
  Node (require MODULE_NOT_FOUND / getBuiltinModule undefined). This also
  fixes the previous bare-'test'/'sqlite' looseness.

Newly reachable via createRequire (both spellings): v8, fs/promises,
stream/consumers, stream/web, trace_events; node:sea. Newly reachable via
getBuiltinModule: v8, tls, dgram, domain, inspector, inspector/promises,
repl, wasi, path/posix, path/win32, fs/promises, stream/consumers,
stream/web, trace_events, node:sqlite. Value routing is shared too
(process::builtin_module_value): submodule-spec modules (diagnostics_channel,
timers/promises, fs/promises, stream/consumers, stream/web, trace_events,
test/reporters — the last was resolving to a method-dead namespace, spec/tap
were undefined) go through the node_submodules registry, the rest through the
native-module namespace. The PerryTS#6644 devirt install-all hooks already arm every
bucket both registries need.

Regression guards: perry-runtime unit tests assert the resolvers cover every
MODULE_BUILTIN_MODULES entry (and only Node's spellings) and that every
submodule route names a registered spec; a compiled fixture sweeps
module.builtinModules through require + getBuiltinModule in both spellings,
including the negative cases; a minimal node:v8 fixture is byte-identical to
node v26.

Fixes PerryTS#6651

Claude-Session: https://claude.ai/code/session_01JuiiePQfrXhAFD9fuCygB9
@proggeramlug
proggeramlug force-pushed the fix/6651-createrequire-allowlist-family branch from 50aff8c to b7440cc Compare July 19, 2026 01:33

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
crates/perry/tests/createrequire_builtin_modules.rs (1)

63-64: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Prefer unit tests for acceptance coverage.

As per coding guidelines, prefer acceptance coverage in cargo-test-visible unit tests because integration suites under crates/*/tests/*.rs do not run on every PR.

While tests that must invoke the full perry binary might necessitate this location, please consider if these checks can be refactored into unit tests to ensure they run consistently on all PRs.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/perry/tests/createrequire_builtin_modules.rs` around lines 63 - 64,
Refactor the coverage for createrequire diagnostics-channel and node-prefixed
builtins from the integration test
createrequire_resolves_diagnostics_channel_and_node_prefixed_builtins into a
cargo-test-visible unit test, unless invoking the full perry binary is required.
Preserve both resolution checks and their acceptance behavior in the unit-test
location.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@crates/perry/tests/createrequire_builtin_modules.rs`:
- Around line 63-64: Refactor the coverage for createrequire diagnostics-channel
and node-prefixed builtins from the integration test
createrequire_resolves_diagnostics_channel_and_node_prefixed_builtins into a
cargo-test-visible unit test, unless invoking the full perry binary is required.
Preserve both resolution checks and their acceptance behavior in the unit-test
location.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 0bbcfa52-2a60-4b74-9f41-167c71a2e8b6

📥 Commits

Reviewing files that changed from the base of the PR and between 50aff8c and b7440cc.

📒 Files selected for processing (5)
  • crates/perry-runtime/src/module_require.rs
  • crates/perry-runtime/src/node_submodules/mod.rs
  • crates/perry-runtime/src/process.rs
  • crates/perry-runtime/src/process/node_module.rs
  • crates/perry/tests/createrequire_builtin_modules.rs
🚧 Files skipped from review as they are similar to previous changes (3)
  • crates/perry-runtime/src/process/node_module.rs
  • crates/perry-runtime/src/node_submodules/mod.rs
  • crates/perry-runtime/src/process.rs

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.

runtime: createRequire allowlist missing v8 (and audit the whole allowlist-vs-getBuiltinModule family) — pi wall #5

1 participant