vestigo 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.
vestigo-0.1.0/LICENSE ADDED
@@ -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 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
+ 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 [yyyy] [name of copyright owner]
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 implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
vestigo-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,133 @@
1
+ Metadata-Version: 2.4
2
+ Name: vestigo
3
+ Version: 0.1.0
4
+ Summary: The ledger of the shared computation substrate: versioned artifacts, builds and their leases, references, retention, on SQLite or PostgreSQL.
5
+ Author: Fangchen Li
6
+ Author-email: Fangchen Li <fangchen.li@outlook.com>
7
+ License-Expression: Apache-2.0
8
+ License-File: LICENSE
9
+ Classifier: Development Status :: 2 - Pre-Alpha
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Classifier: Programming Language :: Python :: 3.13
14
+ Classifier: Programming Language :: Python :: 3.14
15
+ Requires-Dist: azure-storage-blob>=12.20.0 ; extra == 'azure'
16
+ Requires-Dist: azure-identity>=1.25.3 ; extra == 'azure'
17
+ Requires-Dist: google-cloud-storage>=3.0.0 ; extra == 'gcs'
18
+ Requires-Dist: psycopg[binary]>=3.1 ; extra == 'postgres'
19
+ Requires-Dist: psycopg-pool>=3.2 ; extra == 'postgres'
20
+ Requires-Dist: boto3>=1.35.0 ; extra == 's3'
21
+ Requires-Python: >=3.12
22
+ Project-URL: Homepage, https://github.com/bearing-research/vestigo
23
+ Project-URL: Repository, https://github.com/bearing-research/vestigo
24
+ Project-URL: Changelog, https://github.com/bearing-research/vestigo/blob/main/CHANGELOG.md
25
+ Provides-Extra: azure
26
+ Provides-Extra: gcs
27
+ Provides-Extra: postgres
28
+ Provides-Extra: s3
29
+ Description-Content-Type: text/markdown
30
+
31
+ # vestigo
32
+
33
+ <!-- --8<-- [start:body] -->
34
+ The ledger of the shared computation substrate, factored out of Strata's
35
+ artifact store (ADR 002): immutable versioned artifacts deduplicated by
36
+ provenance hash, builds with leases and fenced attempts, mutable references
37
+ with compare-and-set and approval, retention and race-safe garbage
38
+ collection, all in one transaction discipline on SQLite or PostgreSQL, with
39
+ blob backends for local disk, S3, GCS and Azure.
40
+
41
+ Strata is its first consumer. The package imports nothing of Strata: a
42
+ consumer passes blob settings in (`BlobSettings`), registers the validators
43
+ `verify_artifacts` runs per content type (`register_validator`), and records
44
+ what a version holds (`retain`) or requires (`require`, `requires=` on
45
+ `create_artifact`), which garbage collection protects as one closure. A
46
+ structural graph of content-addressed nodes (`graph`) records what produced
47
+ a version (`definition_id`) and is walked with bounded traversals; the
48
+ ledger never parses a node's payload. A build's releases (`releases`) make
49
+ its outputs current together, any number of checkpoints and one final, each
50
+ fenced on the attempt's lease and accepted only once every output's bytes
51
+ are stored, and a build is found again by its computation
52
+ (`find_open_build`) for the attempt that resumes it; the typed operations a release carries (`operations`) move
53
+ references and assign authorities in the same transaction.
54
+ *Vestigo* is Latin for "I track down, I trace": the ledger traces every
55
+ artifact back to the computation and inputs that made it.
56
+ <!-- --8<-- [end:body] -->
57
+
58
+ ## Formal models
59
+
60
+ `formal/tla/` holds the TLA+ models of the two lifecycles this package
61
+ implements, `ArtifactLifecycle.tla` and `BuildLease.tla`, with the
62
+ configurations that found and then closed their bugs. `formal/README.md`
63
+ says how to run them.
64
+
65
+ Artifact and name URIs are ``{scheme}://artifact/{id}@v={n}`` and
66
+ ``{scheme}://name/{name}``; the scheme is ``vestigo`` unless the consumer calls
67
+ ``vestigo.uris.set_uri_scheme`` once at import (Strata uses ``strata``). The
68
+ scheme is persisted in ``input_versions`` rows, so a store keeps the scheme it
69
+ was written under.
70
+
71
+ ## API
72
+
73
+ The package exports nothing at its top level; a consumer imports each module.
74
+
75
+ - `vestigo.store`: `ArtifactStore(artifact_dir, blob_store=None, dialect=None,
76
+ read_only=False)`, the versioned artifacts with their names, aliases, tags,
77
+ pins, publications, retention (`retain`, `require`, `requires=` on
78
+ `create_artifact`)
79
+ and audit log; `register_validator(content_type, validate)`; the
80
+ `ArtifactVersion` record; `get_artifact_store` and `reset_artifact_store`
81
+ for the process-wide instance.
82
+ - `vestigo.sql_backend`: `SqliteDialect` (the default) and
83
+ `PostgresDialect(dsn)`, passed as `dialect=` to the stores; `SqlDialect` and
84
+ `StoreConnection`, the protocols they satisfy.
85
+ - `vestigo.blob_store`: `BlobSettings`, `LocalBlobStore`, `S3BlobStore`,
86
+ `GCSBlobStore`, `AzureBlobStore`.
87
+ - `vestigo.build_store`: `BuildStore(db_path, dialect=None)`, the builds with
88
+ their leases and attempts (`create_build`, `open_attempt`, `renew_lease`,
89
+ `find_open_build`, `complete_attempt_within`); `BuildState`, `AttemptState`.
90
+ - `vestigo.releases`: `ReleaseStore(artifacts, builds)`, a build's checkpoint
91
+ and final releases (`prepare`, `attach`, `accept`, `abandon`, `resume`,
92
+ `latest_accepted`, `reference`, `authority`); `Release`, `ReleaseBundle` and
93
+ the `ReleaseError` family.
94
+ - `vestigo.operations`: the typed operations a release runs in its transaction
95
+ (`CheckBuildLease`, `AssertReferenceRevision`, `AssignAuthority`,
96
+ `AdvanceReference`, `InsertAuditEvent`), with `to_json` and `from_json`.
97
+ - `vestigo.graph`: `GraphStore` (reached as `ArtifactStore.graph`: `put_batch`,
98
+ `get`, `inputs`, `ancestors`, `dependents`, `topological_order`), `NodeSpec`,
99
+ `Edge`, `Traversal(max_depth=MAX_DEPTH, max_nodes=MAX_NODES)`, the `CGN1` and
100
+ `CGD1` encoders (`node_id`, `cgn1_envelope`, `graph_definition_id`,
101
+ `cgd1_envelope`) and `identity_scope`.
102
+ - `vestigo.provenance`: `TransformSpec(executor, params, inputs)` and its
103
+ `canonical_json`, `compute_provenance_hash(input_hashes, spec)`,
104
+ `derive_subkey(parent_hash, *labels)` with `checkpoint_output_key` and
105
+ `run_output_key`, `parse_transform_spec`.
106
+ - `vestigo.uris`: `set_uri_scheme`, `uri_scheme`, `artifact_uri`,
107
+ `artifact_uri_prefix`, `name_uri_prefix`, `parse_artifact_uri`,
108
+ `parse_name_uri`, `LATEST_VERSION`.
109
+ - `vestigo.tables`: `LEDGER_TABLES`, the tables the ledger owns with their
110
+ copy order, and `TRANSIENT_TABLES`.
111
+ - `vestigo.file_modes`: `private_dir`, `private_file`, `narrow`, the modes the
112
+ stores create their directories and files with.
113
+
114
+ ## Install
115
+
116
+ ```bash
117
+ uv add vestigo # or: pip install vestigo; no dependencies beyond the stdlib
118
+ uv add "vestigo[postgres]" # PostgreSQL metadata; [s3], [gcs], [azure] bring each blob backend's SDK
119
+ ```
120
+
121
+ ## Development
122
+
123
+ ```bash
124
+ uv sync --all-extras # the package, every extra and the dev group
125
+ uv run pytest # the suite; Postgres and the object-store emulators run in Docker
126
+ uv run pre-commit run --all-files # ruff, ty, the lockfile check: what CI runs
127
+ uv run pre-commit run --hook-stage manual --all-files # the above plus pytest
128
+ ```
129
+
130
+ Strata's `tests/contract/` holds the cross-repository compatibility tests:
131
+ hash vectors for the graph encoders, operation schemas, output keys, and the
132
+ ledger's table inventory. A change to any of those is a contract change and
133
+ needs a matching Strata release.
@@ -0,0 +1,103 @@
1
+ # vestigo
2
+
3
+ <!-- --8<-- [start:body] -->
4
+ The ledger of the shared computation substrate, factored out of Strata's
5
+ artifact store (ADR 002): immutable versioned artifacts deduplicated by
6
+ provenance hash, builds with leases and fenced attempts, mutable references
7
+ with compare-and-set and approval, retention and race-safe garbage
8
+ collection, all in one transaction discipline on SQLite or PostgreSQL, with
9
+ blob backends for local disk, S3, GCS and Azure.
10
+
11
+ Strata is its first consumer. The package imports nothing of Strata: a
12
+ consumer passes blob settings in (`BlobSettings`), registers the validators
13
+ `verify_artifacts` runs per content type (`register_validator`), and records
14
+ what a version holds (`retain`) or requires (`require`, `requires=` on
15
+ `create_artifact`), which garbage collection protects as one closure. A
16
+ structural graph of content-addressed nodes (`graph`) records what produced
17
+ a version (`definition_id`) and is walked with bounded traversals; the
18
+ ledger never parses a node's payload. A build's releases (`releases`) make
19
+ its outputs current together, any number of checkpoints and one final, each
20
+ fenced on the attempt's lease and accepted only once every output's bytes
21
+ are stored, and a build is found again by its computation
22
+ (`find_open_build`) for the attempt that resumes it; the typed operations a release carries (`operations`) move
23
+ references and assign authorities in the same transaction.
24
+ *Vestigo* is Latin for "I track down, I trace": the ledger traces every
25
+ artifact back to the computation and inputs that made it.
26
+ <!-- --8<-- [end:body] -->
27
+
28
+ ## Formal models
29
+
30
+ `formal/tla/` holds the TLA+ models of the two lifecycles this package
31
+ implements, `ArtifactLifecycle.tla` and `BuildLease.tla`, with the
32
+ configurations that found and then closed their bugs. `formal/README.md`
33
+ says how to run them.
34
+
35
+ Artifact and name URIs are ``{scheme}://artifact/{id}@v={n}`` and
36
+ ``{scheme}://name/{name}``; the scheme is ``vestigo`` unless the consumer calls
37
+ ``vestigo.uris.set_uri_scheme`` once at import (Strata uses ``strata``). The
38
+ scheme is persisted in ``input_versions`` rows, so a store keeps the scheme it
39
+ was written under.
40
+
41
+ ## API
42
+
43
+ The package exports nothing at its top level; a consumer imports each module.
44
+
45
+ - `vestigo.store`: `ArtifactStore(artifact_dir, blob_store=None, dialect=None,
46
+ read_only=False)`, the versioned artifacts with their names, aliases, tags,
47
+ pins, publications, retention (`retain`, `require`, `requires=` on
48
+ `create_artifact`)
49
+ and audit log; `register_validator(content_type, validate)`; the
50
+ `ArtifactVersion` record; `get_artifact_store` and `reset_artifact_store`
51
+ for the process-wide instance.
52
+ - `vestigo.sql_backend`: `SqliteDialect` (the default) and
53
+ `PostgresDialect(dsn)`, passed as `dialect=` to the stores; `SqlDialect` and
54
+ `StoreConnection`, the protocols they satisfy.
55
+ - `vestigo.blob_store`: `BlobSettings`, `LocalBlobStore`, `S3BlobStore`,
56
+ `GCSBlobStore`, `AzureBlobStore`.
57
+ - `vestigo.build_store`: `BuildStore(db_path, dialect=None)`, the builds with
58
+ their leases and attempts (`create_build`, `open_attempt`, `renew_lease`,
59
+ `find_open_build`, `complete_attempt_within`); `BuildState`, `AttemptState`.
60
+ - `vestigo.releases`: `ReleaseStore(artifacts, builds)`, a build's checkpoint
61
+ and final releases (`prepare`, `attach`, `accept`, `abandon`, `resume`,
62
+ `latest_accepted`, `reference`, `authority`); `Release`, `ReleaseBundle` and
63
+ the `ReleaseError` family.
64
+ - `vestigo.operations`: the typed operations a release runs in its transaction
65
+ (`CheckBuildLease`, `AssertReferenceRevision`, `AssignAuthority`,
66
+ `AdvanceReference`, `InsertAuditEvent`), with `to_json` and `from_json`.
67
+ - `vestigo.graph`: `GraphStore` (reached as `ArtifactStore.graph`: `put_batch`,
68
+ `get`, `inputs`, `ancestors`, `dependents`, `topological_order`), `NodeSpec`,
69
+ `Edge`, `Traversal(max_depth=MAX_DEPTH, max_nodes=MAX_NODES)`, the `CGN1` and
70
+ `CGD1` encoders (`node_id`, `cgn1_envelope`, `graph_definition_id`,
71
+ `cgd1_envelope`) and `identity_scope`.
72
+ - `vestigo.provenance`: `TransformSpec(executor, params, inputs)` and its
73
+ `canonical_json`, `compute_provenance_hash(input_hashes, spec)`,
74
+ `derive_subkey(parent_hash, *labels)` with `checkpoint_output_key` and
75
+ `run_output_key`, `parse_transform_spec`.
76
+ - `vestigo.uris`: `set_uri_scheme`, `uri_scheme`, `artifact_uri`,
77
+ `artifact_uri_prefix`, `name_uri_prefix`, `parse_artifact_uri`,
78
+ `parse_name_uri`, `LATEST_VERSION`.
79
+ - `vestigo.tables`: `LEDGER_TABLES`, the tables the ledger owns with their
80
+ copy order, and `TRANSIENT_TABLES`.
81
+ - `vestigo.file_modes`: `private_dir`, `private_file`, `narrow`, the modes the
82
+ stores create their directories and files with.
83
+
84
+ ## Install
85
+
86
+ ```bash
87
+ uv add vestigo # or: pip install vestigo; no dependencies beyond the stdlib
88
+ uv add "vestigo[postgres]" # PostgreSQL metadata; [s3], [gcs], [azure] bring each blob backend's SDK
89
+ ```
90
+
91
+ ## Development
92
+
93
+ ```bash
94
+ uv sync --all-extras # the package, every extra and the dev group
95
+ uv run pytest # the suite; Postgres and the object-store emulators run in Docker
96
+ uv run pre-commit run --all-files # ruff, ty, the lockfile check: what CI runs
97
+ uv run pre-commit run --hook-stage manual --all-files # the above plus pytest
98
+ ```
99
+
100
+ Strata's `tests/contract/` holds the cross-repository compatibility tests:
101
+ hash vectors for the graph encoders, operation schemas, output keys, and the
102
+ ledger's table inventory. A change to any of those is a contract change and
103
+ needs a matching Strata release.
@@ -0,0 +1,87 @@
1
+ [project]
2
+ name = "vestigo"
3
+ version = "0.1.0"
4
+ description = "The ledger of the shared computation substrate: versioned artifacts, builds and their leases, references, retention, on SQLite or PostgreSQL."
5
+ readme = "README.md"
6
+ requires-python = ">=3.12"
7
+ license = "Apache-2.0"
8
+ license-files = ["LICENSE"]
9
+ classifiers = [
10
+ "Development Status :: 2 - Pre-Alpha",
11
+ "Intended Audience :: Developers",
12
+ "Programming Language :: Python :: 3",
13
+ "Programming Language :: Python :: 3.12",
14
+ "Programming Language :: Python :: 3.13",
15
+ "Programming Language :: Python :: 3.14",
16
+ ]
17
+ dependencies = []
18
+
19
+ [[project.authors]]
20
+ name = "Fangchen Li"
21
+ email = "fangchen.li@outlook.com"
22
+
23
+ [project.optional-dependencies]
24
+ postgres = [
25
+ "psycopg[binary]>=3.1",
26
+ "psycopg-pool>=3.2",
27
+ ]
28
+ s3 = ["boto3>=1.35.0"]
29
+ gcs = ["google-cloud-storage>=3.0.0"]
30
+ azure = [
31
+ "azure-storage-blob>=12.20.0",
32
+ "azure-identity>=1.25.3",
33
+ ]
34
+
35
+ [project.urls]
36
+ Homepage = "https://github.com/bearing-research/vestigo"
37
+ Repository = "https://github.com/bearing-research/vestigo"
38
+ Changelog = "https://github.com/bearing-research/vestigo/blob/main/CHANGELOG.md"
39
+
40
+ [build-system]
41
+ requires = ["uv_build>=0.13.1,<0.14"]
42
+ build-backend = "uv_build"
43
+
44
+ [dependency-groups]
45
+ dev = [
46
+ "pytest>=8.0.0",
47
+ "pytest-asyncio>=0.24.0",
48
+ "pytest-timeout>=2.3.0",
49
+ "testcontainers>=4.15.0",
50
+ "docker>=7.0.0",
51
+ "anyio>=4.0.0",
52
+ "cryptography>=42.0.0",
53
+ "pyarrow>=18.0.0",
54
+ "moto[s3]>=5.0.0",
55
+ "ruff==0.17.1",
56
+ "pre-commit>=4.0.0",
57
+ "ty>=0.0.24",
58
+ ]
59
+
60
+ [tool.pytest.ini_options]
61
+ asyncio_mode = "auto"
62
+ testpaths = ["tests"]
63
+ timeout = 180
64
+ timeout_method = "thread"
65
+ markers = [
66
+ """slow: marks tests as slow (deselect with '-m "not slow"')""",
67
+ "integration: marks tests as integration tests requiring external services",
68
+ ]
69
+
70
+ [tool.ty.environment]
71
+ python-version = "3.12"
72
+ python = ".venv"
73
+
74
+ [tool.ty.src]
75
+ include = ["src"]
76
+
77
+ [tool.ruff]
78
+ line-length = 100
79
+ target-version = "py312"
80
+
81
+ [tool.ruff.lint]
82
+ select = [
83
+ "E",
84
+ "F",
85
+ "I",
86
+ "UP",
87
+ ]
@@ -0,0 +1,92 @@
1
+ [project]
2
+ name = "vestigo"
3
+ version = "0.1.0"
4
+ description = "The ledger of the shared computation substrate: versioned artifacts, builds and their leases, references, retention, on SQLite or PostgreSQL."
5
+ readme = "README.md"
6
+ requires-python = ">=3.12"
7
+ license = "Apache-2.0"
8
+ license-files = ["LICENSE"]
9
+ authors = [{ name = "Fangchen Li", email = "fangchen.li@outlook.com" }]
10
+ classifiers = [
11
+ "Development Status :: 2 - Pre-Alpha",
12
+ "Intended Audience :: Developers",
13
+ "Programming Language :: Python :: 3",
14
+ "Programming Language :: Python :: 3.12",
15
+ "Programming Language :: Python :: 3.13",
16
+ "Programming Language :: Python :: 3.14",
17
+ ]
18
+ # Metadata is stdlib sqlite3, or PostgreSQL via the extra below. Blobs are local
19
+ # files, or an object store through its own SDK, each the extra of its backend.
20
+ dependencies = []
21
+
22
+ [project.optional-dependencies]
23
+ postgres = [
24
+ "psycopg[binary]>=3.1",
25
+ "psycopg-pool>=3.2",
26
+ ]
27
+ s3 = [
28
+ "boto3>=1.35.0",
29
+ ]
30
+ gcs = [
31
+ "google-cloud-storage>=3.0.0",
32
+ ]
33
+ azure = [
34
+ "azure-storage-blob>=12.20.0",
35
+ "azure-identity>=1.25.3",
36
+ ]
37
+
38
+ [project.urls]
39
+ Homepage = "https://github.com/bearing-research/vestigo"
40
+ Repository = "https://github.com/bearing-research/vestigo"
41
+ Changelog = "https://github.com/bearing-research/vestigo/blob/main/CHANGELOG.md"
42
+
43
+ [build-system]
44
+ requires = ["uv_build>=0.13.1,<0.14"]
45
+ build-backend = "uv_build"
46
+
47
+ [dependency-groups]
48
+ dev = [
49
+ "pytest>=8.0.0",
50
+ "pytest-asyncio>=0.24.0",
51
+ "pytest-timeout>=2.3.0",
52
+ # The Postgres suite starts a container and drives the store off the loop.
53
+ "testcontainers>=4.15.0",
54
+ "docker>=7.0.0",
55
+ "anyio>=4.0.0",
56
+ # The presigned-signing tests mint an RSA key.
57
+ "cryptography>=42.0.0",
58
+ # The suite's payloads are Arrow IPC streams; the package itself never reads them.
59
+ "pyarrow>=18.0.0",
60
+ # The S3 backend's unit tests run over moto's in-process S3.
61
+ "moto[s3]>=5.0.0",
62
+ # The same ruff as .pre-commit-config.yaml.
63
+ "ruff==0.17.1",
64
+ "pre-commit>=4.0.0",
65
+ "ty>=0.0.24",
66
+ ]
67
+
68
+ [tool.pytest.ini_options]
69
+ asyncio_mode = "auto"
70
+ testpaths = ["tests"]
71
+ timeout = 180
72
+ timeout_method = "thread"
73
+ markers = [
74
+ "slow: marks tests as slow (deselect with '-m \"not slow\"')",
75
+ "integration: marks tests as integration tests requiring external services",
76
+ ]
77
+
78
+ [tool.ty.environment]
79
+ python-version = "3.12"
80
+ python = ".venv"
81
+
82
+ # Type-check only the shipped code, which must stay clean; the tests rely on
83
+ # fakes and fixture injection ty cannot model.
84
+ [tool.ty.src]
85
+ include = ["src"]
86
+
87
+ [tool.ruff]
88
+ line-length = 100
89
+ target-version = "py312"
90
+
91
+ [tool.ruff.lint]
92
+ select = ["E", "F", "I", "UP"]
@@ -0,0 +1,14 @@
1
+ """The ledger of the shared computation substrate (ADR 002); *vestigo*, I trace.
2
+
3
+ ``store`` holds versioned artifacts, names, aliases, tags, pins, publications,
4
+ retention and the audit log; ``build_store`` the builds, their leases and
5
+ attempts; ``releases`` a build's checkpoint and final releases, fenced on its
6
+ attempt's lease, with ``operations`` the typed operations a release runs in its
7
+ transaction; ``graph`` the content-addressed structural nodes, their encoders
8
+ and the bounded traversals; ``sql_backend`` the SQLite and PostgreSQL dialects
9
+ and the one write discipline they share; ``blob_store`` the byte backends;
10
+ ``provenance`` the transform spec, its hash and the per-output key derivation;
11
+ ``uris`` the artifact and name URI grammar and the process's scheme;
12
+ ``file_modes`` the private directory and file modes the stores create with;
13
+ ``tables`` the list of tables the ledger owns.
14
+ """