> ## Documentation Index
> Fetch the complete documentation index at: https://docs.datafog.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Development

> Build DataFog Core and run the Rust and installed-package verification suites.

## Clone the repository

```bash theme={null}
git clone https://github.com/DataFog/datafog-core.git
cd datafog-core
```

## Rust quality gates

```bash theme={null}
cargo fmt --all --check
cargo clippy --workspace --all-targets --all-features -- -D warnings
cargo test --workspace --all-features
```

## Node.js installed-package test

```bash theme={null}
npm ci --prefix bindings/node
npm run test:package --prefix bindings/node
```

## Browser/WASM installed-package test

```bash theme={null}
rustup target add wasm32-unknown-unknown
cargo install wasm-bindgen-cli --version 0.2.127 --locked
npm ci --prefix bindings/wasm
npx --prefix bindings/wasm playwright install chromium
npm run test:package --prefix bindings/wasm
```

## Python installed-package test

```bash theme={null}
python -m venv .venv
.venv/bin/python -m pip install maturin
.venv/bin/maturin build --manifest-path bindings/python/Cargo.toml --release
.venv/bin/python -m pip install --force-reinstall target/wheels/*.whl
.venv/bin/python bindings/python/tests/test_installed.py
```

## Documentation preview

The Mintlify content root is `docs/`.

```bash theme={null}
npm install --global mint
cd docs
mint validate
mint broken-links --check-anchors
mint dev --no-open
```

`mint dev --no-open` starts a local preview without opening a browser.

## Repository structure

```text theme={null}
crates/core/        Rust scanning and transformation engine
bindings/python/    Python extension
bindings/node/      Node.js native binding
bindings/wasm/      Browser WebAssembly binding
fixtures/           Shared conformance fixtures
docs/               Architecture records and Mintlify documentation
```

## Publish a release from GitHub Actions

Keep the four Cargo package versions, Python project version, both npm
package versions, and their lockfiles aligned. The publishing workflows run
`python3 scripts/check-release.py <runtime>` and reject inconsistent versions
or a release tag that does not match the package version.

Run the quality gates and installed-package tests above on the release commit.
Merge the release preparation PR, then create these tags on that same commit
for version 0.3.0:

| Tag             | Workflow             | Destination                                 |
| --------------- | -------------------- | ------------------------------------------- |
| `rust-v0.3.0`   | `publish-rust.yml`   | crates.io                                   |
| `python-v0.3.0` | `publish-python.yml` | PyPI                                        |
| `node-v0.3.0`   | `publish-node.yml`   | npm: Node and five native platform packages |
| `wasm-v0.3.0`   | `publish-wasm.yml`   | npm: browser WASM                           |

Each tag push starts its publishing workflow. Check all four runs and install
the published versions before announcing the combined release. Registry
publication is not atomic across packages; inspect any partial result before
retrying. Never move a tag that has already published a package.

The npm workflows also accept a manual `dry_run` input, which defaults to
`true`. A dry run builds and verifies package contents without publishing.
For an actual manual publish, select the intended release tag and set
`dry_run` to `false`.

### npm trusted publisher setup

Configure [npm trusted publishing](https://docs.npmjs.com/trusted-publishers/)
once in each package's npm settings. Use GitHub organization **DataFog**,
repository **datafog-core**, environment **npm**, and allow direct
`npm publish`:

| Packages                                                                                                                                                                  | Workflow filename  |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ |
| `@datafog/node`, `@datafog/node-darwin-arm64`, `@datafog/node-darwin-x64`, `@datafog/node-linux-x64-gnu`, `@datafog/node-linux-arm64-gnu`, `@datafog/node-win32-x64-msvc` | `publish-node.yml` |
| `@datafog/wasm`                                                                                                                                                           | `publish-wasm.yml` |

The publish jobs request GitHub's OIDC identity with `id-token: write` and use
npm 11.17.0 on Node 24. They do not use `NPM_TOKEN` or a local machine's npm
session. npm generates provenance for these public packages automatically.

The Node workflow builds all five native binaries, transfers the generated
JavaScript loader and types to the publish job, and runs the installed-package
suite against the assembled package and its Linux native dependency before
publishing. The WASM workflow runs the browser package suite before publishing.
