= Licensing Guide
:toc: macro
:toc-title: Contents
:toclevels: 2
:sectnums:
:icons: font

Detailed explanation of the Rhodium Pipeline Template licensing structure.

toc::[]

== License Overview

Rhodium Pipeline Template uses a *dual licensing* model with a *philosophical overlay*:

[cols="1,2,1"]
|===
|Component |License |Binding

|Template code
|MIT OR PMPL-1.0-or-later
|Legally binding (choose one)

|Generated projects
|Inherits from user choice
|Legally binding

|Palimpsest principles
|Philosophical overlay
|Non-binding (encouraged)
|===

== Dual License: MIT OR AGPL-3.0

You may use this template under *either* license at your choice:

=== MIT License

The MIT License is a permissive open-source license that allows:

* Commercial use without restriction
* Modification and distribution
* Private use
* Sublicensing

*Requirements:* Include copyright notice and license text in copies.

=== PMPL-1.0-or-later

The GNU Affero General Public License v3.0 is a copyleft license that:

* Ensures source code remains open
* Requires disclosure for network services (SaaS)
* Propagates to derivative works

*Requirements:* Distribute source code for modifications, including network services.

== Choosing Your License

=== For Most Users: MIT

Choose MIT if:

* You want maximum flexibility
* You're building proprietary software
* You don't want copyleft obligations
* You're embedding in a larger project with different licensing

=== For Open Source Advocates: AGPL-3.0

Choose AGPL-3.0 if:

* You want to ensure derivatives remain open source
* You're building a SaaS and want source disclosure
* You prefer strong copyleft protections
* You want to prevent proprietary forks

== Generated Project Licensing

When you generate a project, you select a license during the prompts:

[source,bash]
----
# During generation:
? Base license (MIT or AGPL-3.0)? [MIT, AGPL-3.0]
----

Your generated project inherits:

1. *Your chosen license* (MIT or AGPL-3.0) for the base code
2. *Palimpsest overlay* (non-binding, encouraged)

The generated `LICENSE` file reflects your choice.

== Palimpsest Philosophical Overlay

The Palimpsest License is a *non-binding philosophical framework* encouraging:

=== Core Principles

1. **Emotional Lineage** — Respect the creative and emotional history of code
2. **Consent-Based AI** — Require explicit consent for AI training
3. **Metadata Preservation** — Maintain attribution and provenance
4. **Cultural Context** — Protect narrative intent and meaning

=== Practical Application

While not legally enforceable, we encourage:

* Acknowledging original authors beyond legal requirements
* Seeking consent before using code for AI training datasets
* Preserving meaningful comments and documentation context
* Respecting the intent behind code, not just the letter

Learn more: https://github.com/hyperpolymath/palimpsest-license

== SPDX Identifiers

All source files should include SPDX headers:

[source]
----
// SPDX-License-Identifier: MPL-2.0
// SPDX-FileCopyrightText: 2024-2025 Your Name
----

For Isabelle theories:

[source,isabelle]
----
(* SPDX-License-Identifier: MIT OR PMPL-1.0-or-later *)
(* SPDX-FileCopyrightText: 2024-2025 Your Name *)
----

== Third-Party Dependencies

=== Template Dependencies

The template includes or references:

[cols="2,1,2"]
|===
|Dependency |License |Notes

|Rust crates (clap, serde, etc.)
|MIT/Apache-2.0
|Standard Rust licensing

|Isabelle/HOL
|BSD-3-Clause
|Theorem prover

|Nickel
|MIT
|Configuration language

|Guile
|GPL-3.0
|Used only for runtime scripting

|just
|CC0-1.0
|Task runner
|===

=== Compatibility

* MIT is compatible with all listed dependencies
* AGPL-3.0 may have implications for distribution

== Contributing

By contributing to this project, you agree to license your contributions under the same dual-license terms (MIT OR PMPL-1.0-or-later).

See link:CONTRIBUTING.adoc[CONTRIBUTING.adoc] for details.

== Questions

For licensing questions:

* Template licensing: Open an issue on the repository
* Legal advice: Consult a qualified attorney
* Palimpsest philosophy: See the Palimpsest License repository
