SWE-rebench leaderboard — July 2026 task
harbor run -t ibragim-badertdinov/PerryTS__perry-3982harbor download ibragim-badertdinov/PerryTS__perry-3982Node API checker: namespace reads of absent builtin exports should return undefined
Perry's strict built-in API gate currently rejects some namespace property reads that Node treats as ordinary JavaScript property misses returning undefined.
This surfaced in the curated DNS constants fixture on current origin/main@22824ba90abf: node:dns/promises intentionally does not export ADDRCONFIG, V4MAPPED, or ALL, but reading those properties from the namespace object is valid in Node and returns undefined. Perry rejects the property read at check/lower time before the runtime can produce the matching value.
This is separate from named ESM import validation. Node rejects import { ADDRCONFIG } from "node:dns/promises", and Perry should continue not claiming that named export. The compatibility gap is namespace/property-read semantics.
Current main:
22824ba90abf Expose globalThis.EventTarget (#3628)
Node v25.9.0 behavior for the namespace object:
$ node -e 'import("node:dns/promises").then(m=>{for (const k of ["ADDRCONFIG","V4MAPPED","ALL","NODATA","CANCELLED"]){console.log(k, Object.prototype.hasOwnProperty.call(m,k), k in m, typeof m[k], m[k]);}})'
ADDRCONFIG false false undefined undefined
V4MAPPED false false undefined undefined
ALL false false undefined undefined
NODATA true true string ENODATA
CANCELLED true true string ECANCELLED
Node rejects the corresponding named import, which is correct and should remain true:
$ node --input-type=module -e 'import { ADDRCONFIG } from "node:dns/promises"; console.log(ADDRCONFIG)'
SyntaxError: The requested module 'node:dns/promises' does not provide an export named 'ADDRCONFIG'
Perry currently rejects the namespace property read in the curated fixture:
$ target/release/perry check test-parity/node-suite/dns/constants/error-aliases.ts
error[U006]: `dns/promises.ADDRCONFIG` is not implemented in Perry — see `perry --print-api-manifest` for the supported surface, or set `PERRY_ALLOW_UNIMPLEMENTED=1` to ignore. (#463)
--> test-parity/node-suite/dns/constants/error-aliases.ts:9:48
The manifest matches Node for named exports: dns/promises includes DNS error aliases like NODATA and CANCELLED, but does not include ADDRCONFIG, V4MAPPED, or ALL.
With the gate bypassed, Perry's runtime output matches Node for this fixture, including the absent namespace properties:
$ PERRY_ALLOW_UNIMPLEMENTED=1 target/release/perry run test-parity/node-suite/dns/constants/error-aliases.ts
...
dnsPromises.ADDRCONFIG: undefined
dnsPromises.V4MAPPED: undefined
dnsPromises.ALL: undefined
...
named aliases: ENODATA ECANCELLED
The relevant gate is in crates/perry-hir/src/lower/expr_member.rs: namespace PropertyGet on a NativeModuleRef(module) fails whenever module_has_symbol(module, prop) is None, even when the Node-compatible value for a namespace property miss is simply undefined.
Make Node built-in namespace property reads distinguishable from named imports/calls:
import * as dnsPromises from "node:dns/promises"; dnsPromises.ADDRCONFIG should compile and evaluate to undefined, matching Node.fs.notARealMethod()-style call gaps unless the runtime has a deliberate JS-compatible fallback.target/release/perry check test-parity/node-suite/dns/constants/error-aliases.ts passes without PERRY_ALLOW_UNIMPLEMENTED=1.dns/promises.ADDRCONFIG, V4MAPPED, and ALL namespace reads (undefined), andNODATA, CANCELLED, etc.).node:dns and node:dns/promises.No new interfaces are introduced.