package-alert 0.1.0__tar.gz

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 (82) hide show
  1. package_alert-0.1.0/.gitignore +239 -0
  2. package_alert-0.1.0/.hgignore +1 -0
  3. package_alert-0.1.0/ARCHITECTURE.md +102 -0
  4. package_alert-0.1.0/Dockerfile +20 -0
  5. package_alert-0.1.0/LICENSE +194 -0
  6. package_alert-0.1.0/PKG-INFO +433 -0
  7. package_alert-0.1.0/README.md +397 -0
  8. package_alert-0.1.0/ROADMAP.md +35 -0
  9. package_alert-0.1.0/THREAT_MODEL.md +53 -0
  10. package_alert-0.1.0/config.example.toml +56 -0
  11. package_alert-0.1.0/package-alert.service +15 -0
  12. package_alert-0.1.0/packagealert/__init__.py +1 -0
  13. package_alert-0.1.0/packagealert/alerts/__init__.py +1 -0
  14. package_alert-0.1.0/packagealert/alerts/desktop.py +51 -0
  15. package_alert-0.1.0/packagealert/alerts/terminal.py +65 -0
  16. package_alert-0.1.0/packagealert/analyzers/__init__.py +1 -0
  17. package_alert-0.1.0/packagealert/analyzers/risk.py +99 -0
  18. package_alert-0.1.0/packagealert/cli/__init__.py +1 -0
  19. package_alert-0.1.0/packagealert/cli/app.py +898 -0
  20. package_alert-0.1.0/packagealert/cli/status.py +357 -0
  21. package_alert-0.1.0/packagealert/config.py +147 -0
  22. package_alert-0.1.0/packagealert/daemon.py +232 -0
  23. package_alert-0.1.0/packagealert/heuristics/__init__.py +1 -0
  24. package_alert-0.1.0/packagealert/heuristics/base.py +12 -0
  25. package_alert-0.1.0/packagealert/heuristics/npm.py +102 -0
  26. package_alert-0.1.0/packagealert/heuristics/python.py +85 -0
  27. package_alert-0.1.0/packagealert/heuristics/typosquat.py +80 -0
  28. package_alert-0.1.0/packagealert/logging_setup.py +49 -0
  29. package_alert-0.1.0/packagealert/models/__init__.py +1 -0
  30. package_alert-0.1.0/packagealert/models/advisories.py +30 -0
  31. package_alert-0.1.0/packagealert/models/events.py +27 -0
  32. package_alert-0.1.0/packagealert/models/risk.py +27 -0
  33. package_alert-0.1.0/packagealert/monitors/__init__.py +1 -0
  34. package_alert-0.1.0/packagealert/monitors/base.py +31 -0
  35. package_alert-0.1.0/packagealert/monitors/cache.py +160 -0
  36. package_alert-0.1.0/packagealert/monitors/process.py +236 -0
  37. package_alert-0.1.0/packagealert/osv/__init__.py +1 -0
  38. package_alert-0.1.0/packagealert/osv/cache.py +77 -0
  39. package_alert-0.1.0/packagealert/osv/client.py +142 -0
  40. package_alert-0.1.0/packagealert/osv/popularity.py +77 -0
  41. package_alert-0.1.0/packagealert/parsers/__init__.py +1 -0
  42. package_alert-0.1.0/packagealert/parsers/lockfiles.py +304 -0
  43. package_alert-0.1.0/packagealert/parsers/npm.py +68 -0
  44. package_alert-0.1.0/packagealert/parsers/process_args.py +360 -0
  45. package_alert-0.1.0/packagealert/parsers/wheel.py +58 -0
  46. package_alert-0.1.0/packagealert/sandbox/__init__.py +0 -0
  47. package_alert-0.1.0/packagealert/sandbox/bwrap.py +69 -0
  48. package_alert-0.1.0/packagealert/sandbox/runner.py +992 -0
  49. package_alert-0.1.0/packagealert/scheduler/__init__.py +0 -0
  50. package_alert-0.1.0/packagealert/scheduler/db.py +267 -0
  51. package_alert-0.1.0/packagealert/scheduler/runner.py +228 -0
  52. package_alert-0.1.0/packagealert/storage/__init__.py +1 -0
  53. package_alert-0.1.0/packagealert/storage/db.py +111 -0
  54. package_alert-0.1.0/pyproject.toml +62 -0
  55. package_alert-0.1.0/tests/__init__.py +1 -0
  56. package_alert-0.1.0/tests/conftest.py +15 -0
  57. package_alert-0.1.0/tests/fixtures/osv_responses/clean_batch.json +5 -0
  58. package_alert-0.1.0/tests/fixtures/osv_responses/malicious_batch.json +14 -0
  59. package_alert-0.1.0/tests/integration/__init__.py +1 -0
  60. package_alert-0.1.0/tests/integration/test_cache_monitor.py +156 -0
  61. package_alert-0.1.0/tests/integration/test_daemon.py +386 -0
  62. package_alert-0.1.0/tests/integration/test_full_pipeline.py +154 -0
  63. package_alert-0.1.0/tests/integration/test_process_monitor.py +33 -0
  64. package_alert-0.1.0/tests/unit/__init__.py +1 -0
  65. package_alert-0.1.0/tests/unit/test_composer.py +249 -0
  66. package_alert-0.1.0/tests/unit/test_config.py +95 -0
  67. package_alert-0.1.0/tests/unit/test_heuristics_npm.py +95 -0
  68. package_alert-0.1.0/tests/unit/test_heuristics_python.py +107 -0
  69. package_alert-0.1.0/tests/unit/test_models.py +86 -0
  70. package_alert-0.1.0/tests/unit/test_osv_cache.py +68 -0
  71. package_alert-0.1.0/tests/unit/test_osv_client.py +151 -0
  72. package_alert-0.1.0/tests/unit/test_parsers.py +386 -0
  73. package_alert-0.1.0/tests/unit/test_risk_engine.py +98 -0
  74. package_alert-0.1.0/tests/unit/test_sandbox.py +1230 -0
  75. package_alert-0.1.0/tests/unit/test_scheduler_db.py +261 -0
  76. package_alert-0.1.0/tests/unit/test_scheduler_runner.py +265 -0
  77. package_alert-0.1.0/tests/unit/test_spec_normalization.py +165 -0
  78. package_alert-0.1.0/tests/unit/test_status.py +459 -0
  79. package_alert-0.1.0/tests/unit/test_typosquat.py +54 -0
  80. package_alert-0.1.0/tests/unit/test_wheel_npm_parsers.py +89 -0
  81. package_alert-0.1.0/uv.lock +1042 -0
  82. package_alert-0.1.0/uv.toml +8 -0
@@ -0,0 +1,239 @@
1
+ .web
2
+ assets/external/
3
+ *.db
4
+ *.py[cod]
5
+ .states
6
+ # Byte-compiled / optimized / DLL files
7
+ __pycache__/
8
+ *.py[codz]
9
+ *$py.class
10
+
11
+ # C extensions
12
+ *.so
13
+
14
+ # Distribution / packaging
15
+ .Python
16
+ build/
17
+ develop-eggs/
18
+ dist/
19
+ downloads/
20
+ eggs/
21
+ .eggs/
22
+ lib/
23
+ lib64/
24
+ parts/
25
+ sdist/
26
+ var/
27
+ wheels/
28
+ share/python-wheels/
29
+ *.egg-info/
30
+ .installed.cfg
31
+ *.egg
32
+ MANIFEST
33
+
34
+ # PyInstaller
35
+ # Usually these files are written by a python script from a template
36
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
37
+ *.manifest
38
+ *.spec
39
+
40
+ # Installer logs
41
+ pip-log.txt
42
+ pip-delete-this-directory.txt
43
+
44
+ # Unit test / coverage reports
45
+ htmlcov/
46
+ .tox/
47
+ .nox/
48
+ .coverage
49
+ .coverage.*
50
+ .cache
51
+ nosetests.xml
52
+ coverage.xml
53
+ *.cover
54
+ *.py.cover
55
+ .hypothesis/
56
+ .pytest_cache/
57
+ cover/
58
+
59
+ # Translations
60
+ *.mo
61
+ *.pot
62
+
63
+ # Django stuff:
64
+ *.log
65
+ local_settings.py
66
+ db.sqlite3
67
+ db.sqlite3-journal
68
+
69
+ # Flask stuff:
70
+ instance/
71
+ .webassets-cache
72
+
73
+ # Scrapy stuff:
74
+ .scrapy
75
+
76
+ # Sphinx documentation
77
+ docs/_build/
78
+
79
+ # PyBuilder
80
+ .pybuilder/
81
+ target/
82
+
83
+ # Jupyter Notebook
84
+ .ipynb_checkpoints
85
+
86
+ # IPython
87
+ profile_default/
88
+ ipython_config.py
89
+
90
+ # pyenv
91
+ # For a library or package, you might want to ignore these files since the code is
92
+ # intended to run in multiple environments; otherwise, check them in:
93
+ # .python-version
94
+
95
+ # pipenv
96
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
97
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
98
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
99
+ # install all needed dependencies.
100
+ # Pipfile.lock
101
+
102
+ # UV
103
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
104
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
105
+ # commonly ignored for libraries.
106
+ # uv.lock
107
+
108
+ # poetry
109
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
110
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
111
+ # commonly ignored for libraries.
112
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
113
+ # poetry.lock
114
+ # poetry.toml
115
+
116
+ # pdm
117
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
118
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
119
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
120
+ # pdm.lock
121
+ # pdm.toml
122
+ .pdm-python
123
+ .pdm-build/
124
+
125
+ # pixi
126
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
127
+ # pixi.lock
128
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
129
+ # in the .venv directory. It is recommended not to include this directory in version control.
130
+ .pixi
131
+
132
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
133
+ __pypackages__/
134
+
135
+ # Celery stuff
136
+ celerybeat-schedule
137
+ celerybeat.pid
138
+
139
+ # Redis
140
+ *.rdb
141
+ *.aof
142
+ *.pid
143
+
144
+ # RabbitMQ
145
+ mnesia/
146
+ rabbitmq/
147
+ rabbitmq-data/
148
+
149
+ # ActiveMQ
150
+ activemq-data/
151
+
152
+ # SageMath parsed files
153
+ *.sage.py
154
+
155
+ # Environments
156
+ .env
157
+ .envrc
158
+ .venv
159
+ env/
160
+ venv/
161
+ ENV/
162
+ env.bak/
163
+ venv.bak/
164
+
165
+ # Spyder project settings
166
+ .spyderproject
167
+ .spyproject
168
+
169
+ # Rope project settings
170
+ .ropeproject
171
+
172
+ # mkdocs documentation
173
+ /site
174
+
175
+ # mypy
176
+ .mypy_cache/
177
+ .dmypy.json
178
+ dmypy.json
179
+
180
+ # Pyre type checker
181
+ .pyre/
182
+
183
+ # pytype static type analyzer
184
+ .pytype/
185
+
186
+ # Cython debug symbols
187
+ cython_debug/
188
+
189
+ # PyCharm
190
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
191
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
192
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
193
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
194
+ # .idea/
195
+
196
+ # Abstra
197
+ # Abstra is an AI-powered process automation framework.
198
+ # Ignore directories containing user credentials, local state, and settings.
199
+ # Learn more at https://abstra.io/docs
200
+ .abstra/
201
+
202
+ # Visual Studio Code
203
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
204
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
205
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
206
+ # you could uncomment the following to ignore the entire vscode folder
207
+ # .vscode/
208
+ # Temporary file for partial code execution
209
+ tempCodeRunnerFile.py
210
+
211
+ # Ruff stuff:
212
+ .ruff_cache/
213
+
214
+ # PyPI configuration file
215
+ .pypirc
216
+
217
+ # Marimo
218
+ marimo/_static/
219
+ marimo/_lsp/
220
+ __marimo__/
221
+
222
+ # Streamlit
223
+ .streamlit/secrets.toml
224
+
225
+ Pipfile
226
+
227
+ # SolarIQ
228
+ solariq.ini
229
+ cache/
230
+ /data
231
+ .web/
232
+ .superpowers/
233
+ .claude/settings.local.json
234
+ requirements.txt
235
+ superpowers/
236
+ .python-version
237
+ .worktrees/
238
+ *.sqlite3
239
+ .claude
@@ -0,0 +1 @@
1
+ .hgignore.personal
@@ -0,0 +1,102 @@
1
+ # Architecture
2
+
3
+ ## Overview
4
+
5
+ package-alert is an asyncio daemon with two independent detection pipelines feeding a common analysis + alerting layer.
6
+
7
+ ```
8
+ ┌─────────────────────────────────────────────────────────┐
9
+ │ package-alert daemon │
10
+ │ │
11
+ │ ┌──────────────┐ ┌──────────────┐ │
12
+ │ │ ProcessMonitor│ │ CacheMonitor │ │
13
+ │ │ (psutil/proc) │ │ (watchdog) │ │
14
+ │ └──────┬───────┘ └──────┬───────┘ │
15
+ │ │ PackageEvent │ │
16
+ │ └────────┬───────────┘ │
17
+ │ ▼ │
18
+ │ ┌────────────────┐ │
19
+ │ │ Event Router │ │
20
+ │ └───────┬────────┘ │
21
+ │ │ │
22
+ │ ┌────────┴────────┐ │
23
+ │ ▼ ▼ │
24
+ │ ┌──────────┐ ┌──────────────┐ │
25
+ │ │ OSV Check │ │ Risk Engine │ │
26
+ │ │ (httpx) │ │ (heuristics) │ │
27
+ │ └────┬─────┘ └──────┬───────┘ │
28
+ │ │ │ │
29
+ │ └────────┬────────┘ │
30
+ │ ▼ │
31
+ │ ┌──────────────┐ │
32
+ │ │ Alert Layer │ │
33
+ │ │ terminal+dsk │ │
34
+ │ └──────────────┘ │
35
+ └─────────────────────────────────────────────────────────┘
36
+ ```
37
+
38
+ ## Key Design Decisions
39
+
40
+ **Async-first:** All I/O (OSV HTTP, SQLite, process scanning) runs in asyncio. The watchdog observer runs in a thread and posts events onto an asyncio Queue via `run_coroutine_threadsafe`.
41
+
42
+ **Static analysis only:** Package inspection never executes code. Wheel files are opened as zip archives. npm tarballs are read with `tarfile`. All path traversal is validated before access.
43
+
44
+ **Offline-first cache:** OSV results are cached in SQLite with configurable TTL. The daemon operates normally when OSV is unreachable — it logs a warning and skips the check.
45
+
46
+ **Pluggable heuristics:** Each heuristic is an `AbstractHeuristic` that returns `list[RiskSignal]`. Adding a new signal requires implementing one class and registering it in `RiskEngine`.
47
+
48
+ ## Module Responsibilities
49
+
50
+ | Module | Responsibility |
51
+ |--------|---------------|
52
+ | `monitors/process.py` | Poll `psutil` for new pip/uv/npm processes, parse args |
53
+ | `monitors/cache.py` | Watch cache dirs with watchdog, classify new files |
54
+ | `parsers/process_args.py` | Parse CLI args into package name/version; collects `-r` req file paths |
55
+ | `parsers/wheel.py` | PEP 427 filename parsing, METADATA extraction |
56
+ | `parsers/npm.py` | Static package.json + tarball inspection |
57
+ | `osv/client.py` | Async OSV batch API with retries |
58
+ | `osv/cache.py` | SQLite advisory cache with TTL |
59
+ | `heuristics/npm.py` | npm-specific risk signals |
60
+ | `heuristics/python.py` | Python-specific risk signals |
61
+ | `heuristics/typosquat.py` | Levenshtein typosquatting detection |
62
+ | `analyzers/risk.py` | Composite scoring engine |
63
+ | `alerts/terminal.py` | Rich terminal panels |
64
+ | `alerts/desktop.py` | notify-send desktop notifications |
65
+ | `storage/db.py` | aiosqlite schema and queries |
66
+ | `daemon.py` | asyncio orchestrator, signal handling |
67
+ | `cli/app.py` | Typer CLI commands, log config routing (daemon vs. CLI log) |
68
+ | `cli/status.py` | Daemon state gathering and rendering |
69
+ | `sandbox/runner.py` | bubblewrap sandbox orchestration, SSH VCS detection |
70
+ | `sandbox/bwrap.py` | bwrap command builder with layered mount strategy |
71
+ | `config.py` | Pydantic config models; `DaemonLogConfig`/`CliLogConfig` with separate defaults |
72
+
73
+ ## Data Flow
74
+
75
+ 1. `ProcessMonitor` or `CacheMonitor` emits a `PackageEvent`
76
+ 2. `Daemon._process_event()` receives it
77
+ 3. OSV cache checked → if miss, `OsvClient.batch_query()` called → result stored in cache
78
+ 4. If advisory is malicious → `alert_malicious()` fires immediately
79
+ 5. Otherwise, `RiskEngine.analyze()` runs heuristics + typosquat check
80
+ 6. If score ≥ warning threshold → `alert_risk()` fires
81
+
82
+ ## Database Schema
83
+
84
+ ```sql
85
+ -- OSV advisory results, TTL-based
86
+ CREATE TABLE osv_cache (
87
+ ecosystem TEXT, package TEXT, version TEXT,
88
+ queried_at REAL, has_results INTEGER, payload TEXT
89
+ );
90
+
91
+ -- Historical alert log
92
+ CREATE TABLE alerts (
93
+ package_name TEXT, ecosystem TEXT, version TEXT,
94
+ advisory_id TEXT, risk_score INTEGER, alerted_at REAL
95
+ );
96
+
97
+ -- Package popularity data (for future use)
98
+ CREATE TABLE popularity_cache (
99
+ ecosystem TEXT, package TEXT,
100
+ queried_at REAL, downloads INTEGER, payload TEXT
101
+ );
102
+ ```
@@ -0,0 +1,20 @@
1
+ FROM python:3.12-slim
2
+
3
+ WORKDIR /app
4
+
5
+ RUN apt-get update && apt-get install -y --no-install-recommends \
6
+ libnotify-bin \
7
+ && rm -rf /var/lib/apt/lists/*
8
+
9
+ COPY pyproject.toml .
10
+ COPY packagealert/ packagealert/
11
+
12
+ RUN pip install --no-cache-dir -e .
13
+
14
+ RUN useradd -m packagealert
15
+ USER packagealert
16
+
17
+ ENV PYTHONUNBUFFERED=1
18
+
19
+ ENTRYPOINT ["package-alert"]
20
+ CMD ["daemon"]
@@ -0,0 +1,194 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship made available under
36
+ the License, as indicated by a copyright notice that is included in
37
+ or attached to the work (an example is provided in the Appendix below).
38
+
39
+ "Derivative Works" shall mean any work, whether in Source or Object
40
+ form, that is based on (or derived from) the Work and for which the
41
+ editorial revisions, annotations, elaborations, or other modifications
42
+ represent, as a whole, an original work of authorship. For the purposes
43
+ of this License, Derivative Works shall not include works that remain
44
+ separable from, or merely link (or bind by name) to the interfaces of,
45
+ the Work and Derivative Works thereof.
46
+
47
+ "Contribution" shall mean, as submitted to the Licensor for inclusion
48
+ in the Work by the copyright owner or by an individual or Legal Entity
49
+ authorized to submit on behalf of the copyright owner. For the purposes
50
+ of this definition, "submitted" means any form of electronic, verbal,
51
+ or written communication sent to the Licensor or its representatives,
52
+ including but not limited to communication on electronic mailing lists,
53
+ source code control systems, and issue tracking systems that are managed
54
+ by, or on behalf of, the Licensor for the purpose of discussing and
55
+ improving the Work, but excluding communication that is conspicuously
56
+ marked or designated in writing by the copyright owner as "Not a
57
+ Contribution."
58
+
59
+ "Contributor" shall mean Licensor and any Legal Entity on behalf of
60
+ whom a Contribution has been received by the Licensor and subsequently
61
+ incorporated within the Work.
62
+
63
+ 2. Grant of Copyright License. Subject to the terms and conditions of
64
+ this License, each Contributor hereby grants to You a perpetual,
65
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
66
+ copyright license to reproduce, prepare Derivative Works of,
67
+ publicly display, publicly perform, sublicense, and distribute the
68
+ Work and such Derivative Works in Source or Object form.
69
+
70
+ 3. Grant of Patent License. Subject to the terms and conditions of
71
+ this License, each Contributor hereby grants to You a perpetual,
72
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
73
+ (except as stated in this section) patent license to make, have made,
74
+ use, offer to sell, sell, import, and otherwise transfer the Work,
75
+ where such license applies only to those patent claims licensable
76
+ by such Contributor that are necessarily infringed by their
77
+ Contribution(s) alone or by the combination of their Contribution(s)
78
+ with the Work to which such Contribution(s) was submitted. If You
79
+ institute patent litigation against any entity (including a cross-claim
80
+ or counterclaim in a lawsuit) alleging that the Work or any
81
+ Contribution embodied within the Work constitutes direct or contributory
82
+ patent infringement, then any patent licenses granted to You under
83
+ this License for that Work shall terminate as of the date such
84
+ litigation is filed.
85
+
86
+ 4. Redistribution. You may reproduce and distribute copies of the
87
+ Work or Derivative Works thereof in any medium, with or without
88
+ modifications, and in Source or Object form, provided that You
89
+ meet the following conditions:
90
+
91
+ (a) You must give any other recipients of the Work or Derivative
92
+ Works a copy of this License; and
93
+
94
+ (b) You must cause any modified files to carry prominent notices
95
+ stating that You changed the files; and
96
+
97
+ (c) You must retain, in the Source form of any Derivative Works
98
+ that You distribute, all copyright, patent, trademark, and
99
+ attribution notices from the Source form of the Work,
100
+ excluding those notices that do not pertain to any part of
101
+ the Derivative Works; and
102
+
103
+ (d) If the Work includes a "NOTICE" text file as part of its
104
+ distribution, You must include a readable copy of the
105
+ attribution notices contained within such NOTICE file, in
106
+ at least one of the following places: within a NOTICE text
107
+ file distributed as part of the Derivative Works; within
108
+ the Source form or documentation, if provided along with the
109
+ Derivative Works; or, within a display generated by the
110
+ Derivative Works, if and wherever such third-party notices
111
+ normally appear. The contents of the NOTICE file are for
112
+ informational purposes only and do not modify the License.
113
+ You may add Your own attribution notices within Derivative
114
+ Works that You distribute, alongside or as an addendum to
115
+ the NOTICE text from the Work, provided that such additional
116
+ attribution notices cannot be construed as modifying the License.
117
+
118
+ You may add Your own license statement for Your modifications and
119
+ may provide additional grant of rights to use, copy, modify, merge,
120
+ publish, distribute, sublicense, and/or sell copies of the
121
+ Contribution, either on an included basis or on a separate written
122
+ agreement. Such additional grants are entirely Your choice.
123
+
124
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
125
+ any Contribution intentionally submitted for inclusion in the Work
126
+ by You to the Licensor shall be under the terms and conditions of
127
+ this License, without any additional terms or conditions.
128
+ Notwithstanding the above, nothing herein shall supersede or modify
129
+ the terms of any separate license agreement you may have executed
130
+ with Licensor regarding such Contributions.
131
+
132
+ 6. Trademarks. This License does not grant permission to use the trade
133
+ names, trademarks, service marks, or product names of the Licensor,
134
+ except as required for reasonable and customary use in describing the
135
+ origin of the Work and reproducing the content of the NOTICE file.
136
+
137
+ 7. Disclaimer of Warranty. Unless required by applicable law or
138
+ agreed to in writing, Licensor provides the Work (and each
139
+ Contributor provides its Contributions) on an "AS IS" BASIS,
140
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
141
+ implied, including, without limitation, any warranties or conditions
142
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
143
+ PARTICULAR PURPOSE. You are solely responsible for determining the
144
+ appropriateness of using or reproducing the Work and assume any
145
+ risks associated with Your exercise of permissions under this License.
146
+
147
+ 8. Limitation of Liability. In no event and under no legal theory,
148
+ whether in tort (including negligence), contract, or otherwise,
149
+ unless required by applicable law (such as deliberate and grossly
150
+ negligent acts) or agreed to in writing, shall any Contributor be
151
+ liable to You for damages, including any direct, indirect, special,
152
+ incidental, or exemplary damages of any character arising as a
153
+ result of this License or out of the use or inability to use the
154
+ Work (including but not limited to damages for loss of goodwill,
155
+ work stoppage, computer failure or malfunction, or all other
156
+ commercial damages or losses), even if such Contributor has been
157
+ advised of the possibility of such damages.
158
+
159
+ 9. Accepting Warranty or Additional Liability. While redistributing
160
+ the Work or Derivative Works thereof, You may choose to offer,
161
+ and charge a fee for, acceptance of support, warranty, indemnity,
162
+ or other liability obligations and/or rights consistent with this
163
+ License. However, in accepting such obligations, You may offer such
164
+ liability only on Your own behalf and on Your sole responsibility,
165
+ not on behalf of any other Contributor, and only if You agree to
166
+ indemnify, defend, and hold each Contributor harmless for any
167
+ liability incurred by, or claims asserted against, such Contributor
168
+ by reason of your accepting any such warranty or additional liability.
169
+
170
+ END OF TERMS AND CONDITIONS
171
+
172
+ APPENDIX: How to apply the Apache License to your work.
173
+
174
+ To apply the Apache License to your work, attach the following
175
+ boilerplate notice, with the fields enclosed by brackets "[]"
176
+ replaced with your own identifying information. (Don't include
177
+ the brackets!) The text should be enclosed in the appropriate
178
+ comment syntax for the file format in use. Please also include a
179
+ "See the License for the specific language governing permissions
180
+ and limitations under the License." notice after the copyright.
181
+
182
+ Copyright 2026 Al Slater
183
+
184
+ Licensed under the Apache License, Version 2.0 (the "License");
185
+ you may not use this file except in compliance with the License.
186
+ You may obtain a copy of the License at
187
+
188
+ http://www.apache.org/licenses/LICENSE-2.0
189
+
190
+ Unless required by applicable law or agreed to in writing, software
191
+ distributed under the License is distributed on an "AS IS" BASIS,
192
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
193
+ See the License for the specific language governing permissions and
194
+ limitations under the License.