diff --git a/docs/concepts/privacy-transformations.mdx b/docs/concepts/privacy-transformations.mdx index 82536bba..a9bdbdf2 100644 --- a/docs/concepts/privacy-transformations.mdx +++ b/docs/concepts/privacy-transformations.mdx @@ -29,7 +29,7 @@ Redaction replaces each selected finding with an unnumbered entity placeholder. Masking replaces every non-revealed Unicode code point. The default character is `*`. A custom character must be exactly one non-whitespace, non-control -Unicode code point. +Unicode code point. Reveal counts leave at least one code point masked, even when the requested count reaches the length of the finding. ```json { diff --git a/docs/core/index.mdx b/docs/core/index.mdx index d90e4d20..5a7ab2a9 100644 --- a/docs/core/index.mdx +++ b/docs/core/index.mdx @@ -44,13 +44,16 @@ Text scans recognize these entities without a locale: - `IP_ADDRESS` - `DATE` - `ZIP_CODE` -- `BEARER_TOKEN` (0.4.1; [explicit Authorization headers](/reference/bearer-token)) +- [`ACCOUNT_NUMBER`](/reference/account-number) and [`STREET_ADDRESS`](/reference/street-address) in supported labeled contexts +- [`US_ROUTING_NUMBER`](/reference/us-routing-number) and [`NPI`](/reference/npi) with explicit context +- [`CREDENTIAL_URI`](/reference/credential-uri) for supported PostgreSQL URIs +- `BEARER_TOKEN` ([explicit Authorization headers](/reference/bearer-token)) - `JWT` ([recognition rules](/reference/jwt)) -- `API_KEY` (0.4.1; [supported providers](/reference/api-keys)) +- `API_KEY` ([supported providers](/reference/api-keys)) - `PRIVATE_KEY` (complete PEM blocks — [format and boundaries](/reference/private-keys)) Structured scans also discover `PERSON` in supported name fields. See -[structured person discovery](/guides/person-discovery) for field mappings. +[structured person discovery](/guides/person-discovery) for field mappings. For recipient names and mailing-address blocks in prose, use the [embedded CNN](/reference/embedded-cnn). To detect application-specific phrases, supply [literal deny rules](/reference/literal-denylists). **Credit cards and decimal numbers:** contiguous card candidates immediately @@ -111,10 +114,3 @@ explicit scan-then-transform convenience operation. Detect and redact an email address in a few lines. - -[US routing number detection](/reference/us-routing-number) adds `US_ROUTING_NUMBER` with explicit text context. -[National Provider Identifiers detection](/reference/npi) adds `NPI` with explicit text context. - -[datafog core 0.4.1](/releases/0-4-1) is published across all four runtimes and includes Rust/Python capability discovery and a [compatibility policy](/reference/compatibility). The higher-level Python adapter is integrated in [merged PR #179](https://github.com/DataFog/datafog-python/pull/179); its package release is separate. - -[Core 0.4.1](/releases/0-4-1) adds default `API_KEY`, `BEARER_TOKEN`, and `CREDENTIAL_URI` detection. The runtime registry reports 23 supported entities and 14 defaults. The local Python 4.9 adapter integration gate passed against the exact candidate wheel; the release notes record its evidence and limits. diff --git a/docs/development.mdx b/docs/development.mdx index 039a70cc..87895892 100644 --- a/docs/development.mdx +++ b/docs/development.mdx @@ -19,34 +19,19 @@ cargo clippy --workspace --all-targets --all-features -- -D warnings cargo test --workspace --all-features ``` -## Node.js installed-package test +## Cross-SDK verification -```bash -npm ci --prefix bindings/node -npm run test:package --prefix bindings/node -``` - -## Browser/WASM installed-package test +Use the repository verifier to check toolchain pins, build the bindings and exercise the installed packages. ```bash -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 +cargo dfv doctor +cargo dfv build +cargo dfv check +cargo dfv smoke +cargo dfv parity --live ``` -## Python installed-package test - -```bash -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 -.venv/bin/python -m pip install -r bindings/python/tests/requirements-typing.txt -.venv/bin/python bindings/python/tests/test_typing.py -``` +Run `cargo dfv check --models` for model changes. Each run writes a report under `target/dfv/runs/`. ## Documentation preview @@ -75,38 +60,7 @@ 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 ` and reject inconsistent versions -or a release tag that does not match the package version. - -For future releases, run the quality gates and installed-package tests above -on the release commit, complete the -[integration checklist](/releases/0-4-0#release-readiness-gate), and merge the -release preparation PR before creating runtime tags on that same commit. -Version 0.4.1 has already been published using the tags below; do not recreate -or move these tags. A source version bump alone does not publish packages: - -| Tag | Workflow | Destination | -| --- | --- | --- | -| `rust-v0.4.1` | `publish-rust.yml` | crates.io | -| `python-v0.4.1` | `publish-python.yml` | PyPI | -| `node-v0.4.1` | `publish-node.yml` | npm: Node and five native platform packages | -| `wasm-v0.4.1` | `publish-wasm.yml` | npm: browser WASM | - -Push runtime tags individually and confirm that each publishing workflow starts. -If a tag already exists without a run, dispatch its publishing workflow against -that existing tag; never move the tag to retrigger publication. For 0.4.1, the -workflows were dispatched after a batch tag push did not produce workflow events. -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`. +Qualify the release commit and publish the base SDKs and companion packages in dependency order. Push each runtime tag separately. If publication stops partway through, check the registry versions and completed workflow runs before retrying. The [publication runbook](https://github.com/DataFog/datafog-core/blob/main/docs/core-v1-publication.md) covers qualification, tag handling, companion workflows and installed-package checks. ### npm trusted publisher setup diff --git a/docs/docs.json b/docs/docs.json index ff0ad186..e54e3db0 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -101,6 +101,7 @@ "group": "Guides", "pages": [ "guides/migrating-from-datafog-python", + "guides/migrating-to-core-1-5", "guides/configuration", "guides/email-boundaries", "guides/pseudonymization", @@ -154,6 +155,8 @@ "releases/1-8-0", "releases/1-7-0", "releases/1-6-0", + "releases/1-5-0", + "releases/1-1-0", "releases/1-0-0", "releases/0-5-0-beta-3", "releases/0-5-0-beta-2", diff --git a/docs/get-started/installation.mdx b/docs/get-started/installation.mdx index 202f33c9..28dbfb35 100644 --- a/docs/get-started/installation.mdx +++ b/docs/get-started/installation.mdx @@ -4,14 +4,9 @@ description: "Install datafog core for Rust, Python, Node.js, or browser WebAsse icon: "download" --- -The expanded detectors are available in **0.4.0 or newer** across all four runtimes. Runtime capability discovery is available in Rust and Python. See the [0.4.0 release notes](/releases/0-4-0). - -The three credential detectors require [Core 0.4.1](/releases/0-4-1) or newer. - ## Package availability -The structured PERSON APIs require version **0.3.0 or newer** in every -binding. See the [0.3.0 release notes](/releases/0-3-0). +[Core 1.8.0](/releases/1-8-0) is available for all four runtimes. | Runtime | Distribution | Import | Availability | | --- | --- | --- | --- | diff --git a/docs/guides/configuration.mdx b/docs/guides/configuration.mdx index b3cc49cb..85c8e002 100644 --- a/docs/guides/configuration.mdx +++ b/docs/guides/configuration.mdx @@ -152,3 +152,7 @@ Use `{"detect_uuid":true}` in a text or structured scan configuration to enable not change it. The option accepts only booleans, including an explicit `false`. For scan-and-transform, place it under `scan` and use `transform.entities` to select UUID replacements. Selection alone never enables scanning. + +## Literal deny rules + +Supply `deny` in the scan configuration to protect application-specific phrases. A matching phrase takes precedence over allowlists and entity filters for that request. See [literal denylists](/reference/literal-denylists) for word boundaries and case sensitivity. diff --git a/docs/guides/migrating-from-datafog-python.mdx b/docs/guides/migrating-from-datafog-python.mdx index 7f2ee894..60540d52 100644 --- a/docs/guides/migrating-from-datafog-python.mdx +++ b/docs/guides/migrating-from-datafog-python.mdx @@ -1,21 +1,20 @@ --- title: "Migrate from datafog Python" -description: "Move from datafog 4.8.x to the canonical datafog core 0.3.x Python API." +description: "Move from datafog 4.8.x to the canonical datafog core 1.8.x Python API." icon: "arrow-right-arrow-left" --- - - This guide covers migration of the synchronous text detection and - transformation API from `datafog` 4.8.x to `datafog-core` 0.2.x. datafog - core is a new canonical API, not a drop-in replacement for the established - datafog Python package. - +This guide translates synchronous text detection and transformation calls from the +`datafog` 4.8.x API to `datafog-core` 1.8.x. The packages version independently. +The newer [`datafog` 4.12.0 release](https://github.com/DataFog/datafog-python/releases/tag/v4.12.0) +requires `datafog-core~=1.5.0`. Use separate environments to compare that adapter +with standalone Core 1.8. datafog core makes detection results, text ranges, transformation policy, and provider-backed operations consistent across Rust, Python, Node.js, and browser/WASM. That consistency requires a few deliberate API changes in Python. -datafog core 0.3 does not replace the legacy package's optional spaCy, GLiNER, +The standalone Core SDK does not replace the legacy package's optional spaCy, GLiNER, OCR, distributed-processing, CLI, or application-guardrail features. Keep the established package for those workloads while adopting Core where its smaller, cross-runtime contract fits. @@ -25,11 +24,11 @@ cross-runtime contract fits. ```bash datafog Python 4.8.x -python -m pip install datafog +python -m pip install 'datafog==4.8.*' ``` -```bash datafog core 0.3.x -python -m pip install datafog-core +```bash datafog core 1.8.x +python -m pip install 'datafog-core==1.8.*' ``` @@ -40,15 +39,14 @@ python -m pip install datafog-core from datafog.engine import Entity, redact, scan, scan_and_redact ``` -```python datafog core 0.3.x +```python datafog core 1.8.x from datafog_core import Finding, scan, scan_and_transform, transform ``` The distribution name uses a hyphen (`datafog-core`), while the Python import -uses an underscore (`datafog_core`). The two distributions can be installed at -the same time while an application is migrated incrementally. +uses an underscore (`datafog_core`). ## Update scan results @@ -70,7 +68,7 @@ for entity in result.entities: print(entity.type, entity.text, entity.start, entity.end) ``` -```python datafog core 0.3.x +```python datafog core 1.8.x from datafog_core import scan findings = scan("Email jane@example.com") @@ -90,7 +88,7 @@ Use `codepoint_range` when slicing a Python string. Use `byte_range` when addressing the UTF-8 encoded input. Both ranges are zero-based and end-exclusive. -| datafog Python 4.8.x | datafog core 0.3.x | +| datafog Python 4.8.x | datafog core 1.8.x | | --- | --- | | `ScanResult.entities` | The return value from `scan` | | `Entity.type` | `Finding.entity_type` | @@ -124,7 +122,7 @@ result = scan_and_redact( print(result.redacted_text) ``` -```python datafog core 0.3.x +```python datafog core 1.8.x from datafog_core import scan_and_transform result = scan_and_transform( @@ -142,7 +140,7 @@ print(result.text) -| datafog Python 4.8.x | datafog core 0.3.x | +| datafog Python 4.8.x | datafog core 1.8.x | | --- | --- | | `scan_and_redact(...)` | `scan_and_transform(text, {"scan": ..., "transform": ...})` | | `redact(text, entities, ...)` | `transform(text, findings, config)` | @@ -179,16 +177,13 @@ behavior and threat-model distinctions. ## Remove legacy engine selection Do not translate `engine="regex"`, `"smart"`, `"spacy"`, or `"gliner"` into -Core configuration. datafog core 0.3 owns detector composition and exposes -`locale` as its scan setting. Detector provenance appears on each finding. +Core configuration. The default scan uses rules. For model-backed prose detection, +see the [embedded CNN reference](/reference/embedded-cnn). -Entity names are exact and case-sensitive. The built-in Core entities are: - -`EMAIL`, `PHONE`, `SSN`, `CREDIT_CARD`, `IP_ADDRESS`, `DATE`, and `ZIP_CODE`. - -Use canonical names such as `DATE` and `ZIP_CODE` rather than legacy aliases -such as `DOB` or `ZIP`. Entity selection belongs in the transformation config, -not the scan config. +Use canonical labels such as `DATE` and `ZIP_CODE`. Query `capabilities()` for the +[rule inventory and activation settings](/reference/capabilities). Supply `scan.entities` +to limit detection in a combined call or `transform.entities` to select findings +for replacement. Detector activation settings such as `locale` still apply. ## Migration checklist @@ -229,14 +224,8 @@ All matching preserves source casing and separators. Allowlist entries must use that source representation. Required context stays in the output, except postal prefixes, which are part of the finding and are replaced too. -The Python adapter may translate explicit German entity requests into locale -`de` and then filter results, but must separately test legacy overlap and -selection semantics. Core adds no plural `locales`, engine switch or scan-time -entity selector. The capability-aware higher-level adapter and its -`datafog-core>=0.4.0,<0.5` dependency were merged in -[PR #179](https://github.com/DataFog/datafog-python/pull/179). The higher-level -Python package has its own release process; see the -[reviewed legacy NPI selection limitation](/releases/0-4-0#python-adapter-dependency-and-npi-selection). +For the original adapter’s overlap and selection behavior, see the +[legacy NPI selection limitation](/releases/0-4-0#python-adapter-dependency-and-npi-selection). ## Credential detector migration (0.4.1) diff --git a/docs/guides/tokenization-and-restoration.mdx b/docs/guides/tokenization-and-restoration.mdx index 205988ca..c85be9b1 100644 --- a/docs/guides/tokenization-and-restoration.mdx +++ b/docs/guides/tokenization-and-restoration.mdx @@ -115,5 +115,5 @@ Token envelopes use the canonical Base64URL components. Treat the envelope as opaque application data; do not parse or construct it yourself. -Browser/WASM rejects selected tokenization and every restoration call with -`unsupported_strategy`. +Browser/WASM rejects provider-backed tokenization and restoration with +`unsupported_strategy`. Use a [browser Workspace](/reference/browser-wasm) to restore its locally issued markers. diff --git a/docs/mcp/privacy-and-coverage.mdx b/docs/mcp/privacy-and-coverage.mdx index 47df111c..06a93cfe 100644 --- a/docs/mcp/privacy-and-coverage.mdx +++ b/docs/mcp/privacy-and-coverage.mdx @@ -7,7 +7,7 @@ icon: "shield-halved" ## Know what is checked Default checks cover email, SSN, credit cards, labeled US routing numbers and -NPIs, and supported credentials. Phone, date, ZIP code, and IP address checks +NPIs, and supported credentials. Phone, date, ZIP code, IP address, labeled account number and labeled street address checks are available but off by default. Plain-text names and unlabelled street addresses need a model or user review. The bounded labelled street-line rule uses `STREET_ADDRESS`; full model `ADDRESS` remains distinct. @@ -21,6 +21,8 @@ logs, ENV, and SQL. CSV/TSV headers are preserved and not scanned by default; use `has_header=false` when the first record must be checked. PDF, DOCX, XLSX, images, and archives are not parsed. A refused scan means the file was not checked. +ENV assignments and SQL quoted strings use format-specific [email boundaries](/guides/email-boundaries). In mixed-script text, review the span when an address touches surrounding letters. + ## Understand the privacy boundary The running server processes file contents locally and makes no network diff --git a/docs/mcp/quickstart.mdx b/docs/mcp/quickstart.mdx index 7156c4f8..6621e8bf 100644 --- a/docs/mcp/quickstart.mdx +++ b/docs/mcp/quickstart.mdx @@ -13,6 +13,8 @@ counts, locations, and copy paths, without file contents or matched values. You need **Python 3.10 or later**, [uv](https://docs.astral.sh/uv/getting-started/installation/), and Claude Code running on the machine that holds your files. +MCP 1.2.0 uses Core 1.8.x. On Intel macOS, install the Rust toolchain before installing MCP so the Core dependency can build from source. See [Core installation requirements](/get-started/installation). + ```bash diff --git a/docs/mcp/scanning-and-transformations.mdx b/docs/mcp/scanning-and-transformations.mdx index 060d8582..0027fb08 100644 --- a/docs/mcp/scanning-and-transformations.mdx +++ b/docs/mcp/scanning-and-transformations.mdx @@ -15,7 +15,8 @@ Put a CSV or text file inside an allowed folder. Ask Claude Code: Use an absolute path if the file is outside the agent's current directory. The scan returns counts by entity type and finding locations. CSV/TSV findings -include record and column numbers; text findings include character offsets. +include record and column numbers. Text findings include character offsets. +Scans with more than 700 findings return complete counts and omit individual locations. You can try the [fictional customer CSV](https://github.com/DataFog/datafog-mcp/blob/main/docs/demo/customers.csv) from the MCP repository. Save it inside an allowed folder first. diff --git a/docs/reference/account-number.mdx b/docs/reference/account-number.mdx index 2ce5395f..b8402dae 100644 --- a/docs/reference/account-number.mdx +++ b/docs/reference/account-number.mdx @@ -6,7 +6,7 @@ description: 'Bounded lexical account-number coverage with model compatibility.' `ACCOUNT_NUMBER` detects 6–17 contiguous ASCII digits immediately after `account number`, `account no.`, `acct number` or `acct no.` (ASCII case insensitive). The value span excludes the label. Supported spacing, delimiters, -boundaries and exclusions are defined in the [rule contract](../account-number-rule-contract.md). +boundaries and exclusions are defined in the [rule contract](https://github.com/DataFog/datafog-core/blob/main/docs/account-number-rule-contract.md). This is lexical coverage, not bank validation or universal account detection. ```python @@ -28,7 +28,7 @@ console.assert(result.text === "bank account number: [ACCOUNT_NUMBER]"); Rules run by default across locales. Bare numbers, generic `account:` labels, intervening prose, split numeric values and alphanumeric accounts are excluded. -The [masked-account contract](../masked-account-number-rule-contract.md) also +The [masked-account contract](https://github.com/DataFog/datafog-core/blob/main/docs/masked-account-number-rule-contract.md) also accepts account-labelled four-digit endings and bounded X/asterisk masks. For `account ending in 1234`, only `1234` is the value. For `account number: XXXX1234`, the whole `XXXX1234` token is the value. A visible diff --git a/docs/reference/browser-wasm.mdx b/docs/reference/browser-wasm.mdx index 44b34413..b420ec80 100644 --- a/docs/reference/browser-wasm.mdx +++ b/docs/reference/browser-wasm.mdx @@ -14,32 +14,13 @@ import { init, scan, scanAndTransform, transform } from "@datafog/wasm"; await init(); ``` -## 0.5.0-beta.1 developer integration - -The `0.5.0-beta.1` candidate adds a separate `Workspace` flow for persistent -pseudonyms and strict restoration, plus optional English GLiNER2.5 Small sessions -from `@datafog/wasm/models`. Model assets and host-owned encrypted storage require -explicit setup; synchronous `scan()` remains rule-based. Follow the -[0.5.0-beta.1 integration contract](https://github.com/DataFog/datafog-core/blob/main/docs/extension-integration-0.5.0-beta.1.md) -and [release checklist](https://github.com/DataFog/datafog-core/issues/132) for -availability, exact APIs and provisional development-vault compatibility. - -## 0.5.0-beta.2 workspace policy draft - -The beta.2 draft adds `workspace.policy()` and -`workspace.preparePolicyChanges({rules, choices}, operationId)`, with local -before/after review through `change.policyPreview()`. Protected types default to -hide and reject generic keep. An explicit exact-value `not_sensitive` correction -can deliberately allow actual PII; it uses the existing normalized type/value -identity and applies to preparation and recall. Source/needs-review flags grant -no exception. Reset/removal preserves previously issued aliases. - -Before saving a change where `change.snapshotFormat()` reports version 1 to 2, -explain that beta.1 cannot open the upgraded vault. Read/no-op/discard behavior -preserves old bytes; only an approved saved real change or recovery upgrades. -Use the same encrypted export, complete-head comparison and single activation -flow. The [policy contract](../proposals/workspace-policy-choices.md) defines -methods, bounds, errors, compatibility and the synthetic host/browser evidence. +## Persistent Workspace and model detection + +Use `Workspace` for persistent pseudonyms and strict local restoration. The browser host reviews a prepared change, saves its encrypted state and activates it before releasing the transformed text. FogVault and SQLite3 Multiple Ciphers both support this flow. + +The `BrowserWorkspace` coordinator enables the bundled name and address detector by default. Use `setCnnEnabled(false)` to disable it. The detector runs in a dedicated Worker. Synchronous `scan()` uses the rule engine. + +See the [browser Workspace integration example](https://github.com/DataFog/datafog-core/blob/main/docs/browser-workspace-v1-1.md) for setup and commit order, and the [embedded CNN reference](/reference/embedded-cnn) for model coverage and limits. ## Operations @@ -94,7 +75,7 @@ for aliases, policy configuration, input limits, and examples. German locale routing and the seven additional entity labels are documented in the [German entity reference](/reference/german-entities). -Core 0.4.0 shares its detector registry with Rust and Python. Runtime `capabilities()` discovery is exposed by Rust and Python only; this binding retains its existing scan APIs. See the [capability inventory](/reference/capabilities) and [compatibility policy](/reference/compatibility). +This SDK shares the Rust detector registry. See the [rule inventory](/reference/capabilities) for activation settings. ## Email source context diff --git a/docs/reference/capabilities.mdx b/docs/reference/capabilities.mdx index a74a9082..b41cc8d6 100644 --- a/docs/reference/capabilities.mdx +++ b/docs/reference/capabilities.mdx @@ -28,8 +28,7 @@ assert!(info.supported_entities.iter().any(|label| label == "UUID")); ``` Node.js and browser WASM share the core detector behavior but do not export a -capability-discovery API in 0.4.1. Their existing scan APIs remain -available. +capability-discovery API in Core 1.8. ## Response contract @@ -50,11 +49,9 @@ that entity. For example, UUID uses `{"detect_uuid":true}` and German entities use `{"locale":"de"}`. The `scopes` field distinguishes text scanning from structured scanning; inspect it before choosing a runtime operation. -## Version 0.4.1 inventory +## Core 1.8 rule inventory -This inventory describes Core 0.4.1. Core 0.4.0 exposes 20 supported entities and 11 default text detectors; its history is preserved in the [0.4.0 release notes](/releases/0-4-0). - -This table was generated from the Rust `capabilities()` response. It reports **23 supported entities** and **14 default text detectors**, with unchanged `contract_version: 1`. Query the installed runtime for its actual inventory. +The released SDK reports **25 supported entities**, including **16 default text detectors**. Request-local [literal deny rules](/reference/literal-denylists) and the [embedded model](/reference/embedded-cnn) provide additional coverage outside this registry. | Entity | Scopes | Activation | Scan settings | | --- | --- | --- | --- | @@ -94,7 +91,7 @@ This table was generated from the Rust `capabilities()` response. It reports **2 | `en-US` | None | | `fr` | None | -The three new default labels are [API_KEY](/reference/api-keys), [BEARER_TOKEN](/reference/bearer-token), and [CREDENTIAL_URI](/reference/credential-uri). Bearer recognition uses explicit header context in text and also the immediate `Authorization` field key in structured objects. Neither other field names nor transformation selection activate arbitrary token detection. +Credential detectors include [API_KEY](/reference/api-keys), [BEARER_TOKEN](/reference/bearer-token), and [CREDENTIAL_URI](/reference/credential-uri). Bearer recognition uses explicit header context in text and also the immediate `Authorization` field key in structured objects. Neither other field names nor transformation selection activate arbitrary token detection. ## Locale handling @@ -102,7 +99,7 @@ Locale comparison trims the supplied value and uses ASCII case-insensitive matching. The original configured string remains preserved. German aliases activate their locale-specific entities; `en-US` and `fr` retain base detection. Omitted locale runs base detection. Unsupported explicit locale strings raise -the existing configuration error in Core 0.4.0. +the existing configuration error. Selecting an entity for transformation does not activate its detector. Use the reported scan settings and keep transformation selection separate. Structured diff --git a/docs/reference/compatibility.mdx b/docs/reference/compatibility.mdx index b1a102ab..61aeb55b 100644 --- a/docs/reference/compatibility.mdx +++ b/docs/reference/compatibility.mdx @@ -1,37 +1,23 @@ --- title: "Compatibility policy" -description: "The public API and capability contract for the 0.4 release line." +description: "How Core versions its public APIs, finding ranges and privacy behavior across SDKs." --- -This policy applies to the **0.4.x** release line across Rust, Python, Node.js, -and browser WASM. Version 0.4.0 is published for all four runtimes. +Core follows semantic versioning across Rust, Python, Node.js and browser WASM. -## Stable within 0.4.x +| Release | What can change | +| --- | --- | +| Major | Incompatible changes to a published API, error code, range unit, transformation design or protocol version. | +| Minor | Detectors, supported platforms, optional engines and APIs. Fixes that change findings or spans ship in a minor release, as do corrective privacy fixes such as tightening mask reveal limits. | +| Patch | Fixes that preserve findings, spans and error codes for previously working inputs. | -Existing public function signatures, required finding fields, documented error -and exception interfaces, and offset semantics remain compatible throughout -0.4.x. Byte ranges use UTF-8 bytes, code-point ranges use Unicode code points, -and JavaScript UTF-16 ranges use UTF-16 code units. Every range is zero-based -and end-exclusive. Structured finding ranges remain local to the string leaf -identified by the JSON Pointer path. +When upgrading across minor versions, check the affected entities and rerun representative inputs. For example, [Core 1.8.0](/releases/1-8-0) changes EMAIL spans where addresses touch text in another script. -Breaking changes to a binding's existing public interface require **0.5.0**. -This includes removing or renaming required finding fields, changing existing -argument requirements, or changing the documented error or range contract. +## Range and support contracts -## Additions and detector changes +All ranges are zero-based and end-exclusive. Byte offsets count UTF-8 bytes, code-point offsets count Unicode code points, and JavaScript UTF-16 offsets count code units. A structured finding's offsets refer to the decoded string at its JSON Pointer path. -New entity labels, supported locales, API entry points, and optional metadata -fields are compatible additions. Consumers should tolerate unknown optional -metadata and use the Rust/Python capability API when choosing detectors. Do not infer -capabilities solely from a package version or maintain a private copy of the -supported-label inventory. - -Detection results are data-dependent. Detector fixes and improvements can change -which findings are returned, including correcting false positives or missed -matches. A compatible API does not guarantee identical findings for every input -across patch releases. Pin package versions and maintain representative fixtures -when exact detection output is part of an application's acceptance criteria. +The two latest minor releases of the current major receive fixes. Older minor releases receive security fixes only. Experimental surfaces can change in a minor release. See the [versioning policy](https://github.com/DataFog/datafog-core/blob/main/VERSIONING.md) for deprecation windows and experimental APIs. ## Capability contract version @@ -42,6 +28,4 @@ optional metadata field retain contract version 1. Changes to existing capabilit field meanings or incompatible structure require a contract-version increment. See the [capabilities reference](/reference/capabilities) for the generated -inventory and activation metadata. The [0.4.0 release notes](/releases/0-4-0) -identify the intentional locale-validation change introduced at the release -boundary. +inventory and activation metadata. diff --git a/docs/reference/errors.mdx b/docs/reference/errors.mdx index fc815061..e46ffc74 100644 --- a/docs/reference/errors.mdx +++ b/docs/reference/errors.mdx @@ -62,7 +62,7 @@ documented behavior; all supplied findings validate before filtering. - `unsupported_strategy` - `internal_error` -### Workspace operations in 0.5.0-beta.1 +### Workspace operations - `invalid_batch` - `closed_workspace` @@ -70,7 +70,10 @@ documented behavior; all supplied findings validate before filtering. - `workspace_conflict` - `invalid_marker` - `invalid_snapshot` -- `invalid_operation_id` +- `invalid_operation_id`, `invalid_operation`, `operation_reused` +- `invalid_policy` +- `invalid_conversation`, `conversation_unknown`, `conversation_pending`, `invalid_send_intent` +- `inactive_stream`, `invalid_encoding` - `resource_limit` `Workspace.restoreReport` returns marker issues with `text: null`; the strict @@ -78,7 +81,7 @@ documented behavior; all supplied findings validate before filtering. and resource errors can still throw from either call. Source preparation rejects invalid markers before approval and may carry `markerIssues` on the error. -### Optional browser model operations in 0.5.0-beta.1 +### Optional browser model operations - `model_load_failed` - `model_inference_failed` @@ -91,10 +94,7 @@ Some model pre-validation and initialization failures are native JavaScript exceptions. Catch those at the host boundary too; do not treat failures as an empty successful scan or an implicit rule-only fallback. -The [0.5.0-beta.1 integration contract](https://github.com/DataFog/datafog-core/blob/main/docs/extension-integration-0.5.0-beta.1.md#errors-and-retry) -lists every declared browser SDK code, retry/lifecycle handling and the separate -reference host's persistence/worker errors. Provider codes in the shared error -union do not enable key/token providers in browser WASM. +See the [browser SDK declarations](https://github.com/DataFog/datafog-core/blob/main/bindings/wasm/index.d.ts) for the complete `DataFogErrorCode` union. ## JavaScript example diff --git a/docs/reference/node.mdx b/docs/reference/node.mdx index ee41e7d2..d42506be 100644 --- a/docs/reference/node.mdx +++ b/docs/reference/node.mdx @@ -56,6 +56,8 @@ await manager.scanAndTransform(text, config, context?) await manager.restore(text, context) ``` +For recipient names and mailing addresses in prose, use [`EmbeddedCnnDetector`](/reference/embedded-cnn). + ## Native distribution targets The package build is configured for: @@ -89,7 +91,7 @@ for aliases, policy configuration, input limits, and examples. German locale routing and the seven additional entity labels are documented in the [German entity reference](/reference/german-entities). -Core 0.4.0 shares its detector registry with Rust and Python. Runtime `capabilities()` discovery is exposed by Rust and Python only; this binding retains its existing scan APIs. See the [capability inventory](/reference/capabilities) and [compatibility policy](/reference/compatibility). +This SDK shares the Rust detector registry. See the [rule inventory](/reference/capabilities) for activation settings. ## Email source context diff --git a/docs/reference/python.mdx b/docs/reference/python.mdx index ca513778..0fe4b9e6 100644 --- a/docs/reference/python.mdx +++ b/docs/reference/python.mdx @@ -104,11 +104,13 @@ async def restore_batch(scope: str, items: list[dict]) -> list[dict]: Exceptions expose stable `code`, optional `reason`, optional `path`, and optional `finding_index` attributes. See [Errors](/reference/errors). -## Testing hook +## Model detection and encrypted storage -`panic_probe()` forces a Rust panic through the detached-work path and raises -`DataFogInternalError` (code `internal_error`, message including the panic text). -Use it to check that your own error handling covers the Rust boundary. +Use [`EmbeddedCnnDetector`](/reference/embedded-cnn) for recipient names and mailing addresses in prose. The optional `datafog-fogvault` package provides `ApplicationVault` for an encrypted Workspace shared across application processes. See the [Python vault guide](https://github.com/DataFog/datafog-core/tree/main/integrations/fogvault-python). + +## Deprecated testing hook + +Since Core 1.5, `panic_probe()` emits a deprecation warning and raises `DataFogInternalError` without triggering a Rust panic. ## Structured JSON and PERSON fields @@ -128,7 +130,7 @@ the [German entity reference](/reference/german-entities). ## Capability discovery (0.4.0+) -Use `capabilities()` to inspect the runtime registry, including supported entities, default detectors, locale aliases, and activation settings. See the [capabilities contract and generated inventory](/reference/capabilities) and [0.4.x compatibility policy](/reference/compatibility). +Use `capabilities()` to inspect the runtime registry, including supported entities, default detectors, locale aliases, and activation settings. See the [capabilities contract and generated inventory](/reference/capabilities) and [compatibility policy](/reference/compatibility). ## Email source context diff --git a/docs/reference/rust.mdx b/docs/reference/rust.mdx index 2e75eb16..8d78a48d 100644 --- a/docs/reference/rust.mdx +++ b/docs/reference/rust.mdx @@ -117,7 +117,7 @@ the [German entity reference](/reference/german-entities). ## Capability discovery (0.4.0+) -Use `capabilities()` to inspect the runtime registry, including supported entities, default detectors, locale aliases, and activation settings. See the [capabilities contract and generated inventory](/reference/capabilities) and [0.4.x compatibility policy](/reference/compatibility). +Use `capabilities()` to inspect the runtime registry, including supported entities, default detectors, locale aliases, and activation settings. See the [capabilities contract and generated inventory](/reference/capabilities) and [compatibility policy](/reference/compatibility). ## Email source context diff --git a/docs/reference/street-address.mdx b/docs/reference/street-address.mdx index fcdaff59..730f9fa7 100644 --- a/docs/reference/street-address.mdx +++ b/docs/reference/street-address.mdx @@ -7,7 +7,7 @@ description: 'Bounded English street-line coverage with broader model coverage p immediately after `street address:`, `shipping address:` or `billing address:`. Labels and values stay on one line. The value includes a supported direction and single trailing unit, and excludes city, region, postcode and country. Exact -suffixes, bounds and exclusions are in the [approved contract](../street-address-rule-proposal.md). +suffixes, bounds and exclusions are in the [approved contract](https://github.com/DataFog/datafog-core/blob/main/docs/street-address-rule-proposal.md). This is lexical coverage, not universal postal-address validation. ```python diff --git a/docs/releases/1-0-0.mdx b/docs/releases/1-0-0.mdx index 95f8e4e4..e77d4816 100644 --- a/docs/releases/1-0-0.mdx +++ b/docs/releases/1-0-0.mdx @@ -7,7 +7,7 @@ icon: "tag" Core `1.0.0` aligns the Rust, Python, native Node and browser WASM SDK versions. The public Workspace API contract is version **1**; the snapshot writer remains version **3**, with supported readers for versions **1, 2 and 3**. These identifiers -are separate. The [reviewed compatibility contract](../contracts/core-v1.md) +are separate. The [reviewed compatibility contract](https://github.com/DataFog/datafog-core/blob/v1.0.0/docs/contracts/core-v1.md) records their guarantees and limits. ## What changes from beta.3 @@ -42,7 +42,7 @@ npm install --save-exact @datafog/node@1.0.0 npm install --save-exact @datafog/wasm@1.0.0 ``` -The optional [FogVault integration guide](../integrations/fogvault.md) describes +The optional [FogVault integration guide](https://github.com/DataFog/datafog-core/blob/v1.0.0/docs/integrations/fogvault.md) describes `datafog-fogvault-native`, `datafog-fogvault-migration`, `datafog-fogvault`, `@datafog/core-fogvault-node`, `@datafog/core-fogvault-browser` and `@datafog/core-fogvault-legacy-browser`, all version `1.0.0`. FogVault itself is @@ -76,5 +76,5 @@ This is an SDK release. Shipping-extension/provider acceptance, real key-provide integration, certification, CUDA/all-device OOM guarantees and global memory SLAs are not established by these checks. CSV remains deferred. Browser model accuracy measurements retain actual misses/false positives and do not become an extension -accuracy promise. See the [release scope](../core-v1-release-scope.md) and -[publication runbook](../core-v1-publication.md). +accuracy promise. See the [release scope](https://github.com/DataFog/datafog-core/blob/v1.0.0/docs/core-v1-release-scope.md) and +[publication runbook](https://github.com/DataFog/datafog-core/blob/v1.0.0/docs/core-v1-publication.md). diff --git a/docs/releases/1-1-0-rc-1.mdx b/docs/releases/1-1-0-rc-1.mdx index 2db222e8..a2162007 100644 --- a/docs/releases/1-1-0-rc-1.mdx +++ b/docs/releases/1-1-0-rc-1.mdx @@ -44,7 +44,7 @@ FogVault engines remain at 0.1.0. npm prereleases use `next`, preserving stable ## Extension acceptance -[Extension installation and testing instructions](1-1-0-rc-1-extension-testing.md) cover package installation, +[Extension installation and testing instructions](https://github.com/DataFog/datafog-core/blob/v1.1.0-rc.1/docs/releases/1-1-0-rc-1-extension-testing.md) cover package installation, asset layout, default-on and disabled detection, both vaults, restart, save failures and conversation observations. The candidate is published so this testing can happen; it does not claim acceptance in the shipping extension. diff --git a/docs/releases/1-1-0.mdx b/docs/releases/1-1-0.mdx index 1c65caf4..e59f086c 100644 --- a/docs/releases/1-1-0.mdx +++ b/docs/releases/1-1-0.mdx @@ -43,7 +43,7 @@ FogVault engines remain at 0.1.0. npm stable packages use `latest`. Pin exact ve ## Extension acceptance -[Extension installation and testing instructions](1-1-0-extension-testing.md) cover package installation, +[Extension installation and testing instructions](https://github.com/DataFog/datafog-core/blob/v1.1.0/docs/releases/1-1-0-extension-testing.md) cover package installation, asset layout, default-on and disabled detection, both vaults, restart, save failures and conversation observations. Core publication is independent of this testing; it does not claim acceptance in the shipping extension. diff --git a/docs/releases/1-5-0.mdx b/docs/releases/1-5-0.mdx new file mode 100644 index 00000000..09f456ef --- /dev/null +++ b/docs/releases/1-5-0.mdx @@ -0,0 +1,10 @@ +--- +title: "1.5.0" +description: "Corrective privacy fixes for masking, overlapping findings, token validation and Python providers." +--- + +Core 1.5.0 retains the public APIs and Workspace and model wire contracts. Masking now conceals at least one code point. Combined scan-and-transform calls protect the union of overlapping detector spans. Explicit transforms still require review when a partial overlap would leave text exposed. + +Tokenization validates reserved token prefixes before contacting a provider. Python async providers must return awaitables. Several detectors also change finding boundaries. Review the [1.5 migration guide](/guides/migrating-to-core-1-5) for affected inputs and the [release notes](https://github.com/DataFog/datafog-core/releases/tag/v1.5.0) for package details. + +Applications upgrading today should also review the later [EMAIL and PHONE corrections in 1.7](/releases/1-7-0) and [mixed-script EMAIL corrections in 1.8](/releases/1-8-0).