Skip to content

node:constants: fill POSIX file flag, libuv, and default cipher metadata tail #3683

@andrewtdiz

Description

@andrewtdiz

Summary

Perry's node:constants surface is broad, but current Node exposes additional constants that are either absent from Perry's manifest and/or resolve to undefined at runtime. The missing group is mostly POSIX file-mode/open flags, libuv dirent/symlink/copyfile flags, and defaultCoreCipherList.

This is a focused metadata parity cut, not a behavior-heavy subsystem change.

Local evidence

Current manifest has 198 constants entries. Node v25.9.0 exposes these representative constants:

UV_DIRENT_FILE: number 1
UV_DIRENT_DIR: number 2
UV_DIRENT_LINK: number 3
UV_FS_SYMLINK_DIR: number 1
UV_FS_SYMLINK_JUNCTION: number 2
S_IFMT: number 61440
S_IFREG: number 32768
S_IFDIR: number 16384
S_IFLNK: number 40960
O_DIRECTORY: number 1048576
O_NOCTTY: number 131072
O_NONBLOCK: number 4
O_SYNC: number 128
O_DSYNC: number 4194304
O_SYMLINK: number 2097152
UV_FS_COPYFILE_EXCL: number 1
UV_FS_COPYFILE_FICLONE: number 2
UV_FS_COPYFILE_FICLONE_FORCE: number 4
defaultCoreCipherList: string 416

Disposable probe: test-files/tmp_constants_missing_tail_probe.ts.

Perry output:

UV_DIRENT_FILE: undefined undefined
UV_DIRENT_DIR: undefined undefined
UV_DIRENT_LINK: undefined undefined
UV_FS_SYMLINK_DIR: undefined undefined
UV_FS_SYMLINK_JUNCTION: undefined undefined
S_IFMT: undefined undefined
S_IFREG: undefined undefined
S_IFDIR: undefined undefined
S_IFLNK: undefined undefined
O_DIRECTORY: undefined undefined
O_NOCTTY: undefined undefined
O_NONBLOCK: undefined undefined
O_SYNC: undefined undefined
O_DSYNC: undefined undefined
O_SYMLINK: undefined undefined
UV_FS_COPYFILE_EXCL: undefined undefined
UV_FS_COPYFILE_FICLONE: undefined undefined
UV_FS_COPYFILE_FICLONE_FORCE: undefined undefined
defaultCoreCipherList: undefined undefined

Note: SIGINFO is not listed in the manifest diff, but a dynamic read currently returns Node-compatible 29 on this host, so this issue intentionally does not include it in the missing-runtime set.

Existing test caveat

./run_parity_tests.sh --suite node-suite --module constants is not useful evidence today because its only case fails under Node in the harness and is bucketed as node_fail. This issue is therefore based on manifest comparison plus direct Node/Perry probes.

Expected

The representative constants above should be exposed from node:constants with Node-compatible values for the supported host target, and should be added to the manifest if Perry intends to claim them.

Actual

Runtime reads for the representative missing constants return undefined in Perry.

Suggested PR cut

Implement one constants metadata cut covering:

  • libuv dirent constants: UV_DIRENT_*
  • libuv symlink/copyfile constants: UV_FS_SYMLINK_*, UV_FS_COPYFILE_*
  • POSIX file type and permission aggregate masks: S_IF*, S_IRWX*
  • POSIX open flags missing on this host: O_DIRECTORY, O_NOCTTY, O_NONBLOCK, O_SYNC, O_DSYNC, O_SYMLINK
  • defaultCoreCipherList

Acceptance

  • Add deterministic parity coverage for representative numeric values and typeof defaultCoreCipherList === "string".
  • Runtime dynamic reads and named imports expose values rather than undefined.
  • Manifest/docs are updated for newly claimed constants.
  • Avoid asserting platform constants that Node does not expose on the current supported target.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions