Files
rea/scripts/verify-evm-interface.mjs
T
dependabot[bot]andVincent Koc 029ad60f4f chore(deps): update 37 npm pins and preserve capture and release behavior (#14231)
* chore(deps): bump the npm-minor-and-patch group across 2 directories with 38 updates

Bumps the npm-minor-and-patch group with 37 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [@babel/parser](https://github.com/babel/babel/tree/HEAD/packages/babel-parser) | `8.0.4` | `8.1.2` |
| [@babel/types](https://github.com/babel/babel/tree/HEAD/packages/babel-types) | `8.0.4` | `8.1.2` |
| [@bufbuild/protobuf](https://github.com/bufbuild/protobuf-es/tree/HEAD/packages/protobuf) | `2.16.0` | `2.17.0` |
| [@clack/prompts](https://github.com/bombshell-dev/clack/tree/HEAD/packages/prompts) | `1.7.0` | `1.9.0` |
| [@zip.js/zip.js](https://github.com/gildas-lormeau/zip.js) | `2.15.0` | `2.25.0` |
| [evmole](https://github.com/cdump/evmole/tree/HEAD/javascript) | `0.9.3` | `0.9.4` |
| [ignore](https://github.com/kaelzhang/node-ignore) | `7.0.6` | `7.0.14` |
| [isomorphic-git](https://github.com/isomorphic-git/isomorphic-git) | `1.38.7` | `1.44.15` |
| [lossless-json](https://github.com/josdejong/lossless-json) | `4.3.1` | `4.3.3` |
| [parse5](https://github.com/inikulin/parse5) | `8.0.1` | `8.1.1` |
| [playwright-core](https://github.com/microsoft/playwright) | `1.64.1` | `1.65.1` |
| [plist](https://github.com/TooTallNate/plist.js) | `5.0.0` | `5.1.1` |
| [semver](https://github.com/npm/node-semver) | `7.8.5` | `7.8.6` |
| [@types/semver](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/semver) | `7.7.1` | `7.8.0` |
| [smol-toml](https://github.com/squirrelchat/smol-toml) | `1.9.0` | `1.9.1` |
| [stream-chain](https://github.com/uhop/stream-chain) | `4.2.6` | `4.4.2` |
| [stream-json](https://github.com/uhop/stream-json) | `3.7.0` | `3.9.0` |
| [ws](https://github.com/websockets/ws) | `8.21.0` | `8.23.0` |
| [@types/ws](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ws) | `8.18.1` | `8.18.2` |
| [yaml](https://github.com/eemeli/yaml) | `2.9.0` | `2.9.1` |
| [zod](https://github.com/colinhacks/zod) | `4.6.6` | `4.6.7` |
| [@electron/asar](https://github.com/electron/asar) | `4.2.0` | `4.3.2` |
| [@stryker-mutator/core](https://github.com/stryker-mutator/stryker-js/tree/HEAD/packages/core) | `10.0.0` | `10.1.1` |
| [@stryker-mutator/typescript-checker](https://github.com/stryker-mutator/stryker-js/tree/HEAD/packages/typescript-checker) | `10.0.0` | `10.1.1` |
| [@stryker-mutator/vitest-runner](https://github.com/stryker-mutator/stryker-js/tree/HEAD/packages/vitest-runner) | `10.0.0` | `10.1.1` |
| [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) | `26.6.4` | `26.6.6` |
| [@types/semver](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/semver) | `7.7.1` | `7.8.0` |
| [@types/ws](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ws) | `8.18.1` | `8.18.2` |
| [@vitest/coverage-v8](https://github.com/vitest-dev/vitest/tree/HEAD/packages/coverage-v8) | `5.0.3` | `5.1.0` |
| [jscpd](https://github.com/kucherenko/jscpd/tree/HEAD/rust/jscpd) | `5.0.12` | `5.4.3` |
| [knip](https://github.com/webpro-nl/knip/tree/HEAD/packages/knip) | `6.39.0` | `6.45.1` |
| [oxfmt](https://github.com/oxc-project/oxc/tree/HEAD/npm/oxfmt) | `0.72.0` | `0.79.0` |
| [oxlint](https://github.com/oxc-project/oxc/tree/HEAD/npm/oxlint) | `1.87.0` | `1.94.0` |
| [oxlint-tsgolint](https://github.com/oxc-project/tsgolint) | `7.0.2005` | `7.0.2007` |
| [release-please](https://github.com/googleapis/release-please) | `17.3.0` | `17.11.2` |
| [rolldown](https://github.com/rolldown/rolldown/tree/HEAD/packages/rolldown) | `1.2.12` | `1.3.2` |
| [turbo](https://github.com/vercel/turborepo) | `2.11.7` | `2.11.11` |
| [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) | `5.0.3` | `5.1.0` |
| [frida](https://github.com/frida/frida-node) | `17.23.2` | `17.26.4` |

Bumps the npm-minor-and-patch group with 1 update in the /scripts/verify-tools/skills directory: [skills](https://github.com/vercel-labs/skills).


Updates `@babel/parser` from 8.0.4 to 8.1.2
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v8.1.2/packages/babel-parser)

Updates `@babel/types` from 8.0.4 to 8.1.2
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v8.1.2/packages/babel-types)

Updates `@bufbuild/protobuf` from 2.16.0 to 2.17.0
- [Release notes](https://github.com/bufbuild/protobuf-es/releases)
- [Commits](https://github.com/bufbuild/protobuf-es/commits/v2.17.0/packages/protobuf)

Updates `@clack/prompts` from 1.7.0 to 1.9.0
- [Release notes](https://github.com/bombshell-dev/clack/releases)
- [Changelog](https://github.com/bombshell-dev/clack/blob/main/packages/prompts/CHANGELOG.md)
- [Commits](https://github.com/bombshell-dev/clack/commits/@clack/prompts@1.9.0/packages/prompts)

Updates `@zip.js/zip.js` from 2.15.0 to 2.25.0
- [Release notes](https://github.com/gildas-lormeau/zip.js/releases)
- [Commits](https://github.com/gildas-lormeau/zip.js/compare/v2.15.0...v2.25.0)

Updates `evmole` from 0.9.3 to 0.9.4
- [Release notes](https://github.com/cdump/evmole/releases)
- [Commits](https://github.com/cdump/evmole/commits/0.9.4/javascript)

Updates `ignore` from 7.0.6 to 7.0.14
- [Release notes](https://github.com/kaelzhang/node-ignore/releases)
- [Commits](https://github.com/kaelzhang/node-ignore/compare/7.0.6...7.0.14)

Updates `isomorphic-git` from 1.38.7 to 1.44.15
- [Release notes](https://github.com/isomorphic-git/isomorphic-git/releases)
- [Commits](https://github.com/isomorphic-git/isomorphic-git/compare/v1.38.7...v1.44.15)

Updates `lossless-json` from 4.3.1 to 4.3.3
- [Changelog](https://github.com/josdejong/lossless-json/blob/main/CHANGELOG.md)
- [Commits](https://github.com/josdejong/lossless-json/compare/v4.3.1...v4.3.3)

Updates `parse5` from 8.0.1 to 8.1.1
- [Release notes](https://github.com/inikulin/parse5/releases)
- [Commits](https://github.com/inikulin/parse5/compare/v8.0.1...v8.1.1)

Updates `playwright-core` from 1.64.1 to 1.65.1
- [Release notes](https://github.com/microsoft/playwright/releases)
- [Commits](https://github.com/microsoft/playwright/compare/v1.64.1...v1.65.1)

Updates `plist` from 5.0.0 to 5.1.1
- [Release notes](https://github.com/TooTallNate/plist.js/releases)
- [Changelog](https://github.com/TooTallNate/plist.js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TooTallNate/plist.js/compare/plist@5.0.0...plist@5.1.1)

Updates `semver` from 7.8.5 to 7.8.6
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v7.8.5...v7.8.6)

Updates `@types/semver` from 7.7.1 to 7.8.0
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/semver)

Updates `smol-toml` from 1.9.0 to 1.9.1
- [Release notes](https://github.com/squirrelchat/smol-toml/releases)
- [Commits](https://github.com/squirrelchat/smol-toml/compare/v1.9.0...v1.9.1)

Updates `stream-chain` from 4.2.6 to 4.4.2
- [Commits](https://github.com/uhop/stream-chain/compare/4.2.6...4.4.2)

Updates `stream-json` from 3.7.0 to 3.9.0
- [Commits](https://github.com/uhop/stream-json/compare/3.7.0...3.9.0)

Updates `ws` from 8.21.0 to 8.23.0
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/8.21.0...8.23.0)

Updates `@types/ws` from 8.18.1 to 8.18.2
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ws)

Updates `yaml` from 2.9.0 to 2.9.1
- [Release notes](https://github.com/eemeli/yaml/releases)
- [Commits](https://github.com/eemeli/yaml/compare/v2.9.0...v2.9.1)

Updates `zod` from 4.6.6 to 4.6.7
- [Release notes](https://github.com/colinhacks/zod/releases)
- [Commits](https://github.com/colinhacks/zod/compare/v4.6.6...v4.6.7)

Updates `@electron/asar` from 4.2.0 to 4.3.2
- [Release notes](https://github.com/electron/asar/releases)
- [Changelog](https://github.com/electron/asar/blob/main/CHANGELOG.md)
- [Commits](https://github.com/electron/asar/compare/v4.2.0...v4.3.2)

Updates `@stryker-mutator/core` from 10.0.0 to 10.1.1
- [Release notes](https://github.com/stryker-mutator/stryker-js/releases)
- [Changelog](https://github.com/stryker-mutator/stryker-js/blob/master/packages/core/CHANGELOG.md)
- [Commits](https://github.com/stryker-mutator/stryker-js/commits/v10.1.1/packages/core)

Updates `@stryker-mutator/typescript-checker` from 10.0.0 to 10.1.1
- [Release notes](https://github.com/stryker-mutator/stryker-js/releases)
- [Changelog](https://github.com/stryker-mutator/stryker-js/blob/master/packages/typescript-checker/CHANGELOG.md)
- [Commits](https://github.com/stryker-mutator/stryker-js/commits/v10.1.1/packages/typescript-checker)

Updates `@stryker-mutator/vitest-runner` from 10.0.0 to 10.1.1
- [Release notes](https://github.com/stryker-mutator/stryker-js/releases)
- [Changelog](https://github.com/stryker-mutator/stryker-js/blob/master/packages/vitest-runner/CHANGELOG.md)
- [Commits](https://github.com/stryker-mutator/stryker-js/commits/v10.1.1/packages/vitest-runner)

Updates `@types/node` from 26.6.4 to 26.6.6
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Updates `@types/semver` from 7.7.1 to 7.8.0
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/semver)

Updates `@types/ws` from 8.18.1 to 8.18.2
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ws)

Updates `@vitest/coverage-v8` from 5.0.3 to 5.1.0
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Changelog](https://github.com/vitest-dev/vitest/blob/main/docs/releases.md)
- [Commits](https://github.com/vitest-dev/vitest/commits/v5.1.0/packages/coverage-v8)

Updates `jscpd` from 5.0.12 to 5.4.3
- [Release notes](https://github.com/kucherenko/jscpd/releases)
- [Commits](https://github.com/kucherenko/jscpd/commits/v5.4.3/rust/jscpd)

Updates `knip` from 6.39.0 to 6.45.1
- [Release notes](https://github.com/webpro-nl/knip/releases)
- [Commits](https://github.com/webpro-nl/knip/commits/knip@6.45.1/packages/knip)

Updates `oxfmt` from 0.72.0 to 0.79.0
- [Release notes](https://github.com/oxc-project/oxc/releases)
- [Changelog](https://github.com/oxc-project/oxc/blob/main/npm/oxfmt/CHANGELOG.md)
- [Commits](https://github.com/oxc-project/oxc/commits/oxfmt_v0.79.0/npm/oxfmt)

Updates `oxlint` from 1.87.0 to 1.94.0
- [Release notes](https://github.com/oxc-project/oxc/releases)
- [Changelog](https://github.com/oxc-project/oxc/blob/main/npm/oxlint/CHANGELOG.md)
- [Commits](https://github.com/oxc-project/oxc/commits/oxlint_v1.94.0/npm/oxlint)

Updates `oxlint-tsgolint` from 7.0.2005 to 7.0.2007
- [Release notes](https://github.com/oxc-project/tsgolint/releases)
- [Commits](https://github.com/oxc-project/tsgolint/compare/v7.0.2005...v7.0.2007)

Updates `release-please` from 17.3.0 to 17.11.2
- [Release notes](https://github.com/googleapis/release-please/releases)
- [Changelog](https://github.com/googleapis/release-please/blob/main/CHANGELOG.md)
- [Commits](https://github.com/googleapis/release-please/compare/v17.3.0...v17.11.2)

Updates `rolldown` from 1.2.12 to 1.3.2
- [Release notes](https://github.com/rolldown/rolldown/releases)
- [Changelog](https://github.com/rolldown/rolldown/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rolldown/rolldown/commits/v1.3.2/packages/rolldown)

Updates `turbo` from 2.11.7 to 2.11.11
- [Release notes](https://github.com/vercel/turborepo/releases)
- [Changelog](https://github.com/vercel/turborepo/blob/main/RELEASE.md)
- [Commits](https://github.com/vercel/turborepo/compare/v2.11.7...v2.11.11)

Updates `vitest` from 5.0.3 to 5.1.0
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Changelog](https://github.com/vitest-dev/vitest/blob/main/docs/releases.md)
- [Commits](https://github.com/vitest-dev/vitest/commits/v5.1.0/packages/vitest)

Updates `frida` from 17.23.2 to 17.26.4
- [Commits](https://github.com/frida/frida-node/compare/17.23.2...17.26.4)

Updates `skills` from 1.7.2 to 1.9.0
- [Release notes](https://github.com/vercel-labs/skills/releases)
- [Commits](https://github.com/vercel-labs/skills/compare/v1.7.2...v1.9.0)

---
updated-dependencies:
- dependency-name: "@babel/parser"
  dependency-version: 8.1.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: npm-minor-and-patch
- dependency-name: "@babel/types"
  dependency-version: 8.1.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: npm-minor-and-patch
- dependency-name: "@bufbuild/protobuf"
  dependency-version: 2.17.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: npm-minor-and-patch
- dependency-name: "@clack/prompts"
  dependency-version: 1.9.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: npm-minor-and-patch
- dependency-name: "@electron/asar"
  dependency-version: 4.3.2
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor-and-patch
- dependency-name: "@stryker-mutator/core"
  dependency-version: 10.1.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor-and-patch
- dependency-name: "@stryker-mutator/typescript-checker"
  dependency-version: 10.1.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor-and-patch
- dependency-name: "@stryker-mutator/vitest-runner"
  dependency-version: 10.1.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor-and-patch
- dependency-name: "@types/node"
  dependency-version: 26.6.6
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor-and-patch
- dependency-name: "@types/semver"
  dependency-version: 7.8.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor-and-patch
- dependency-name: "@types/semver"
  dependency-version: 7.8.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor-and-patch
- dependency-name: "@types/ws"
  dependency-version: 8.18.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor-and-patch
- dependency-name: "@types/ws"
  dependency-version: 8.18.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor-and-patch
- dependency-name: "@vitest/coverage-v8"
  dependency-version: 5.1.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor-and-patch
- dependency-name: "@zip.js/zip.js"
  dependency-version: 2.25.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: npm-minor-and-patch
- dependency-name: evmole
  dependency-version: 0.9.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-minor-and-patch
- dependency-name: frida
  dependency-version: 17.26.4
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: npm-minor-and-patch
- dependency-name: ignore
  dependency-version: 7.0.14
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-minor-and-patch
- dependency-name: isomorphic-git
  dependency-version: 1.44.15
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: npm-minor-and-patch
- dependency-name: jscpd
  dependency-version: 5.4.3
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor-and-patch
- dependency-name: knip
  dependency-version: 6.45.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor-and-patch
- dependency-name: lossless-json
  dependency-version: 4.3.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-minor-and-patch
- dependency-name: oxfmt
  dependency-version: 0.79.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor-and-patch
- dependency-name: oxlint
  dependency-version: 1.94.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor-and-patch
- dependency-name: oxlint-tsgolint
  dependency-version: 7.0.2007
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor-and-patch
- dependency-name: parse5
  dependency-version: 8.1.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: npm-minor-and-patch
- dependency-name: playwright-core
  dependency-version: 1.65.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: npm-minor-and-patch
- dependency-name: plist
  dependency-version: 5.1.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: npm-minor-and-patch
- dependency-name: release-please
  dependency-version: 17.11.2
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor-and-patch
- dependency-name: rolldown
  dependency-version: 1.3.2
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor-and-patch
- dependency-name: semver
  dependency-version: 7.8.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-minor-and-patch
- dependency-name: skills
  dependency-version: 1.9.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: npm-minor-and-patch
- dependency-name: smol-toml
  dependency-version: 1.9.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-minor-and-patch
- dependency-name: stream-chain
  dependency-version: 4.4.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: npm-minor-and-patch
- dependency-name: stream-json
  dependency-version: 3.9.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: npm-minor-and-patch
- dependency-name: turbo
  dependency-version: 2.11.11
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-minor-and-patch
- dependency-name: vitest
  dependency-version: 5.1.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor-and-patch
- dependency-name: ws
  dependency-version: 8.23.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: npm-minor-and-patch
- dependency-name: yaml
  dependency-version: 2.9.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-minor-and-patch
- dependency-name: zod
  dependency-version: 4.6.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-minor-and-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix(deps): adapt release tooling and capture metadata to the new npm pins

* fix(deps): preserve numeric, plist and archive evidence semantics

* test(zip): verify malformed compression with CRC checks enabled

* fix(capture): preserve exact decimal projections and redaction

* test(apple): verify keyed archive controls before altering the trailer

* test(lint): cover safe and suggested regex escape fixes

* fix(reference): preserve directory exclusion provenance with ignore 7

* docs(examples): refresh HAR evidence identities for the current decoder

* fix(reference): preserve metadata failures with strict Git ref reads

* chore(config): remove the unused MCP profile type alias

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-11-24 21:26:48 +08:00

612 lines
20 KiB
JavaScript

#!/usr/bin/env node
import assert from "node:assert/strict";
import { execFile } from "node:child_process";
import { createHash } from "node:crypto";
import { access, readFile, readdir, writeFile } from "node:fs/promises";
import { constants } from "node:fs";
import { isAbsolute, join } from "node:path";
import { fileURLToPath, pathToFileURL } from "node:url";
import { promisify } from "node:util";
import { Client } from "@modelcontextprotocol/client";
import { StdioClientTransport } from "@modelcontextprotocol/client/stdio";
import { parseEvidence } from "../dist/domain/evidence.js";
import { isOwnershipPsExecution } from "./lib/ownership-ps-trace.mjs";
import {
requireMcpOutput,
requireMcpToolError,
} from "./lib/mcp-verifier-results.mjs";
import { createVerifierRun, completeVerifierRun } from "./lib/verifier-run.mjs";
import { VerifierFixture } from "./lib/verifier-fixture.mjs";
const solcModule = process.env.REA_VERIFY_SOLC_MODULE;
const strace = process.env.REA_VERIFY_STRACE_COMMAND;
if (
process.platform !== "linux" ||
process.arch !== "x64" ||
!isAbsolute(solcModule ?? "") ||
!isAbsolute(strace ?? "")
)
throw new Error(
"verify:evm:interface requires Linux x64, caller-supplied util-linux prlimit and absolute REA_VERIFY_SOLC_MODULE pointing to unchanged solc 0.8.30 and absolute REA_VERIFY_STRACE_COMMAND. No target or chain is executed.",
);
try {
await access(
process.env.REA_EVM_PRLIMIT_COMMAND ?? "/usr/bin/prlimit",
constants.X_OK,
);
await access(solcModule, constants.R_OK);
await access(strace, constants.X_OK);
} catch (cause) {
throw new Error(
"verify:evm:interface prerequisite unavailable: selected solc module, strace or util-linux prlimit",
{ cause },
);
}
const solc = (await import(pathToFileURL(solcModule).href)).default;
assert.equal(solc.version(), "0.8.30+commit.73712a01.Emscripten.clang");
const source = await readFile(
new URL("./fixtures/evm-interface.sol", import.meta.url),
"utf8",
);
const entrypoint =
process.argv[2] ?? fileURLToPath(new URL("./rea.mjs", import.meta.url));
const execute = promisify(execFile);
const environment = Object.fromEntries(
Object.entries(process.env).filter(([, value]) => typeof value === "string"),
);
const run = createVerifierRun();
const root = await VerifierFixture.open({ prefix: "rea-evm-verifier-" });
const client = new Client({ name: "evm-interface-verifier", version: "1" });
const transport = new StdioClientTransport({
command: process.execPath,
args: [entrypoint, "mcp"],
env: environment,
stderr: "pipe",
});
const failures = [];
let cases = 0;
try {
await client.connect(transport);
const tools = await client.listTools();
assert.ok(tools.tools.some(({ name }) => name === "inspect_evm_interface"));
const inspect = async (
mode,
path,
encoding,
expectedCategory,
scope = { command: process.execPath, prefix: [], client },
) => {
let value;
if (mode === "cli") {
let stdout;
try {
({ stdout } = await execute(
scope.command,
[
...scope.prefix,
entrypoint,
"inspect-evm-interface",
path,
encoding,
"--json",
],
{
env: scope.environment ?? environment,
timeout: 45_000,
maxBuffer: 32 * 1024 * 1024,
},
));
} catch (cause) {
if (typeof cause.code !== "number" || typeof cause.stdout !== "string")
throw cause;
stdout = cause.stdout;
}
value = JSON.parse(stdout);
} else {
const reply = await scope.client.callTool({
name: "inspect_evm_interface",
arguments: { path, encoding },
});
value =
expectedCategory !== undefined
? requireMcpToolError(reply)
: requireMcpOutput(reply, "inspect_evm_interface");
}
if (expectedCategory !== undefined) {
assert.equal(value.category, expectedCategory, JSON.stringify(value));
return value;
}
assert.equal(
value.category,
undefined,
`Unexpected public failure: ${JSON.stringify(value)}`,
);
const evidence = parseEvidence(value);
const report = evidence.normalized_result;
assert.equal(report.diagnostics.truncated, false);
assert.equal(evidence.provider.version, "evmole@0.9.4");
assert.equal(evidence.confidence, "inferred");
assert.equal(report.artifact.path, path);
assert.equal(report.artifact.encoding, encoding);
const carrier = await readFile(path);
assert.equal(
report.artifact.sha256,
createHash("sha256").update(carrier).digest("hex"),
);
assert.equal(evidence.subject.identity.sha256, report.artifact.sha256);
assert.equal(report.artifact.bytes, carrier.length);
assert.equal(
report.bytecode.sha256,
createHash("sha256")
.update(Buffer.from(report.bytecode.hex, "hex"))
.digest("hex"),
);
assert.equal(report.bytecode.bytes, report.bytecode.hex.length / 2);
for (const key of ["kind", "hardfork", "deployment_authenticity"])
assert.equal(report.bytecode[key], "unknown");
assert.equal(report.discovery_completeness, "unknown");
assert.equal(report.runtime_execution, "not-performed");
assert.deepEqual(
report.functions.map((fn) => ({
selector: fn.selector.slice(2),
bytecodeOffset: fn.bytecode_offset,
dispatch: fn.dispatch,
...(fn.inferred_arguments === null
? {}
: { arguments: fn.inferred_arguments }),
...(fn.inferred_state_mutability === null
? {}
: { stateMutability: fn.inferred_state_mutability }),
})),
evidence.raw_result.functions ?? [],
);
if (mode === "mcp") assert.deepEqual(value.normalized_result, report);
return report;
};
// Ownership inventory runs ps from fixed system locations, so a caller PATH
// without ps neither hides nor replaces it and inspection still completes.
const ownershipProbe = join(root.path, "ownership-prerequisite.hex");
await writeFile(ownershipProbe, "0x00");
const pathWithoutPs = await inspect("cli", ownershipProbe, "hex", undefined, {
command: process.execPath,
prefix: [],
client,
environment: { ...environment, PATH: root.path },
});
assert.equal(pathWithoutPs.bytecode.hex, "00");
cases++;
for (const [name, optimizer, viaIR] of [
["plain", false, false],
["optimized", true, false],
["via-ir", true, true],
]) {
const output = JSON.parse(
solc.compile(
JSON.stringify({
language: "Solidity",
sources: { "Interface.sol": { content: source } },
settings: {
optimizer: { enabled: optimizer, runs: 200 },
viaIR,
evmVersion: "cancun",
outputSelection: {
"*": {
"*": [
"evm.deployedBytecode.object",
"evm.methodIdentifiers",
"abi",
],
},
},
},
}),
),
);
assert.ok(
!output.errors?.some(({ severity }) => severity === "error"),
JSON.stringify(output.errors),
);
const artifact = output.contracts["Interface.sol"].InterfaceFixture;
const hex = artifact.evm.deployedBytecode.object;
const expected = Object.values(artifact.evm.methodIdentifiers)
.map((selector) => "0x" + selector)
.sort();
const forms = [
["hex", ` \t0x${hex.toUpperCase()}\r\n`],
["raw", Buffer.from(hex, "hex")],
];
for (const [encoding, data] of forms) {
const path = join(root.path, `${name}.${encoding}`);
await writeFile(path, data);
const original = await readFile(path);
for (const mode of ["cli", "mcp"]) {
const report = await inspect(mode, path, encoding);
assert.equal(report.bytecode.hex, hex);
assert.equal(report.bytecode.metadata.status, "decoded");
assert.deepEqual(report.bytecode.metadata.compiler_version, {
representation: "release-bytes",
value: "0.8.30",
});
assert.equal(
report.bytecode.metadata.bytecode_offset +
report.bytecode.metadata.cbor_bytes +
2,
Buffer.from(hex, "hex").length,
);
assert.ok(
report.bytecode.metadata.entries.some(
({ key, value }) =>
key.kind === "text" &&
key.value === "solc" &&
value.kind === "bytes" &&
value.value === "00081e",
),
);
assert.deepEqual(
report.functions
.filter(({ dispatch }) => dispatch === "abi")
.map(({ selector }) => selector)
.sort(),
expected,
);
assert.ok(
report.functions.every(
({ bytecode_offset }) => bytecode_offset < report.bytecode.bytes,
),
);
const set = report.functions.find(
({ selector }) =>
selector === "0x" + artifact.evm.methodIdentifiers["set(uint256)"],
);
assert.equal(set.inferred_arguments, "uint256");
assert.equal(set.inferred_state_mutability, "nonpayable");
cases++;
}
assert.deepEqual(await readFile(path), original);
}
}
for (const [name, data, encoding] of [
["empty", "0x", "hex"],
["empty-raw", Buffer.alloc(0), "raw"],
["incomplete-push", Buffer.from([0x7f]), "raw"],
["no-dispatch", "60006000f3", "hex"],
]) {
const path = join(root.path, name);
await writeFile(path, data);
for (const mode of ["cli", "mcp"]) {
const report = await inspect(mode, path, encoding);
assert.equal(report.functions.length, 0);
cases++;
}
}
for (const [name, hex, expected] of [
["zero-selector", "60003560e01c630000000014601057005b00", ["0x00000000"]],
["push-immediate", "63123456785060006000f3", []],
]) {
const path = join(root.path, name);
await writeFile(path, hex);
for (const mode of ["cli", "mcp"]) {
const report = await inspect(mode, path, "hex");
assert.deepEqual(
report.functions.map(({ selector }) => selector),
expected,
);
cases++;
}
}
for (const [encoding, data] of [
["raw", Buffer.from("ef0001", "hex")],
["hex", "0xef0001"],
]) {
const path = join(root.path, "eof." + encoding);
await writeFile(path, data);
for (const mode of ["cli", "mcp"]) {
const failure = await inspect(mode, path, encoding, "unsupported_target");
assert.equal(failure.code, "unsupported_target");
assert.equal(failure.details.path, path);
assert.match(failure.details.reason, /EF00/);
assert.match(failure.remediation.action, /target format/);
cases++;
}
}
for (const [name, data] of [
["odd", "0x1"],
["invalid-hex", "xyz"],
["interior-space", "60 00"],
["bom", "\uFEFF6000"],
["utf8", Buffer.from([0xff])],
]) {
const path = join(root.path, name);
await writeFile(path, data);
for (const mode of ["cli", "mcp"]) {
await inspect(mode, path, "hex", "invalid_input");
cases++;
}
}
for (const mode of ["cli", "mcp"]) {
await inspect(mode, join(root.path, "absent"), "raw", "invalid_input");
cases++;
}
for (const [option, expected] of [
["--as=2147483648", "address_space_bytes=2147483648"],
["--cpu=20", "cpu_seconds=20"],
["--fsize=8388608", "file_size_bytes=8388608"],
]) {
const limiter = environment.REA_EVM_PRLIMIT_COMMAND ?? "/usr/bin/prlimit";
const prefix = [
option,
"--",
process.execPath,
"--disable-wasm-trap-handler",
];
const limitedClient = new Client({
name: "limited-evm-verifier",
version: "1",
});
const limitedTransport = new StdioClientTransport({
command: limiter,
args: [...prefix, entrypoint, "mcp"],
env: environment,
stderr: "pipe",
});
try {
await limitedClient.connect(limitedTransport);
const scope = { command: limiter, prefix, client: limitedClient };
for (const mode of ["cli", "mcp"]) {
const report = await inspect(
mode,
join(root.path, "zero-selector"),
"hex",
undefined,
scope,
);
assert.ok(report.limitations.some((item) => item.includes(expected)));
cases++;
}
} finally {
// A close that fails keeps the root until release confirms it.
await root.closeEarly([
() => limitedClient.close(),
() => limitedTransport.close(),
]);
}
}
const brokenLimiter = join(root.path, "broken-limiter");
await writeFile(brokenLimiter, "#!/rea-verifier-missing-interpreter\n", {
mode: 0o700,
});
const signalLimiter = join(root.path, "signal-limiter");
await writeFile(signalLimiter, '#!/bin/sh\nulimit -c 0\nkill -XCPU "$$"\n', {
mode: 0o700,
});
const fileLimiter = join(root.path, "file-size-limiter");
const unmarkedLimiter = join(root.path, "unmarked-file-size-limiter");
await writeFile(
unmarkedLimiter,
'#!/bin/sh\nprintf "launcher exit 76\\n" >&2\nexit 76\n',
{ mode: 0o700 },
);
// Fixture-only launcher: run the actual Node/WASM worker with a one-byte
// file allowance, keeping the usual address-space, CPU and core budgets.
await writeFile(
fileLimiter,
'#!/bin/sh\nwhile [ "$#" -gt 0 ] && [ "$1" != "--" ]; do shift; done\n[ "$#" -gt 0 ] || exit 64\nshift\nexec /usr/bin/prlimit --as=3221225472: --cpu=30: --fsize=1: --core=0: -- "$@"\n',
{ mode: 0o700 },
);
for (const [limiter, category, resource] of [
[root.path, "unsupported_provider"],
[brokenLimiter, "unsupported_provider"],
[signalLimiter, "resource_constraint", "cpu"],
[fileLimiter, "resource_constraint", "file-size"],
[unmarkedLimiter, "execution_failure"],
]) {
const selectedEnvironment = {
...environment,
REA_EVM_PRLIMIT_COMMAND: limiter,
};
const selectedClient = new Client({
name: "unavailable-evm-limiter-verifier",
version: "1",
});
const selectedTransport = new StdioClientTransport({
command: process.execPath,
args: [entrypoint, "mcp"],
env: selectedEnvironment,
stderr: "pipe",
});
try {
await selectedClient.connect(selectedTransport);
const scope = {
command: process.execPath,
prefix: [],
client: selectedClient,
environment: selectedEnvironment,
};
for (const mode of ["cli", "mcp"]) {
const error = await inspect(
mode,
join(root.path, "zero-selector"),
"hex",
category,
scope,
);
if (category === "resource_constraint") {
assert.equal(error.code, "resource_constraint");
assert.equal(error.details.resource, resource);
assert.equal(
error.details.reported_limits.effective_soft_limits,
null,
);
assert.equal(
typeof error.details.reported_limits.configured_soft_limits
.cpu_seconds,
"number",
);
assert.ok(
JSON.stringify(error).includes(
resource === "cpu" ? "SIGXCPU" : "EFBIG",
),
);
} else if (category === "execution_failure") {
assert.equal(error.code, "execution_failure");
assert.ok(JSON.stringify(error).includes("launcher exit 76"));
assert.ok(JSON.stringify(error).includes("file_size_failure_marker"));
} else {
assert.equal(error.code, "capability_unavailable");
assert.ok(JSON.stringify(error).includes(limiter));
}
cases++;
}
} finally {
// A close that fails keeps the root until release confirms it.
await root.closeEarly([
() => selectedClient.close(),
() => selectedTransport.close(),
]);
}
}
for (const [name, encoding] of [
["plain.hex", "hex"],
["via-ir.raw", "raw"],
]) {
await execute(
strace,
[
"-ff",
"-e",
"trace=network,execve,execveat",
"-s",
"4096",
"-o",
join(root.path, `offline.trace.${name}`),
process.execPath,
entrypoint,
"inspect-evm-interface",
join(root.path, name),
encoding,
"--json",
],
{
env: { ...environment, PATH: "/usr/bin:/bin" },
timeout: 45_000,
maxBuffer: 32 * 1024 * 1024,
},
);
}
const observedExecutables = new Set();
for (const file of await readdir(root.path)) {
if (!file.startsWith("offline.trace.")) continue;
const localSocketDescriptors = new Set();
for (const line of (await readFile(join(root.path, file), "utf8")).split(
"\n",
)) {
if (/execve(?:at)?\(/.test(line)) {
const match = /^execve\("([^"]+)"/.exec(line);
assert.notEqual(match, null, `Unresolved executable identity: ${line}`);
assert.ok(
line.endsWith(" = 0") || / = -1 [A-Z]+/.test(line),
`Incomplete exec observation: ${line}`,
);
const ownershipInspection = isOwnershipPsExecution(line);
assert.ok(
[
process.execPath,
environment.REA_EVM_PRLIMIT_COMMAND ?? "/usr/bin/prlimit",
].includes(match[1]) || ownershipInspection,
`Unexpected host execution: ${line}`,
);
observedExecutables.add(match[1]);
} else if (/^[a-z]+\(/.test(line)) {
assert.ok(
permitsStdioSocketObservation(line, localSocketDescriptors),
`Unexpected attempted network operation: ${line}`,
);
}
}
}
assert.ok(observedExecutables.has(process.execPath));
assert.ok(
observedExecutables.has(
environment.REA_EVM_PRLIMIT_COMMAND ?? "/usr/bin/prlimit",
),
);
cases += 2;
} catch (cause) {
failures.push(cause);
} finally {
// The root is removed only after the client and transport confirm.
root.releaseAfter(() => client.close());
root.releaseAfter(() => transport.close());
try {
await root.release();
} catch (cause) {
failures.push(cause);
}
}
const verifier = await completeVerifierRun(run);
if (
verifier.process_lineage.status !== "verified" ||
verifier.process_lineage.descendants.length !== 0
)
failures.push(
new Error(
"Verifier process lineage was not fully released: " +
JSON.stringify(verifier),
),
);
console.log(
JSON.stringify(
{
status: failures.length === 0 ? "passed" : "failed",
public_cases: cases,
compiler: solc.version(),
engine: "evmole@0.9.4",
...(failures.length === 0
? {
target_execution: "exec-syscalls-verified-absent",
network_requests: "socket-syscalls-verified-absent",
}
: {}),
verifier,
},
null,
2,
),
);
if (failures.length !== 0)
throw Object.assign(
new AggregateError(
failures,
"Offline EVM interface verification failed; cleanup failures retained.",
),
// The caller can retry the retained root from the final failure.
root.released ? {} : { cleanupLeases: [root] },
);
function permitsStdioSocketObservation(line, localDescriptors) {
if (line.startsWith("socketpair(AF_UNIX,")) {
const pair = /\[(\d+), (\d+)\]\)\s+= 0$/.exec(line);
if (pair !== null) {
localDescriptors.add(pair[1]);
localDescriptors.add(pair[2]);
}
return true;
}
const name = /^getsockname\((\d+), \{sa_family=AF_UNIX\}/.exec(line);
if (name !== null) {
localDescriptors.add(name[1]);
return true;
}
// A failed descriptor query performs no request and identifies no socket.
if (line.startsWith("getsockname(") && / = -1 ENOTSOCK/.test(line))
return true;
const metadata =
/^(?:getsockopt\((\d+), SOL_SOCKET, SO_TYPE,|setsockopt\((\d+), SOL_SOCKET, SO_(?:RCVBUF|SNDBUF),|shutdown\((\d+), SHUT_WR\))/.exec(
line,
);
const descriptor = metadata?.[1] ?? metadata?.[2] ?? metadata?.[3];
// Allow descriptor queries/buffer configuration only after observing a local
// stdio socket. Other socket creation, connection and data operations fail.
return descriptor !== undefined && localDescriptors.has(descriptor);
}