Skip to content

test: add TypeScript FFI surface coverage#694

Merged
proggeramlug merged 8 commits into
PerryTS:mainfrom
TheHypnoo:feat/ts-ffi-surface-coverage
May 12, 2026
Merged

test: add TypeScript FFI surface coverage#694
proggeramlug merged 8 commits into
PerryTS:mainfrom
TheHypnoo:feat/ts-ffi-surface-coverage

Conversation

@TheHypnoo
Copy link
Copy Markdown
Contributor

@TheHypnoo TheHypnoo commented May 11, 2026

Summary

Adds explicit TypeScript FFI surface coverage accounting and splits the generated coverage inventory into domain-focused parity fixtures.

Changes

  • Reworks test-coverage/audit.sh to report TypeScript, Rust, and combined FFI coverage separately.
  • Adds a regenerable TypeScript FFI surface inventory split across runtime core, runtime UI/platform, stdlib core, stdlib IO/framework, and stdlib integrations.
  • Adds test_compat_core_surface.ts with deterministic behavioral parity checks for core JS runtime features.
  • Updates parity output normalization for Node's --experimental-strip-types warning.
  • Regenerates test-coverage/COVERAGE.md with 100% TypeScript FFI surface coverage under the audit metric.

Related issue

n/a

Follow-up issues

Test plan

  • ./test-coverage/regen_ts_surface_inventory.py
  • ./test-coverage/audit.sh --markdown
  • ./run_parity_tests.sh --filter test_ffi_surface
  • ./run_parity_tests.sh --filter test_compat_core_surface
  • git diff --check

Notes

This improves FFI surface coverage accounting. The inventory entries are not a replacement for deeper semantic compatibility tests; they are intended to provide a complete map that can be converted into behavioral parity fixtures over follow-up work.

Checklist

  • I have NOT bumped the workspace version or edited CLAUDE.md / CHANGELOG.md
  • My commit follows the loose conventional prefix style used in the log
  • I've read CONTRIBUTING.md and agree to the Code of Conduct

@proggeramlug proggeramlug merged commit 65d7548 into PerryTS:main May 12, 2026
9 checks passed
@TheHypnoo TheHypnoo deleted the feat/ts-ffi-surface-coverage branch May 12, 2026 17:41
proggeramlug pushed a commit that referenced this pull request May 14, 2026
Converts deterministic entries from `test_ffi_surface_stdlib_integrations.ts`
into focused behavioral parity fixtures, per the follow-up to #694.

- `test_parity_argon2.ts` + expected output: round-trip `argon2.hash` /
  `argon2.verify` (async path — the only one wired in the dispatch
  table) with random-salt shape assertions.
- `test_parity_ethers.ts` + expected output: deterministic helpers
  `getAddress`, `parseEther`/`formatEther`, `parseUnits`/`formatUnits`.
- Adds `@covers` block to `test_parity_crypto.ts` for the
  crypto/webcrypto/crypto_e2e FFI surface it already exercises (digest,
  hash, hmac-via-pbkdf2/hkdf, subtle.sign/verify).

Both new fixtures use the `test-parity/expected/` mechanism: Perry routes
the npm-style imports to its bundled `perry-ext-*` wrappers, but Node
can't load the same names without `node_modules`, so they fall through
to the stored expected-output comparison.

After `./test-coverage/regen_ts_surface_inventory.py`:
- stdlib integrations inventory: 156 → 138 unique FFI names.
- `./test-coverage/audit.sh --markdown` still reports 100% TS FFI coverage.
proggeramlug pushed a commit that referenced this pull request May 14, 2026
…#760)

Converts deterministic entries from `test_ffi_surface_stdlib_integrations.ts`
into focused behavioral parity fixtures, per the follow-up to #694.

- `test_parity_argon2.ts` + expected output: round-trip `argon2.hash` /
  `argon2.verify` (async path — the only one wired in the dispatch
  table) with random-salt shape assertions.
- `test_parity_ethers.ts` + expected output: deterministic helpers
  `getAddress`, `parseEther`/`formatEther`, `parseUnits`/`formatUnits`.
- Adds `@covers` block to `test_parity_crypto.ts` for the
  crypto/webcrypto/crypto_e2e FFI surface it already exercises (digest,
  hash, hmac-via-pbkdf2/hkdf, subtle.sign/verify).

Both new fixtures use the `test-parity/expected/` mechanism: Perry routes
the npm-style imports to its bundled `perry-ext-*` wrappers, but Node
can't load the same names without `node_modules`, so they fall through
to the stored expected-output comparison.

After `./test-coverage/regen_ts_surface_inventory.py`:
- stdlib integrations inventory: 156 → 138 unique FFI names.
- `./test-coverage/audit.sh --markdown` still reports 100% TS FFI coverage.
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.

2 participants