ssot-pack-contracts 0.2.18__tar.gz → 0.2.19.dev2__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.
@@ -0,0 +1,218 @@
1
+ Metadata-Version: 2.4
2
+ Name: ssot-pack-contracts
3
+ Version: 0.2.19.dev2
4
+ Summary: Shared governance-pack metadata, manifest, and packaged document contracts for SSOT.
5
+ Author-email: Jacob Stewart <jacob@swarmauri.com>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/groupsum/ssot-registry/tree/main/pkgs/ssot-pack-contracts
8
+ Project-URL: Repository, https://github.com/groupsum/ssot-registry/tree/main/pkgs/ssot-pack-contracts
9
+ Project-URL: Issues, https://github.com/groupsum/ssot-registry/issues
10
+ Keywords: ssot,governance,packs,contracts,metadata,manifest
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3 :: Only
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Requires-Python: <3.15,>=3.10
22
+ Description-Content-Type: text/markdown
23
+ Requires-Dist: tomli>=2.0.1; python_version < "3.11"
24
+
25
+ <div align="center">
26
+ <h1>ssot-pack-contracts</h1>
27
+ <p><strong>Shared metadata, manifest, and packaged-document contracts for installable SSOT governance packs.</strong></p>
28
+ </div>
29
+
30
+ <div align="center">
31
+ <a href="https://pypi.org/project/ssot-pack-contracts/"><img src="https://img.shields.io/pypi/v/ssot-pack-contracts?label=PyPI%20version" alt="PyPI version" /></a>
32
+ <a href="https://pypi.org/project/ssot-pack-contracts/"><img src="https://img.shields.io/pypi/pyversions/ssot-pack-contracts?label=Python" alt="Supported Python versions" /></a>
33
+ <a href="https://pepy.tech/project/ssot-pack-contracts"><img src="https://static.pepy.tech/badge/ssot-pack-contracts" alt="Downloads" /></a>
34
+ <a href="https://hits.sh/github.com/groupsum/ssot-registry/"><img src="https://hits.sh/github.com/groupsum/ssot-registry.svg?style=flat-square" alt="Repository hits" /></a>
35
+ <!-- ssot-schema-badges:start -->
36
+ <img src="https://img.shields.io/badge/schema_version-0.4.0-blue" alt="schema_version 0.4.0" />
37
+ <img src="https://img.shields.io/badge/migration%20coverage-11%2F11-brightgreen" alt="Migration coverage 11/11" />
38
+ <!-- ssot-schema-badges:end -->
39
+ </div>
40
+
41
+ `ssot-pack-contracts` is the shared Python contract layer for installable SSOT governance packs.
42
+
43
+ It gives external governance packs one common API for declaring pack identity, schema compatibility, trust metadata, document manifests, and packaged ADR/SPEC resources. It does not mutate `.ssot/registry.json` and does not depend on [ssot-core](https://pypi.org/project/ssot-core/) or [ssot-cli](https://pypi.org/project/ssot-cli/).
44
+
45
+ - GitHub: https://github.com/groupsum/ssot-registry/tree/main/pkgs/ssot-pack-contracts
46
+ - PyPI: https://pypi.org/project/ssot-pack-contracts/
47
+
48
+ ## What this package owns
49
+
50
+ - Governance-pack metadata loading and validation
51
+ - Governance-pack schema version access
52
+ - PyPI distribution name and version discovery through installed package metadata
53
+ - Pack document manifest loading for ADR and SPEC payloads
54
+ - Packaged document text and byte readers
55
+ - Document ID listing and manifest-entry lookup helpers
56
+ - Fail-closed validation errors for invalid pack metadata or manifest entries
57
+
58
+ ## When to use this package
59
+
60
+ Use `ssot-pack-contracts` when you are building an installable governance pack that ships SSOT ADRs, SPECs, or other governed pack documents as Python package resources.
61
+
62
+ Use another package when you want:
63
+
64
+ - [ssot-contracts](https://pypi.org/project/ssot-contracts/) for canonical SSOT schemas, templates, and generated contract metadata
65
+ - [ssot-core](https://pypi.org/project/ssot-core/) for registry loading, validation, synchronization, pack ingestion, and mutation APIs
66
+ - [ssot-cli](https://pypi.org/project/ssot-cli/) for operator commands such as pack inspection, preflight checks, and sync workflows
67
+ - [ssot-registry](https://pypi.org/project/ssot-registry/) for the umbrella runtime bundle
68
+
69
+ ## Governance packs using this contract
70
+
71
+ These governance packs are expected to expose the `ssot-pack-contracts` API surface from their package root:
72
+
73
+ - [seo-aeo-aieo-governance-pack](https://pypi.org/project/seo-aeo-aieo-governance-pack/) packages SEO, AEO, and AiEO governance ADR/SPEC content.
74
+ - [digital-signature-governance-pack](https://pypi.org/project/digital-signature-governance-pack/) packages digital-signature governance ADR/SPEC content.
75
+ - [cache-freshness-governance-pack](https://pypi.org/project/cache-freshness-governance-pack/) packages cache freshness and cache governance ADR/SPEC content.
76
+
77
+ Each pack should depend on `ssot-pack-contracts`, include a packaged `metadata.json`, include declared document manifests, and bind the shared API at the package root.
78
+
79
+ ## Install
80
+
81
+ ```bash
82
+ python -m pip install ssot-pack-contracts
83
+ ```
84
+
85
+ For local development from this repository:
86
+
87
+ ```bash
88
+ python -m pip install -e pkgs/ssot-pack-contracts
89
+ ```
90
+
91
+ ## Pack authoring pattern
92
+
93
+ Governance packs should not reimplement the contract API. Their package root should bind and export the shared contract functions:
94
+
95
+ ```python
96
+ from ssot_pack_contracts import bind_pack_contract
97
+
98
+ globals().update(bind_pack_contract(__name__))
99
+ ```
100
+
101
+ The binder resolves:
102
+
103
+ - `__pypi_package_name__` from installed distribution metadata
104
+ - `__version__` from `importlib.metadata.version(...)`
105
+ - `__ssot_package_name__` from packaged governance metadata
106
+ - `load_pack_metadata`
107
+ - `load_pack_schema_version`
108
+ - `load_pack_manifest`
109
+ - `load_document_manifest`
110
+ - `read_packaged_document_bytes`
111
+ - `read_packaged_document_text`
112
+ - `list_packaged_document_ids`
113
+ - `get_packaged_document_entry`
114
+
115
+ ## Required metadata
116
+
117
+ Every governance pack must package a `metadata.json` resource at the import-package root. The metadata file is the source of truth for SSOT pack identity.
118
+
119
+ Required top-level fields:
120
+
121
+ ```json
122
+ {
123
+ "schema_version": "1.0.0",
124
+ "ssot_package_name": "example-governance-pack",
125
+ "origin": {
126
+ "id": "pack:example-governance-pack",
127
+ "package_name": "example-governance-pack",
128
+ "import_name": "example_governance_pack",
129
+ "kind": "governance-pack"
130
+ },
131
+ "compatibility": {
132
+ "python": ">=3.10,<3.15",
133
+ "ssot_registry_schema": ">=0.4.0,<0.5.0",
134
+ "ssot_pack_contract": ">=0.2.18,<0.3.0"
135
+ },
136
+ "trust": {
137
+ "origin": "extension-pack",
138
+ "trusted_by_default": false,
139
+ "reservation_owner": "extension-pack:example-governance-pack"
140
+ },
141
+ "documents": {
142
+ "adr": {
143
+ "manifest_path": "adr/manifest.json"
144
+ },
145
+ "spec": {
146
+ "manifest_path": "specs/manifest.json"
147
+ }
148
+ }
149
+ }
150
+ ```
151
+
152
+ The package version is not authored in `metadata.json`. It is loaded from the installed PyPI distribution metadata, which is generated from the pack's `pyproject.toml`.
153
+
154
+ ## Public API
155
+
156
+ ```python
157
+ from ssot_pack_contracts import (
158
+ bind_pack_contract,
159
+ get_packaged_document_entry,
160
+ list_packaged_document_ids,
161
+ load_document_manifest,
162
+ load_pack_manifest,
163
+ load_pack_metadata,
164
+ load_pack_schema_version,
165
+ read_packaged_document_bytes,
166
+ read_packaged_document_text,
167
+ )
168
+ ```
169
+
170
+ Load pack identity and schema version:
171
+
172
+ ```python
173
+ from ssot_pack_contracts import load_pack_metadata, load_pack_schema_version
174
+
175
+ metadata = load_pack_metadata("seo_aeo_aieo_governance_pack")
176
+ schema_version = load_pack_schema_version("seo_aeo_aieo_governance_pack")
177
+
178
+ print(metadata["ssot_package_name"])
179
+ print(metadata["pypi_package_name"])
180
+ print(metadata["version"])
181
+ print(schema_version)
182
+ ```
183
+
184
+ List and read packaged documents:
185
+
186
+ ```python
187
+ from ssot_pack_contracts import (
188
+ get_packaged_document_entry,
189
+ list_packaged_document_ids,
190
+ read_packaged_document_text,
191
+ )
192
+
193
+ document_ids = list_packaged_document_ids("seo_aeo_aieo_governance_pack", "spec")
194
+ entry = get_packaged_document_entry("seo_aeo_aieo_governance_pack", document_ids[0])
195
+ body = read_packaged_document_text("seo_aeo_aieo_governance_pack", "spec", entry["filename"])
196
+ ```
197
+
198
+ ## Contract rules
199
+
200
+ - Pack root APIs must be loaded from `ssot-pack-contracts`, not copied by hand.
201
+ - `metadata.schema_version` is required and must be available through `load_pack_schema_version`.
202
+ - `metadata.ssot_package_name` is required and must match `metadata.origin.package_name`.
203
+ - `metadata.origin.import_name` must match the installed import package.
204
+ - `metadata.origin.kind` must be `governance-pack`.
205
+ - `metadata.trust.origin` must be `extension-pack`.
206
+ - `metadata.trust.reservation_owner` must start with `extension-pack:`.
207
+ - `metadata.compatibility.python`, `metadata.compatibility.ssot_registry_schema`, and `metadata.compatibility.ssot_pack_contract` are required.
208
+ - Document manifest kinds must use normalized keys: `adr` and `spec`.
209
+ - Packaged document entries must include stable IDs, filenames, target paths, SHA-256 hashes, origin, reservation owner, compatibility metadata, status, and supersession fields.
210
+
211
+ ## Package relationships
212
+
213
+ - Package type: governance-pack contract package
214
+ - Depends on: standard library only, plus `tomli` on Python earlier than 3.11
215
+ - Used by: governance packs such as [seo-aeo-aieo-governance-pack](https://pypi.org/project/seo-aeo-aieo-governance-pack/), [digital-signature-governance-pack](https://pypi.org/project/digital-signature-governance-pack/), and [cache-freshness-governance-pack](https://pypi.org/project/cache-freshness-governance-pack/)
216
+ - Consumed by: [ssot-core](https://pypi.org/project/ssot-core/) pack ingestion and [ssot-cli](https://pypi.org/project/ssot-cli/) pack inspection, preflight, and sync workflows
217
+
218
+ If you are publishing an SSOT governance pack, use `ssot-pack-contracts` as the root API contract. If you are consuming packs, use [ssot-cli](https://pypi.org/project/ssot-cli/) or [ssot-core](https://pypi.org/project/ssot-core/) to inspect, preflight, and synchronize pack content into a governed registry.
@@ -0,0 +1,194 @@
1
+ <div align="center">
2
+ <h1>ssot-pack-contracts</h1>
3
+ <p><strong>Shared metadata, manifest, and packaged-document contracts for installable SSOT governance packs.</strong></p>
4
+ </div>
5
+
6
+ <div align="center">
7
+ <a href="https://pypi.org/project/ssot-pack-contracts/"><img src="https://img.shields.io/pypi/v/ssot-pack-contracts?label=PyPI%20version" alt="PyPI version" /></a>
8
+ <a href="https://pypi.org/project/ssot-pack-contracts/"><img src="https://img.shields.io/pypi/pyversions/ssot-pack-contracts?label=Python" alt="Supported Python versions" /></a>
9
+ <a href="https://pepy.tech/project/ssot-pack-contracts"><img src="https://static.pepy.tech/badge/ssot-pack-contracts" alt="Downloads" /></a>
10
+ <a href="https://hits.sh/github.com/groupsum/ssot-registry/"><img src="https://hits.sh/github.com/groupsum/ssot-registry.svg?style=flat-square" alt="Repository hits" /></a>
11
+ <!-- ssot-schema-badges:start -->
12
+ <img src="https://img.shields.io/badge/schema_version-0.4.0-blue" alt="schema_version 0.4.0" />
13
+ <img src="https://img.shields.io/badge/migration%20coverage-11%2F11-brightgreen" alt="Migration coverage 11/11" />
14
+ <!-- ssot-schema-badges:end -->
15
+ </div>
16
+
17
+ `ssot-pack-contracts` is the shared Python contract layer for installable SSOT governance packs.
18
+
19
+ It gives external governance packs one common API for declaring pack identity, schema compatibility, trust metadata, document manifests, and packaged ADR/SPEC resources. It does not mutate `.ssot/registry.json` and does not depend on [ssot-core](https://pypi.org/project/ssot-core/) or [ssot-cli](https://pypi.org/project/ssot-cli/).
20
+
21
+ - GitHub: https://github.com/groupsum/ssot-registry/tree/main/pkgs/ssot-pack-contracts
22
+ - PyPI: https://pypi.org/project/ssot-pack-contracts/
23
+
24
+ ## What this package owns
25
+
26
+ - Governance-pack metadata loading and validation
27
+ - Governance-pack schema version access
28
+ - PyPI distribution name and version discovery through installed package metadata
29
+ - Pack document manifest loading for ADR and SPEC payloads
30
+ - Packaged document text and byte readers
31
+ - Document ID listing and manifest-entry lookup helpers
32
+ - Fail-closed validation errors for invalid pack metadata or manifest entries
33
+
34
+ ## When to use this package
35
+
36
+ Use `ssot-pack-contracts` when you are building an installable governance pack that ships SSOT ADRs, SPECs, or other governed pack documents as Python package resources.
37
+
38
+ Use another package when you want:
39
+
40
+ - [ssot-contracts](https://pypi.org/project/ssot-contracts/) for canonical SSOT schemas, templates, and generated contract metadata
41
+ - [ssot-core](https://pypi.org/project/ssot-core/) for registry loading, validation, synchronization, pack ingestion, and mutation APIs
42
+ - [ssot-cli](https://pypi.org/project/ssot-cli/) for operator commands such as pack inspection, preflight checks, and sync workflows
43
+ - [ssot-registry](https://pypi.org/project/ssot-registry/) for the umbrella runtime bundle
44
+
45
+ ## Governance packs using this contract
46
+
47
+ These governance packs are expected to expose the `ssot-pack-contracts` API surface from their package root:
48
+
49
+ - [seo-aeo-aieo-governance-pack](https://pypi.org/project/seo-aeo-aieo-governance-pack/) packages SEO, AEO, and AiEO governance ADR/SPEC content.
50
+ - [digital-signature-governance-pack](https://pypi.org/project/digital-signature-governance-pack/) packages digital-signature governance ADR/SPEC content.
51
+ - [cache-freshness-governance-pack](https://pypi.org/project/cache-freshness-governance-pack/) packages cache freshness and cache governance ADR/SPEC content.
52
+
53
+ Each pack should depend on `ssot-pack-contracts`, include a packaged `metadata.json`, include declared document manifests, and bind the shared API at the package root.
54
+
55
+ ## Install
56
+
57
+ ```bash
58
+ python -m pip install ssot-pack-contracts
59
+ ```
60
+
61
+ For local development from this repository:
62
+
63
+ ```bash
64
+ python -m pip install -e pkgs/ssot-pack-contracts
65
+ ```
66
+
67
+ ## Pack authoring pattern
68
+
69
+ Governance packs should not reimplement the contract API. Their package root should bind and export the shared contract functions:
70
+
71
+ ```python
72
+ from ssot_pack_contracts import bind_pack_contract
73
+
74
+ globals().update(bind_pack_contract(__name__))
75
+ ```
76
+
77
+ The binder resolves:
78
+
79
+ - `__pypi_package_name__` from installed distribution metadata
80
+ - `__version__` from `importlib.metadata.version(...)`
81
+ - `__ssot_package_name__` from packaged governance metadata
82
+ - `load_pack_metadata`
83
+ - `load_pack_schema_version`
84
+ - `load_pack_manifest`
85
+ - `load_document_manifest`
86
+ - `read_packaged_document_bytes`
87
+ - `read_packaged_document_text`
88
+ - `list_packaged_document_ids`
89
+ - `get_packaged_document_entry`
90
+
91
+ ## Required metadata
92
+
93
+ Every governance pack must package a `metadata.json` resource at the import-package root. The metadata file is the source of truth for SSOT pack identity.
94
+
95
+ Required top-level fields:
96
+
97
+ ```json
98
+ {
99
+ "schema_version": "1.0.0",
100
+ "ssot_package_name": "example-governance-pack",
101
+ "origin": {
102
+ "id": "pack:example-governance-pack",
103
+ "package_name": "example-governance-pack",
104
+ "import_name": "example_governance_pack",
105
+ "kind": "governance-pack"
106
+ },
107
+ "compatibility": {
108
+ "python": ">=3.10,<3.15",
109
+ "ssot_registry_schema": ">=0.4.0,<0.5.0",
110
+ "ssot_pack_contract": ">=0.2.18,<0.3.0"
111
+ },
112
+ "trust": {
113
+ "origin": "extension-pack",
114
+ "trusted_by_default": false,
115
+ "reservation_owner": "extension-pack:example-governance-pack"
116
+ },
117
+ "documents": {
118
+ "adr": {
119
+ "manifest_path": "adr/manifest.json"
120
+ },
121
+ "spec": {
122
+ "manifest_path": "specs/manifest.json"
123
+ }
124
+ }
125
+ }
126
+ ```
127
+
128
+ The package version is not authored in `metadata.json`. It is loaded from the installed PyPI distribution metadata, which is generated from the pack's `pyproject.toml`.
129
+
130
+ ## Public API
131
+
132
+ ```python
133
+ from ssot_pack_contracts import (
134
+ bind_pack_contract,
135
+ get_packaged_document_entry,
136
+ list_packaged_document_ids,
137
+ load_document_manifest,
138
+ load_pack_manifest,
139
+ load_pack_metadata,
140
+ load_pack_schema_version,
141
+ read_packaged_document_bytes,
142
+ read_packaged_document_text,
143
+ )
144
+ ```
145
+
146
+ Load pack identity and schema version:
147
+
148
+ ```python
149
+ from ssot_pack_contracts import load_pack_metadata, load_pack_schema_version
150
+
151
+ metadata = load_pack_metadata("seo_aeo_aieo_governance_pack")
152
+ schema_version = load_pack_schema_version("seo_aeo_aieo_governance_pack")
153
+
154
+ print(metadata["ssot_package_name"])
155
+ print(metadata["pypi_package_name"])
156
+ print(metadata["version"])
157
+ print(schema_version)
158
+ ```
159
+
160
+ List and read packaged documents:
161
+
162
+ ```python
163
+ from ssot_pack_contracts import (
164
+ get_packaged_document_entry,
165
+ list_packaged_document_ids,
166
+ read_packaged_document_text,
167
+ )
168
+
169
+ document_ids = list_packaged_document_ids("seo_aeo_aieo_governance_pack", "spec")
170
+ entry = get_packaged_document_entry("seo_aeo_aieo_governance_pack", document_ids[0])
171
+ body = read_packaged_document_text("seo_aeo_aieo_governance_pack", "spec", entry["filename"])
172
+ ```
173
+
174
+ ## Contract rules
175
+
176
+ - Pack root APIs must be loaded from `ssot-pack-contracts`, not copied by hand.
177
+ - `metadata.schema_version` is required and must be available through `load_pack_schema_version`.
178
+ - `metadata.ssot_package_name` is required and must match `metadata.origin.package_name`.
179
+ - `metadata.origin.import_name` must match the installed import package.
180
+ - `metadata.origin.kind` must be `governance-pack`.
181
+ - `metadata.trust.origin` must be `extension-pack`.
182
+ - `metadata.trust.reservation_owner` must start with `extension-pack:`.
183
+ - `metadata.compatibility.python`, `metadata.compatibility.ssot_registry_schema`, and `metadata.compatibility.ssot_pack_contract` are required.
184
+ - Document manifest kinds must use normalized keys: `adr` and `spec`.
185
+ - Packaged document entries must include stable IDs, filenames, target paths, SHA-256 hashes, origin, reservation owner, compatibility metadata, status, and supersession fields.
186
+
187
+ ## Package relationships
188
+
189
+ - Package type: governance-pack contract package
190
+ - Depends on: standard library only, plus `tomli` on Python earlier than 3.11
191
+ - Used by: governance packs such as [seo-aeo-aieo-governance-pack](https://pypi.org/project/seo-aeo-aieo-governance-pack/), [digital-signature-governance-pack](https://pypi.org/project/digital-signature-governance-pack/), and [cache-freshness-governance-pack](https://pypi.org/project/cache-freshness-governance-pack/)
192
+ - Consumed by: [ssot-core](https://pypi.org/project/ssot-core/) pack ingestion and [ssot-cli](https://pypi.org/project/ssot-cli/) pack inspection, preflight, and sync workflows
193
+
194
+ If you are publishing an SSOT governance pack, use `ssot-pack-contracts` as the root API contract. If you are consuming packs, use [ssot-cli](https://pypi.org/project/ssot-cli/) or [ssot-core](https://pypi.org/project/ssot-core/) to inspect, preflight, and synchronize pack content into a governed registry.
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ssot-pack-contracts"
7
- version = "0.2.18"
7
+ version = "0.2.19.dev2"
8
8
  description = "Shared governance-pack metadata, manifest, and packaged document contracts for SSOT."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10,<3.15"
@@ -0,0 +1,218 @@
1
+ Metadata-Version: 2.4
2
+ Name: ssot-pack-contracts
3
+ Version: 0.2.19.dev2
4
+ Summary: Shared governance-pack metadata, manifest, and packaged document contracts for SSOT.
5
+ Author-email: Jacob Stewart <jacob@swarmauri.com>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/groupsum/ssot-registry/tree/main/pkgs/ssot-pack-contracts
8
+ Project-URL: Repository, https://github.com/groupsum/ssot-registry/tree/main/pkgs/ssot-pack-contracts
9
+ Project-URL: Issues, https://github.com/groupsum/ssot-registry/issues
10
+ Keywords: ssot,governance,packs,contracts,metadata,manifest
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3 :: Only
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Requires-Python: <3.15,>=3.10
22
+ Description-Content-Type: text/markdown
23
+ Requires-Dist: tomli>=2.0.1; python_version < "3.11"
24
+
25
+ <div align="center">
26
+ <h1>ssot-pack-contracts</h1>
27
+ <p><strong>Shared metadata, manifest, and packaged-document contracts for installable SSOT governance packs.</strong></p>
28
+ </div>
29
+
30
+ <div align="center">
31
+ <a href="https://pypi.org/project/ssot-pack-contracts/"><img src="https://img.shields.io/pypi/v/ssot-pack-contracts?label=PyPI%20version" alt="PyPI version" /></a>
32
+ <a href="https://pypi.org/project/ssot-pack-contracts/"><img src="https://img.shields.io/pypi/pyversions/ssot-pack-contracts?label=Python" alt="Supported Python versions" /></a>
33
+ <a href="https://pepy.tech/project/ssot-pack-contracts"><img src="https://static.pepy.tech/badge/ssot-pack-contracts" alt="Downloads" /></a>
34
+ <a href="https://hits.sh/github.com/groupsum/ssot-registry/"><img src="https://hits.sh/github.com/groupsum/ssot-registry.svg?style=flat-square" alt="Repository hits" /></a>
35
+ <!-- ssot-schema-badges:start -->
36
+ <img src="https://img.shields.io/badge/schema_version-0.4.0-blue" alt="schema_version 0.4.0" />
37
+ <img src="https://img.shields.io/badge/migration%20coverage-11%2F11-brightgreen" alt="Migration coverage 11/11" />
38
+ <!-- ssot-schema-badges:end -->
39
+ </div>
40
+
41
+ `ssot-pack-contracts` is the shared Python contract layer for installable SSOT governance packs.
42
+
43
+ It gives external governance packs one common API for declaring pack identity, schema compatibility, trust metadata, document manifests, and packaged ADR/SPEC resources. It does not mutate `.ssot/registry.json` and does not depend on [ssot-core](https://pypi.org/project/ssot-core/) or [ssot-cli](https://pypi.org/project/ssot-cli/).
44
+
45
+ - GitHub: https://github.com/groupsum/ssot-registry/tree/main/pkgs/ssot-pack-contracts
46
+ - PyPI: https://pypi.org/project/ssot-pack-contracts/
47
+
48
+ ## What this package owns
49
+
50
+ - Governance-pack metadata loading and validation
51
+ - Governance-pack schema version access
52
+ - PyPI distribution name and version discovery through installed package metadata
53
+ - Pack document manifest loading for ADR and SPEC payloads
54
+ - Packaged document text and byte readers
55
+ - Document ID listing and manifest-entry lookup helpers
56
+ - Fail-closed validation errors for invalid pack metadata or manifest entries
57
+
58
+ ## When to use this package
59
+
60
+ Use `ssot-pack-contracts` when you are building an installable governance pack that ships SSOT ADRs, SPECs, or other governed pack documents as Python package resources.
61
+
62
+ Use another package when you want:
63
+
64
+ - [ssot-contracts](https://pypi.org/project/ssot-contracts/) for canonical SSOT schemas, templates, and generated contract metadata
65
+ - [ssot-core](https://pypi.org/project/ssot-core/) for registry loading, validation, synchronization, pack ingestion, and mutation APIs
66
+ - [ssot-cli](https://pypi.org/project/ssot-cli/) for operator commands such as pack inspection, preflight checks, and sync workflows
67
+ - [ssot-registry](https://pypi.org/project/ssot-registry/) for the umbrella runtime bundle
68
+
69
+ ## Governance packs using this contract
70
+
71
+ These governance packs are expected to expose the `ssot-pack-contracts` API surface from their package root:
72
+
73
+ - [seo-aeo-aieo-governance-pack](https://pypi.org/project/seo-aeo-aieo-governance-pack/) packages SEO, AEO, and AiEO governance ADR/SPEC content.
74
+ - [digital-signature-governance-pack](https://pypi.org/project/digital-signature-governance-pack/) packages digital-signature governance ADR/SPEC content.
75
+ - [cache-freshness-governance-pack](https://pypi.org/project/cache-freshness-governance-pack/) packages cache freshness and cache governance ADR/SPEC content.
76
+
77
+ Each pack should depend on `ssot-pack-contracts`, include a packaged `metadata.json`, include declared document manifests, and bind the shared API at the package root.
78
+
79
+ ## Install
80
+
81
+ ```bash
82
+ python -m pip install ssot-pack-contracts
83
+ ```
84
+
85
+ For local development from this repository:
86
+
87
+ ```bash
88
+ python -m pip install -e pkgs/ssot-pack-contracts
89
+ ```
90
+
91
+ ## Pack authoring pattern
92
+
93
+ Governance packs should not reimplement the contract API. Their package root should bind and export the shared contract functions:
94
+
95
+ ```python
96
+ from ssot_pack_contracts import bind_pack_contract
97
+
98
+ globals().update(bind_pack_contract(__name__))
99
+ ```
100
+
101
+ The binder resolves:
102
+
103
+ - `__pypi_package_name__` from installed distribution metadata
104
+ - `__version__` from `importlib.metadata.version(...)`
105
+ - `__ssot_package_name__` from packaged governance metadata
106
+ - `load_pack_metadata`
107
+ - `load_pack_schema_version`
108
+ - `load_pack_manifest`
109
+ - `load_document_manifest`
110
+ - `read_packaged_document_bytes`
111
+ - `read_packaged_document_text`
112
+ - `list_packaged_document_ids`
113
+ - `get_packaged_document_entry`
114
+
115
+ ## Required metadata
116
+
117
+ Every governance pack must package a `metadata.json` resource at the import-package root. The metadata file is the source of truth for SSOT pack identity.
118
+
119
+ Required top-level fields:
120
+
121
+ ```json
122
+ {
123
+ "schema_version": "1.0.0",
124
+ "ssot_package_name": "example-governance-pack",
125
+ "origin": {
126
+ "id": "pack:example-governance-pack",
127
+ "package_name": "example-governance-pack",
128
+ "import_name": "example_governance_pack",
129
+ "kind": "governance-pack"
130
+ },
131
+ "compatibility": {
132
+ "python": ">=3.10,<3.15",
133
+ "ssot_registry_schema": ">=0.4.0,<0.5.0",
134
+ "ssot_pack_contract": ">=0.2.18,<0.3.0"
135
+ },
136
+ "trust": {
137
+ "origin": "extension-pack",
138
+ "trusted_by_default": false,
139
+ "reservation_owner": "extension-pack:example-governance-pack"
140
+ },
141
+ "documents": {
142
+ "adr": {
143
+ "manifest_path": "adr/manifest.json"
144
+ },
145
+ "spec": {
146
+ "manifest_path": "specs/manifest.json"
147
+ }
148
+ }
149
+ }
150
+ ```
151
+
152
+ The package version is not authored in `metadata.json`. It is loaded from the installed PyPI distribution metadata, which is generated from the pack's `pyproject.toml`.
153
+
154
+ ## Public API
155
+
156
+ ```python
157
+ from ssot_pack_contracts import (
158
+ bind_pack_contract,
159
+ get_packaged_document_entry,
160
+ list_packaged_document_ids,
161
+ load_document_manifest,
162
+ load_pack_manifest,
163
+ load_pack_metadata,
164
+ load_pack_schema_version,
165
+ read_packaged_document_bytes,
166
+ read_packaged_document_text,
167
+ )
168
+ ```
169
+
170
+ Load pack identity and schema version:
171
+
172
+ ```python
173
+ from ssot_pack_contracts import load_pack_metadata, load_pack_schema_version
174
+
175
+ metadata = load_pack_metadata("seo_aeo_aieo_governance_pack")
176
+ schema_version = load_pack_schema_version("seo_aeo_aieo_governance_pack")
177
+
178
+ print(metadata["ssot_package_name"])
179
+ print(metadata["pypi_package_name"])
180
+ print(metadata["version"])
181
+ print(schema_version)
182
+ ```
183
+
184
+ List and read packaged documents:
185
+
186
+ ```python
187
+ from ssot_pack_contracts import (
188
+ get_packaged_document_entry,
189
+ list_packaged_document_ids,
190
+ read_packaged_document_text,
191
+ )
192
+
193
+ document_ids = list_packaged_document_ids("seo_aeo_aieo_governance_pack", "spec")
194
+ entry = get_packaged_document_entry("seo_aeo_aieo_governance_pack", document_ids[0])
195
+ body = read_packaged_document_text("seo_aeo_aieo_governance_pack", "spec", entry["filename"])
196
+ ```
197
+
198
+ ## Contract rules
199
+
200
+ - Pack root APIs must be loaded from `ssot-pack-contracts`, not copied by hand.
201
+ - `metadata.schema_version` is required and must be available through `load_pack_schema_version`.
202
+ - `metadata.ssot_package_name` is required and must match `metadata.origin.package_name`.
203
+ - `metadata.origin.import_name` must match the installed import package.
204
+ - `metadata.origin.kind` must be `governance-pack`.
205
+ - `metadata.trust.origin` must be `extension-pack`.
206
+ - `metadata.trust.reservation_owner` must start with `extension-pack:`.
207
+ - `metadata.compatibility.python`, `metadata.compatibility.ssot_registry_schema`, and `metadata.compatibility.ssot_pack_contract` are required.
208
+ - Document manifest kinds must use normalized keys: `adr` and `spec`.
209
+ - Packaged document entries must include stable IDs, filenames, target paths, SHA-256 hashes, origin, reservation owner, compatibility metadata, status, and supersession fields.
210
+
211
+ ## Package relationships
212
+
213
+ - Package type: governance-pack contract package
214
+ - Depends on: standard library only, plus `tomli` on Python earlier than 3.11
215
+ - Used by: governance packs such as [seo-aeo-aieo-governance-pack](https://pypi.org/project/seo-aeo-aieo-governance-pack/), [digital-signature-governance-pack](https://pypi.org/project/digital-signature-governance-pack/), and [cache-freshness-governance-pack](https://pypi.org/project/cache-freshness-governance-pack/)
216
+ - Consumed by: [ssot-core](https://pypi.org/project/ssot-core/) pack ingestion and [ssot-cli](https://pypi.org/project/ssot-cli/) pack inspection, preflight, and sync workflows
217
+
218
+ If you are publishing an SSOT governance pack, use `ssot-pack-contracts` as the root API contract. If you are consuming packs, use [ssot-cli](https://pypi.org/project/ssot-cli/) or [ssot-core](https://pypi.org/project/ssot-core/) to inspect, preflight, and synchronize pack content into a governed registry.
@@ -1,29 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: ssot-pack-contracts
3
- Version: 0.2.18
4
- Summary: Shared governance-pack metadata, manifest, and packaged document contracts for SSOT.
5
- Author-email: Jacob Stewart <jacob@swarmauri.com>
6
- License-Expression: Apache-2.0
7
- Project-URL: Homepage, https://github.com/groupsum/ssot-registry/tree/main/pkgs/ssot-pack-contracts
8
- Project-URL: Repository, https://github.com/groupsum/ssot-registry/tree/main/pkgs/ssot-pack-contracts
9
- Project-URL: Issues, https://github.com/groupsum/ssot-registry/issues
10
- Keywords: ssot,governance,packs,contracts,metadata,manifest
11
- Classifier: Development Status :: 3 - Alpha
12
- Classifier: Intended Audience :: Developers
13
- Classifier: Programming Language :: Python :: 3
14
- Classifier: Programming Language :: Python :: 3 :: Only
15
- Classifier: Programming Language :: Python :: 3.10
16
- Classifier: Programming Language :: Python :: 3.11
17
- Classifier: Programming Language :: Python :: 3.12
18
- Classifier: Programming Language :: Python :: 3.13
19
- Classifier: Programming Language :: Python :: 3.14
20
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
- Requires-Python: <3.15,>=3.10
22
- Description-Content-Type: text/markdown
23
- Requires-Dist: tomli>=2.0.1; python_version < "3.11"
24
-
25
- # ssot-pack-contracts
26
-
27
- Shared Python contracts for installable SSOT governance packs.
28
-
29
- The package validates pack metadata, document manifests, and packaged document resources without depending on `ssot-core`, `ssot-cli`, or any repository mutation layer.
@@ -1,5 +0,0 @@
1
- # ssot-pack-contracts
2
-
3
- Shared Python contracts for installable SSOT governance packs.
4
-
5
- The package validates pack metadata, document manifests, and packaged document resources without depending on `ssot-core`, `ssot-cli`, or any repository mutation layer.
@@ -1,29 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: ssot-pack-contracts
3
- Version: 0.2.18
4
- Summary: Shared governance-pack metadata, manifest, and packaged document contracts for SSOT.
5
- Author-email: Jacob Stewart <jacob@swarmauri.com>
6
- License-Expression: Apache-2.0
7
- Project-URL: Homepage, https://github.com/groupsum/ssot-registry/tree/main/pkgs/ssot-pack-contracts
8
- Project-URL: Repository, https://github.com/groupsum/ssot-registry/tree/main/pkgs/ssot-pack-contracts
9
- Project-URL: Issues, https://github.com/groupsum/ssot-registry/issues
10
- Keywords: ssot,governance,packs,contracts,metadata,manifest
11
- Classifier: Development Status :: 3 - Alpha
12
- Classifier: Intended Audience :: Developers
13
- Classifier: Programming Language :: Python :: 3
14
- Classifier: Programming Language :: Python :: 3 :: Only
15
- Classifier: Programming Language :: Python :: 3.10
16
- Classifier: Programming Language :: Python :: 3.11
17
- Classifier: Programming Language :: Python :: 3.12
18
- Classifier: Programming Language :: Python :: 3.13
19
- Classifier: Programming Language :: Python :: 3.14
20
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
- Requires-Python: <3.15,>=3.10
22
- Description-Content-Type: text/markdown
23
- Requires-Dist: tomli>=2.0.1; python_version < "3.11"
24
-
25
- # ssot-pack-contracts
26
-
27
- Shared Python contracts for installable SSOT governance packs.
28
-
29
- The package validates pack metadata, document manifests, and packaged document resources without depending on `ssot-core`, `ssot-cli`, or any repository mutation layer.