meridian-storage-semantics 1.0.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 (58) hide show
  1. meridian_storage_semantics-1.0.0/.github/CODEOWNERS +3 -0
  2. meridian_storage_semantics-1.0.0/.github/dependabot.yml +14 -0
  3. meridian_storage_semantics-1.0.0/.github/workflows/ci.yml +94 -0
  4. meridian_storage_semantics-1.0.0/.github/workflows/release.yml +97 -0
  5. meridian_storage_semantics-1.0.0/.gitignore +13 -0
  6. meridian_storage_semantics-1.0.0/CHANGELOG.md +17 -0
  7. meridian_storage_semantics-1.0.0/CONTRIBUTING.md +14 -0
  8. meridian_storage_semantics-1.0.0/LICENSE +202 -0
  9. meridian_storage_semantics-1.0.0/NOTICE +5 -0
  10. meridian_storage_semantics-1.0.0/PKG-INFO +149 -0
  11. meridian_storage_semantics-1.0.0/README.md +116 -0
  12. meridian_storage_semantics-1.0.0/RELEASING.md +17 -0
  13. meridian_storage_semantics-1.0.0/SECURITY.md +11 -0
  14. meridian_storage_semantics-1.0.0/compatibility.json +23 -0
  15. meridian_storage_semantics-1.0.0/contracts/catalogs/meridian-catalog-registry.v1.json +12 -0
  16. meridian_storage_semantics-1.0.0/contracts/conformance/invalid/unknown-field.schema.json +15 -0
  17. meridian_storage_semantics-1.0.0/contracts/conformance/valid/customer.schema.json +43 -0
  18. meridian_storage_semantics-1.0.0/contracts/logical-schema/meridian.collection.v1.schema.json +46 -0
  19. meridian_storage_semantics-1.0.0/contracts/logical-schema/meridian.object.v1.schema.json +42 -0
  20. meridian_storage_semantics-1.0.0/contracts/logical-schema/meridian.record.v1.schema.json +36 -0
  21. meridian_storage_semantics-1.0.0/contracts/logical-schema/meridian.relation-profile.v1.schema.json +29 -0
  22. meridian_storage_semantics-1.0.0/contracts/logical-schema/meridian.schema.v1.schema.json +212 -0
  23. meridian_storage_semantics-1.0.0/contracts/public-api/meridian-semantics.v1.json +123 -0
  24. meridian_storage_semantics-1.0.0/docs/architecture.md +34 -0
  25. meridian_storage_semantics-1.0.0/docs/compatibility.md +24 -0
  26. meridian_storage_semantics-1.0.0/docs/contracts.md +59 -0
  27. meridian_storage_semantics-1.0.0/pyproject.toml +127 -0
  28. meridian_storage_semantics-1.0.0/scripts/compare_artifacts.py +29 -0
  29. meridian_storage_semantics-1.0.0/scripts/generate_sbom.py +101 -0
  30. meridian_storage_semantics-1.0.0/scripts/verify_artifacts.py +126 -0
  31. meridian_storage_semantics-1.0.0/scripts/verify_contracts.py +128 -0
  32. meridian_storage_semantics-1.0.0/src/meridian_storage/semantics/__init__.py +185 -0
  33. meridian_storage_semantics-1.0.0/src/meridian_storage/semantics/_version.py +3 -0
  34. meridian_storage_semantics-1.0.0/src/meridian_storage/semantics/canonical.py +245 -0
  35. meridian_storage_semantics-1.0.0/src/meridian_storage/semantics/catalogs.py +805 -0
  36. meridian_storage_semantics-1.0.0/src/meridian_storage/semantics/compatibility.py +311 -0
  37. meridian_storage_semantics-1.0.0/src/meridian_storage/semantics/errors.py +152 -0
  38. meridian_storage_semantics-1.0.0/src/meridian_storage/semantics/i18n.py +327 -0
  39. meridian_storage_semantics-1.0.0/src/meridian_storage/semantics/profiles.py +515 -0
  40. meridian_storage_semantics-1.0.0/src/meridian_storage/semantics/publication.py +709 -0
  41. meridian_storage_semantics-1.0.0/src/meridian_storage/semantics/py.typed +1 -0
  42. meridian_storage_semantics-1.0.0/src/meridian_storage/semantics/resources.py +591 -0
  43. meridian_storage_semantics-1.0.0/src/meridian_storage/semantics/schemas.py +639 -0
  44. meridian_storage_semantics-1.0.0/src/meridian_storage/semantics/spi.py +124 -0
  45. meridian_storage_semantics-1.0.0/src/meridian_storage/semantics/validation.py +892 -0
  46. meridian_storage_semantics-1.0.0/tests/__init__.py +2 -0
  47. meridian_storage_semantics-1.0.0/tests/conformance/test_contracts.py +171 -0
  48. meridian_storage_semantics-1.0.0/tests/integration/test_catalogs.py +178 -0
  49. meridian_storage_semantics-1.0.0/tests/integration/test_publication.py +270 -0
  50. meridian_storage_semantics-1.0.0/tests/property/test_determinism.py +83 -0
  51. meridian_storage_semantics-1.0.0/tests/support.py +96 -0
  52. meridian_storage_semantics-1.0.0/tests/unit/test_canonical_i18n.py +176 -0
  53. meridian_storage_semantics-1.0.0/tests/unit/test_compatibility.py +187 -0
  54. meridian_storage_semantics-1.0.0/tests/unit/test_edge_cases.py +452 -0
  55. meridian_storage_semantics-1.0.0/tests/unit/test_profiles.py +114 -0
  56. meridian_storage_semantics-1.0.0/tests/unit/test_resources.py +200 -0
  57. meridian_storage_semantics-1.0.0/tests/unit/test_schemas.py +230 -0
  58. meridian_storage_semantics-1.0.0/tests/unit/test_validation.py +381 -0
@@ -0,0 +1,3 @@
1
+ # SPDX-License-Identifier: Apache-2.0
2
+
3
+ * @zephytiju
@@ -0,0 +1,14 @@
1
+ # SPDX-License-Identifier: Apache-2.0
2
+
3
+ version: 2
4
+ updates:
5
+ - package-ecosystem: pip
6
+ directory: /
7
+ schedule:
8
+ interval: monthly
9
+ open-pull-requests-limit: 5
10
+ - package-ecosystem: github-actions
11
+ directory: /
12
+ schedule:
13
+ interval: monthly
14
+ open-pull-requests-limit: 5
@@ -0,0 +1,94 @@
1
+ # SPDX-License-Identifier: Apache-2.0
2
+
3
+ name: CI
4
+
5
+ on:
6
+ pull_request:
7
+ push:
8
+ branches: [main]
9
+ workflow_dispatch:
10
+
11
+ permissions:
12
+ contents: read
13
+
14
+ concurrency:
15
+ group: ci-${{ github.workflow }}-${{ github.ref }}
16
+ cancel-in-progress: true
17
+
18
+ jobs:
19
+ quality:
20
+ name: Python ${{ matrix.python-version }}
21
+ runs-on: ubuntu-latest
22
+ strategy:
23
+ fail-fast: false
24
+ matrix:
25
+ python-version: ["3.12", "3.13", "3.14"]
26
+ steps:
27
+ - name: Check out source
28
+ uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
29
+ with:
30
+ persist-credentials: false
31
+ - name: Set up Python
32
+ uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
33
+ with:
34
+ python-version: ${{ matrix.python-version }}
35
+ cache: pip
36
+ - name: Install package and test tools
37
+ run: python -m pip install --disable-pip-version-check '.[test]'
38
+ - name: Check formatting
39
+ run: ruff format --check src tests scripts
40
+ - name: Lint
41
+ run: ruff check src tests scripts
42
+ - name: Type check
43
+ run: mypy src
44
+ - name: Check public contracts
45
+ run: python scripts/verify_contracts.py
46
+ - name: Test
47
+ run: pytest --cov=meridian_storage.semantics --cov-report=term-missing --cov-report=xml
48
+
49
+ package:
50
+ name: Reproducible package
51
+ needs: quality
52
+ runs-on: ubuntu-latest
53
+ steps:
54
+ - name: Check out source
55
+ uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
56
+ with:
57
+ persist-credentials: false
58
+ - name: Set up Python
59
+ uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
60
+ with:
61
+ python-version: "3.13"
62
+ cache: pip
63
+ - name: Install package and build tools
64
+ run: python -m pip install --disable-pip-version-check '.[test]'
65
+ - name: Fix reproducible-build timestamp
66
+ run: echo "SOURCE_DATE_EPOCH=$(git show -s --format=%ct HEAD)" >> "$GITHUB_ENV"
67
+ - name: Build twice
68
+ run: |
69
+ python -m build --no-isolation --outdir .artifacts/first
70
+ python -m build --no-isolation --outdir .artifacts/second
71
+ - name: Compare builds
72
+ run: python scripts/compare_artifacts.py .artifacts/first .artifacts/second
73
+ - name: Verify package contents
74
+ run: python scripts/verify_artifacts.py .artifacts/first/*
75
+ - name: Generate SPDX SBOM
76
+ run: |
77
+ python scripts/generate_sbom.py --output ".artifacts/meridian-storage-semantics-1.0.0.spdx.json" .artifacts/first/*
78
+ - name: Clean-install wheel with released Core
79
+ run: |
80
+ python -m venv .artifacts/venv
81
+ WHEEL_PATH=$(find .artifacts/first -name '*.whl' -type f -print -quit)
82
+ .artifacts/venv/bin/python -m pip install --disable-pip-version-check meridian-storage-core==1.0.0 "$WHEEL_PATH"
83
+ cd /tmp
84
+ "$GITHUB_WORKSPACE/.artifacts/venv/bin/python" -I -c 'from meridian_storage import Meridian; from meridian_storage.semantics import SemanticsSchemaProvider, catalog_registry; assert Meridian and SemanticsSchemaProvider().load() and tuple(catalog_registry()) == ("structured", "object", "cache", "evidence", "streaming")'
85
+ - name: Upload verified artifacts
86
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
87
+ with:
88
+ name: meridian-storage-semantics-${{ github.sha }}
89
+ path: |
90
+ .artifacts/first/*
91
+ .artifacts/meridian-storage-semantics-*.spdx.json
92
+ if-no-files-found: error
93
+ include-hidden-files: true
94
+ retention-days: 30
@@ -0,0 +1,97 @@
1
+ # SPDX-License-Identifier: Apache-2.0
2
+
3
+ name: Release
4
+
5
+ on:
6
+ push:
7
+ tags: ["v*.*.*"]
8
+
9
+ permissions: {}
10
+
11
+ jobs:
12
+ release:
13
+ name: Verify and release
14
+ runs-on: ubuntu-latest
15
+ permissions:
16
+ attestations: write
17
+ contents: write
18
+ id-token: write
19
+ steps:
20
+ - name: Check out tagged source
21
+ uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
22
+ with:
23
+ fetch-depth: 0
24
+ persist-credentials: false
25
+ - name: Set up Python
26
+ uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
27
+ with:
28
+ python-version: "3.13"
29
+ cache: pip
30
+ - name: Verify tag is on main
31
+ run: git merge-base --is-ancestor "$GITHUB_SHA" origin/main
32
+ - name: Install package and release tools
33
+ run: python -m pip install --disable-pip-version-check '.[test]'
34
+ - name: Verify tag and package versions
35
+ run: |
36
+ python - <<'PY'
37
+ import os
38
+ import tomllib
39
+ from pathlib import Path
40
+
41
+ version = tomllib.loads(Path("pyproject.toml").read_text())["project"]["version"]
42
+ assert os.environ["GITHUB_REF_NAME"] == f"v{version}"
43
+ assert Path("src/meridian_storage/semantics/_version.py").read_text().strip().endswith(f'"{version}"')
44
+ PY
45
+ - name: Run quality gates
46
+ run: |
47
+ ruff format --check src tests scripts
48
+ ruff check src tests scripts
49
+ mypy src
50
+ python scripts/verify_contracts.py
51
+ pytest --cov=meridian_storage.semantics --cov-report=term-missing
52
+ - name: Fix reproducible-build timestamp
53
+ run: echo "SOURCE_DATE_EPOCH=$(git show -s --format=%ct HEAD)" >> "$GITHUB_ENV"
54
+ - name: Build twice and verify
55
+ run: |
56
+ python -m build --no-isolation --outdir .artifacts/first
57
+ python -m build --no-isolation --outdir .artifacts/second
58
+ python scripts/compare_artifacts.py .artifacts/first .artifacts/second
59
+ python scripts/verify_artifacts.py .artifacts/first/*
60
+ mkdir release
61
+ cp .artifacts/first/* release/
62
+ python scripts/generate_sbom.py --output "release/meridian-storage-semantics-1.0.0.spdx.json" .artifacts/first/*
63
+ - name: Attest release provenance
64
+ uses: actions/attest-build-provenance@96b4a1ef7235a096b17240c259729fdd70c83d45 # v2
65
+ with:
66
+ subject-path: release/*
67
+ - name: Create GitHub release
68
+ env:
69
+ GH_TOKEN: ${{ github.token }}
70
+ run: gh release create "$GITHUB_REF_NAME" release/* --verify-tag --generate-notes --title "$GITHUB_REF_NAME"
71
+ - name: Upload Python distributions for gated publication
72
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
73
+ with:
74
+ name: python-distributions
75
+ path: |
76
+ release/*.whl
77
+ release/*.tar.gz
78
+ if-no-files-found: error
79
+
80
+ publish-pypi:
81
+ name: Publish to PyPI
82
+ if: ${{ vars.PYPI_TRUSTED_PUBLISHING_ENABLED == 'true' }}
83
+ needs: release
84
+ runs-on: ubuntu-latest
85
+ environment:
86
+ name: pypi
87
+ url: https://pypi.org/project/meridian-storage-semantics/
88
+ permissions:
89
+ id-token: write
90
+ steps:
91
+ - name: Download Python distributions
92
+ uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
93
+ with:
94
+ name: python-distributions
95
+ path: dist
96
+ - name: Publish with trusted publishing
97
+ uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # release/v1
@@ -0,0 +1,13 @@
1
+ .coverage
2
+ .hypothesis/
3
+ .mypy_cache/
4
+ .pytest_cache/
5
+ .ruff_cache/
6
+ .venv/
7
+ .artifacts/
8
+ build/
9
+ dist/
10
+ *.egg-info/
11
+ __pycache__/
12
+ *.py[cod]
13
+
@@ -0,0 +1,17 @@
1
+ <!-- SPDX-License-Identifier: Apache-2.0 -->
2
+
3
+ # Changelog
4
+
5
+ ## 1.0.0 — 2026-08-25
6
+
7
+ - Implement canonical `meridian.schema.v1` Schema, Field, type, index, policy,
8
+ extension, compatibility, and fingerprint contracts.
9
+ - Add dynamic immutable Schema publication, read, update, version, deprecation,
10
+ revision, discovery, and Core schema-provider integration.
11
+ - Add Record, RecordRef, Relation, Collection, Object, and cache metadata values
12
+ plus portable validation for every V1 logical type and profile.
13
+ - Add multilingual BCP 47/ICU metadata and deterministic compatibility reports.
14
+ - Add structured/cache mapping-first Catalog surfaces and serialized Core
15
+ Operation normalization without Adapter/Engine concepts.
16
+ - Add unit, integration, property, conformance, packaging, reproducibility, SBOM,
17
+ provenance, and release automation.
@@ -0,0 +1,14 @@
1
+ <!-- SPDX-License-Identifier: Apache-2.0 -->
2
+
3
+ # Contributing
4
+
5
+ Changes must preserve the one-repository/one-distribution boundary, Apache-2.0
6
+ headers and metadata, exact Core pin, deterministic wire contracts, and Catalog
7
+ authority boundaries. Public contract changes require an approved authoritative
8
+ design update before implementation.
9
+
10
+ Install `.[test]`, run the commands in the README, and include tests and contract
11
+ fixtures for behavioral changes. Pull requests must pass all supported Python
12
+ versions and the reproducible-package job. Do not commit generated artifacts,
13
+ credentials, provider endpoints, Engine-specific options, or cross-repository
14
+ source copies.
@@ -0,0 +1,202 @@
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.
202
+
@@ -0,0 +1,5 @@
1
+ Meridian Storage Semantics
2
+ Copyright 2026 Meridian contributors
3
+
4
+ This product includes software developed by Meridian contributors.
5
+
@@ -0,0 +1,149 @@
1
+ Metadata-Version: 2.4
2
+ Name: meridian-storage-semantics
3
+ Version: 1.0.0
4
+ Summary: Meridian V1 logical schema, resource, data, and metadata semantics
5
+ Project-URL: Documentation, https://github.com/zephytiju/meridian-storage-semantics#readme
6
+ Project-URL: Issues, https://github.com/zephytiju/meridian-storage-semantics/issues
7
+ Project-URL: Repository, https://github.com/zephytiju/meridian-storage-semantics
8
+ Author: Meridian contributors
9
+ License-Expression: Apache-2.0
10
+ License-File: LICENSE
11
+ License-File: NOTICE
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: Apache Software License
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
+ Classifier: Typing :: Typed
21
+ Requires-Python: >=3.12
22
+ Requires-Dist: meridian-storage-core==1.0.0
23
+ Provides-Extra: test
24
+ Requires-Dist: build<2,>=1.2; extra == 'test'
25
+ Requires-Dist: hatchling==1.27.0; extra == 'test'
26
+ Requires-Dist: hypothesis<7,>=6.135; extra == 'test'
27
+ Requires-Dist: jsonschema<5,>=4.23; extra == 'test'
28
+ Requires-Dist: mypy<2,>=1.15; extra == 'test'
29
+ Requires-Dist: pytest-cov<8,>=6; extra == 'test'
30
+ Requires-Dist: pytest<10,>=8.3; extra == 'test'
31
+ Requires-Dist: ruff<1,>=0.11; extra == 'test'
32
+ Description-Content-Type: text/markdown
33
+
34
+ <!-- SPDX-License-Identifier: Apache-2.0 -->
35
+
36
+ # Meridian Storage Semantics
37
+
38
+ `meridian-storage-semantics` is the independently released Meridian V1 logical
39
+ schema, resource, data, and query-facing metadata package. It provides portable
40
+ contracts for Records, Relations, Objects, cache entries, dynamic Schema
41
+ publication, compatibility classification, multilingual ICU metadata, and Core
42
+ mapping-first Catalog surfaces.
43
+
44
+ The distribution contains one Python package, `meridian_storage.semantics`, and
45
+ depends on the released `meridian-storage-core==1.0.0` contract. The shared
46
+ `meridian_storage` import root is packaging infrastructure; this repository does
47
+ not contain Core source or any other Meridian package.
48
+
49
+ ## Install
50
+
51
+ ```console
52
+ python -m pip install meridian-storage-semantics==1.0.0
53
+ ```
54
+
55
+ Python 3.12 or newer is required.
56
+
57
+ ## Define and publish a Schema
58
+
59
+ ```python
60
+ from meridian_storage.semantics import InMemoryMetadataRepository, SchemaAPI
61
+
62
+ schemas = SchemaAPI(InMemoryMetadataRepository())
63
+ published = schemas.publish(
64
+ namespace="investigation",
65
+ name="case",
66
+ version="1.0.0",
67
+ definition={
68
+ "semanticKind": "relational",
69
+ "fields": [
70
+ {"name": "case_id", "logicalType": "uuid"},
71
+ {"name": "title", "logicalType": "string"},
72
+ ],
73
+ "identity": ["case_id"],
74
+ },
75
+ )
76
+
77
+ assert published.publication.document.format_version == "meridian.schema.v1"
78
+ ```
79
+
80
+ Schema versions are immutable. Publishing an identical version and fingerprint
81
+ is idempotent; a different document under the same version is rejected. New
82
+ versions are ordered by SemVer and classified before activation.
83
+
84
+ ## Build mapping-first Expressions
85
+
86
+ ```python
87
+ from meridian_storage.semantics import StructuredCatalogProvider
88
+
89
+ provider = StructuredCatalogProvider()
90
+ expression = provider.create_surface().query(
91
+ resource="investigation.cases",
92
+ where={"status": {"eq": "open"}},
93
+ select=("case_id", "title"),
94
+ limit=50,
95
+ )
96
+ operation = provider.normalize(expression)
97
+ ```
98
+
99
+ Consumers create serializable Core `Expression` values. Planning normalizes them
100
+ to portable `Operation` values. Engine selection, credentials, provisioning,
101
+ physical DDL, ACLs, migration execution, and lifecycle remain Adapter/Platform
102
+ responsibilities and are not accepted by these APIs.
103
+
104
+ ## Catalog registry
105
+
106
+ The V1 registry is exactly:
107
+
108
+ - `structured` — owned here; relational, document, key-value, search,
109
+ geospatial, time-series, and relation profiles.
110
+ - `object` — owned by `meridian-storage-object-common`; object, artifact, and
111
+ media profiles. This package supplies their logical metadata values.
112
+ - `cache` — owned here; explicit, non-authoritative cache semantics.
113
+ - `evidence` — owned by `meridian-storage-evidence`; telemetry, audit, lineage,
114
+ and provenance profiles.
115
+ - `streaming` — accepted-pending and owned by the downstream streaming package.
116
+
117
+ Query, projection, ontology, search, geospatial, time-series, relation,
118
+ artifact, media, telemetry, audit, lineage, and provenance are not Catalogs.
119
+ `NativeQuery` is post-V1. No Kafka or streaming-provider behavior is embedded.
120
+
121
+ ## Contracts and verification
122
+
123
+ Language-neutral JSON contracts live in [`contracts`](contracts), including the
124
+ canonical `meridian.schema.v1` schema, wire documents, public API ledger, exact
125
+ Catalog registry, and valid/invalid conformance fixtures. Compatibility with
126
+ Core and the design revisions is pinned in [`compatibility.json`](compatibility.json).
127
+
128
+ Run all local gates after installing test dependencies:
129
+
130
+ ```console
131
+ python -m pip install '.[test]'
132
+ ruff format --check src tests scripts
133
+ ruff check src tests scripts
134
+ mypy src
135
+ python scripts/verify_contracts.py
136
+ pytest --cov=meridian_storage.semantics --cov-report=term-missing
137
+ ```
138
+
139
+ Release builds are created twice with a fixed `SOURCE_DATE_EPOCH`, compared
140
+ byte-for-byte, inspected for repository/package boundaries and license metadata,
141
+ and accompanied by SPDX SBOM and GitHub build-provenance attestations.
142
+
143
+ Further detail is in [`docs/contracts.md`](docs/contracts.md) and
144
+ [`docs/architecture.md`](docs/architecture.md).
145
+
146
+ ## License
147
+
148
+ Copyright 2026 Meridian contributors. Licensed under Apache License 2.0; see
149
+ [`LICENSE`](LICENSE) and [`NOTICE`](NOTICE).