diff --git a/README.md b/README.md index b48140fa9..03787c889 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ [![Platforms](https://img.shields.io/badge/platforms-iOS%20%7C%20Android%20%7C%20macOS%20%7C%20Linux%20%7C%20Windows-lightgrey.svg)](#building-the-sdk) [![Discord](https://img.shields.io/badge/chat-Discord-5865F2.svg?logo=discord&logoColor=white)](https://discord.gg/9TQGrxaPJk) -**Dual-licensed:** use it under [AGPL-3.0-only](LICENSE), or buy a [commercial license](LICENSE-COMMERCIAL.md), your call — see the [License](#license) section for the full breakdown. +**Dual-licensed:** use it under [AGPL-3.0-only](LICENSE), or buy a [commercial license](LICENSE-COMMERCIAL.md), your call — see the [License](#license) section for the full breakdown. **Choosing?** Start with the [license decision tree](docs/licensing-decision-tree.md) (then [Licensing FAQ](docs/licensing-faq.md)). ## Features diff --git a/bindings/flutter/README.md b/bindings/flutter/README.md index d6b8a6e00..4cbb86aaa 100644 --- a/bindings/flutter/README.md +++ b/bindings/flutter/README.md @@ -2,6 +2,8 @@ Flutter plugin for the [Offline Protocol SDK](https://github.com/Offline-Protocol/offline-protocol-sdk): offline-first mesh messaging with MLS encryption. +**Dual-licensed:** [AGPL-3.0-only](../../LICENSE) or [commercial license](../../LICENSE-COMMERCIAL.md). Package manifests list AGPL SPDX only — see [license decision tree](../../docs/licensing-decision-tree.md) before legal review. + Hand-written native bridge code is shared with the React Native module under `bindings/react-native/{ios,android}` ([ADR 0025](../../docs/adr/0025-native-packages-are-assembled-in-place.md)). diff --git a/bindings/python/README.md b/bindings/python/README.md index 738ca7a9c..2cface50e 100644 --- a/bindings/python/README.md +++ b/bindings/python/README.md @@ -6,7 +6,7 @@ Python bindings for the Offline Protocol SDK: offline-first mesh networking with [docs/python-distribution.md](https://github.com/Offline-Protocol/offline-protocol-sdk/blob/main/docs/python-distribution.md) (supported hosts, and what to run on Alpine, an older glibc or an Intel Mac). -**Dual-licensed:** use it under [AGPL-3.0-only](https://github.com/Offline-Protocol/offline-protocol-sdk/blob/main/LICENSE), or buy a [commercial license](https://github.com/Offline-Protocol/offline-protocol-sdk/blob/main/LICENSE-COMMERCIAL.md), your call. The package metadata can only name `AGPL-3.0-only` because SPDX has no identifier for the commercial offer — see [License](#license) for the full breakdown. +**Dual-licensed:** use it under [AGPL-3.0-only](https://github.com/Offline-Protocol/offline-protocol-sdk/blob/main/LICENSE), or buy a [commercial license](https://github.com/Offline-Protocol/offline-protocol-sdk/blob/main/LICENSE-COMMERCIAL.md), your call. The package metadata can only name `AGPL-3.0-only` because SPDX has no identifier for the commercial offer — see [License](#license) for the full breakdown. **Choosing?** [License decision tree](https://github.com/Offline-Protocol/offline-protocol-sdk/blob/main/docs/licensing-decision-tree.md) → [Licensing FAQ](https://github.com/Offline-Protocol/offline-protocol-sdk/blob/main/docs/licensing-faq.md). > **Upgrading an existing install?** Read [docs/UPGRADING.md](https://github.com/Offline-Protocol/offline-protocol-sdk/blob/main/docs/UPGRADING.md) > first — `ProtocolManager` now requires an explicit `state_root`, and this diff --git a/bindings/react-native/README.md b/bindings/react-native/README.md index 0d2d07962..3db785c4e 100644 --- a/bindings/react-native/README.md +++ b/bindings/react-native/README.md @@ -2,7 +2,7 @@ Offline-first mesh networking SDK for React Native. Enables peer-to-peer messaging over BLE, WiFi Direct, Internet, Reticulum, and Nostr relays with intelligent transport switching. -**Dual-licensed:** use it under [AGPL-3.0-only](./LICENSE), or buy a [commercial license](./LICENSE-COMMERCIAL.md), your call. The npm manifest can only name `AGPL-3.0-only` because SPDX has no identifier for the commercial offer — see [License](#license) for the full breakdown. +**Dual-licensed:** use it under [AGPL-3.0-only](./LICENSE), or buy a [commercial license](./LICENSE-COMMERCIAL.md), your call. The npm manifest can only name `AGPL-3.0-only` because SPDX has no identifier for the commercial offer — see [License](#license) for the full breakdown. **Choosing?** [License decision tree](../../docs/licensing-decision-tree.md) → [Licensing FAQ](../../docs/licensing-faq.md). > **Upgrading an existing app?** Read [docs/UPGRADING.md](https://github.com/Offline-Protocol/offline-protocol-sdk/blob/main/docs/UPGRADING.md) > first — this release changes storage, adds new input rejections, and is not diff --git a/crates/offline-protocol-uniffi/src/lib.rs b/crates/offline-protocol-uniffi/src/lib.rs index e205ffb5f..f8c555467 100644 --- a/crates/offline-protocol-uniffi/src/lib.rs +++ b/crates/offline-protocol-uniffi/src/lib.rs @@ -25685,4 +25685,50 @@ mod tests { ); } } + + /// Friction #31: integrators get a license decision tree linked from package + /// READMEs and the integrator map. + #[test] + fn licensing_decision_tree_is_linked_from_package_readmes() { + let repo = std::path::Path::new(env!("CARGO_MANIFEST_DIR")) + .parent() + .and_then(std::path::Path::parent) + .expect("repository root"); + let tree = std::fs::read_to_string(repo.join("docs/licensing-decision-tree.md")) + .expect("licensing-decision-tree.md"); + let map = + std::fs::read_to_string(repo.join("docs/integrator-map.md")).expect("integrator-map"); + for needle in [ + "not legal advice", + "Commercial license", + "AGPL-3.0-only", + "legal@offlineprotocol.com", + "licensing-faq.md", + ] { + assert!( + tree.contains(needle), + "licensing-decision-tree.md must mention `{needle}`" + ); + } + assert!( + map.contains("licensing-decision-tree.md"), + "integrator-map must link licensing-decision-tree.md" + ); + for (path, label) in [ + ("README.md", "repository README"), + ( + "bindings/react-native/README.md", + "React Native package README", + ), + ("bindings/python/README.md", "Python package README"), + ("bindings/flutter/README.md", "Flutter README"), + ] { + let readme = std::fs::read_to_string(repo.join(path)) + .unwrap_or_else(|e| panic!("read {label}: {e}")); + assert!( + readme.contains("licensing-decision-tree.md"), + "{label} must link licensing-decision-tree.md" + ); + } + } } diff --git a/docs/README.md b/docs/README.md index dfaa5b83b..67b752413 100644 --- a/docs/README.md +++ b/docs/README.md @@ -17,6 +17,7 @@ before changing behaviour, not before using the SDK. | [Mobile permissions](mobile-permissions.md) | **iOS and Android:** Info.plist, manifest, runtime grants, background mesh | | [Transport troubleshooting](troubleshooting.md) | **QA:** Wi‑Fi Direct timing, several SDK apps on one phone, false "broken SDK" | | [Integration testing matrix](integration-testing-matrix.md) | **QA:** simulator vs hardware, golden smoke paths, release milestones | +| [License decision tree](licensing-decision-tree.md) | **Legal triage:** AGPL vs commercial before first import | | [Quick Start](../QUICKSTART.md) | Get started in 5 minutes (React Native, iOS, Android) | | [Upgrading](UPGRADING.md) | **Breaking changes and required app-side work** (use the [version index](UPGRADING.md#start-here-version-and-surface-index) first) | | [React Native Integration](react-native-integration.md) | Full SDK integration guide with complete API reference | @@ -174,5 +175,6 @@ in here fails **silently** when violated. | Resource | Description | |----------|-------------| -| [Licensing FAQ](licensing-faq.md) | The dual license in practice: app stores, the AGPL's reach, commercial licensing | +| [License decision tree](licensing-decision-tree.md) | AGPL vs commercial — start here before legal review | +| [Licensing FAQ](licensing-faq.md) | App stores, §13, telemetry (after the tree) | | [Export Control Notice](../EXPORT.md) | Encryption export status of the SDK and what app teams must handle themselves | diff --git a/docs/integrator-map.md b/docs/integrator-map.md index 71abfce05..c80891ef9 100644 --- a/docs/integrator-map.md +++ b/docs/integrator-map.md @@ -277,4 +277,5 @@ version for the index). | [Documentation index](README.md) | Full list of guides and spec | | [Bridge contracts](bridges/README.md) | Boundary rules (silent failures if violated) | | [Architecture](architecture.md) | Crate layout and design | -| [Licensing FAQ](licensing-faq.md) | AGPL vs commercial | +| [License decision tree](licensing-decision-tree.md) | AGPL vs commercial — start here for legal triage | +| [Licensing FAQ](licensing-faq.md) | App Store, §13, telemetry (after the tree) | diff --git a/docs/licensing-decision-tree.md b/docs/licensing-decision-tree.md new file mode 100644 index 000000000..6ccf31859 --- /dev/null +++ b/docs/licensing-decision-tree.md @@ -0,0 +1,72 @@ +# License decision tree + +**Purpose:** Fast legal/product triage before you import the SDK. This is +**not legal advice**; it routes you to the authoritative text. Nothing here +changes either license. + +| Document | Role | +|----------|------| +| [LICENSE](../LICENSE) | AGPL-3.0-only grant | +| [LICENSE-COMMERCIAL.md](../LICENSE-COMMERCIAL.md) | Commercial alternative | +| [Licensing FAQ](licensing-faq.md) | App Store, §13, telemetry, export (read after this tree) | + +**SPDX note:** npm/PyPI/crates metadata name **`AGPL-3.0-only` only**. The +commercial license is a separate grant, not a second SPDX id on the package. + +--- + +## Decision flow + +Answer in order. The first **stop** that matches your situation is your default +path; read the FAQ section it points to before sign-off. + +```mermaid +flowchart TD + start([You will ship or distribute something that links or embeds the SDK]) + start --> q1{Is the **whole product** allowed to be AGPL-3.0-only, with corresponding source offered to everyone you **distribute** the product to?} + q1 -->|No| commercial[Stop: **Commercial license** — email legal@offlineprotocol.com] + q1 -->|Yes| q2{"Distributing on the **Apple App Store** (including open source)?"} + q2 -->|Yes| commercial + q2 -->|No| q3{Distributing on **Google Play** or other stores as a **proprietary** app?} + q3 -->|Yes| commercial + q3 -->|No| q4{Will you **modify** the SDK and ship mesh/P2P software where remote peers use your build?} + q4 -->|Yes, and AGPL source offer to those users is not acceptable| commercial + q4 -->|No, or you can comply with §13| agpl[Stop: **AGPL-3.0-only** — comply with LICENSE + CLA if you contribute upstream] +``` + +Plain-language reading of the branches: + +1. **AGPL covers your whole app** when you link the SDK ([FAQ](licensing-faq.md#my-app-links-the-sdk-does-the-agpl-cover-my-whole-app)). If you cannot release your application under AGPL-3.0 with source to recipients, do not assume the free license fits. +2. **Apple App Store** (proprietary or AGPL open-source app) — treat as + **commercial** ([FAQ](licensing-faq.md#can-i-ship-an-agpl-licensed-app-on-the-apple-app-store)). + AGPL App Store distribution is unsupported; no §7 app-store exception is + granted today. +3. **Google Play** — proprietary apps → **commercial** (same as closed iOS). AGPL-3.0 + apps with source offered to every recipient can follow the **AGPL** path when + q4 still allows it ([FAQ](licensing-faq.md#what-about-google-play)). +4. **Modified SDK in mesh** — AGPL **§13** may require source offers to remote users, not only installers ([FAQ](licensing-faq.md#does-the-network-clause-13-matter-for-a-mesh-app)). + +--- + +## Quick picks (common integrator profiles) + +| Profile | Usual path | Next read | +|---------|------------|-----------| +| Any app on the **Apple App Store** (proprietary or AGPL open source) | Commercial | [FAQ: App Store](licensing-faq.md#can-i-ship-an-agpl-licensed-app-on-the-apple-app-store) | +| **Proprietary** Android app on Google Play or other stores | Commercial | [FAQ: Google Play](licensing-faq.md#what-about-google-play) | +| **AGPL-3.0** Android app on Google Play (source to recipients, combined-work rules met) | AGPL | [FAQ: Google Play](licensing-faq.md#what-about-google-play), [LICENSE](../LICENSE) | +| Closed-source desktop or backend service | Commercial | FAQ: combined work | +| AGPL-3.0 app (source published, recipients get corresponding source) | AGPL | [LICENSE](../LICENSE), [CONTRIBUTING](../CONTRIBUTING.md) | +| OSS app under a license **incompatible** with AGPL for the combined work | Commercial or do not link | FAQ + your counsel | +| Evaluating only (no distribution yet) | Decide before first beta | This tree again before store submit | + +--- + +## After you choose + +| Path | Action | +|------|--------| +| **AGPL-3.0-only** | Keep `LICENSE` and notices in redistributions; plan source offers; telemetry optional ([FAQ](licensing-faq.md#is-telemetry-part-of-the-license)) | +| **Commercial** | Contact legal@offlineprotocol.com with product, distribution model, scale ([LICENSE-COMMERCIAL.md](../LICENSE-COMMERCIAL.md)) | + +Export control is separate from copyright: [EXPORT.md](../EXPORT.md).