gabion 0.1.0__py3-none-any.whl

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.
@@ -0,0 +1,45 @@
1
+ from __future__ import annotations
2
+
3
+ import re
4
+ from typing import Iterable
5
+
6
+ from gabion.synthesis.model import NamingContext
7
+
8
+
9
+ def _camelize(value: str) -> str:
10
+ parts = [p for p in re.split(r"[^a-zA-Z0-9]+", value) if p]
11
+ return "".join(p[:1].upper() + p[1:] for p in parts)
12
+
13
+
14
+ def _normalize_identifier(value: str, fallback: str) -> str:
15
+ cleaned = re.sub(r"[^a-zA-Z0-9_]", "", value)
16
+ if not cleaned:
17
+ return fallback
18
+ if cleaned[0].isdigit():
19
+ return f"{fallback}{cleaned}"
20
+ return cleaned
21
+
22
+
23
+ def suggest_name(fields: Iterable[str], context: NamingContext | None = None) -> str:
24
+ context = context or NamingContext()
25
+ field_list = [f for f in fields if f]
26
+ if not field_list:
27
+ base = context.fallback_prefix
28
+ else:
29
+ frequency = context.frequency
30
+ anchor = max(
31
+ sorted(field_list),
32
+ key=lambda name: (frequency.get(name, 0), len(name)),
33
+ )
34
+ base = _camelize(anchor) or context.fallback_prefix
35
+
36
+ base = f"{base}Bundle"
37
+ base = _normalize_identifier(base, context.fallback_prefix)
38
+
39
+ name = base
40
+ counter = 2
41
+ existing = set(context.existing_names)
42
+ while name in existing:
43
+ name = f"{base}{counter}"
44
+ counter += 1
45
+ return name
@@ -0,0 +1,74 @@
1
+ from __future__ import annotations
2
+
3
+ from dataclasses import dataclass, field
4
+ from typing import Dict, Iterable, List, Mapping, Set
5
+
6
+ from gabion.synthesis.model import (
7
+ FieldSpec,
8
+ NamingContext,
9
+ ProtocolSpec,
10
+ SynthesisConfig,
11
+ SynthesisPlan,
12
+ )
13
+ from gabion.synthesis.naming import suggest_name
14
+
15
+
16
+ @dataclass
17
+ class Synthesizer:
18
+ config: SynthesisConfig = field(default_factory=SynthesisConfig)
19
+
20
+ def plan(
21
+ self,
22
+ bundle_tiers: Mapping[frozenset[str], int],
23
+ field_types: Mapping[str, str] | None = None,
24
+ naming_context: NamingContext | None = None,
25
+ ) -> SynthesisPlan:
26
+ field_types = field_types or {}
27
+ naming_context = naming_context or NamingContext()
28
+ protocols: List[ProtocolSpec] = []
29
+ warnings: List[str] = []
30
+
31
+ existing_names = set(naming_context.existing_names)
32
+ context = NamingContext(
33
+ existing_names=existing_names,
34
+ frequency=naming_context.frequency,
35
+ fallback_prefix=naming_context.fallback_prefix,
36
+ )
37
+
38
+ for bundle, tier in bundle_tiers.items():
39
+ bundle_set = set(bundle)
40
+ if not self._bundle_allowed(bundle_set, tier):
41
+ continue
42
+ name = suggest_name(bundle_set, context)
43
+ context.existing_names.add(name)
44
+ fields = self._build_fields(bundle_set, field_types)
45
+ protocols.append(
46
+ ProtocolSpec(
47
+ name=name,
48
+ fields=fields,
49
+ bundle=bundle_set,
50
+ tier=tier,
51
+ rationale=f"Tier-{tier} bundle",
52
+ )
53
+ )
54
+
55
+ if not protocols:
56
+ warnings.append("No bundles qualified for synthesis.")
57
+
58
+ return SynthesisPlan(protocols=protocols, warnings=warnings, errors=[])
59
+
60
+ def _bundle_allowed(self, bundle: Set[str], tier: int) -> bool:
61
+ if not bundle:
62
+ return False
63
+ if len(bundle) < self.config.min_bundle_size and not self.config.allow_singletons:
64
+ return False
65
+ return tier <= self.config.max_tier
66
+
67
+ def _build_fields(
68
+ self, bundle: Iterable[str], field_types: Dict[str, str]
69
+ ) -> List[FieldSpec]:
70
+ fields: List[FieldSpec] = []
71
+ for name in sorted(bundle):
72
+ type_hint = field_types.get(name)
73
+ fields.append(FieldSpec(name=name, type_hint=type_hint, source_params={name}))
74
+ return fields
@@ -0,0 +1,87 @@
1
+ from __future__ import annotations
2
+
3
+ from dataclasses import dataclass, field
4
+ from typing import Dict, List, Set
5
+
6
+
7
+ @dataclass(frozen=True)
8
+ class ScheduleResult:
9
+ order: List[str] = field(default_factory=list)
10
+ cycles: List[Set[str]] = field(default_factory=list)
11
+
12
+
13
+ def topological_schedule(graph: Dict[str, Set[str]]) -> ScheduleResult:
14
+ nodes: Set[str] = set(graph.keys())
15
+ for deps in graph.values():
16
+ nodes.update(deps)
17
+
18
+ incoming: Dict[str, Set[str]] = {node: set() for node in nodes}
19
+ outgoing: Dict[str, Set[str]] = {node: set() for node in nodes}
20
+
21
+ for node, deps in graph.items():
22
+ for dep in deps:
23
+ outgoing[dep].add(node)
24
+ incoming[node].add(dep)
25
+
26
+ ready = sorted(node for node, deps in incoming.items() if not deps)
27
+ order: List[str] = []
28
+
29
+ while ready:
30
+ node = ready.pop(0)
31
+ order.append(node)
32
+ for follower in sorted(outgoing[node]):
33
+ incoming[follower].discard(node)
34
+ if not incoming[follower]:
35
+ if follower not in ready and follower not in order:
36
+ ready.append(follower)
37
+ ready.sort()
38
+
39
+ remaining = {node for node, deps in incoming.items() if deps}
40
+ cycles: List[Set[str]] = []
41
+ if remaining:
42
+ subgraph = {node: {dep for dep in graph.get(node, set()) if dep in remaining} for node in remaining}
43
+ cycles = _strongly_connected_components(subgraph)
44
+ cycles = [
45
+ comp
46
+ for comp in cycles
47
+ if len(comp) > 1 or any(node in subgraph.get(node, set()) for node in comp)
48
+ ]
49
+ return ScheduleResult(order=order, cycles=cycles)
50
+
51
+
52
+ def _strongly_connected_components(graph: Dict[str, Set[str]]) -> List[Set[str]]:
53
+ index = 0
54
+ indices: Dict[str, int] = {}
55
+ lowlinks: Dict[str, int] = {}
56
+ stack: List[str] = []
57
+ on_stack: Set[str] = set()
58
+ components: List[Set[str]] = []
59
+
60
+ def visit(node: str) -> None:
61
+ nonlocal index
62
+ indices[node] = index
63
+ lowlinks[node] = index
64
+ index += 1
65
+ stack.append(node)
66
+ on_stack.add(node)
67
+ for neighbor in graph.get(node, set()):
68
+ if neighbor not in indices:
69
+ visit(neighbor)
70
+ lowlinks[node] = min(lowlinks[node], lowlinks[neighbor])
71
+ elif neighbor in on_stack:
72
+ lowlinks[node] = min(lowlinks[node], indices[neighbor])
73
+ if lowlinks[node] == indices[node]:
74
+ component: Set[str] = set()
75
+ while True:
76
+ popped = stack.pop()
77
+ on_stack.discard(popped)
78
+ component.add(popped)
79
+ if popped == node:
80
+ break
81
+ components.append(component)
82
+
83
+ for node in graph:
84
+ if node not in indices:
85
+ visit(node)
86
+
87
+ return components
@@ -0,0 +1,250 @@
1
+ Metadata-Version: 2.4
2
+ Name: gabion
3
+ Version: 0.1.0
4
+ Summary: Architectural linter that stabilizes loose parameters into structural bundles.
5
+ Project-URL: Repository, https://github.com/mikemol/gabion
6
+ Project-URL: Issues, https://github.com/mikemol/gabion/issues
7
+ Project-URL: Releases, https://github.com/mikemol/gabion/releases
8
+ Author-email: Mike Mol <mikemol@gmail.com>
9
+ License: Apache-2.0
10
+ License-File: LICENSE
11
+ Keywords: architecture,lint,linter,refactoring,static-analysis
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: Apache Software License
15
+ Classifier: Programming Language :: Python :: 3 :: Only
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Software Development :: Quality Assurance
20
+ Requires-Python: >=3.11
21
+ Requires-Dist: libcst>=1.1
22
+ Requires-Dist: pydantic>=2.5
23
+ Requires-Dist: pygls>=1.3
24
+ Requires-Dist: rich>=13.0
25
+ Requires-Dist: typer>=0.9
26
+ Description-Content-Type: text/markdown
27
+
28
+ ---
29
+ doc_revision: 45
30
+ reader_reintern: "Reader-only: re-intern if doc_revision changed since you last read this doc."
31
+ doc_id: readme
32
+ doc_role: readme
33
+ doc_scope:
34
+ - repo
35
+ - overview
36
+ - tooling
37
+ doc_authority: informative
38
+ doc_requires:
39
+ - POLICY_SEED.md
40
+ - glossary.md
41
+ - AGENTS.md
42
+ - CONTRIBUTING.md
43
+ doc_change_protocol: "POLICY_SEED.md §6"
44
+ doc_erasure:
45
+ - formatting
46
+ - typos
47
+ doc_owner: maintainer
48
+ ---
49
+
50
+ # Gabion
51
+
52
+ [![CI](https://github.com/mikemol/gabion/actions/workflows/ci.yml/badge.svg)](https://github.com/mikemol/gabion/actions/workflows/ci.yml)
53
+
54
+ Gabion is an architectural linter that stabilizes loose parameters into
55
+ structural bundles. It discovers recurring argument groups in a Python codebase
56
+ and guides their reification into dataclass-based Protocols.
57
+
58
+ This repo contains scaffolded infrastructure plus a prototype dataflow audit.
59
+ Synthesis and refactoring exist as evolving prototypes and are intentionally
60
+ conservative.
61
+
62
+ ## Why Gabion
63
+ - **Find implicit structure:** detect “dataflow grammar” bundles that repeatedly
64
+ travel together across function boundaries.
65
+ - **Refactor safely:** promote bundles into explicit dataclass Protocols.
66
+ - **Govern meaning:** enforce semantics via a normative glossary.
67
+
68
+ ## Status
69
+ - CLI uses the LSP server as its semantic core.
70
+ - Dataflow grammar audit is implemented (prototype).
71
+ - Type-flow, constant-flow, and unused-argument smells are implemented (prototype).
72
+ - Refactor engine can rewrite signatures/call sites for targeted functions (prototype).
73
+ - Governance layer is active.
74
+
75
+ ## Versioning (pre-1.0)
76
+ Gabion is pre-1.0. Until a 1.0 release, minor version bumps (0.x) may include
77
+ breaking changes; patch releases target fixes. Breaking changes will be called
78
+ out in release notes.
79
+
80
+ ## Branching model
81
+ - `stage` is the integration branch for routine pushes; CI runs on every push.
82
+ - `main` is protected and receives changes via PRs from `stage`.
83
+ - Merge commits are allowed; merges to `main` should be regular merges (no squash).
84
+ - `stage` accumulates changes and may include merge commits from `main` as it stays in sync.
85
+
86
+ ## Convergence checklist
87
+ Bottom-up convergence targets live in `docs/sppf_checklist.md`.
88
+
89
+ ## Governance addenda (optional)
90
+ See `docs/doer_judge_witness.md` for optional role framing.
91
+
92
+ ## Non-goals (for now)
93
+ - Docflow is a repo-local convenience feature, not a Gabion product feature.
94
+ - Public-API compatibility shims for refactors are not yet implemented.
95
+ - Multi-language support is out of scope (Python-first).
96
+
97
+ ## Quick start
98
+ Install toolchain with `mise` (once):
99
+ ```
100
+ mise install
101
+ ```
102
+
103
+ Install from source (editable):
104
+ ```
105
+ mise exec -- python -m pip install -e .
106
+ ```
107
+
108
+ Install git hooks (optional):
109
+ ```
110
+ scripts/install_hooks.sh
111
+ ```
112
+
113
+ Commands below assume the package is installed (editable) or `PYTHONPATH=src`.
114
+
115
+ Run the dataflow grammar audit (strict defaults):
116
+ ```
117
+ mise exec -- python -m gabion check
118
+ ```
119
+ `gabion check` enforces violations even without `--report` output.
120
+ Use `--baseline path/to/baseline.txt` to ratchet existing violations and
121
+ `--baseline-write` to generate/update the baseline file.
122
+
123
+ Run the dataflow grammar audit (prototype):
124
+ ```
125
+ mise exec -- python -m gabion dataflow-audit path/to/project
126
+ ```
127
+ Repo defaults are driven by `gabion.toml` (see `[dataflow]`).
128
+ By default, `in/` (inspiration) is excluded from enforcement there.
129
+ Use `--synthesis-plan` to emit a JSON plan and `--synthesis-report` to append a
130
+ summary section to the Markdown report. Use `--synthesis-protocols` to emit
131
+ dataclass stubs (prototype) for review, or add
132
+ `--synthesis-protocols-kind protocol` for typing.Protocol stubs.
133
+ Use `--refactor-plan` to append a per-bundle refactoring schedule and
134
+ `--refactor-plan-json` to emit the JSON plan.
135
+
136
+ Generate protocol refactor edits (prototype):
137
+ ```
138
+ mise exec -- python -m gabion refactor-protocol \
139
+ --protocol-name BundleProtocol \
140
+ --bundle a --bundle b \
141
+ --target-path path/to/module.py \
142
+ --target-function foo
143
+ ```
144
+
145
+ Run audit + synthesis in one step (timestamped output under `artifacts/synthesis`):
146
+ ```
147
+ mise exec -- python -m gabion synth path/to/project
148
+ ```
149
+
150
+ Run the docflow audit (governance docs only):
151
+ ```
152
+ mise exec -- python -m gabion docflow-audit
153
+ ```
154
+
155
+ Note: docflow is a repo-local convenience feature. It is not a core Gabion
156
+ capability and is not intended to generalize beyond this repository.
157
+
158
+ Generate a synthesis plan from a JSON payload (prototype scaffolding):
159
+ ```
160
+ mise exec -- python -m gabion synthesis-plan --input path/to/payload.json --output plan.json
161
+ ```
162
+ Example payload:
163
+ ```json
164
+ {
165
+ "bundles": [
166
+ { "bundle": ["ctx", "config"], "tier": 2 }
167
+ ],
168
+ "field_types": {
169
+ "ctx": "Context",
170
+ "config": "Config"
171
+ }
172
+ }
173
+ ```
174
+ Payload schema: `docs/synthesis_payload.md`.
175
+
176
+ Capture an audit snapshot (reports + DOT graph under `artifacts/`):
177
+ ```
178
+ scripts/audit_snapshot.sh
179
+ ```
180
+ Snapshots now include a synthesis plan JSON and protocol stub file.
181
+ Show the latest snapshot paths:
182
+ ```
183
+ scripts/latest_snapshot.sh
184
+ ```
185
+
186
+ ## Editor integration
187
+ The VS Code extension stub lives in `extensions/vscode` and launches the
188
+ Gabion LSP server over stdio. It is a thin wrapper only.
189
+
190
+ ## Quick commands (make)
191
+ ```
192
+ make bootstrap
193
+ make check
194
+ make check-ci
195
+ make test
196
+ make test-logs
197
+ make clean-artifacts
198
+ make docflow
199
+ make dataflow
200
+ make lsp-smoke
201
+ make audit-snapshot
202
+ make audit-latest
203
+ ```
204
+
205
+ ## CI
206
+ GitHub-hosted CI runs `gabion check`, docflow audit, and pytest using `mise`
207
+ as defined in `.github/workflows/ci.yml`.
208
+ If `POLICY_GITHUB_TOKEN` is set, the posture check also runs on pushes.
209
+
210
+ Allow-listed actions are defined in `docs/allowed_actions.txt`.
211
+
212
+ Pull requests also get a dataflow-grammar report artifact (and a comment on
213
+ same-repo PRs) via `.github/workflows/pr-dataflow-grammar.yml`.
214
+
215
+ ## GitHub Action (redistributable)
216
+ A composite action wrapper lives at `.github/actions/gabion`.
217
+ It installs Gabion via pip and runs `gabion check` (or another subcommand).
218
+ See `.github/actions/gabion/README.md` for usage and pinning guidance.
219
+ Example workflow (with pinned SHA placeholders):
220
+ `docs/workflows/gabion_action_example.yml`.
221
+ Pinning guide: `docs/pinning_actions.md`.
222
+
223
+ ## Architecture (planned shape)
224
+ - **LSP-first:** the language server is the semantic core; the CLI is a thin
225
+ LSP client. Editor integrations remain thin wrappers over the same server.
226
+ The server is the single source of truth for diagnostics and code actions.
227
+ - **Analysis:** import resolution, alias-aware identity tracking, fixed-point
228
+ bundle propagation, and tiering. Type-flow, constant-flow, and unused-argument
229
+ audits are part of the prototype coverage.
230
+ - **Reports:** Mermaid/DOT graph outputs and a violations list from the audit.
231
+ - **Synthesis:** Protocol generation, bundle-merge heuristics, and refactoring
232
+ assistance (callee-first/topological schedule).
233
+
234
+ See `in/` for design notes and the prototype audit script.
235
+
236
+ ## Governance
237
+ This repository is governed by two co-equal contracts:
238
+ - `POLICY_SEED.md` (execution and CI safety)
239
+ - `glossary.md` (semantic meanings and commutation obligations)
240
+
241
+ LLM/agent behavior is governed by `AGENTS.md`.
242
+
243
+ ## Cross-references
244
+ - `CONTRIBUTING.md` defines workflow guardrails and dataflow grammar rules.
245
+ - `AGENTS.md` defines LLM/agent obligations.
246
+ - `POLICY_SEED.md` defines execution and CI safety constraints.
247
+ - `glossary.md` defines semantic meanings, axes, and commutation obligations.
248
+
249
+ ## License
250
+ Apache-2.0. See `LICENSE`.
@@ -0,0 +1,26 @@
1
+ gabion/__init__.py,sha256=IuUZho6f7uzs3D8wgAQM1OpCgmJ949PXd24oq-GEufE,77
2
+ gabion/__main__.py,sha256=pZ3SvIhFpELK_ry4qcOI8tt_81PydhzJMS-AQUpfO4Q,129
3
+ gabion/cli.py,sha256=ncGtAWwWYY2GZEkxvxVKtOcgAjCFHldzwIQBe5OPAak,20002
4
+ gabion/config.py,sha256=4kg0x03fP2-A8LuXe3QikED6jZbDFfzr9IQaMge7Ua4,1235
5
+ gabion/lsp_client.py,sha256=XA8uuxolRPhcbMHpjUVgrnFw3PMuMGzm5bBCakqDvPk,3277
6
+ gabion/schema.py,sha256=QG1tYTFDqrafvWwrRjyfD44ufoh45vvynJwoMxiMT1w,1725
7
+ gabion/server.py,sha256=n4bVYYwW-cjydfFJCpbgFUqJVMX-nyPj3OKJvbH5LaU,16083
8
+ gabion/analysis/__init__.py,sha256=jq1C9ie-II8eWZtPH-yBijEApWOCFsszSXwhd1Msk0Q,793
9
+ gabion/analysis/dataflow_audit.py,sha256=Nqdacgk6X2x3rdUlk2fKhn-J2bkk1mXHc2ga8X7Slio,111937
10
+ gabion/analysis/engine.py,sha256=Ec0DL9eCc_4kedI9eiEZM9qDK79AWzbIio6iD9Yf47o,198
11
+ gabion/analysis/model.py,sha256=d4f3Vb_3a-trbP5L0yHkmniK8mh43lVFgv40QsXYeZo,846
12
+ gabion/analysis/visitors.py,sha256=8gjLMhP7I_aWgGhCqX7xb9KyVysgfeRTA-hCrPqainE,16460
13
+ gabion/refactor/__init__.py,sha256=J1TlmgUgl86tSZnh7hZOL9M6pA2cf0cLTsyuOuA1qCc,225
14
+ gabion/refactor/engine.py,sha256=1DyoZ8Riln2cA730OZDa4Jm4zT_y76m7merqFuJ60MQ,26860
15
+ gabion/refactor/model.py,sha256=GVdVNUXT9kFpoTvgZ17X4vzSRe8OnqQf6Rji-mWiRL4,820
16
+ gabion/synthesis/__init__.py,sha256=G76-Jp_OX9_UEJmuYi14XrJHlyMtU2k-gH77RMD8PLg,622
17
+ gabion/synthesis/merge.py,sha256=2758qL2xGmB9lXC_jvqrxK6bTD8Vmrt1YTH_5_5jKg0,1193
18
+ gabion/synthesis/model.py,sha256=cBHltcdLmCRneE2fgi3hA36A6UzU9E0YuTmKiCOk17I,968
19
+ gabion/synthesis/naming.py,sha256=I7FXFkxoTXEog63CA8FjPNkcp0DzPn-WzncLLlABH4E,1262
20
+ gabion/synthesis/protocols.py,sha256=OdxbVUsj_DmKSNlZeaFgRIu46_on2qV4ge3K8bquXGY,2470
21
+ gabion/synthesis/schedule.py,sha256=_1SBktOR5X5hl1z91tVXht8ZPIrY8wXP3SaxWh3K9xI,2835
22
+ gabion-0.1.0.dist-info/METADATA,sha256=_eQVSisUWWYIhF4ofE3PnwUfUO-OhlTkB4Y0LlF2n0Q,8479
23
+ gabion-0.1.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
24
+ gabion-0.1.0.dist-info/entry_points.txt,sha256=Deu--5uPUKZKcsVfXvAj8h_0T7K52PLieJttYCrlRG8,74
25
+ gabion-0.1.0.dist-info/licenses/LICENSE,sha256=ZlxQIqhO3NX4-cv0ineYuyIeQJRuu43qq2p_J2OWvX4,10735
26
+ gabion-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.28.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ gabion = gabion.cli:app
3
+ gabion-ls = gabion.server:start
@@ -0,0 +1,190 @@
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, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2026 Mike Mol
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.