---
url: https://edgefit.kitdev.space/contributing/data.md
description: >-
  edgefit compatibility data: where it lives, how override files and runtime
  probes work, and how to bump a data source.
---

# Compatibility data

The quality of edgefit's results is the quality of its data. This page explains where the data lives, how to change it, and how it is kept honest.

## Where it lives

Everything is in `data`:

| Path                            | What it is                                                                             |
| ------------------------------- | -------------------------------------------------------------------------------------- |
| `source.json`                   | Every data source with its URL, version, commit and license                            |
| `workers-nodejs-compat-matrix/` | The vendored matrix: a Node baseline and one dump per runtime                          |
| `runtime-compat-data/`          | The vendored Web API data, as published                                                |
| `dom-globals.json`              | The DOM globals, and the names of them that each runtime has                           |
| `overrides/<target>.json`       | Curated corrections per target                                                         |
| `suggestions.json`              | Reviewed fixes for packages and APIs, see [Suggested fixes](/contributing/suggestions) |
| `allowlists/<target>.json`      | For a runtime with no dump: what its documentation allows                              |

`edgefit targets` prints what `source.json` says, so users can see exactly which data produced their results.

## Override files

The matrix only records whether an API exists. Override files record what happens when it is called:

```json
{
  "modules": {
    "child_process": {
      "status": "unsupported",
      "note": "every child_process function throws ERR_METHOD_NOT_IMPLEMENTED; Workers cannot spawn processes",
      "source": "child_process.ts",
      "except": []
    }
  },
  "present": {
    "v8": {
      "note": "loads with nodejs_compat; the matrix does not list the module, so its members are not measured",
      "source": "v8.ts"
    }
  },
  "apis": {
    "fs.watch": {
      "status": "unsupported",
      "note": "file watching is not implemented; throws ERR_UNSUPPORTED_OPERATION",
      "source": "internal/internal_fs_callback.ts"
    }
  }
}
```

* `modules` covers a whole module, minus the members in `except`.

* `apis` covers one member.

* `present` records a module that the matrix does not list but that loads on the target. An import of the module gives no finding, so its `note` is for maintainers only. Its members are not measured, so a use of one is `unknown`, unless an `apis` entry covers it. The probe looks each module up and reports one that no longer loads.

* `status` is `unsupported`, `mocked`, `mismatch` or `supported`.

* `note` is the detail line users see. Say what happens, in plain words.

* `source` is a path relative to the source URL in `source.json`, pinned to the runtime version. It becomes the `see` link in reports.

* `missingHarmless` (optional, with `supported`) marks an API that is missing on the runtime while the code that uses it works without it, such as `fs.F_OK` on Deno. The runtime probe then does not report the missing API as a stale entry. Say in the `note` why it is harmless.

* `options` (optional, with `mismatch`) lists the options that make a call fail. With `options`, only a call that passes one of them is a finding. An item is one of these:

  * A key, such as `"ALPNProtocols"`. It matches when the value is always defined: a literal other than `undefined`, an array, an object, a function, a class, a template, a `new` object, a known value, or a `?:`, `||` or `??` that always gives one of these.
  * An object with a `key` and a `value`, such as `{ "key": "rejectUnauthorized", "value": false }`. The value is a boolean, a number or a string. edgefit matches only this literal value. When the runtime throws for each truthy value, as workerd does for `enableTrace`, list `true`, and know that other truthy values such as `1` are not found.
  * An object with a `key` and a `gate`, for an option that fails only while a workerd compatibility flag is on: `{ "key": "checkServerIdentity", "gate": { "flag": "throw_on_not_implemented_tls_options", "disableFlag": "no_throw_on_not_implemented_tls_options", "date": "2026-06-16" } }`. The option then fails from `date` with `nodejs_compat`, or with `flag`, and not with `disableFlag`. Without `disableFlag`, the disable flag is `flag` with `enable_` replaced by `disable_`. Other targets do not read the gate.

  edgefit stops with an error when `options` is not a list, when the list is empty, when an item has a wrong type, or when the status is not `mismatch`.

* `validatesFirst` (optional) marks a stub that checks its arguments before it throws, as workerd's `vm.compileFunction` does. The runtime probe then does not take an argument error for a working implementation.

### Adding or changing an entry

1. Find the code in the runtime's source at the pinned version, not at `main`.
2. Add the entry with a `note` that describes the behavior and a `source` that points to that file.
3. Add or update a test in `test` that shows the finding.
4. In the pull request, link the lines you read.

Entries without a source are not accepted. The whole point of an override is that anyone can check it.

## Runtimes without a dump

Vercel Edge has no matrix dump, so `allowlists/vercel-edge.json` lists what its documentation allows and a provider (`src/data/providers/allowlist.ts`) builds a dump from the Node baseline with everything else removed. The file has one list per kind of evidence:

* `modules` maps each allowed module to the members that exist on it (or to `true` for all of them). The documentation says which modules; the members come from `members.sources`, two pieces of the vendor's own code that list them.
* `globals` are the names in the documentation's tables, and `Buffer`.
* `languageGlobals` are the ECMAScript builtins of a fresh V8 context, and `emulatorGlobals` are web globals the vendor's emulator has and the tables omit.
* `witnessGlobals` are globals the [production witness](#production-witness) measured in every entry of the platform, and the tables omit.
* `docs.moduleDescriptions` are hashes of the documentation's description of each module, so the weekly check notices a changed sentence. `emulator` pins the emulator release.

A list that falls behind the platform reports an API as missing that exists, never the reverse, so a mistake here shows to users as a false error. Keep the `source.json` date in step with the page you read.

## DOM globals

`dom-globals.json` has two parts. `names` holds each global that `lib.dom.d.ts` of TypeScript declares as a `var`, `let`, `const`, `function` or `class`, and `lib.webworker.d.ts` does not, without `toString`, which every object has. `presentOn` holds, for each runtime, the names from `names` that the runtime also has. Build `presentOn` with `typeof globalThis[name]` on the version that `source.json` pins for the runtime. Build the `netlify` list from the production witness, see [Production witness](#production-witness). Name each version in the `note` of the source.

A name in `names` that a runtime does not list in `presentOn` is a missing global for that runtime. edgefit reports a read of it only when the read runs as the module loads. A name that `runtime-compat-data` also lists is decided by that data. For workerd, Bun and Deno, the weekly probe looks the missing names up, so a runtime that adds a DOM global shows in the drift issue. The Netlify and Vercel columns are not probed.

## Runtime probes

Reading source by hand is slow and misses things, so a workflow checks the overrides against the real runtimes. It lives in `.github/workflows/probe.yml` and runs weekly and on demand.

For each of Bun, Deno and workerd, it installs the runtime, imports each API inside it, calls functions with no arguments and constructs classes, and classifies what happens:

| Outcome                                                                                                       | Result         |
| ------------------------------------------------------------------------------------------------------------- | -------------- |
| Import or member lookup fails                                                                                 | `missing`      |
| Throws `ERR_NOT_IMPLEMENTED`, `ERR_METHOD_NOT_IMPLEMENTED`, `ERR_UNSUPPORTED_OPERATION`, or "not implemented" | `unsupported`  |
| Throws an argument error such as `ERR_INVALID_ARG_TYPE`                                                       | `implemented`  |
| Returns, or throws anything else                                                                              | `inconclusive` |

Dangerous APIs such as `process.exit`, `child_process.*` and `fs` writes are only looked up, never called.

The workflow runs twice per runtime:

* **pinned** probes the versions in `source.json` and lists every disagreement with the overrides, the matrix, the Web API data and the DOM globals data in the job summary.
* **latest** probes the newest release and lists what differs from the pinned data. For workerd it uses the newest compatibility date that release accepts, since newer dates turn features on.

Both channels also look up every API the runtime's data marks as missing (Web APIs like `crypto.subtle.getPublicKey` included, and each global counted once), without calling it. For workerd, Bun and Deno this includes each DOM global that the runtime lacks according to `dom-globals.json`, such as `DOMParser`, except the ones that the Web API data decides. They also look up each module that `present` records. A `missing` API that exists in the newest release is the clearest sign that the data is behind. The latest channel reports four kinds of drift:

* APIs the data marks missing that now exist
* curated stubs that now work, which means the probe got an argument error from real code (an inconclusive result is not counted)
* `mocked` entries the targeted check found implemented
* modules recorded as `present` that no longer load

Every Monday, and on a manual run with **open-issue** ticked, a last job collects the latest results and keeps one issue, labelled `data`, up to date with them. It opens the issue when there is drift, edits it on later weeks, and closes it when the data agrees with the newest releases again.

The [maintenance runbook](/contributing/maintenance) explains how to read the drift issue and what to do about each list.

Nothing is committed automatically. Probe results are evidence for reviewers. edgefit itself never reads them when checking a project, so results only ever come from the reviewed override files.

The probe code is in `scripts/probe`.

### Production witness

Netlify and Vercel publish no runtime to install, so a small function deployed on each platform reports what production has. The **Witness** workflow (`.github/workflows/witness.yml`) deploys it to a Netlify site as an edge function, and to a Vercel project as middleware and as an edge route. Run the workflow by hand when the witness code or its list of APIs changes. Only this workflow needs the platform tokens.

The witness only looks APIs up. It never calls them, because the endpoint is public. It reports:

* the Deno version (Netlify), and each place the runtime reports a version as evidence. Netlify hides `Deno.version.deno`, so the version can be missing.
* the names on the global object. On a Vercel edge route, `globalThis` hides most of its own names, so only the middleware names are compared.
* a lookup of each API in its list: every module and member in the Node baseline on Netlify, and the members of the allowed modules on Vercel
* on Vercel, `typeof` of each global the data keeps. The build writes this as static code, because on an edge route `globalThis` is a copy that lacks most globals, while a bare name resolves through the real scope, as in user code. It also measures a few candidate globals that the data does not keep (`vercelCandidates` in `scripts/probe/witness/spec.mjs`). A defined candidate is reported as a global to review. The middleware's own names include `require`, which is left out, because it cannot load a module.
* whether `eval`, `new Function`, `WebAssembly.compile` and `WebAssembly.instantiate` from bytes run
* on Vercel, whether the `require` global loads a module
* on Netlify, the `run`, `write` and `env` permissions, `Deno.execPath()`, whether a subprocess runs, and whether a file write runs in `/tmp`, in the working directory and in `/`

The weekly Probe run reads the witness with no secret, in the `witness` jobs, and compares the answer with the data in the job summary. Each answer has a hash of the list of APIs that the witness was built with. When the hash does not match the repository, the summary says to redeploy. The witness is not part of the drift issue. A witness that does not answer gives a warning, so you can remove the witness and the results do not change.

A data entry that rests on the witness needs a source that does not expire, and run logs and artifacts do. Commit the reviewed answer under `scripts/probe/witness/answers`, named for the platform and the date, and link it from the entry: the layer's `url` in `source.json` points at the answers folder at a pinned commit, and each entry's `source` is the file name. When a layer's `url` is another page, such as the platform's docs, an entry that rests on the witness gives the full link to the answer at a pinned commit as its `source`. An absolute `source` replaces the layer's `url`. The folder is outside `data`, so it does not ship in the package. An `unsupported` override with `"absent": true` says that the API does not exist on the target, as when the matrix lacks it, so a use that checks for the API first is not reported.

The code is in `scripts/probe/witness`.

## Bumping a data source

The matrix provider's repository may lag behind the runtimes. Check its newest commit first: if it has newer dumps, vendor those. If it does not, regenerate the runtime dumps with its own scripts, at the commit `source.json` names:

1. Run the **Dump data** workflow with the runtime versions you want. It checks out the provider at the commit in `source.json` and runs its dump scripts on Linux, which is how the provider makes them.
2. Download its `runtime-dumps` artifact. Do not dump on a laptop: macOS lacks Linux-only constants and a terminal changes `process.stdin`, so the dump would disagree with the probe. The maintenance runbook has the details, and how to dump by hand in a container.
3. Copy the three dumps to `data/workers-nodejs-compat-matrix`, keeping the file formatting.
4. In `source.json`, update `generatedAt`, the runtime versions, the workerd compatibility date, and the override sources' tags. Say in `note` how the data was generated.
5. Check that every override `source` still exists at the new tag. Files move: Bun's `src/bun.js` became `src/jsc`.
6. Probe the DOM globals again with `typeof globalThis[name]` on the new version, and update its column in `data/dom-globals.json`, see [DOM globals](#dom-globals). Then review every override against the new source, and run a `pinned` probe on the new versions (see below). It lists overrides that no longer match. A stub that now works is removed, and one that changed is corrected. A stub that validates its arguments before it throws gets `"validatesFirst": true`, so the probe does not read its argument error as a working implementation.
7. Run the tests and compare results on the fixture projects. Explain every change in the pull request.
