sqlite-ursula 0.11.3.dev0__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,183 @@
1
+ Metadata-Version: 2.5
2
+ Name: sqlite-ursula
3
+ Version: 0.11.3.dev0
4
+ Summary: SQLite replicated through an Ursula stream by the sqlite-ursula-vfs extension, for the stdlib sqlite3 module: commits are local and replicate in the background, and db.synced() is the output gate
5
+ Project-URL: Homepage, https://ursula.tonbo.io/docs/examples/sqlite-vfs
6
+ Project-URL: Repository, https://github.com/tonbo-io/ursula
7
+ Project-URL: Issues, https://github.com/tonbo-io/ursula/issues
8
+ License-Expression: Apache-2.0
9
+ License-File: LICENSE
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Operating System :: MacOS
13
+ Classifier: Operating System :: POSIX :: Linux
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3 :: Only
16
+ Classifier: Programming Language :: Python :: Free Threading :: 2 - Beta
17
+ Classifier: Topic :: Database
18
+ Requires-Python: >=3.11
19
+ Provides-Extra: langgraph
20
+ Requires-Dist: langgraph-checkpoint-sqlite<3.2,>=3.0.3; extra == 'langgraph'
21
+ Description-Content-Type: text/markdown
22
+
23
+ # sqlite-ursula
24
+
25
+ SQLite databases replicated through [Ursula](https://ursula.tonbo.io) streams, for the stdlib `sqlite3` module of CPython 3.11 or later. The Python peer of the npm package [`@tonbo/sqlite-ursula`](https://github.com/tonbo-io/ursula/tree/main/clients/sqlite-ursula).
26
+
27
+ ```python
28
+ import sqlite_ursula
29
+
30
+ db = sqlite_ursula.open("https://streams.example.com/acme/notes")
31
+ db.execute("CREATE TABLE IF NOT EXISTS notes(id INTEGER PRIMARY KEY, body TEXT)")
32
+ db.execute("INSERT INTO notes(body) VALUES (?)", ("hello",))
33
+ db.commit() # committed on this host
34
+ db.synced() # this database's commits are in the stream, and this process still owns it
35
+ send(reply)
36
+ ```
37
+
38
+ **The one rule:** before anything outside the process acts on what you wrote or read (a response, a queue acknowledgement, a call to another service), call `db.synced()`, `await db.asynced()`, or wrap the work in `with gate(db)` or `async with agate(db)`.
39
+
40
+ A commit is local. The extension appends it to a log it owns and replicates the log to the stream in the background, on threads of its own. `synced()` returns once the stream holds every commit the process made on that database before the call, and a round trip that started after the call found this process still the owner. Scripts call it before they exit.
41
+
42
+ ## Hosts
43
+
44
+ The extension loads into the `sqlite3` module's own SQLite and becomes its default VFS, so every `sqlite3.connect(path)` of a bound database in the process replicates, a framework's included. That takes a Python whose `sqlite3` loads extensions and runs a SQLite the extension supports. The extension's refusal of an older one names the version it needs.
45
+
46
+ | Python | hosts the extension |
47
+ | --- | --- |
48
+ | uv-managed CPython (`uv python install`), Homebrew, conda-forge | yes |
49
+ | `python:3.x-alpine` (Alpine 3.23 or newer) | yes, on x64 |
50
+ | `python:3.x-slim`, Debian and Ubuntu `apt`, RHEL and UBI, Amazon Linux, Colab | no: SQLite older than the extension supports |
51
+ | the python.org macOS installer, Apple's `/usr/bin/python3`, pyenv's default build | no: built without loadable extensions |
52
+ | Windows | no: use WSL |
53
+
54
+ On a Python that cannot host it, `open()` raises `UrsulaSetupError` with kind `host_unsupported`, whose `fix` says what to do for that reason: a Python that can host it, WSL on Windows, or `SQLITE_URSULA_VFS` where the install carries no library. `python -m sqlite_ursula` runs the same check and prints what it found.
55
+
56
+ ### Docker
57
+
58
+ Switch the base image in one line:
59
+
60
+ ```diff
61
+ -FROM python:3.13-slim
62
+ +FROM python:3.13-alpine
63
+ ```
64
+
65
+ [`recipes/Dockerfile`](https://github.com/tonbo-io/ursula/blob/main/clients/sqlite-ursula-python/recipes/Dockerfile) is a complete example. To keep a Debian base, on arm64, or with the [`langgraph` extra](#langgraph), which does not install on Alpine, run a uv-managed CPython instead, as [`recipes/Dockerfile.uv`](https://github.com/tonbo-io/ursula/blob/main/clients/sqlite-ursula-python/recipes/Dockerfile.uv) does.
66
+
67
+ On macOS, use uv or Homebrew.
68
+
69
+ ## open
70
+
71
+ `open(url, *, token, dir, read_only, recreate, max_pending_bytes, timeout, busy_timeout, **connect_kwargs)` returns an `UrsulaConnection`, a `sqlite3.Connection` subclass, so every library that takes one takes it.
72
+
73
+ - The first open of a stream in the process binds its cache in `dir` (by default `<user cache>/sqlite-ursula/0.8`), catches it up and claims the stream: the last open that reaches the stream owns it. Later opens in the process return another connection on the same binding, with no network. Concurrent opens from any thread share one.
74
+ - `token` is the bearer token requests carry. One token per process: `set_token(token)` replaces it, and `set_token(None)` goes back to `URSULA_VFS_TOKEN_FILE`.
75
+ - The open gives up after `timeout` seconds (30 by default) with `UrsulaUnavailableError`, whose kind is the last condition it met. Ctrl-C cancels it too.
76
+ - `busy_timeout` is `sqlite3.connect`'s `timeout`, 5 seconds by default, since a binding's connections share its files. The other keywords go to `sqlite3.connect`. `check_same_thread` is `False` unless given.
77
+ - `autocommit=False` (Python 3.12 or newer) is refused with `invalid_argument`. In that mode the connection is always in a transaction: CPython's own `ROLLBACK` after a refused `COMMIT` would hide the refusal, and a connection kept open would hold a read snapshot that stops checkpoints. Use the default transaction control, `isolation_level=None` or `autocommit=True`.
78
+ - `read_only=True` claims nothing and never fences the owner, and writes fail with `SQLITE_READONLY`.
79
+ - `db.close()` closes the connection. Once a binding's last connection closes, replication drains in the background and the binding retires. Keep `db` open while a framework uses `db.path`.
80
+
81
+ `UrsulaConnection` adds `name` (the stream's path, such as `/acme/notes`), `path` (the local database file, which frameworks open by path), `synced(timeout=None)`, `asynced(timeout=None)` ([asyncio](#asyncio)), `status()` and `on_reset(callback)` / `off_reset(callback)`.
82
+
83
+ ```python
84
+ db = sqlite_ursula.open(url)
85
+ other = sqlite3.connect(db.path) # a framework's own connection: it replicates too
86
+ ```
87
+
88
+ `synced()` covers every connection of the process on this database (`db.path`), a framework's included, and no other: gate each database an output depends on. A negative or non-numeric `timeout` is `invalid_argument`. It raises `TimeoutError` after `timeout` seconds while the commits keep replicating, and `UrsulaResetError` on a reset. Network failures never raise from it: it waits. Ctrl-C interrupts it.
89
+
90
+ `import_sqlite(url, file, *, token, timeout)` makes a plain SQLite file with 4096-byte pages the first snapshot of a new stream, then `open()` it as any other.
91
+
92
+ ## asyncio
93
+
94
+ `aopen()` takes the arguments `open()` takes and returns the same `UrsulaConnection`, and `db.asynced(timeout=None)` is `synced()`. Both wait on the event loop instead of blocking it, and neither uses the loop's default executor.
95
+
96
+ ```python
97
+ db = await sqlite_ursula.aopen(url)
98
+ db.execute("INSERT INTO notes(body) VALUES (?)", ("hello",))
99
+ db.commit()
100
+ await db.asynced()
101
+ send(reply)
102
+ ```
103
+
104
+ Cancelling `asynced()`, as `asyncio.timeout` around it does, ends the wait while the commits keep replicating. Cancelling `aopen()` cancels the bind, so it never goes on to claim the stream. Statements still run on the calling thread, as they do with `sqlite3`.
105
+
106
+ ## Gates
107
+
108
+ `gate(*dbs, timeout=None)` and `agate(*dbs, timeout=None)` wrap a block of work: leaving the block waits for a `synced()` call made after it ended, on every database given, before the result or the block's error goes on.
109
+
110
+ ```python
111
+ with sqlite_ursula.gate(db):
112
+ reply = handle(request)
113
+ send(reply)
114
+
115
+ async with sqlite_ursula.agate(db, other):
116
+ reply = await handle(request)
117
+ await send(reply)
118
+ ```
119
+
120
+ - A block that only read waits too, since it may have read another connection's pending commit.
121
+ - An `UrsulaError` the block raises passes at once, as the block raised it, also when a library wrapped it (as `__cause__`, as SQLAlchemy's `.orig`, or in an `ExceptionGroup`). So does a raw `sqlite3` error of a framework's own connection that the extension classifies, also wrapped. With one database, a bare raw error that the extension names a refused write or a reset raises as that `UrsulaError`, which is a `sqlite3.OperationalError` too.
122
+ - Every other error waits as a result does, then passes. Ctrl-C and cancellations pass at once.
123
+ - The wait covers every database at once. A reset during it raises the `UrsulaResetError` instead of the outcome, and a failure on one database ends the wait on the others.
124
+ - `timeout` bounds the wait, not the block, and raises `TimeoutError`.
125
+
126
+ Effects inside the block, such as a call to another service, are not gated: call `db.synced()` before them.
127
+
128
+ ## LangGraph
129
+
130
+ `sqlite_ursula.langgraph` holds LangGraph's SQLite checkpointers and stores on a replicated database. Install it with the `langgraph` extra, which pins `langgraph-checkpoint-sqlite` to the releases CI tests (3.0.3 up to 3.2):
131
+
132
+ ```sh
133
+ pip install 'sqlite-ursula[langgraph]'
134
+ ```
135
+
136
+ ```python
137
+ import sqlite_ursula
138
+ from sqlite_ursula.langgraph import UrsulaSaver
139
+
140
+ db = sqlite_ursula.open(url)
141
+ with UrsulaSaver(db) as saver:
142
+ graph = builder.compile(checkpointer=saver)
143
+ reply = graph.invoke(inputs, {"configurable": {"thread_id": "1"}})
144
+ send(reply) # every checkpoint of the run is in the stream
145
+ ```
146
+
147
+ | class | LangGraph's | closed by |
148
+ | --- | --- | --- |
149
+ | `UrsulaSaver(db)` | `SqliteSaver` | `close()` or `with` |
150
+ | `await AsyncUrsulaSaver.open(db)` | `AsyncSqliteSaver` | `aclose()` or `async with` |
151
+ | `UrsulaStore(db)` | `SqliteStore` | `close()` or `with` |
152
+ | `await AsyncUrsulaStore.open(db)` | `AsyncSqliteStore` | `aclose()` or `async with` |
153
+
154
+ - Each class opens a connection of its own on `db`'s binding, the async ones through aiosqlite, and closing it closes that connection. LangGraph writes checkpoints from threads of its own while the graph's nodes run, so the application keeps `db` for its own statements. The savers' connections keep SQLite's default transaction control, which makes each checkpoint, each task's writes and each deleted thread one transaction, whatever `db`'s is. The stores' connections open no transactions of their own, since `SqliteStore` runs its own `BEGIN` and `COMMIT`. Each connection is bound as `db` is: read-only when `db` is, with `db`'s busy timeout, and its errors are the package's.
155
+ - Every write returns once `db.synced()` (or `asynced()`) returned after it: a checkpoint, a task's writes, a deleted thread, a store put or delete, a store get or search that refreshes TTLs (`refresh_on_read`), a TTL sweep. LangGraph waits for a run's checkpoint writes before `invoke` returns, so the return is gated in every durability mode. With `durability="sync"`, each step also waits for the one before it, so what a node does rests on acknowledged checkpoints.
156
+ - Reads do not wait, and neither does the setup that creates the tables, which LangGraph runs before the first read: the next write's wait covers it. `AsyncUrsulaStore` waits in `aput` and `adelete`, not in the task that runs its batches, so a read never waits behind another call's write. Its `abatch` and `batch`, which take operations, are LangGraph's own: call `db.asynced()` after them.
157
+ - `stream()` and `astream()` yield a step's chunks before that step's checkpoint is acknowledged, and only the end of the iteration is gated. Call `db.synced()` or `await db.asynced()` before acting on a chunk.
158
+ - A write refused with `backlog_full` committed nothing: it waits for `synced()` and runs again. That is safe because each of these writes is one transaction. An `AsyncUrsulaStore` read batched with a refused write runs again at once. LangGraph's setup commits its statements one by one, and a store's migrations are not safe to run twice, so there each refused statement waits and runs again by itself. In the async adapters that wait blocks aiosqlite's thread until the stream acknowledges the commits pending before it, even when the caller of the setup is cancelled.
159
+ - A reset raises the `UrsulaResetError`, from a write or a read. Keep `db` open while the graph runs.
160
+ - `sqlite-vec`, which `langgraph-checkpoint-sqlite` requires, has no wheel for musl, so the extra does not install on Alpine. Use a Debian base with a uv-managed CPython, as [`recipes/Dockerfile.uv`](https://github.com/tonbo-io/ursula/blob/main/clients/sqlite-ursula-python/recipes/Dockerfile.uv) does.
161
+
162
+ ## Errors
163
+
164
+ Four classes with `kind` and `action` (`retry`, `reopen`, `stop`, `fix`), whose cause (`__cause__`) is the SQLite error they replace. Branch on `action`. The extension says which failure is which (`ursula_classify`).
165
+
166
+ | class | raised by | kinds |
167
+ | --- | --- | --- |
168
+ | `UrsulaWriteRefusedError` | a write or COMMIT, nothing committed, and a gate for a framework connection's refusal | `backlog_full` (`retry` after `synced()`), `unsupported`, `too_large` |
169
+ | `UrsulaResetError` | every statement after a reset, `synced()`, `asynced()`, a gate, `on_reset` callbacks | `fenced` (`stop`), `stale`, `rewound`, `deleted`, `local_damage`, `stream_state`, `internal` |
170
+ | `UrsulaUnavailableError` | `open()` or `aopen()` past its timeout | the last condition: `unreachable`, `unavailable`, `rate_limited`, `unauthorized`, `payment_required`, `forbidden`, or `cancelled` |
171
+ | `UrsulaSetupError` | `open()`, `aopen()`, `import_sqlite()`, the calls the package guards in a forked child ([Forks](#forks)) | `host_unsupported`, `forked`, `invalid_url`, `invalid_argument`, `not_found`, `in_use`, `bound_elsewhere`, `local_setup`, and the rest of the extension's |
172
+
173
+ `UrsulaWriteRefusedError` and `UrsulaResetError` are also `sqlite3.OperationalError`, as the error they replace was, so existing `except sqlite3.OperationalError` clauses keep catching them, and `sqlite_errorcode` and `sqlite_errorname` are SQLite's. A transaction helper's `ROLLBACK` after one, or its `COMMIT` in a `finally` block, which finds no transaction since SQLite rolled it back, does not hide it.
174
+
175
+ A reset rejects the database's pending `synced()` calls first, then runs its `on_reset` callbacks once, on a thread of the package's.
176
+
177
+ ## Forks
178
+
179
+ Open databases after a fork, never before: the extension's replication does not survive `fork()`. In a child forked after its parent opened a database, `open()`, `aopen()`, `import_sqlite()` and `set_token()` raise `forked`, and so do the statements, transactions, `synced()`, `asynced()`, `status()` and `on_reset()` of an inherited `UrsulaConnection`, whose `close()` does nothing. Its other `sqlite3.Connection` methods (`backup`, `blobopen`, `serialize` and the like) and a framework's own connections on `db.path` are not the package's to guard: the extension fails their I/O on a bound file in the child. Importing the package before the fork is fine. Use gunicorn's `post_fork` hook, Celery's `worker_process_init` signal, or multiprocessing's `spawn` or `forkserver` start method.
180
+
181
+ ## The extension
182
+
183
+ The package loads the extension its wheel carries, or the one `SQLITE_URSULA_VFS` names, built from [`clients/sqlite-vfs`](https://github.com/tonbo-io/ursula/tree/main/clients/sqlite-vfs). Wheels carry it for Linux x64 and arm64 with glibc 2.28 or newer, Linux x64 with musl, and macOS 11 or newer on arm64. Elsewhere the installer picks the wheel without a library, and `open()` raises `host_unsupported` unless `SQLITE_URSULA_VFS` names one. The design is [`docs/architecture/sqlite-vfs.md`](https://github.com/tonbo-io/ursula/blob/main/docs/architecture/sqlite-vfs.md).
@@ -0,0 +1,17 @@
1
+ sqlite_ursula/__init__.py,sha256=CQTyrA8koOwADxgVLRAJCVnnC2ggxjv8A-GHeVHD5Hg,2980
2
+ sqlite_ursula/__main__.py,sha256=MSVApQPAxRYo_oyVckzjvP-R3m64KOvV0opIMblczKw,122
3
+ sqlite_ursula/_args.py,sha256=gWXcbOvXNMLnuEt8LnCBgbKn5Me5VN8Qsfg4yt-w2Kg,1570
4
+ sqlite_ursula/_connection.py,sha256=f_lOJ_lN9m36Vl9B4yimAvhqTJ5UH_lFChyjceo60xY,15874
5
+ sqlite_ursula/_control.py,sha256=hfmW3fF7oGGmUHlcZ6BM_EuBLdxfLC7RT_uwXx0u7EA,7481
6
+ sqlite_ursula/_doctor.py,sha256=zQT5fHACBBLm2tqsr4EsBRB8qsICsK62jhzafxQpIcs,1448
7
+ sqlite_ursula/_events.py,sha256=22Fy2c7DcG-8ktLqMaSsjYXwmWK3YrF-d2tjrnm6FkA,17928
8
+ sqlite_ursula/_gate.py,sha256=Gu6xZDQLe8t-_DrOqHtQPzkGKgbZU2_68ifeRA-f8RU,5813
9
+ sqlite_ursula/_host.py,sha256=P__IaTgJ7eNntUVfTubarE0qnMWHrhrjD5Jli0DRp_A,6086
10
+ sqlite_ursula/_open.py,sha256=YAMeOsfdX4BlmKeJ6pUK_xDCKFOpSq09RJ2BU55ptpk,17206
11
+ sqlite_ursula/errors.py,sha256=1j7dHwmtk5hjgnRnQWrcyw2RRgAz0GvQFymxjC3aWq0,6834
12
+ sqlite_ursula/langgraph.py,sha256=x6-5OuRDYM1S0TFYGkb5pX16fPL7LWOjbtznsA8MFk4,19368
13
+ sqlite_ursula/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
+ sqlite_ursula-0.11.3.dev0.dist-info/METADATA,sha256=2wTIMV5Bat3CvmuSVKd54JiU4HSW7nJ-LFoRfJByfCw,15639
15
+ sqlite_ursula-0.11.3.dev0.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
16
+ sqlite_ursula-0.11.3.dev0.dist-info/licenses/LICENSE,sha256=mVNyV0yqEpKcDz4AyumbDLjmDBvaSn0UkQdPT6wHuOg,11295
17
+ sqlite_ursula-0.11.3.dev0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.32.4
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,201 @@
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 describing the origin of the Work and
141
+ 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 Support. 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 support.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 The Ursula contributors
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
200
+ implied. See the License for the specific language governing
201
+ permissions and limitations under the License.