From 6ed1b931f095d419bdf47e965e4bcdbe14140e4e Mon Sep 17 00:00:00 2001 From: luisleo526 Date: Sun, 4 Oct 2026 17:28:18 +0800 Subject: [PATCH 1/3] docs: point licensing at enterprise@pineforge.dev; the commercial-license store is coming soon The README's "Buying a commercial license" section and LEGAL.md's commercial use bullet named luis@4pass.com.tw. Both now give enterprise@pineforge.dev and say the commercial-license store is coming soon. The LICENSE text is untouched (it keeps its own contact line). Co-Authored-By: Claude Sonnet 5.5 --- LEGAL.md | 2 +- README.md | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/LEGAL.md b/LEGAL.md index bf9d36d..c1f97dd 100644 --- a/LEGAL.md +++ b/LEGAL.md @@ -7,7 +7,7 @@ Summary of licensing, third-party components, and trademarks for `pineforge-code `pineforge-codegen` is **source-available**, **not** OSI "open source." It is distributed under the **PolyForm Noncommercial License 1.0.0** with two supplemental terms — see [LICENSE](LICENSE), which is the controlling text: - **Personal Trading exception** — free to research, backtest, and trade your **own** capital, for an individual acting on their own behalf. -- **Commercial use** — companies, funds, managing third-party capital, embedding in a product, or operating a hosted/public-facing service requires a **commercial license** (email **luis@4pass.com.tw**). +- **Commercial use** — companies, funds, managing third-party capital, embedding in a product, or operating a hosted/public-facing service requires a **commercial license** (email **enterprise@pineforge.dev**; the commercial-license store is coming soon). Describe this project as **"source-available"** rather than "open source." The runtime it targets, [`pineforge-engine`](https://github.com/pineforge-4pass/pineforge-engine), is separate and **Apache-2.0**. diff --git a/README.md b/README.md index 253ecdd..b1e4e52 100644 --- a/README.md +++ b/README.md @@ -552,7 +552,8 @@ This is source-available, not OSI open source. ### Buying a commercial license Commercial licenses are available — flexible terms for funds, products, and -hosted/embedded use. Email **luis@4pass.com.tw** with your use case for a quote. +hosted/embedded use. Email **enterprise@pineforge.dev** with your use case for +a quote. The commercial-license store (coming soon) will take orders online. ## Explicit Pine execution attachment From 400f226c7c5a5dc2cb2ce29a0f38a6689690fe5e Mon Sep 17 00:00:00 2001 From: luisleo526 Date: Sun, 4 Oct 2026 18:21:08 +0800 Subject: [PATCH 2/3] License: pineforge, LLC; an additive Personal Trading permission; one Commercial Use definition The supplement to the PolyForm Noncommercial License 1.0.0 now only adds to the base license. It no longer "modifies" the base license or "controls" over it, and it says that it reduces, limits or conditions no license or permission of the base license. The PolyForm text below the separator is unchanged, so the PolyForm name stays, and noncommercial organizations and noncommercial purposes stay free. - Licensor and copyright holder: pineforge, LLC (header, Required Notice, LEGAL.md, CONTRIBUTING.md). - Commercial Use has one standalone definition: any use that neither the base license nor the Personal Trading permission permits. Uses (1) to (4) are its examples unless one of those permits the use. Output is defined (generated code and programs built from it; not backtest results, charts, reports or signals). Item (3) covers generating Output for a product, and item (4) reads "through which others can run the software or receive its Output". - Personal Trading covers any of research, development, backtesting and execution, solely for trades placed for the person's own account and funded by their own capital. Household, joint and retirement accounts and revocable trusts count as the person's own account; household capital, ordinary margin and money received outright count as their own capital. Trading in one's own name stays free even as a livelihood, and so does publishing or teaching about one's own trading, even for pay, without giving Output to others. An account of a company or other organization is not the person's own account, even if they wholly own it, and capital an employer, prop firm or funded-trader program provides is not their own capital. - The LICENSE's commercial-license contact is enterprise@pineforge.dev. - README and LEGAL.md describe the new structure. No code changes. Co-Authored-By: Claude Opus 5.5 (1M context) --- CONTRIBUTING.md | 2 +- LEGAL.md | 13 ++++-- LICENSE | 118 +++++++++++++++++++++++++++++++++++------------- README.md | 48 +++++++++++++------- 4 files changed, 127 insertions(+), 54 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index de0e91b..9d2b696 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,7 +4,7 @@ This is the source-available PineScript v6 to C++ translator. Read the [license and contribution terms](LEGAL.md) before sending a material change. Contributions use the Developer Certificate of Origin: add a `Signed-off-by` line with `git commit -s`. Material contributions also require a Contributor -License Agreement so PineForge can include them in its commercial license; +License Agreement so pineforge, LLC can include them in its commercial licenses; contact luis@4pass.com.tw before opening a material pull request. ## Local setup diff --git a/LEGAL.md b/LEGAL.md index c1f97dd..449de23 100644 --- a/LEGAL.md +++ b/LEGAL.md @@ -4,13 +4,18 @@ Summary of licensing, third-party components, and trademarks for `pineforge-code ## License -`pineforge-codegen` is **source-available**, **not** OSI "open source." It is distributed under the **PolyForm Noncommercial License 1.0.0** with two supplemental terms — see [LICENSE](LICENSE), which is the controlling text: +`pineforge-codegen` is **source-available**, **not** OSI "open source." It is distributed under the **PolyForm Noncommercial License 1.0.0** with an additional permission and a definition of Commercial Use — see [LICENSE](LICENSE), which is the controlling text. Both only add to the base license; they take away none of its permissions. -- **Personal Trading exception** — free to research, backtest, and trade your **own** capital, for an individual acting on their own behalf. -- **Commercial use** — companies, funds, managing third-party capital, embedding in a product, or operating a hosted/public-facing service requires a **commercial license** (email **enterprise@pineforge.dev**; the commercial-license store is coming soon). +- **Noncommercial use** — any noncommercial purpose, and any use by a charitable organization, educational institution, public research organization, public safety or health organization, environmental protection organization or government institution, is free under the base license. +- **Personal Trading** — free for a natural person to research, develop or backtest strategies and trade their **own** account with their **own** capital. Household, joint and retirement accounts and ordinary margin count as their own; a company's or fund's account does not, even a company they wholly own. +- **Commercial Use** — any other use, such as managing, advising on or trading third-party capital, use by or for a company or fund, embedding the software or its output in a product or service for others, or operating a hosted/public-facing service with it, requires a **commercial license** (email **enterprise@pineforge.dev**; the commercial-license store is coming soon). Describe this project as **"source-available"** rather than "open source." The runtime it targets, [`pineforge-engine`](https://github.com/pineforge-4pass/pineforge-engine), is separate and **Apache-2.0**. +## Copyright and licensor + +The licensor is **pineforge, LLC**, a Delaware limited liability company. It holds the copyright in `pineforge-codegen`; the founder's rights in the software are assigned to it. Commercial licenses are granted by pineforge, LLC. + ## What this repository is A pure-Python PineScript v6 → C++ transpiler that emits source against the public PineForge engine C-ABI. It implements PineScript v6 from **TradingView's publicly published language documentation**; it does **not** incorporate TradingView proprietary source. Names like "PineScript v6" are used **nominatively** to describe the input language. @@ -25,7 +30,7 @@ The transpiler has **no runtime dependencies** (`transpile()` and `transpile_ful ## Contributions -Contributions are accepted under a Developer Certificate of Origin (`Signed-off-by`). Because this project is **dual-licensed** (source-available + a sold commercial license), material contributions require a Contributor License Agreement granting PineForge the right to include the contribution in the commercial license; otherwise it cannot be accepted. See [CONTRIBUTING.md](CONTRIBUTING.md) (or contact luis@4pass.com.tw) before opening a material PR. +Contributions are accepted under a Developer Certificate of Origin (`Signed-off-by`). Because this project is **dual-licensed** (source-available + a sold commercial license), material contributions require a Contributor License Agreement granting pineforge, LLC the right to include the contribution in its commercial licenses; otherwise it cannot be accepted. See [CONTRIBUTING.md](CONTRIBUTING.md) (or contact luis@4pass.com.tw) before opening a material PR. ## No warranty diff --git a/LICENSE b/LICENSE index a1418cc..1fd0926 100644 --- a/LICENSE +++ b/LICENSE @@ -1,34 +1,89 @@ PineForge Codegen — License ============================ -Copyright 2025 PineForge +Copyright 2025-2026 pineforge, LLC This software is made available under the **PolyForm Noncommercial License -1.0.0** (reproduced in full below), as modified by the two supplemental -sections that follow. In case of any conflict, the supplemental sections -("Additional Permission" and "Commercial Use") control over the base license. +1.0.0** (the "base license", reproduced in full below), with the additional +permission and the definitions that follow. The licensor is pineforge, LLC. -Required Notice: Copyright 2025 PineForge (https://github.com/pineforge-4pass/pineforge-codegen-oss) +The sections "Additional Permission — Personal Trading" and "Commercial Use" +only add to the base license. Nothing in them reduces, limits or conditions +any license or permission the base license gives, including the permitted +purposes in its Noncommercial Purposes, Personal Uses and Noncommercial +Organizations sections. + +Required Notice: Copyright 2025-2026 pineforge, LLC (https://github.com/pineforge-4pass/pineforge-codegen-oss) Additional Permission — Personal Trading ---------------------------------------- -Notwithstanding the limitation to noncommercial purposes in the base license, -the licensor grants you, free of charge, an additional license to use the -software for **Personal Trading**, and Personal Trading is hereby a permitted -purpose under the base license — including its Copyright License, Distribution -License, Changes and New Works License, and Patent License. +In addition to the permitted purposes of the base license, the licensor +grants you, free of charge, a license to use the software for **Personal +Trading**, and Personal Trading is a permitted purpose under the base +license for every license it gives. + +**Personal Trading** means use of the software by a natural person to do any +of the following, solely for trades that meet conditions (a) and (b) below: +research, develop or backtest trading strategies, or execute trades in +securities, derivatives, currencies, crypto-assets, commodities or other +financial instruments. + + (a) The trades are, or will be, placed for that person's own account. + + (b) The trades are, or will be, funded solely by that person's own + capital. + +For Personal Trading: + + - A person's **household** is that person, their spouse or domestic + partner, and their dependants. + + - A person's **own account** includes an account held by the person alone + or jointly with members of their household; an account of a member of + their household; and a retirement, pension, education-savings or other + tax-advantaged account, or an account of a revocable trust, held for the + benefit of the person or members of their household. + + - A person's **own capital** includes capital belonging to members of + their household, and capital borrowed in the ordinary course from a + broker, bank or other lender, such as margin, leverage or credit on a + trading account, for which the person or their household is liable. + Money the person has received outright, such as pay, a gift or an + inheritance, is the person's own capital. + + - Trading in the person's own name, for their own account and with their + own capital, is Personal Trading even when it is the person's business + or livelihood. -**Personal Trading** means use of the software by a natural person to research, -develop, backtest, and execute trades in financial instruments, where: + - Publishing or teaching about the person's own Personal Trading, + including its results, is part of Personal Trading even when the person + is paid for it, as long as they do not give Output to others. - (a) the trades are placed for that same natural person's own account; and + - An account of a company, partnership, fund, trust or other + organization, other than an account described under own account above, + is not the person's own account, even if the person wholly owns or + controls it. - (b) the trades are funded solely by that person's own capital. + - Capital that an employer, a proprietary-trading firm, a funded-trader + program or anyone else outside the person's household provides or + allocates to the person to trade, and that the provider still owns or + whose losses the provider bears, is not the person's own capital, even + if the person shares in the profits. -Personal Trading does **not** include, and this Additional Permission does -**not** cover: + +Commercial Use +-------------- + +**Output** means code that the software generates, such as the C++ source +code it generates from PineScript, and any program or library built from +that code. Backtest results, charts, reports and trade signals are not +Output. + +**Commercial Use** means any use of the software that neither the base +license nor the Additional Permission above permits. Unless one of them +permits it, each of the following is Commercial Use: (1) managing, advising on, or trading capital belonging to any other person or entity, whether or not for a fee; @@ -37,30 +92,29 @@ Personal Trading does **not** include, and this Additional Permission does organization, including use by an individual in the course of work for such an organization; - (3) embedding the software, or output generated by it, into any product or - service made available to others; or + (3) embedding the software, or its Output, into any product or service + made available to others, including using the software to generate + Output for such a product or service; and (4) operating any hosted, software-as-a-service, or otherwise public-facing - service that uses the software. + service through which others can run the software or receive its + Output. -The use described in (1)–(4) is Commercial Use. - - -Commercial Use --------------- +For example, use by an organization of a kind listed in the base license's +Noncommercial Organizations section is a permitted purpose under the base +license, and so is not Commercial Use. -Any use that is not a permitted purpose under the base license and is not -covered by the Additional Permission above — including the uses listed in -(1)–(4) of that section — requires a separate commercial license from the -licensor. +This section does not override, narrow or condition any license or permitted +purpose of the base license, or Personal Trading. It only identifies uses +that those free permissions do not cover. Commercial Use requires a separate +commercial license from the licensor. -To obtain a commercial license, contact: luis@4pass.com.tw +To obtain a commercial license, contact: enterprise@pineforge.dev ================================================================================ -The remainder of this file is the verbatim text of the PolyForm Noncommercial -License 1.0.0. Where it differs from the supplemental sections above, the -supplemental sections control. +The remainder of this file is the verbatim, unchanged text of the PolyForm +Noncommercial License 1.0.0. ================================================================================ diff --git a/README.md b/README.md index b1e4e52..c9d6ae4 100644 --- a/README.md +++ b/README.md @@ -532,28 +532,42 @@ use `python -m pytest --collect-only -q` for the current collection count. ## License Source-available under the [PolyForm Noncommercial License 1.0.0](https://github.com/pineforge-4pass/pineforge-codegen-oss/blob/main/LICENSE), -with two supplemental sections (the `LICENSE` file is the controlling text; -where they conflict with the base license, the supplemental sections control): - -- **Additional Permission — Personal Trading** — a natural person may use the - software free of charge to research, develop, backtest and execute trades - for their own account, funded solely by their own capital. -- **Commercial Use** — managing, advising on or trading anyone else's capital; - use by, for or on behalf of a company, fund, partnership or other - organization (including an individual's work for one); embedding the - software or its output in a product or service made available to others; and - operating a hosted, software-as-a-service or other public-facing service - that uses the software all require a separate commercial license. - So does any other use that is neither a permitted purpose under the base - license nor covered by the Personal Trading permission. +with an additional permission for personal trading and a definition of +Commercial Use. Both only add to the base license and take away none of its +permissions; the `LICENSE` file is the controlling text. The licensor is +pineforge, LLC. + +- **Noncommercial use is free** under the base license: any noncommercial + purpose, and any use by a charitable organization, educational + institution, public research organization, public safety or health + organization, environmental protection organization or government + institution. +- **Personal Trading is free:** a natural person may research, develop or + backtest strategies and execute trades for their own account with their + own capital. Their own account includes joint and household accounts + (spouse or domestic partner, dependants), retirement and other + tax-advantaged accounts and a revocable trust for their benefit; their own + capital includes margin and other ordinary borrowing from a broker or + lender. A company's or fund's account is not a personal account, even if + the person wholly owns the company. +- **Commercial Use needs a commercial license:** any other use, such as + managing, advising on or trading anyone else's capital (outside their + household); use by, for or on + behalf of a company, fund, partnership or other organization (including an + individual's work for one); embedding the software or its output in a + product or service made available to others; or operating a hosted, + software-as-a-service or other public-facing service through which others + run the software or receive its output. This is source-available, not OSI open source. ### Buying a commercial license -Commercial licenses are available — flexible terms for funds, products, and -hosted/embedded use. Email **enterprise@pineforge.dev** with your use case for -a quote. The commercial-license store (coming soon) will take orders online. +Commercial licenses are annual: Solo for one person, Team for an +organization's own use, Fund for managers of others' capital (by assets under +management) and OEM / Embedded for products and hosted services. Email +**enterprise@pineforge.dev** with questions or for a quote. The +commercial-license store (coming soon) will take orders online. ## Explicit Pine execution attachment From 2efb9537a5c1431e5b976131780a44d78b7df17f Mon Sep 17 00:00:00 2001 From: luisleo526 Date: Sun, 4 Oct 2026 19:27:38 +0800 Subject: [PATCH 3/3] License: the PineForge Source License 1.0; investment management is commercial for every organization The owner ruled that fund management is not free for anyone. Charities, schools, public research bodies and government institutions stay free for teaching, research and their other operations, but every individual and every organization needs a commercial license for Investment Management. That covers managing, advising on or trading investment capital, researching strategies for it, or operating the software for others who do. Examples are endowments, pension and public funds, a foundation's treasury, and a friend's money. Personal Trading stays free. That narrows the PolyForm Noncommercial base, so the LICENSE is now one text, the PineForge Source License 1.0. It keeps the grant structure, Personal Trading, uses (1) to (4) and Output as they were, and mentions PolyForm nowhere. PolyForm's terms require that of a changed license: "If you make changes to a PolyForm license, you must remove all mention of "PolyForm" and polyformproject.org, as well." - README, LEGAL.md, AGENTS.md and CLAUDE.md name the new license. LEGAL.md notes that releases up to 1.1.0 keep the license they shipped with. - The pyproject comment names the new license; the classifier is "License :: Other/Proprietary License". - npm/package.json: "license": "SEE LICENSE IN LICENSE". The npm build now copies LICENSE into the package, and the files list includes it. No change to the transpiler or the C++ it emits. Co-Authored-By: Claude Opus 5.5 (1M context) --- .gitignore | 1 + AGENTS.md | 4 +- CLAUDE.md | 4 +- LEGAL.md | 9 +- LICENSE | 285 ++++++++++++++++------------------ README.md | 43 ++--- npm/package.json | 5 +- pyproject.toml | 4 +- scripts/build-npm-package.mjs | 6 +- 9 files changed, 180 insertions(+), 181 deletions(-) diff --git a/.gitignore b/.gitignore index 07882c6..bb2c54a 100644 --- a/.gitignore +++ b/.gitignore @@ -130,3 +130,4 @@ temp/ /npm/release.json /npm/transpile.worker.mjs /npm/glue.py +/npm/LICENSE diff --git a/AGENTS.md b/AGENTS.md index 626d593..719e425 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -63,8 +63,8 @@ Python entry points are `pineforge_codegen.transpile()` and `pineforge_codegen.transpile_full()`; the Pyodide package ships the `gate/glue.py` JSON protocol. See `docs/PUBLIC_CONTRACT.md`. -This is the **source-available** half of the PineForge stack (PolyForm -Noncommercial — see `LICENSE`). The runtime half (`pineforge-engine`, +This is the **source-available** half of the PineForge stack (PineForge +Source License 1.0 — see `LICENSE`). The runtime half (`pineforge-engine`, Apache-2.0) lives in a sibling repo and is typically checked out at `../pineforge-engine`. From 1.0.0 on, a released codegen `X.Y.Z` pairs only with engine `vX.Y.Z`; prereleases match exactly. Codegen 1.1.0 pairs with diff --git a/CLAUDE.md b/CLAUDE.md index 82f483f..ae85b03 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -63,8 +63,8 @@ Python entry points are `pineforge_codegen.transpile()` and `pineforge_codegen.transpile_full()`; the Pyodide package ships the `gate/glue.py` JSON protocol. See `docs/PUBLIC_CONTRACT.md`. -This is the **source-available** half of the PineForge stack (PolyForm -Noncommercial — see `LICENSE`). The runtime half (`pineforge-engine`, +This is the **source-available** half of the PineForge stack (PineForge +Source License 1.0 — see `LICENSE`). The runtime half (`pineforge-engine`, Apache-2.0) lives in a sibling repo and is typically checked out at `../pineforge-engine`. From 1.0.0 on, a released codegen `X.Y.Z` pairs only with engine `vX.Y.Z`; prereleases match exactly. Codegen 1.1.0 pairs with diff --git a/LEGAL.md b/LEGAL.md index 449de23..1834238 100644 --- a/LEGAL.md +++ b/LEGAL.md @@ -4,14 +4,17 @@ Summary of licensing, third-party components, and trademarks for `pineforge-code ## License -`pineforge-codegen` is **source-available**, **not** OSI "open source." It is distributed under the **PolyForm Noncommercial License 1.0.0** with an additional permission and a definition of Commercial Use — see [LICENSE](LICENSE), which is the controlling text. Both only add to the base license; they take away none of its permissions. +`pineforge-codegen` is **source-available**, **not** OSI "open source." It is distributed under the **PineForge Source License 1.0** — see [LICENSE](LICENSE), which is the controlling text. -- **Noncommercial use** — any noncommercial purpose, and any use by a charitable organization, educational institution, public research organization, public safety or health organization, environmental protection organization or government institution, is free under the base license. +- **Noncommercial use** — any noncommercial purpose, and use by a charitable organization, educational institution, public research organization, public safety or health organization, environmental protection organization or government institution for its teaching, research and other operations, is free. - **Personal Trading** — free for a natural person to research, develop or backtest strategies and trade their **own** account with their **own** capital. Household, joint and retirement accounts and ordinary margin count as their own; a company's or fund's account does not, even a company they wholly own. -- **Commercial Use** — any other use, such as managing, advising on or trading third-party capital, use by or for a company or fund, embedding the software or its output in a product or service for others, or operating a hosted/public-facing service with it, requires a **commercial license** (email **enterprise@pineforge.dev**; the commercial-license store is coming soon). +- **Investment management** — managing, advising on or trading investment capital, or researching strategies for it (a friend's, clients' or investors' capital, an endowment, a pension fund, a public fund, a foundation's treasury), is **Commercial Use for every individual and every organization**, noncommercial organizations included, except Personal Trading. +- **Commercial Use** — investment management and any other use that is not free, such as use by or for a company or fund, embedding the software or its output in a product or service for others, or operating a hosted/public-facing service with it, requires a **commercial license** (email **enterprise@pineforge.dev**; the commercial-license store is coming soon). Describe this project as **"source-available"** rather than "open source." The runtime it targets, [`pineforge-engine`](https://github.com/pineforge-4pass/pineforge-engine), is separate and **Apache-2.0**. +Releases up to and including 1.1.0 were published under the license text that came with them (the PolyForm Noncommercial License 1.0.0 with a PineForge supplement); copies of those releases keep that license. The PineForge Source License 1.0 is a separate license and is not a PolyForm license. + ## Copyright and licensor The licensor is **pineforge, LLC**, a Delaware limited liability company. It holds the copyright in `pineforge-codegen`; the founder's rights in the software are assigned to it. Commercial licenses are granted by pineforge, LLC. diff --git a/LICENSE b/LICENSE index 1fd0926..28efad9 100644 --- a/LICENSE +++ b/LICENSE @@ -1,28 +1,88 @@ -PineForge Codegen — License +PineForge Source License 1.0 ============================ Copyright 2025-2026 pineforge, LLC -This software is made available under the **PolyForm Noncommercial License -1.0.0** (the "base license", reproduced in full below), with the additional -permission and the definitions that follow. The licensor is pineforge, LLC. +Required Notice: Copyright 2025-2026 pineforge, LLC (https://github.com/pineforge-4pass/pineforge-codegen-oss) -The sections "Additional Permission — Personal Trading" and "Commercial Use" -only add to the base license. Nothing in them reduces, limits or conditions -any license or permission the base license gives, including the permitted -purposes in its Noncommercial Purposes, Personal Uses and Noncommercial -Organizations sections. +The software is free of charge for the permitted purposes below, including +Personal Trading. Commercial Use, defined below, needs a separate commercial +license from the licensor. -Required Notice: Copyright 2025-2026 pineforge, LLC (https://github.com/pineforge-4pass/pineforge-codegen-oss) + +## Acceptance + +In order to get any license under these terms, you must agree to them as both +strict obligations and conditions to all your licenses. + + +## Copyright License + +The licensor grants you a copyright license for the software to do everything +you might do with the software that would otherwise infringe the licensor's +copyright in it for any permitted purpose. However, you may only distribute +the software according to the Distribution License section, and make changes +or new works based on the software according to the Changes and New Works +License section. + + +## Distribution License + +The licensor grants you an additional copyright license to distribute copies +of the software. Your license to distribute covers distributing the software +with changes and new works permitted by the Changes and New Works License +section. Distributing copies under this section is not Commercial Use, and it +gives the people who get them no license beyond these terms. + + +## Notices + +You must ensure that anyone who gets a copy of any part of the software from +you also gets a copy of these terms or a link to them, as well as copies of +any plain-text lines beginning with `Required Notice:` that the licensor +provided with the software. For example: + +> Required Notice: Copyright Yoyodyne, Inc. (http://example.com) + + +## Changes and New Works License + +The licensor grants you an additional copyright license to make changes and +new works based on the software for any permitted purpose. + + +## Patent License + +The licensor grants you a patent license for the software that covers patent +claims the licensor can license, or becomes able to license, that you would +infringe by using the software for a permitted purpose. -Additional Permission — Personal Trading ----------------------------------------- +## Permitted Purposes -In addition to the permitted purposes of the base license, the licensor -grants you, free of charge, a license to use the software for **Personal -Trading**, and Personal Trading is a permitted purpose under the base -license for every license it gives. +Each of the following is a permitted purpose: + +- **Noncommercial purposes.** Any noncommercial purpose. + +- **Personal uses.** Personal use for research, experiment, and testing for + the benefit of public knowledge, personal study, private entertainment, + hobby projects, amateur pursuits, or religious observance, without any + anticipated commercial application. + +- **Noncommercial organizations.** Use by any charitable organization, + educational institution, public research organization, public safety or + health organization, environmental protection organization, or government + institution for its teaching, research and other operations, regardless of + the source of funding or obligations resulting from the funding. + +- **Personal Trading**, as defined in the next section. + +Investment Management, defined in the Commercial Use section, is never a +permitted purpose, except as Personal Trading. That is so even when it is done +by a noncommercial organization or for a noncommercial purpose. + + +## Personal Trading **Personal Trading** means use of the software by a natural person to do any of the following, solely for trades that meet conditions (a) and (b) below: @@ -73,17 +133,27 @@ For Personal Trading: if the person shares in the profits. -Commercial Use --------------- +## Commercial Use -**Output** means code that the software generates, such as the C++ source -code it generates from PineScript, and any program or library built from -that code. Backtest results, charts, reports and trade signals are not -Output. +**Investment Management** means using the software to manage, advise on, or +trade investment capital; to research, develop or backtest strategies for +investment capital that you, or anyone you do the work for, manage, advise on +or trade; or to operate the software for others who do any of these things; +in each case whoever the capital belongs to and whether or not for a fee. + +**Investment capital** means any money or other assets held for investment or +trading, including capital belonging to any other person or entity, such as a +friend or relative, clients or investors, an endowment, a pension or +retirement fund, a sovereign or other public fund, or the treasury or reserves +of a foundation or other organization. -**Commercial Use** means any use of the software that neither the base -license nor the Additional Permission above permits. Unless one of them -permits it, each of the following is Commercial Use: +**Commercial Use** means any use of the software that is not a permitted +purpose, other than distributing copies under the Distribution License +section. Investment Management is Commercial Use for every individual and +every organization, including the noncommercial organizations listed under +Permitted Purposes, whatever its purpose, unless it is Personal Trading. +Unless it is a permitted purpose, each of the following is also Commercial +Use: (1) managing, advising on, or trading capital belonging to any other person or entity, whether or not for a fee; @@ -100,152 +170,71 @@ permits it, each of the following is Commercial Use: service through which others can run the software or receive its Output. -For example, use by an organization of a kind listed in the base license's -Noncommercial Organizations section is a permitted purpose under the base -license, and so is not Commercial Use. +Commercial Use requires a separate commercial license from the licensor. To +obtain one, contact: enterprise@pineforge.dev -This section does not override, narrow or condition any license or permitted -purpose of the base license, or Personal Trading. It only identifies uses -that those free permissions do not cover. Commercial Use requires a separate -commercial license from the licensor. -To obtain a commercial license, contact: enterprise@pineforge.dev +## Output +**Output** means code that the software generates, such as the C++ source +code it generates from PineScript, and any program or library built from that +code. Backtest results, charts, reports and trade signals are not Output. -================================================================================ -The remainder of this file is the verbatim, unchanged text of the PolyForm -Noncommercial License 1.0.0. -================================================================================ - - -# PolyForm Noncommercial License 1.0.0 - - - -## Acceptance - -In order to get any license under these terms, you must agree -to them as both strict obligations and conditions to all -your licenses. - -## Copyright License - -The licensor grants you a copyright license for the -software to do everything you might do with the software -that would otherwise infringe the licensor's copyright -in it for any permitted purpose. However, you may -only distribute the software according to [Distribution -License](#distribution-license) and make changes or new works -based on the software according to [Changes and New Works -License](#changes-and-new-works-license). - -## Distribution License - -The licensor grants you an additional copyright license -to distribute copies of the software. Your license -to distribute covers distributing the software with -changes and new works permitted by [Changes and New Works -License](#changes-and-new-works-license). - -## Notices - -You must ensure that anyone who gets a copy of any part of -the software from you also gets a copy of these terms or the -URL for them above, as well as copies of any plain-text lines -beginning with `Required Notice:` that the licensor provided -with the software. For example: - -> Required Notice: Copyright Yoyodyne, Inc. (http://example.com) - -## Changes and New Works License - -The licensor grants you an additional copyright license to -make changes and new works based on the software for any -permitted purpose. - -## Patent License - -The licensor grants you a patent license for the software that -covers patent claims the licensor can license, or becomes able -to license, that you would infringe by using the software. - -## Noncommercial Purposes - -Any noncommercial purpose is a permitted purpose. - -## Personal Uses - -Personal use for research, experiment, and testing for -the benefit of public knowledge, personal study, private -entertainment, hobby projects, amateur pursuits, or religious -observance, without any anticipated commercial application, -is use for a permitted purpose. - -## Noncommercial Organizations - -Use by any charitable organization, educational institution, -public research organization, public safety or health -organization, environmental protection organization, -or government institution is use for a permitted purpose -regardless of the source of funding or obligations resulting -from the funding. ## Fair Use -You may have "fair use" rights for the software under the -law. These terms do not limit them. +You may have "fair use" rights for the software under the law. These terms do +not limit them. + ## No Other Rights -These terms do not allow you to sublicense or transfer any of -your licenses to anyone else, or prevent the licensor from -granting licenses to anyone else. These terms do not imply -any other licenses. +These terms do not allow you to sublicense or transfer any of your licenses +to anyone else, or prevent the licensor from granting licenses to anyone +else. These terms do not imply any other licenses. + ## Patent Defense -If you make any written claim that the software infringes or -contributes to infringement of any patent, your patent license -for the software granted under these terms ends immediately. If -your company makes such a claim, your patent license ends -immediately for work on behalf of your company. +If you make any written claim that the software infringes or contributes to +infringement of any patent, your patent license for the software granted +under these terms ends immediately. If your company makes such a claim, your +patent license ends immediately for work on behalf of your company. + ## Violations -The first time you are notified in writing that you have -violated any of these terms, or done anything with the software -not covered by your licenses, your licenses can nonetheless -continue if you come into full compliance with these terms, -and take practical steps to correct past violations, within -32 days of receiving notice. Otherwise, all your licenses -end immediately. +The first time you are notified in writing that you have violated any of +these terms, or done anything with the software not covered by your licenses, +your licenses can nonetheless continue if you come into full compliance with +these terms, and take practical steps to correct past violations, within 32 +days of receiving notice. Otherwise, all your licenses end immediately. + ## No Liability -***As far as the law allows, the software comes as is, without -any warranty or condition, and the licensor will not be liable -to you for any damages arising out of these terms or the use -or nature of the software, under any kind of legal claim.*** +***As far as the law allows, the software comes as is, without any warranty +or condition, and the licensor will not be liable to you for any damages +arising out of these terms or the use or nature of the software, under any +kind of legal claim.*** + ## Definitions -The **licensor** is the individual or entity offering these -terms, and the **software** is the software the licensor makes -available under these terms. +The **licensor** is pineforge, LLC, and the **software** is the software the +licensor makes available under these terms. -**You** refers to the individual or entity agreeing to these -terms. +**You** refers to the individual or entity agreeing to these terms. -**Your company** is any legal entity, sole proprietorship, -or other kind of organization that you work for, plus all -organizations that have control over, are under the control of, -or are under common control with that organization. **Control** -means ownership of substantially all the assets of an entity, -or the power to direct its management and policies by vote, -contract, or otherwise. Control can be direct or indirect. +**Your company** is any legal entity, sole proprietorship, or other kind of +organization that you work for, plus all organizations that have control +over, are under the control of, or are under common control with that +organization. **Control** means ownership of substantially all the assets of +an entity, or the power to direct its management and policies by vote, +contract, or otherwise. Control can be direct or indirect. -**Your licenses** are all the licenses granted to you for the -software under these terms. +**Your licenses** are all the licenses granted to you for the software under +these terms. -**Use** means anything you do with the software requiring one -of your licenses. +**Use** means anything you do with the software requiring one of your +licenses. diff --git a/README.md b/README.md index c9d6ae4..cab5924 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![PyPI](https://img.shields.io/pypi/v/pineforge-codegen.svg)](https://pypi.org/project/pineforge-codegen/) [![Python](https://img.shields.io/pypi/pyversions/pineforge-codegen.svg)](https://pypi.org/project/pineforge-codegen/) -[![License](https://img.shields.io/badge/license-PolyForm%20Noncommercial%201.0.0-orange.svg)](https://github.com/pineforge-4pass/pineforge-codegen-oss/blob/main/LICENSE) +[![License](https://img.shields.io/badge/license-PineForge%20Source%201.0-orange.svg)](https://github.com/pineforge-4pass/pineforge-codegen-oss/blob/main/LICENSE) [![Personal use](https://img.shields.io/badge/personal%20trading-free-22c55e.svg)](#license) A pure-Python library that turns a PineScript v6 strategy into a complete C++ @@ -531,18 +531,15 @@ use `python -m pytest --collect-only -q` for the current collection count. ## License -Source-available under the [PolyForm Noncommercial License 1.0.0](https://github.com/pineforge-4pass/pineforge-codegen-oss/blob/main/LICENSE), -with an additional permission for personal trading and a definition of -Commercial Use. Both only add to the base license and take away none of its -permissions; the `LICENSE` file is the controlling text. The licensor is -pineforge, LLC. - -- **Noncommercial use is free** under the base license: any noncommercial - purpose, and any use by a charitable organization, educational - institution, public research organization, public safety or health - organization, environmental protection organization or government - institution. -- **Personal Trading is free:** a natural person may research, develop or +Source-available under the [PineForge Source License 1.0](https://github.com/pineforge-4pass/pineforge-codegen-oss/blob/main/LICENSE); +the `LICENSE` file is the controlling text. The licensor is pineforge, LLC. + +- **Free for noncommercial use:** any noncommercial purpose, and use by a + charitable organization, educational institution, public research + organization, public safety or health organization, environmental + protection organization or government institution for its teaching, + research and other operations. +- **Free for Personal Trading:** a natural person may research, develop or backtest strategies and execute trades for their own account with their own capital. Their own account includes joint and household accounts (spouse or domestic partner, dependants), retirement and other @@ -550,9 +547,14 @@ pineforge, LLC. capital includes margin and other ordinary borrowing from a broker or lender. A company's or fund's account is not a personal account, even if the person wholly owns the company. -- **Commercial Use needs a commercial license:** any other use, such as - managing, advising on or trading anyone else's capital (outside their - household); use by, for or on +- **Investment management is never free**, except Personal Trading: + managing, advising on or trading investment capital, or researching + strategies for it, whether the capital is a friend's, clients' or + investors', an endowment, a pension fund, a public fund or a foundation's + treasury, is Commercial Use for every individual and every organization, + noncommercial organizations included. +- **Commercial Use needs a commercial license:** besides investment + management, any other use that is not free, such as use by, for or on behalf of a company, fund, partnership or other organization (including an individual's work for one); embedding the software or its output in a product or service made available to others; or operating a hosted, @@ -564,10 +566,11 @@ This is source-available, not OSI open source. ### Buying a commercial license Commercial licenses are annual: Solo for one person, Team for an -organization's own use, Fund for managers of others' capital (by assets under -management) and OEM / Embedded for products and hosted services. Email -**enterprise@pineforge.dev** with questions or for a quote. The -commercial-license store (coming soon) will take orders online. +organization's own use, Fund for managers of others' capital and for +institutional investment capital such as endowments and pension or public +funds (by assets under management), and OEM / Embedded for products and +hosted services. Email **enterprise@pineforge.dev** with questions or for a +quote. The commercial-license store (coming soon) will take orders online. ## Explicit Pine execution attachment diff --git a/npm/package.json b/npm/package.json index 257f707..243342a 100644 --- a/npm/package.json +++ b/npm/package.json @@ -17,7 +17,8 @@ "tables.json", "release.json", "transpile.worker.mjs", - "glue.py" + "glue.py", + "LICENSE" ], "engines": { "node": ">=20" @@ -31,5 +32,5 @@ "type": "git", "url": "git+https://github.com/pineforge-4pass/pineforge-codegen-oss.git" }, - "license": "PolyForm-Noncommercial-1.0.0" + "license": "SEE LICENSE IN LICENSE" } diff --git a/pyproject.toml b/pyproject.toml index dbf08c0..4f0398f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,14 +13,14 @@ requires-python = ">=3.11" authors = [ { name = "PineForge", email = "luis@4pass.com.tw" }, ] -# PolyForm Noncommercial 1.0.0 + Personal Trading exception; see LICENSE. +# PineForge Source License 1.0 (source-available); see LICENSE. license = { file = "LICENSE" } readme = "README.md" keywords = ["pinescript", "transpiler", "trading", "backtesting", "tradingview"] classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Financial and Insurance Industry", - "License :: Free for non-commercial use", + "License :: Other/Proprietary License", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", diff --git a/scripts/build-npm-package.mjs b/scripts/build-npm-package.mjs index f2e6d12..c7ea205 100644 --- a/scripts/build-npm-package.mjs +++ b/scripts/build-npm-package.mjs @@ -31,15 +31,17 @@ const release = JSON.parse(readFileSync(RELEASE, "utf8")); if (release.codegen !== VERSION) fail(`release.json codegen ${release.codegen} != VERSION ${VERSION}`); // 1. Clean payload (keep tracked manifest + index). -for (const p of ["pineforge_codegen", "tables.json", "release.json", "glue.py", "transpile.worker.mjs"]) { +for (const p of ["pineforge_codegen", "tables.json", "release.json", "glue.py", "transpile.worker.mjs", "LICENSE"]) { rmSync(join(NPM, p), { recursive: true, force: true }); } const versionedArchive = `pineforge_codegen-${VERSION}.tar.gz`; rmSync(join(NPM, versionedArchive), { force: true }); -// 2. Validated archive (versioned filename) + release.json. +// 2. Validated archive (versioned filename) + release.json, and the LICENSE that +// package.json names ("SEE LICENSE IN LICENSE"). cpSync(SCRATCH_ARCHIVE, join(NPM, versionedArchive)); cpSync(RELEASE, join(NPM, "release.json")); +cpSync(join(ROOT, "LICENSE"), join(NPM, "LICENSE")); // 3. Unpacked source tree — extracted FROM the gate-validated archive (single // source of truth). Never re-copy the working tree: it could have drifted