From 9336d7021c5ad28d0927631687bfc816638faca7 Mon Sep 17 00:00:00 2001 From: Sid Mohan <61345237+sidmohan0@users.noreply.github.com> Date: Tue, 25 Aug 2026 17:45:55 -0700 Subject: [PATCH 01/12] Pin Rust toolchain --- rust-toolchain.toml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 rust-toolchain.toml diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..dd94bb9 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,4 @@ +[toolchain] +channel = "1.85.0" +profile = "minimal" +components = ["rustfmt", "clippy"] From d8e0004c1222b7bcc5b98ad47a1a959cc0f76811 Mon Sep 17 00:00:00 2001 From: Sid Mohan <61345237+sidmohan0@users.noreply.github.com> Date: Tue, 25 Aug 2026 17:45:59 -0700 Subject: [PATCH 02/12] Add Rust formatting config --- rustfmt.toml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 rustfmt.toml diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 0000000..f3e454b --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1,2 @@ +edition = "2024" +style_edition = "2024" From 8d4eae392a007fe5b058cdd14e72aafd7d42d939 Mon Sep 17 00:00:00 2001 From: Sid Mohan <61345237+sidmohan0@users.noreply.github.com> Date: Tue, 25 Aug 2026 17:46:06 -0700 Subject: [PATCH 03/12] Add repository contribution rules --- AGENTS.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 AGENTS.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..b6b8e26 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,27 @@ +# DataFog Core repository rules + +## Correctness + +- Detection changes require positive and negative tests that prove the changed behavior. +- Do not silently discard fallible results. +- Avoid panic paths for user-controlled input. +- Preserve documented entity offset semantics across the Rust core and all bindings. + +## Structure + +- Add files only for distinct logical components. +- Do not introduce abstractions without a demonstrated need in the current codebase. +- Keep bindings thin: PII detection semantics belong in `crates/core`. +- Do not duplicate detector logic in Python, Node, or WASM bindings. +- Do not perform unrelated refactoring while implementing a scoped change. + +## Code + +- Comments document public behavior or explain non-obvious reasoning; do not narrate syntax. +- Prefer descriptive names over abbreviations. +- New third-party dependencies require a concrete need that cannot be met reasonably with the standard library or existing dependencies. + +## Changes + +- Keep each pull request focused on one behavior or maintenance goal. +- Run `cargo fmt --all --check`, `cargo clippy --workspace --all-targets --all-features -- -D warnings`, and `cargo test --workspace --all-features` before merging Rust changes. From 8901764392264f04abc3bcc2117f3e86c63e8c19 Mon Sep 17 00:00:00 2001 From: Sid Mohan <61345237+sidmohan0@users.noreply.github.com> Date: Tue, 25 Aug 2026 17:46:11 -0700 Subject: [PATCH 04/12] Add Rust quality CI --- .github/workflows/rust-quality.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/rust-quality.yml diff --git a/.github/workflows/rust-quality.yml b/.github/workflows/rust-quality.yml new file mode 100644 index 0000000..1c8fe2d --- /dev/null +++ b/.github/workflows/rust-quality.yml @@ -0,0 +1,18 @@ +name: Rust quality + +on: + push: + pull_request: + +jobs: + quality: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.85.0 + components: rustfmt, clippy + - run: cargo fmt --all --check + - run: cargo clippy --workspace --all-targets --all-features -- -D warnings + - run: cargo test --workspace --all-features From cb1b796f025d198b412febad3c436b1a9fb34e85 Mon Sep 17 00:00:00 2001 From: Sid Mohan <61345237+sidmohan0@users.noreply.github.com> Date: Tue, 25 Aug 2026 17:46:19 -0700 Subject: [PATCH 05/12] Add pull request template --- .github/pull_request_template.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/pull_request_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..3b519fa --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,15 @@ +## Objective + +Describe the single problem or maintenance goal this PR addresses. + +## Changes + +Describe the smallest set of changes made to achieve the objective. + +## Verification + +- [ ] `cargo fmt --all --check` +- [ ] `cargo clippy --workspace --all-targets --all-features -- -D warnings` +- [ ] `cargo test --workspace --all-features` +- [ ] New or changed detection behavior includes positive and negative tests +- [ ] I reviewed the diff for unrelated refactoring or duplicated binding logic From ecab8d0d22f3c9250e63089b1077b687b59fcd19 Mon Sep 17 00:00:00 2001 From: Sid Mohan <61345237+sidmohan0@users.noreply.github.com> Date: Tue, 25 Aug 2026 17:47:48 -0700 Subject: [PATCH 06/12] Use workspace-compatible Rust toolchain --- rust-toolchain.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index dd94bb9..fdda5b9 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "1.85.0" +channel = "1.88.0" profile = "minimal" components = ["rustfmt", "clippy"] From 854b917deba0f32f8ff8deab13f0d657c2f00965 Mon Sep 17 00:00:00 2001 From: Sid Mohan <61345237+sidmohan0@users.noreply.github.com> Date: Tue, 25 Aug 2026 17:50:13 -0700 Subject: [PATCH 07/12] Require Rust 1.88 for core crate --- crates/core/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/core/Cargo.toml b/crates/core/Cargo.toml index 5e25a07..4120926 100644 --- a/crates/core/Cargo.toml +++ b/crates/core/Cargo.toml @@ -2,7 +2,7 @@ name = "datafog-core" version = "0.1.0" edition = "2024" -rust-version = "1.85" +rust-version = "1.88" description = "Fast structured PII detection library" license = "MIT" homepage = "https://datafog.ai" From f3cd4c3e13de6724bff32aa9fe17470dc802b604 Mon Sep 17 00:00:00 2001 From: Sid Mohan <61345237+sidmohan0@users.noreply.github.com> Date: Tue, 25 Aug 2026 17:50:17 -0700 Subject: [PATCH 08/12] Require Rust 1.88 for Node binding --- bindings/node/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/bindings/node/Cargo.toml b/bindings/node/Cargo.toml index b908648..77a8171 100644 --- a/bindings/node/Cargo.toml +++ b/bindings/node/Cargo.toml @@ -2,6 +2,7 @@ name = "datafog-node" version = "0.1.0" edition = "2024" +rust-version = "1.88" description = "Node.js bindings for datafog-core" license = "MIT" repository = "https://github.com/DataFog/datafog-core" From 3bfda570c35012d2dec2fa87470135779cf8b4ff Mon Sep 17 00:00:00 2001 From: Sid Mohan <61345237+sidmohan0@users.noreply.github.com> Date: Tue, 25 Aug 2026 17:50:22 -0700 Subject: [PATCH 09/12] Require Rust 1.88 for Python binding --- bindings/python/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/bindings/python/Cargo.toml b/bindings/python/Cargo.toml index f5459a8..db7fa63 100644 --- a/bindings/python/Cargo.toml +++ b/bindings/python/Cargo.toml @@ -2,6 +2,7 @@ name = "datafog-core-python" version = "0.1.0" edition = "2024" +rust-version = "1.88" description = "Python bindings for datafog-core" license = "MIT" repository = "https://github.com/DataFog/datafog-core" From 3de39a58be54d41dc22e067dbb56ced7849f5ac6 Mon Sep 17 00:00:00 2001 From: Sid Mohan <61345237+sidmohan0@users.noreply.github.com> Date: Tue, 25 Aug 2026 17:50:26 -0700 Subject: [PATCH 10/12] Require Rust 1.88 for WASM binding --- bindings/wasm/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/bindings/wasm/Cargo.toml b/bindings/wasm/Cargo.toml index 416c99e..d591e4a 100644 --- a/bindings/wasm/Cargo.toml +++ b/bindings/wasm/Cargo.toml @@ -2,6 +2,7 @@ name = "datafog-wasm" version = "0.1.0" edition = "2024" +rust-version = "1.88" description = "WebAssembly bindings for datafog-core" license = "MIT" repository = "https://github.com/DataFog/datafog-core" From a25dde1a386b6ce72b0467db1e23c7e263746894 Mon Sep 17 00:00:00 2001 From: Sid Mohan <61345237+sidmohan0@users.noreply.github.com> Date: Tue, 25 Aug 2026 17:50:31 -0700 Subject: [PATCH 11/12] Run Rust quality checks on 1.88 --- .github/workflows/rust-quality.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust-quality.yml b/.github/workflows/rust-quality.yml index 1c8fe2d..ef6c6a4 100644 --- a/.github/workflows/rust-quality.yml +++ b/.github/workflows/rust-quality.yml @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable with: - toolchain: 1.85.0 + toolchain: 1.88.0 components: rustfmt, clippy - run: cargo fmt --all --check - run: cargo clippy --workspace --all-targets --all-features -- -D warnings From f1bc8a040f1234442b9148282e0b450eb798341f Mon Sep 17 00:00:00 2001 From: Sid Mohan <61345237+sidmohan0@users.noreply.github.com> Date: Tue, 25 Aug 2026 17:53:43 -0700 Subject: [PATCH 12/12] Align WASM CI with Rust 1.88 --- .github/workflows/wasm-binding.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/wasm-binding.yml b/.github/workflows/wasm-binding.yml index 78d4b8f..0a6d7bc 100644 --- a/.github/workflows/wasm-binding.yml +++ b/.github/workflows/wasm-binding.yml @@ -27,6 +27,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable with: + toolchain: 1.88.0 targets: wasm32-unknown-unknown - uses: actions/setup-node@v4 with: