diff-grok 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. package/.claude/skills/license-updater/SKILL.md +149 -0
  2. package/.claude/skills/license-updater/references/compatibility.md +68 -0
  3. package/.claude/skills/license-updater/references/templates.md +151 -0
  4. package/.claude/skills/license-updater/scripts/generate_license_files.py +467 -0
  5. package/CLAUDE.md +10 -4
  6. package/LICENSE +1 -1
  7. package/README.MD +41 -23
  8. package/THIRD_PARTY_LICENSES +135 -0
  9. package/docs/.nojekyll +1 -0
  10. package/docs/assets/hierarchy.js +1 -0
  11. package/docs/assets/highlight.css +99 -0
  12. package/docs/assets/icons.js +18 -0
  13. package/docs/assets/icons.svg +1 -0
  14. package/docs/assets/main.js +60 -0
  15. package/docs/assets/navigation.js +1 -0
  16. package/docs/assets/search.js +1 -0
  17. package/docs/assets/style.css +1633 -0
  18. package/docs/classes/BasicModelPipelineCreator.html +10 -0
  19. package/docs/classes/Callback.html +7 -0
  20. package/docs/classes/CyclicModelPipelineCreator.html +10 -0
  21. package/docs/classes/IterCheckerCallback.html +8 -0
  22. package/docs/classes/PipelineCreator.html +6 -0
  23. package/docs/classes/TimeCheckerCallback.html +8 -0
  24. package/docs/classes/UpdatesModelPipelineCreator.html +10 -0
  25. package/docs/functions/ab4.html +8 -0
  26. package/docs/functions/ab5.html +8 -0
  27. package/docs/functions/applyPipeline.html +9 -0
  28. package/docs/functions/getCallback.html +3 -0
  29. package/docs/functions/getIVP.html +6 -0
  30. package/docs/functions/getInputVector.html +2 -0
  31. package/docs/functions/getIvp2WebWorker.html +6 -0
  32. package/docs/functions/getJScode.html +6 -0
  33. package/docs/functions/getOutputNames.html +4 -0
  34. package/docs/functions/getPipelineCreator.html +7 -0
  35. package/docs/functions/lsoda.html +8 -0
  36. package/docs/functions/mrt.html +11 -0
  37. package/docs/functions/printE5.html +76 -0
  38. package/docs/functions/printHires.html +76 -0
  39. package/docs/functions/printOrego.html +66 -0
  40. package/docs/functions/printPollution.html +163 -0
  41. package/docs/functions/printRobertson.html +60 -0
  42. package/docs/functions/printVdpol.html +66 -0
  43. package/docs/functions/rk3.html +8 -0
  44. package/docs/functions/rk4.html +8 -0
  45. package/docs/functions/rkdp.html +8 -0
  46. package/docs/functions/ros34prw.html +8 -0
  47. package/docs/functions/ros3prw.html +8 -0
  48. package/docs/functions/solveIvp.html +5 -0
  49. package/docs/hierarchy.html +1 -0
  50. package/docs/index.html +768 -0
  51. package/docs/media/CONTRIBUTING.md +74 -0
  52. package/docs/media/E5.png +0 -0
  53. package/docs/media/HIRES.png +0 -0
  54. package/docs/media/OREGO.png +0 -0
  55. package/docs/media/POLL-full.png +0 -0
  56. package/docs/media/POLL.png +0 -0
  57. package/docs/media/ROBER.png +0 -0
  58. package/docs/media/VDP0L.png +0 -0
  59. package/docs/media/VDPOL.png +0 -0
  60. package/docs/media/acid-prod.gif +0 -0
  61. package/docs/media/basic-use.js +40 -0
  62. package/docs/media/basic-use.js.map +1 -0
  63. package/docs/media/basic-use.ts +44 -0
  64. package/docs/media/check-methods.js +59 -0
  65. package/docs/media/check-methods.js.map +1 -0
  66. package/docs/media/check-methods.ts +81 -0
  67. package/docs/media/corr-probs.js +132 -0
  68. package/docs/media/corr-probs.js.map +1 -0
  69. package/docs/media/corr-probs.ts +155 -0
  70. package/docs/media/cyclic-model.js +102 -0
  71. package/docs/media/cyclic-model.js.map +1 -0
  72. package/docs/media/cyclic-model.ts +112 -0
  73. package/docs/media/e5.js +36 -0
  74. package/docs/media/e5.js.map +1 -0
  75. package/docs/media/e5.ts +36 -0
  76. package/docs/media/hires.js +39 -0
  77. package/docs/media/hires.js.map +1 -0
  78. package/docs/media/hires.ts +40 -0
  79. package/docs/media/model-updates.js +112 -0
  80. package/docs/media/model-updates.js.map +1 -0
  81. package/docs/media/model-updates.ts +122 -0
  82. package/docs/media/orego.js +24 -0
  83. package/docs/media/orego.js.map +1 -0
  84. package/docs/media/orego.ts +25 -0
  85. package/docs/media/pipeline-use.js +87 -0
  86. package/docs/media/pipeline-use.js.map +1 -0
  87. package/docs/media/pipeline-use.ts +98 -0
  88. package/docs/media/pollution.js +132 -0
  89. package/docs/media/pollution.js.map +1 -0
  90. package/docs/media/pollution.ts +133 -0
  91. package/docs/media/print-benchmark.js +581 -0
  92. package/docs/media/print-benchmark.js.map +1 -0
  93. package/docs/media/print-benchmark.ts +594 -0
  94. package/docs/media/robertson.js +19 -0
  95. package/docs/media/robertson.js.map +1 -0
  96. package/docs/media/robertson.ts +19 -0
  97. package/docs/media/scripting.js +30 -0
  98. package/docs/media/scripting.js.map +1 -0
  99. package/docs/media/scripting.ts +35 -0
  100. package/docs/media/vdpol.js +17 -0
  101. package/docs/media/vdpol.js.map +1 -0
  102. package/docs/media/vdpol.ts +17 -0
  103. package/docs/modules.html +1 -0
  104. package/docs/types/Arg.html +12 -0
  105. package/docs/types/DifEqs.html +8 -0
  106. package/docs/types/Func.html +7 -0
  107. package/docs/types/IVP.html +40 -0
  108. package/docs/types/IVP2WebWorker.html +12 -0
  109. package/docs/types/Input.html +8 -0
  110. package/docs/types/Loop.html +7 -0
  111. package/docs/types/ODEs.html +31 -0
  112. package/docs/types/Output.html +6 -0
  113. package/docs/types/Pipeline.html +6 -0
  114. package/docs/types/SolverOptions.html +8 -0
  115. package/docs/types/Update.html +9 -0
  116. package/docs/types/Wrapper.html +8 -0
  117. package/index.js +1 -1
  118. package/index.js.map +1 -1
  119. package/index.ts +1 -1
  120. package/package.json +4 -2
  121. package/src/examples/check-methods.js +15 -3
  122. package/src/examples/check-methods.js.map +1 -1
  123. package/src/examples/check-methods.ts +18 -3
  124. package/src/solver-tools/cvode/common.js +487 -0
  125. package/src/solver-tools/cvode/common.js.map +1 -0
  126. package/src/solver-tools/cvode/common.ts +549 -0
  127. package/src/solver-tools/cvode/cvode.js +1062 -0
  128. package/src/solver-tools/cvode/cvode.js.map +1 -0
  129. package/src/solver-tools/cvode/cvode.ts +1226 -0
  130. package/src/solver-tools/cvode/cvode_adams.js +124 -0
  131. package/src/solver-tools/cvode/cvode_adams.js.map +1 -0
  132. package/src/solver-tools/cvode/cvode_adams.ts +142 -0
  133. package/src/solver-tools/cvode/cvode_bdf.js +153 -0
  134. package/src/solver-tools/cvode/cvode_bdf.js.map +1 -0
  135. package/src/solver-tools/cvode/cvode_bdf.ts +164 -0
  136. package/src/solver-tools/cvode/cvode_class.js +158 -0
  137. package/src/solver-tools/cvode/cvode_class.js.map +1 -0
  138. package/src/solver-tools/cvode/cvode_class.ts +271 -0
  139. package/src/solver-tools/cvode/cvode_hin.js +119 -0
  140. package/src/solver-tools/cvode/cvode_hin.js.map +1 -0
  141. package/src/solver-tools/cvode/cvode_hin.ts +150 -0
  142. package/src/solver-tools/cvode/cvode_io.js +203 -0
  143. package/src/solver-tools/cvode/cvode_io.js.map +1 -0
  144. package/src/solver-tools/cvode/cvode_io.ts +258 -0
  145. package/src/solver-tools/cvode/cvode_ls.js +210 -0
  146. package/src/solver-tools/cvode/cvode_ls.js.map +1 -0
  147. package/src/solver-tools/cvode/cvode_ls.ts +249 -0
  148. package/src/solver-tools/cvode/cvode_nls.js +220 -0
  149. package/src/solver-tools/cvode/cvode_nls.js.map +1 -0
  150. package/src/solver-tools/cvode/cvode_nls.ts +259 -0
  151. package/src/solver-tools/cvode/cvode_root.js +415 -0
  152. package/src/solver-tools/cvode/cvode_root.js.map +1 -0
  153. package/src/solver-tools/cvode/cvode_root.ts +503 -0
  154. package/src/solver-tools/cvode/dense_linalg.js +131 -0
  155. package/src/solver-tools/cvode/dense_linalg.js.map +1 -0
  156. package/src/solver-tools/cvode/dense_linalg.ts +144 -0
  157. package/src/solver-tools/cvode/index.js +26 -0
  158. package/src/solver-tools/cvode/index.js.map +1 -0
  159. package/src/solver-tools/cvode/index.ts +64 -0
  160. package/src/solver-tools/cvode-method.js +114 -0
  161. package/src/solver-tools/cvode-method.js.map +1 -0
  162. package/src/solver-tools/cvode-method.ts +129 -0
  163. package/src/solver-tools/index.js +1 -0
  164. package/src/solver-tools/index.js.map +1 -1
  165. package/src/solver-tools/index.ts +1 -0
  166. package/src/solver-tools/lsoda/blas.js +11 -0
  167. package/src/solver-tools/lsoda/blas.js.map +1 -1
  168. package/src/solver-tools/lsoda/blas.ts +12 -0
  169. package/src/solver-tools/lsoda/cfode.js +11 -0
  170. package/src/solver-tools/lsoda/cfode.js.map +1 -1
  171. package/src/solver-tools/lsoda/cfode.ts +12 -0
  172. package/src/solver-tools/lsoda/corfailure.js +11 -0
  173. package/src/solver-tools/lsoda/corfailure.js.map +1 -1
  174. package/src/solver-tools/lsoda/corfailure.ts +12 -0
  175. package/src/solver-tools/lsoda/correction.js +11 -0
  176. package/src/solver-tools/lsoda/correction.js.map +1 -1
  177. package/src/solver-tools/lsoda/correction.ts +12 -0
  178. package/src/solver-tools/lsoda/dense.js +11 -0
  179. package/src/solver-tools/lsoda/dense.js.map +1 -1
  180. package/src/solver-tools/lsoda/dense.ts +12 -0
  181. package/src/solver-tools/lsoda/index.js +11 -0
  182. package/src/solver-tools/lsoda/index.js.map +1 -1
  183. package/src/solver-tools/lsoda/index.ts +12 -0
  184. package/src/solver-tools/lsoda/intdy.js +11 -0
  185. package/src/solver-tools/lsoda/intdy.js.map +1 -1
  186. package/src/solver-tools/lsoda/intdy.ts +12 -0
  187. package/src/solver-tools/lsoda/lsoda.js +11 -0
  188. package/src/solver-tools/lsoda/lsoda.js.map +1 -1
  189. package/src/solver-tools/lsoda/lsoda.ts +12 -0
  190. package/src/solver-tools/lsoda/methodswitch.js +11 -0
  191. package/src/solver-tools/lsoda/methodswitch.js.map +1 -1
  192. package/src/solver-tools/lsoda/methodswitch.ts +12 -0
  193. package/src/solver-tools/lsoda/orderswitch.js +11 -0
  194. package/src/solver-tools/lsoda/orderswitch.js.map +1 -1
  195. package/src/solver-tools/lsoda/orderswitch.ts +12 -0
  196. package/src/solver-tools/lsoda/prja.js +11 -0
  197. package/src/solver-tools/lsoda/prja.js.map +1 -1
  198. package/src/solver-tools/lsoda/prja.ts +12 -0
  199. package/src/solver-tools/lsoda/scaleh.js +11 -0
  200. package/src/solver-tools/lsoda/scaleh.js.map +1 -1
  201. package/src/solver-tools/lsoda/scaleh.ts +12 -0
  202. package/src/solver-tools/lsoda/solsy.js +11 -0
  203. package/src/solver-tools/lsoda/solsy.js.map +1 -1
  204. package/src/solver-tools/lsoda/solsy.ts +12 -0
  205. package/src/solver-tools/lsoda/stoda.js +11 -0
  206. package/src/solver-tools/lsoda/stoda.js.map +1 -1
  207. package/src/solver-tools/lsoda/stoda.ts +12 -0
  208. package/src/solver-tools/lsoda-method.js +23 -9
  209. package/src/solver-tools/lsoda-method.js.map +1 -1
  210. package/src/solver-tools/lsoda-method.ts +27 -9
  211. package/src/solver-tools/solver-defs.js +1 -0
  212. package/src/solver-tools/solver-defs.js.map +1 -1
  213. package/src/solver-tools/solver-defs.ts +1 -0
  214. package/src/tests/cvode-lib-correctness.test.js +404 -0
  215. package/src/tests/cvode-lib-correctness.test.js.map +1 -0
  216. package/src/tests/cvode-lib-correctness.test.ts +505 -0
  217. package/src/tests/cvode-lib-performance.test.js +103 -0
  218. package/src/tests/cvode-lib-performance.test.js.map +1 -0
  219. package/src/tests/cvode-lib-performance.test.ts +128 -0
  220. package/src/tests/performance.test.js +4 -2
  221. package/src/tests/performance.test.js.map +1 -1
  222. package/src/tests/performance.test.ts +4 -2
  223. package/src/tests/test-defs.js +7 -1
  224. package/src/tests/test-defs.js.map +1 -1
  225. package/src/tests/test-defs.ts +8 -1
  226. package/src/worker-tools/solving.js +3 -1
  227. package/src/worker-tools/solving.js.map +1 -1
  228. package/src/worker-tools/solving.ts +4 -1
  229. package/src/examples/bioreactor.js +0 -125
  230. package/src/examples/bioreactor.js.map +0 -1
  231. package/src/examples/bioreactor.ts +0 -132
@@ -0,0 +1,149 @@
1
+ ---
2
+ name: license-updater
3
+ description: >
4
+ Update and manage third-party license attribution when porting code from
5
+ external libraries. Use this skill whenever the user mentions porting,
6
+ translating, or adapting code from another library (e.g. C/C++/Python to
7
+ TypeScript/JavaScript), asks to add license headers to source files, needs
8
+ to create or update a THIRD_PARTY_LICENSES file, or wants to ensure proper
9
+ license compliance for derived works. Also trigger when the user provides
10
+ a link to or local path of an upstream library and a folder of ported code
11
+ and asks about licensing. Keywords: license, attribution, port, third-party,
12
+ copyright, THIRD_PARTY_LICENSES, license header, BSD, MIT, Apache, derived
13
+ work.
14
+ ---
15
+
16
+ # License Updater
17
+
18
+ A skill for maintaining proper license attribution when incorporating
19
+ third-party code — especially code ported from one language to another.
20
+
21
+ ## When to use
22
+
23
+ - User provides a **source library URL or local path** and a **folder with ported files**
24
+ - User asks to "add license headers", "update THIRD_PARTY_LICENSES", or
25
+ "set up licensing for ported code"
26
+ - User mentions porting/translating code from an external project
27
+
28
+ ## Inputs
29
+
30
+ The user provides two things:
31
+
32
+ 1. **Source library URL or local path** — a GitHub (or similar) link to the
33
+ upstream project whose code was ported, or a local filesystem path to a
34
+ cloned/downloaded copy of the library.
35
+ Examples: `https://github.com/sdwfrost/liblsoda`, `src/solver-tools/cvode-7.5.0`
36
+ 2. **Ported files path** — a path (relative to the repo root) to the folder
37
+ containing the ported TypeScript (or other language) files.
38
+ Example: `src/solver-tools/lsoda`
39
+
40
+ The user may optionally provide:
41
+ - The **repo root URL** or local path to their own project
42
+ - The **target project's license** (if not, discover it from the repo)
43
+
44
+ ## Workflow
45
+
46
+ Follow these steps in order:
47
+
48
+ ### Step 1: Discover upstream license
49
+
50
+ If the user provided a **URL**, use `web_fetch` to open the source library URL.
51
+ If the user provided a **local path**, read files directly from the filesystem.
52
+
53
+ Look for:
54
+
55
+ 1. A `LICENSE` or `COPYING` file in the repository root
56
+ 2. License badges or mentions in the README
57
+ 3. SPDX identifiers in `package.json`, `setup.py`, `Cargo.toml`, etc.
58
+ 4. Copyright headers inside source files (especially the main source file)
59
+
60
+ Identify:
61
+ - **License type** (MIT, BSD-2-Clause, BSD-3-Clause, Apache-2.0, etc.)
62
+ - **Copyright holders** — every `Copyright (c)` line you find
63
+ - **Provenance chain** — if the upstream code itself was derived from earlier
64
+ work, trace the chain (e.g., Fortran → C → C refactoring → shared library)
65
+
66
+ If the license is unclear, tell the user and ask for clarification before
67
+ proceeding.
68
+
69
+ ### Step 2: Check compatibility
70
+
71
+ Verify that the upstream license is compatible with the target project's
72
+ license. Read `references/compatibility.md` for the compatibility matrix.
73
+
74
+ If there is a compatibility issue, **stop and inform the user** with a clear
75
+ explanation of the conflict and possible remedies.
76
+
77
+ ### Step 3: Discover target project structure
78
+
79
+ If the user provided a repo URL, fetch it to understand the existing layout.
80
+ Look for:
81
+ - Existing `LICENSE` file
82
+ - Existing `THIRD_PARTY_LICENSES` or `NOTICES` file
83
+ - Existing copyright headers in files
84
+
85
+ ### Step 4: Generate artifacts
86
+
87
+ Produce exactly three outputs. Use the script at
88
+ `scripts/generate_license_files.py` to generate them:
89
+
90
+ ```bash
91
+ python3 /path/to/skill/scripts/generate_license_files.py \
92
+ --license-type "<SPDX identifier, e.g. MIT>" \
93
+ --copyright-holders "<semicolon-separated list>" \
94
+ --project-name "<upstream project name>" \
95
+ --project-url "<upstream project URL>" \
96
+ --ported-files-path "<relative path in target repo>" \
97
+ --target-copyright "<target project copyright line>" \
98
+ --provenance "<semicolon-separated provenance chain>" \
99
+ --output-dir "/home/claude/license-output"
100
+ ```
101
+
102
+ The script creates three files in the output directory:
103
+
104
+ 1. **`THIRD_PARTY_LICENSES`** — standalone file for the repo root documenting
105
+ upstream license and provenance
106
+ 2. **`HEADER_TEMPLATE.txt`** — comment block to prepend to each ported file
107
+ 3. **`LICENSE_GUIDE.md`** — human-readable instructions explaining what to do
108
+
109
+ If the script is unavailable or doesn't fit the situation, generate the files
110
+ manually following the templates in `references/templates.md`.
111
+
112
+ ### Step 5: Update the README License section
113
+
114
+ If the project has a `README.md` (or `README.MD`), update its **License**
115
+ section to mention the third-party code and link to `THIRD_PARTY_LICENSES`.
116
+
117
+ Rules:
118
+ - Look for an existing `## License` heading in the README
119
+ - If one exists, **append** a line about the ported code beneath the existing
120
+ license statement — do not remove anything already there
121
+ - If there is no License section, add one at the end of the README (before
122
+ any final "Contributing" or similar section)
123
+ - Keep it concise: one sentence identifying the ported component, its upstream
124
+ source, and a link to the `THIRD_PARTY_LICENSES` file
125
+ - Use the template from `references/templates.md` → "README License section"
126
+
127
+ ### Step 6: Present results
128
+
129
+ 1. Give a brief summary:
130
+ - What license was found
131
+ - Whether it's compatible
132
+ - What files were created or modified (THIRD_PARTY_LICENSES, headers,
133
+ README)
134
+
135
+ ## Important rules
136
+
137
+ - **Never modify the target project's main LICENSE file** unless the user
138
+ explicitly asks. The main LICENSE covers the project as a whole.
139
+ - **Always preserve the full original license text** in THIRD_PARTY_LICENSES.
140
+ Don't paraphrase or abbreviate license texts.
141
+ - **Include ALL copyright holders** from the upstream chain, not just the
142
+ most recent one.
143
+ - **If the upstream repo contains multiple licenses** (e.g., dual-licensed),
144
+ note all of them and ask the user which applies.
145
+ - If the target project already has a THIRD_PARTY_LICENSES file, **append**
146
+ a new section rather than overwriting.
147
+ - The header template should be concise (under 15 lines) — point to
148
+ THIRD_PARTY_LICENSES for full details rather than embedding the entire
149
+ license in every file.
@@ -0,0 +1,68 @@
1
+ # License Compatibility Matrix
2
+
3
+ Quick reference for whether an upstream license is compatible with common
4
+ target project licenses. "Compatible" means the ported code can be included
5
+ in a project under the target license.
6
+
7
+ ## Permissive → Permissive (almost always OK)
8
+
9
+ | Upstream | Target: MIT | Target: BSD-2 | Target: BSD-3 | Target: Apache-2.0 |
10
+ |-----------------|:-----------:|:-------------:|:-------------:|:------------------:|
11
+ | MIT | ✅ | ✅ | ✅ | ✅ |
12
+ | BSD-2-Clause | ✅ | ✅ | ✅ | ✅ |
13
+ | BSD-3-Clause | ✅ | ✅ | ✅ | ✅ |
14
+ | Apache-2.0 | ✅* | ✅* | ✅* | ✅ |
15
+ | ISC | ✅ | ✅ | ✅ | ✅ |
16
+ | Zlib | ✅ | ✅ | ✅ | ✅ |
17
+ | Unlicense | ✅ | ✅ | ✅ | ✅ |
18
+
19
+ *Apache-2.0 has a patent grant clause. When including Apache-2.0 code in a
20
+ non-Apache project, the patent grant still applies to that code. This is
21
+ generally fine but worth noting.
22
+
23
+ ## Copyleft → Permissive (usually NOT OK)
24
+
25
+ | Upstream | Target: MIT | Target: BSD | Target: Apache-2.0 |
26
+ |-----------------|:-----------:|:-----------:|:------------------:|
27
+ | GPL-2.0-only | ❌ | ❌ | ❌ |
28
+ | GPL-3.0-only | ❌ | ❌ | ❌ |
29
+ | LGPL-2.1 | ⚠️* | ⚠️* | ⚠️* |
30
+ | LGPL-3.0 | ⚠️* | ⚠️* | ⚠️* |
31
+ | MPL-2.0 | ⚠️** | ⚠️** | ⚠️** |
32
+ | AGPL-3.0 | ❌ | ❌ | ❌ |
33
+
34
+ *LGPL allows linking but not incorporating source code into a permissive
35
+ project without the LGPL applying to the modified files.
36
+
37
+ **MPL-2.0 is file-level copyleft: the ported files themselves must stay
38
+ under MPL-2.0, but the rest of the project can be permissive.
39
+
40
+ ## What "compatible" means in practice
41
+
42
+ For permissive licenses (MIT, BSD, Apache, ISC, Zlib):
43
+ - Keep the original copyright notice and license text
44
+ - Include them in a THIRD_PARTY_LICENSES file
45
+ - Add attribution headers to ported files
46
+ - The overall project can use any license
47
+
48
+ For copyleft (GPL, LGPL, AGPL):
49
+ - Generally cannot include in a permissive project
50
+ - The copyleft license would need to apply to the derivative work
51
+ - STOP and inform the user about the conflict
52
+
53
+ ## Special conditions by license type
54
+
55
+ ### BSD-3-Clause
56
+ Extra requirement: cannot use the names of copyright holders or contributors
57
+ to endorse or promote the derived product without written permission.
58
+
59
+ ### Apache-2.0
60
+ - Includes explicit patent grant
61
+ - Requires NOTICE file preservation if one exists upstream
62
+ - Must state significant changes made to ported files
63
+
64
+ ### MIT
65
+ Minimal requirements: preserve copyright notice and license text.
66
+
67
+ ### ISC
68
+ Functionally equivalent to MIT. Same requirements.
@@ -0,0 +1,151 @@
1
+ # License File Templates
2
+
3
+ Use these templates when the generation script is unavailable or the situation
4
+ requires custom formatting.
5
+
6
+ ## THIRD_PARTY_LICENSES
7
+
8
+ ```
9
+ Third-Party Licenses
10
+ ====================
11
+
12
+ This file documents the licenses for third-party code included in or adapted
13
+ by this project.
14
+
15
+
16
+ ================================================================================
17
+ {PROJECT_NAME}
18
+ ================================================================================
19
+
20
+ Source: {PROJECT_URL}
21
+ License: {SPDX_IDENTIFIER}
22
+ Files: {PORTED_FILES_PATH}
23
+
24
+ {DESCRIPTION_OF_WHAT_WAS_PORTED}
25
+
26
+ {PROVENANCE_CHAIN — if the code has a history of forks/rewrites, list each
27
+ step with author and license}
28
+
29
+ {FULL_ORIGINAL_LICENSE_TEXT — copy verbatim, do not paraphrase}
30
+ ```
31
+
32
+ When appending to an existing THIRD_PARTY_LICENSES file, add a new section
33
+ starting from the `====` separator line. Do not modify existing sections.
34
+
35
+ ## Header template (for TypeScript / JavaScript files)
36
+
37
+ ```typescript
38
+ /**
39
+ * {BRIEF_DESCRIPTION — one line saying what this code does}
40
+ *
41
+ * {PORT_DESCRIPTION — e.g. "TypeScript port of {project} ({url})"}
42
+ * {ORIGINAL_ALGORITHM_CREDIT — if applicable}
43
+ *
44
+ * {ORIGINAL_COPYRIGHT_LINES — one per line, all of them}
45
+ * {TARGET_COPYRIGHT_LINE}
46
+ *
47
+ * Licensed under the {SPDX_IDENTIFIER} License. See THIRD_PARTY_LICENSES
48
+ * for the full license text and provenance chain of the original code.
49
+ */
50
+ ```
51
+
52
+ ### Header guidelines
53
+
54
+ - Keep under 15 lines total
55
+ - Include ALL original copyright holders
56
+ - Reference THIRD_PARTY_LICENSES instead of embedding the full license
57
+ - For BSD-3-Clause, do NOT include the full "neither the name..." clause
58
+ in the header — the THIRD_PARTY_LICENSES file covers this
59
+
60
+ ## Header template (for Python files)
61
+
62
+ ```python
63
+ # {BRIEF_DESCRIPTION}
64
+ #
65
+ # {PORT_DESCRIPTION}
66
+ # {ORIGINAL_ALGORITHM_CREDIT}
67
+ #
68
+ # {ORIGINAL_COPYRIGHT_LINES}
69
+ # {TARGET_COPYRIGHT_LINE}
70
+ #
71
+ # Licensed under the {SPDX_IDENTIFIER} License. See THIRD_PARTY_LICENSES
72
+ # for the full license text and provenance chain.
73
+ ```
74
+
75
+ ## Header template (for C / C++ files)
76
+
77
+ ```c
78
+ /*
79
+ * {BRIEF_DESCRIPTION}
80
+ *
81
+ * {PORT_DESCRIPTION}
82
+ * {ORIGINAL_ALGORITHM_CREDIT}
83
+ *
84
+ * {ORIGINAL_COPYRIGHT_LINES}
85
+ * {TARGET_COPYRIGHT_LINE}
86
+ *
87
+ * Licensed under the {SPDX_IDENTIFIER} License. See THIRD_PARTY_LICENSES
88
+ * for the full license text and provenance chain.
89
+ */
90
+ ```
91
+
92
+ ## README License section
93
+
94
+ Add the following beneath the existing license statement in the project's
95
+ `README.md`. If the README has no `## License` section yet, create one.
96
+
97
+ ```markdown
98
+ ## License
99
+
100
+ This project is licensed under the [{TARGET_LICENSE}]({LICENSE_FILE_PATH}).
101
+
102
+ {PORTED_COMPONENT_DESCRIPTION} is a {LANGUAGE} port of
103
+ [{PROJECT_NAME}]({PROJECT_URL}).
104
+ See [THIRD_PARTY_LICENSES](./THIRD_PARTY_LICENSES) for details on third-party
105
+ code provenance.
106
+ ```
107
+
108
+ ### README License guidelines
109
+
110
+ - Keep it to 2–3 sentences maximum
111
+ - Always link to both the main `LICENSE` file and `THIRD_PARTY_LICENSES`
112
+ - Name the specific component that was ported (e.g., "The LSODA solver")
113
+ - Name the upstream project and link to it
114
+ - If multiple third-party components exist, list each on its own line
115
+
116
+ ## LICENSE_GUIDE.md
117
+
118
+ ```markdown
119
+ # License Attribution Guide
120
+
121
+ ## Overview
122
+
123
+ This guide explains how to properly attribute the third-party code ported
124
+ into this project from [{PROJECT_NAME}]({PROJECT_URL}).
125
+
126
+ ## Files to add/modify
127
+
128
+ ### 1. `THIRD_PARTY_LICENSES` → repo root
129
+
130
+ {Explain: new file or append to existing}
131
+
132
+ ### 2. Header in each ported file → `{PORTED_FILES_PATH}/*.{ext}`
133
+
134
+ {Show the header template}
135
+
136
+ ### 3. `LICENSE` → no changes needed
137
+
138
+ {Explain why the main license stays as-is}
139
+
140
+ ### 4. `README` → optional update
141
+
142
+ {Suggest a license section addition if appropriate}
143
+
144
+ ## License compatibility
145
+
146
+ Upstream: {UPSTREAM_LICENSE}
147
+ Target: {TARGET_LICENSE}
148
+ Status: ✅ Compatible / ❌ Incompatible
149
+
150
+ {Brief explanation of compatibility and any special conditions}
151
+ ```