sclite-core 0.2.1__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.
- sclite_core-0.2.1/LICENSE +21 -0
- sclite_core-0.2.1/PKG-INFO +266 -0
- sclite_core-0.2.1/README.md +237 -0
- sclite_core-0.2.1/pyproject.toml +75 -0
- sclite_core-0.2.1/sclite/__init__.py +83 -0
- sclite_core-0.2.1/sclite/artifacts.py +539 -0
- sclite_core-0.2.1/sclite/cli.py +224 -0
- sclite_core-0.2.1/sclite/examples/__init__.py +0 -0
- sclite_core-0.2.1/sclite/examples/contract-lifecycle-v0.2/README.md +14 -0
- sclite_core-0.2.1/sclite/examples/contract-lifecycle-v0.2/artifact_chain_manifest.json +114 -0
- sclite_core-0.2.1/sclite/examples/contract-lifecycle-v0.2/evidence_contract.json +54 -0
- sclite_core-0.2.1/sclite/examples/contract-lifecycle-v0.2/execution_contract.json +67 -0
- sclite_core-0.2.1/sclite/examples/contract-lifecycle-v0.2/execution_receipt.json +62 -0
- sclite_core-0.2.1/sclite/examples/contract-lifecycle-v0.2/execution_ticket.json +72 -0
- sclite_core-0.2.1/sclite/examples/contract-lifecycle-v0.2/intent_contract.json +38 -0
- sclite_core-0.2.1/sclite/examples/contract-lifecycle-v0.2/policy_decision.json +46 -0
- sclite_core-0.2.1/sclite/examples/prepared-execution-spec/README.md +3 -0
- sclite_core-0.2.1/sclite/examples/prepared-execution-spec/prepared_execution_spec.json +69 -0
- sclite_core-0.2.1/sclite/examples/public-snapshot-manifest/README.md +3 -0
- sclite_core-0.2.1/sclite/examples/public-snapshot-manifest/public_snapshot_manifest.json +85 -0
- sclite_core-0.2.1/sclite/examples/public-validation-surface-index/README.md +3 -0
- sclite_core-0.2.1/sclite/examples/public-validation-surface-index/public_validation_surface_index.json +65 -0
- sclite_core-0.2.1/sclite/examples/redaction-policy/README.md +3 -0
- sclite_core-0.2.1/sclite/examples/redaction-policy/redaction_policy.json +66 -0
- sclite_core-0.2.1/sclite/examples/redaction-receipt/README.md +3 -0
- sclite_core-0.2.1/sclite/examples/redaction-receipt/redaction_receipt.json +35 -0
- sclite_core-0.2.1/sclite/examples/scope-fidelity-report/README.md +11 -0
- sclite_core-0.2.1/sclite/examples/scope-fidelity-report/scope_fidelity_report.json +39 -0
- sclite_core-0.2.1/sclite/examples/security-contract-proof/README.md +25 -0
- sclite_core-0.2.1/sclite/examples/security-contract-proof/approved_execution_spec.json +107 -0
- sclite_core-0.2.1/sclite/examples/security-contract-proof/evidence_bundle.json +65 -0
- sclite_core-0.2.1/sclite/examples/security-contract-proof/evidence_summary.md +22 -0
- sclite_core-0.2.1/sclite/examples/security-contract-proof/execution_receipt.json +22 -0
- sclite_core-0.2.1/sclite/examples/security-contract-proof/policy_decision.json +29 -0
- sclite_core-0.2.1/sclite/examples/security-contract-proof/prepared_execution_spec.redacted.json +86 -0
- sclite_core-0.2.1/sclite/hosts.py +56 -0
- sclite_core-0.2.1/sclite/integrity/__init__.py +19 -0
- sclite_core-0.2.1/sclite/integrity/chain.py +263 -0
- sclite_core-0.2.1/sclite/redaction.py +216 -0
- sclite_core-0.2.1/sclite/schemas/__init__.py +0 -0
- sclite_core-0.2.1/sclite/schemas/approved_execution_spec.v0.1.schema.json +290 -0
- sclite_core-0.2.1/sclite/schemas/artifact_chain_manifest.v0.2.schema.json +35 -0
- sclite_core-0.2.1/sclite/schemas/evidence_bundle.v0.1.schema.json +137 -0
- sclite_core-0.2.1/sclite/schemas/evidence_contract.v0.2.schema.json +67 -0
- sclite_core-0.2.1/sclite/schemas/execution_contract.v0.2.schema.json +56 -0
- sclite_core-0.2.1/sclite/schemas/execution_receipt.v0.1.schema.json +112 -0
- sclite_core-0.2.1/sclite/schemas/execution_receipt.v0.2.schema.json +20 -0
- sclite_core-0.2.1/sclite/schemas/execution_ticket.v0.2.schema.json +89 -0
- sclite_core-0.2.1/sclite/schemas/intent_contract.v0.2.schema.json +21 -0
- sclite_core-0.2.1/sclite/schemas/policy_decision.v0.1.schema.json +90 -0
- sclite_core-0.2.1/sclite/schemas/policy_decision.v0.2.schema.json +21 -0
- sclite_core-0.2.1/sclite/schemas/prepared_execution_spec.v0.1.schema.json +180 -0
- sclite_core-0.2.1/sclite/schemas/public_snapshot_manifest.v0.1.schema.json +146 -0
- sclite_core-0.2.1/sclite/schemas/public_validation_surface_index.v0.1.schema.json +125 -0
- sclite_core-0.2.1/sclite/schemas/redacted_prepared_execution_spec.v0.1.schema.json +245 -0
- sclite_core-0.2.1/sclite/schemas/redaction_policy.v0.1.schema.json +103 -0
- sclite_core-0.2.1/sclite/schemas/redaction_receipt.v0.1.schema.json +145 -0
- sclite_core-0.2.1/sclite/schemas/scope_fidelity_report.v0.1.schema.json +111 -0
- sclite_core-0.2.1/sclite/schemas/security_contract_validation_receipt.v0.1.schema.json +156 -0
- sclite_core-0.2.1/sclite/scope_fidelity.py +168 -0
- sclite_core-0.2.1/sclite/surfaces.py +148 -0
- sclite_core-0.2.1/sclite/validation.py +223 -0
- sclite_core-0.2.1/sclite_core.egg-info/PKG-INFO +266 -0
- sclite_core-0.2.1/sclite_core.egg-info/SOURCES.txt +70 -0
- sclite_core-0.2.1/sclite_core.egg-info/dependency_links.txt +1 -0
- sclite_core-0.2.1/sclite_core.egg-info/entry_points.txt +3 -0
- sclite_core-0.2.1/sclite_core.egg-info/requires.txt +3 -0
- sclite_core-0.2.1/sclite_core.egg-info/top_level.txt +1 -0
- sclite_core-0.2.1/setup.cfg +4 -0
- sclite_core-0.2.1/tests/test_integrity_chain.py +182 -0
- sclite_core-0.2.1/tests/test_internal_package.py +183 -0
- sclite_core-0.2.1/tests/test_scope_fidelity.py +97 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ravenclaw Security Contract Layer contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sclite-core
|
|
3
|
+
Version: 0.2.1
|
|
4
|
+
Summary: Lightweight Security Contract Layer lifecycle artifacts, validation, and cryptographic integrity chain fixtures
|
|
5
|
+
Author: Krzysztof Probola
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/rozmiarD/SCLite
|
|
8
|
+
Project-URL: Repository, https://github.com/rozmiarD/SCLite
|
|
9
|
+
Project-URL: Issues, https://github.com/rozmiarD/SCLite/issues
|
|
10
|
+
Project-URL: Changelog, https://github.com/rozmiarD/SCLite/blob/main/CHANGELOG.md
|
|
11
|
+
Project-URL: Documentation, https://github.com/rozmiarD/SCLite#readme
|
|
12
|
+
Keywords: security,contracts,validation,evidence,governance
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: Information Technology
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Topic :: Security
|
|
22
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
23
|
+
Requires-Python: >=3.11
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: pytest<9,>=8; extra == "dev"
|
|
28
|
+
Dynamic: license-file
|
|
29
|
+
|
|
30
|
+
# SCLite
|
|
31
|
+
|
|
32
|
+
[](https://github.com/rozmiarD/SCLite/actions/workflows/ci.yml)
|
|
33
|
+
[](LICENSE)
|
|
34
|
+
[](pyproject.toml)
|
|
35
|
+
[](pyproject.toml)
|
|
36
|
+
[](schemas/)
|
|
37
|
+
|
|
38
|
+
Lightweight Security Contract Layer for auditable AI/security contract lifecycles.
|
|
39
|
+
|
|
40
|
+
Project owner: **Krzysztof Probola**.
|
|
41
|
+
|
|
42
|
+
SCLite v0.2 separates what an agent wants, what policy allows, what was approved, what was executed, and what can be proven.
|
|
43
|
+
|
|
44
|
+
## Status
|
|
45
|
+
|
|
46
|
+
- Version: `0.2.1`
|
|
47
|
+
- Status: **draft lifecycle candidate**
|
|
48
|
+
- Runtime execution: not included
|
|
49
|
+
- Protocol/carrier adapters: not included
|
|
50
|
+
- Integrity: canonical SHA-256 artifact descriptors + ordered hash-linked lifecycle manifest
|
|
51
|
+
- Identity/PKI: not included in core
|
|
52
|
+
|
|
53
|
+
SCLite v0.2 is a **contract lifecycle**, not an execution engine. Runtimes such as Ravenclaw can consume SCLite artifacts and enforce tickets, but executors, sandboxes, policy engines, raw evidence storage, agent loops, and carrier adapters stay outside this package.
|
|
54
|
+
|
|
55
|
+
## Project sentence
|
|
56
|
+
|
|
57
|
+
> SCLite separates what an agent wants, what policy allows, what was approved, what was executed, and what can be proven.
|
|
58
|
+
|
|
59
|
+
## What problem does SCLite solve?
|
|
60
|
+
|
|
61
|
+
AI-assisted security workflows often blur separate authority boundaries:
|
|
62
|
+
|
|
63
|
+
1. a model proposes intent;
|
|
64
|
+
2. policy/scope decides whether the request may proceed;
|
|
65
|
+
3. code prepares a concrete execution shape;
|
|
66
|
+
4. an auditor/reviewer approves or rejects that shape;
|
|
67
|
+
5. a runtime executes or dry-runs under bounds;
|
|
68
|
+
6. evidence is summarized for review.
|
|
69
|
+
|
|
70
|
+
SCLite turns those steps into small schema-backed JSON artifacts and verifies their integrity locally. A reviewer can check the public-safe bundle without running live targets or reading private logs.
|
|
71
|
+
|
|
72
|
+
## v0.2 canonical lifecycle
|
|
73
|
+
|
|
74
|
+
```text
|
|
75
|
+
intent_contract -> policy_decision -> execution_contract -> execution_ticket -> execution_receipt -> evidence_contract -> artifact_chain_manifest
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Current v0.2 artifacts:
|
|
79
|
+
|
|
80
|
+
| Artifact | Purpose |
|
|
81
|
+
| --- | --- |
|
|
82
|
+
| `IntentContract` | Captures what an agent/caller wants before authority exists. |
|
|
83
|
+
| `PolicyDecision` v0.2 | Captures allow/deny/review policy outcome bound to intent. |
|
|
84
|
+
| `ExecutionContract` | Captures the exact bounded execution shape prepared for review. |
|
|
85
|
+
| `ExecutionTicket` | Captures approval for one exact execution contract under explicit bounds and validity. |
|
|
86
|
+
| `ExecutionReceipt` v0.2 | Captures what an external runtime reports as executed or dry-run. |
|
|
87
|
+
| `EvidenceContract` | Captures public-safe claims, non-claims, replay, verification, and evidence links. |
|
|
88
|
+
| `ArtifactChainManifest` | Ordered tamper-evident hash chain over lifecycle artifacts. |
|
|
89
|
+
|
|
90
|
+
Verify the lifecycle fixture:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
sclite validate-chain sclite/examples/contract-lifecycle-v0.2/artifact_chain_manifest.json
|
|
94
|
+
sclite verify-lifecycle sclite/examples/contract-lifecycle-v0.2/artifact_chain_manifest.json
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
`verify-lifecycle` currently uses the same verifier as `validate-chain`; the name exists because it describes the v0.2 review action more clearly.
|
|
98
|
+
|
|
99
|
+
## What the verifier checks
|
|
100
|
+
|
|
101
|
+
The v0.2 verifier checks more than raw hashes:
|
|
102
|
+
|
|
103
|
+
- manifest paths cannot escape the artifact root;
|
|
104
|
+
- artifact descriptors match canonical SHA-256 digests;
|
|
105
|
+
- hash-chain links and root digest recompute correctly;
|
|
106
|
+
- lifecycle artifacts appear in the canonical order;
|
|
107
|
+
- policy binds the correct intent digest;
|
|
108
|
+
- ticket binds the correct execution contract digest;
|
|
109
|
+
- receipt binds the correct execution ticket digest;
|
|
110
|
+
- evidence contract binds the correct receipt digest.
|
|
111
|
+
|
|
112
|
+
## What SCLite is
|
|
113
|
+
|
|
114
|
+
SCLite core is limited to:
|
|
115
|
+
|
|
116
|
+
```text
|
|
117
|
+
define / validate / hash / bind / redact / verify
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
It provides:
|
|
121
|
+
|
|
122
|
+
- JSON schemas for lifecycle and compatibility artifacts;
|
|
123
|
+
- deterministic artifact hashing helpers;
|
|
124
|
+
- v0.2 lifecycle/chain verification;
|
|
125
|
+
- redaction/public-snapshot helper artifacts;
|
|
126
|
+
- a CLI for local validation and review fixtures;
|
|
127
|
+
- legacy v0.1 compatibility fixtures and schemas.
|
|
128
|
+
|
|
129
|
+
## What SCLite is not
|
|
130
|
+
|
|
131
|
+
SCLite is not:
|
|
132
|
+
|
|
133
|
+
- a security scanner;
|
|
134
|
+
- an executor;
|
|
135
|
+
- a sandbox;
|
|
136
|
+
- a full policy engine;
|
|
137
|
+
- an approval authority by itself;
|
|
138
|
+
- an agent loop;
|
|
139
|
+
- a tool wrapper package for `nmap`, `ffuf`, etc.;
|
|
140
|
+
- an MCP/OpenClaw/A2A protocol replacement;
|
|
141
|
+
- a proof of legal authorization;
|
|
142
|
+
- a proof of live vulnerability evidence;
|
|
143
|
+
- a proof of signer identity or PKI trust;
|
|
144
|
+
- a tamper-proof transparency log.
|
|
145
|
+
|
|
146
|
+
## Legacy v0.1 compatibility
|
|
147
|
+
|
|
148
|
+
The older public-safe v0.1 proof trace remains supported:
|
|
149
|
+
|
|
150
|
+
```text
|
|
151
|
+
scope/input -> policy decision -> prepared execution spec -> approved execution spec -> dry-run execution receipt -> evidence summary
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
v0.1 compatibility artifacts remain available for existing integrations, including Ravenclaw public proof fixtures. New lifecycle work should use the v0.2 model.
|
|
155
|
+
|
|
156
|
+
See [`SPEC.md`](SPEC.md) for the canonical model, artifact definitions, integrity chain, compatibility notes, and explicit security boundaries.
|
|
157
|
+
|
|
158
|
+
## Project docs
|
|
159
|
+
|
|
160
|
+
- [`PUBLIC_STATUS.md`](PUBLIC_STATUS.md) — current maturity and non-claims.
|
|
161
|
+
- [`VALIDATION.md`](VALIDATION.md) — local validation and build gates.
|
|
162
|
+
- [`PUBLICATION_CHECKLIST.md`](PUBLICATION_CHECKLIST.md) — release/publication checklist.
|
|
163
|
+
- [`CHANGELOG.md`](CHANGELOG.md) — notable package changes.
|
|
164
|
+
- [`CONTRIBUTING.md`](CONTRIBUTING.md) — contribution and boundary rules.
|
|
165
|
+
- [`SECURITY.md`](SECURITY.md) — security reporting and fixture-safety policy.
|
|
166
|
+
|
|
167
|
+
## Installation
|
|
168
|
+
|
|
169
|
+
Once published to PyPI, the intended install path is:
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
pip install sclite-core
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Install directly from GitHub:
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
pip install git+https://github.com/rozmiarD/SCLite.git
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
From a local checkout:
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
python -m venv .venv
|
|
185
|
+
. .venv/bin/activate
|
|
186
|
+
python -m pip install -e '.[dev]'
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
Runtime dependencies are intentionally empty. The `dev` extra installs `pytest` for local tests.
|
|
190
|
+
|
|
191
|
+
## CLI quickstart
|
|
192
|
+
|
|
193
|
+
Validate the v0.2 lifecycle chain:
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
sclite validate-chain sclite/examples/contract-lifecycle-v0.2/artifact_chain_manifest.json
|
|
197
|
+
sclite verify-lifecycle sclite/examples/contract-lifecycle-v0.2/artifact_chain_manifest.json
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Validate the legacy public-safe proof fixture:
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
sclite validate examples/security-contract-proof
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Validate one artifact against a schema:
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
sclite validate-artifact \
|
|
210
|
+
--schema prepared_execution_spec.v0.1 \
|
|
211
|
+
examples/prepared-execution-spec/prepared_execution_spec.json
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Hash one artifact with deterministic SCLite canonical JSON + SHA-256:
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
sclite hash-artifact \
|
|
218
|
+
--schema approved_execution_spec.v0.1 \
|
|
219
|
+
examples/security-contract-proof/approved_execution_spec.json
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
Generate a Scope Fidelity report from the approved spec fixture:
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
sclite scope-fidelity \
|
|
226
|
+
--approved-spec examples/security-contract-proof/approved_execution_spec.json \
|
|
227
|
+
--fail-on review
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
Emit a validation receipt for the proof fixture:
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
sclite validation-receipt examples/security-contract-proof
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
Run tests:
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
python -m pytest -q
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
## Python usage
|
|
243
|
+
|
|
244
|
+
```python
|
|
245
|
+
from sclite.integrity import verify_artifact_chain_manifest
|
|
246
|
+
|
|
247
|
+
# Load artifact_chain_manifest.json as a dict and verify it against a local root.
|
|
248
|
+
result = verify_artifact_chain_manifest(manifest, root=fixture_dir)
|
|
249
|
+
assert result["status"] == "passed"
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
## Repository layout
|
|
253
|
+
|
|
254
|
+
```text
|
|
255
|
+
sclite/ Python package
|
|
256
|
+
sclite/schemas/ Packaged schemas
|
|
257
|
+
sclite/examples/contract-lifecycle-v0.2/
|
|
258
|
+
examples/security-contract-proof/ Legacy v0.1 public-safe proof fixture
|
|
259
|
+
schemas/ Source schema copies
|
|
260
|
+
SPEC.md v0.2 draft specification
|
|
261
|
+
CHANGELOG.md Release notes
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
## License
|
|
265
|
+
|
|
266
|
+
MIT. See [`LICENSE`](LICENSE).
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
# SCLite
|
|
2
|
+
|
|
3
|
+
[](https://github.com/rozmiarD/SCLite/actions/workflows/ci.yml)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
[](pyproject.toml)
|
|
6
|
+
[](pyproject.toml)
|
|
7
|
+
[](schemas/)
|
|
8
|
+
|
|
9
|
+
Lightweight Security Contract Layer for auditable AI/security contract lifecycles.
|
|
10
|
+
|
|
11
|
+
Project owner: **Krzysztof Probola**.
|
|
12
|
+
|
|
13
|
+
SCLite v0.2 separates what an agent wants, what policy allows, what was approved, what was executed, and what can be proven.
|
|
14
|
+
|
|
15
|
+
## Status
|
|
16
|
+
|
|
17
|
+
- Version: `0.2.1`
|
|
18
|
+
- Status: **draft lifecycle candidate**
|
|
19
|
+
- Runtime execution: not included
|
|
20
|
+
- Protocol/carrier adapters: not included
|
|
21
|
+
- Integrity: canonical SHA-256 artifact descriptors + ordered hash-linked lifecycle manifest
|
|
22
|
+
- Identity/PKI: not included in core
|
|
23
|
+
|
|
24
|
+
SCLite v0.2 is a **contract lifecycle**, not an execution engine. Runtimes such as Ravenclaw can consume SCLite artifacts and enforce tickets, but executors, sandboxes, policy engines, raw evidence storage, agent loops, and carrier adapters stay outside this package.
|
|
25
|
+
|
|
26
|
+
## Project sentence
|
|
27
|
+
|
|
28
|
+
> SCLite separates what an agent wants, what policy allows, what was approved, what was executed, and what can be proven.
|
|
29
|
+
|
|
30
|
+
## What problem does SCLite solve?
|
|
31
|
+
|
|
32
|
+
AI-assisted security workflows often blur separate authority boundaries:
|
|
33
|
+
|
|
34
|
+
1. a model proposes intent;
|
|
35
|
+
2. policy/scope decides whether the request may proceed;
|
|
36
|
+
3. code prepares a concrete execution shape;
|
|
37
|
+
4. an auditor/reviewer approves or rejects that shape;
|
|
38
|
+
5. a runtime executes or dry-runs under bounds;
|
|
39
|
+
6. evidence is summarized for review.
|
|
40
|
+
|
|
41
|
+
SCLite turns those steps into small schema-backed JSON artifacts and verifies their integrity locally. A reviewer can check the public-safe bundle without running live targets or reading private logs.
|
|
42
|
+
|
|
43
|
+
## v0.2 canonical lifecycle
|
|
44
|
+
|
|
45
|
+
```text
|
|
46
|
+
intent_contract -> policy_decision -> execution_contract -> execution_ticket -> execution_receipt -> evidence_contract -> artifact_chain_manifest
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Current v0.2 artifacts:
|
|
50
|
+
|
|
51
|
+
| Artifact | Purpose |
|
|
52
|
+
| --- | --- |
|
|
53
|
+
| `IntentContract` | Captures what an agent/caller wants before authority exists. |
|
|
54
|
+
| `PolicyDecision` v0.2 | Captures allow/deny/review policy outcome bound to intent. |
|
|
55
|
+
| `ExecutionContract` | Captures the exact bounded execution shape prepared for review. |
|
|
56
|
+
| `ExecutionTicket` | Captures approval for one exact execution contract under explicit bounds and validity. |
|
|
57
|
+
| `ExecutionReceipt` v0.2 | Captures what an external runtime reports as executed or dry-run. |
|
|
58
|
+
| `EvidenceContract` | Captures public-safe claims, non-claims, replay, verification, and evidence links. |
|
|
59
|
+
| `ArtifactChainManifest` | Ordered tamper-evident hash chain over lifecycle artifacts. |
|
|
60
|
+
|
|
61
|
+
Verify the lifecycle fixture:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
sclite validate-chain sclite/examples/contract-lifecycle-v0.2/artifact_chain_manifest.json
|
|
65
|
+
sclite verify-lifecycle sclite/examples/contract-lifecycle-v0.2/artifact_chain_manifest.json
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
`verify-lifecycle` currently uses the same verifier as `validate-chain`; the name exists because it describes the v0.2 review action more clearly.
|
|
69
|
+
|
|
70
|
+
## What the verifier checks
|
|
71
|
+
|
|
72
|
+
The v0.2 verifier checks more than raw hashes:
|
|
73
|
+
|
|
74
|
+
- manifest paths cannot escape the artifact root;
|
|
75
|
+
- artifact descriptors match canonical SHA-256 digests;
|
|
76
|
+
- hash-chain links and root digest recompute correctly;
|
|
77
|
+
- lifecycle artifacts appear in the canonical order;
|
|
78
|
+
- policy binds the correct intent digest;
|
|
79
|
+
- ticket binds the correct execution contract digest;
|
|
80
|
+
- receipt binds the correct execution ticket digest;
|
|
81
|
+
- evidence contract binds the correct receipt digest.
|
|
82
|
+
|
|
83
|
+
## What SCLite is
|
|
84
|
+
|
|
85
|
+
SCLite core is limited to:
|
|
86
|
+
|
|
87
|
+
```text
|
|
88
|
+
define / validate / hash / bind / redact / verify
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
It provides:
|
|
92
|
+
|
|
93
|
+
- JSON schemas for lifecycle and compatibility artifacts;
|
|
94
|
+
- deterministic artifact hashing helpers;
|
|
95
|
+
- v0.2 lifecycle/chain verification;
|
|
96
|
+
- redaction/public-snapshot helper artifacts;
|
|
97
|
+
- a CLI for local validation and review fixtures;
|
|
98
|
+
- legacy v0.1 compatibility fixtures and schemas.
|
|
99
|
+
|
|
100
|
+
## What SCLite is not
|
|
101
|
+
|
|
102
|
+
SCLite is not:
|
|
103
|
+
|
|
104
|
+
- a security scanner;
|
|
105
|
+
- an executor;
|
|
106
|
+
- a sandbox;
|
|
107
|
+
- a full policy engine;
|
|
108
|
+
- an approval authority by itself;
|
|
109
|
+
- an agent loop;
|
|
110
|
+
- a tool wrapper package for `nmap`, `ffuf`, etc.;
|
|
111
|
+
- an MCP/OpenClaw/A2A protocol replacement;
|
|
112
|
+
- a proof of legal authorization;
|
|
113
|
+
- a proof of live vulnerability evidence;
|
|
114
|
+
- a proof of signer identity or PKI trust;
|
|
115
|
+
- a tamper-proof transparency log.
|
|
116
|
+
|
|
117
|
+
## Legacy v0.1 compatibility
|
|
118
|
+
|
|
119
|
+
The older public-safe v0.1 proof trace remains supported:
|
|
120
|
+
|
|
121
|
+
```text
|
|
122
|
+
scope/input -> policy decision -> prepared execution spec -> approved execution spec -> dry-run execution receipt -> evidence summary
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
v0.1 compatibility artifacts remain available for existing integrations, including Ravenclaw public proof fixtures. New lifecycle work should use the v0.2 model.
|
|
126
|
+
|
|
127
|
+
See [`SPEC.md`](SPEC.md) for the canonical model, artifact definitions, integrity chain, compatibility notes, and explicit security boundaries.
|
|
128
|
+
|
|
129
|
+
## Project docs
|
|
130
|
+
|
|
131
|
+
- [`PUBLIC_STATUS.md`](PUBLIC_STATUS.md) — current maturity and non-claims.
|
|
132
|
+
- [`VALIDATION.md`](VALIDATION.md) — local validation and build gates.
|
|
133
|
+
- [`PUBLICATION_CHECKLIST.md`](PUBLICATION_CHECKLIST.md) — release/publication checklist.
|
|
134
|
+
- [`CHANGELOG.md`](CHANGELOG.md) — notable package changes.
|
|
135
|
+
- [`CONTRIBUTING.md`](CONTRIBUTING.md) — contribution and boundary rules.
|
|
136
|
+
- [`SECURITY.md`](SECURITY.md) — security reporting and fixture-safety policy.
|
|
137
|
+
|
|
138
|
+
## Installation
|
|
139
|
+
|
|
140
|
+
Once published to PyPI, the intended install path is:
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
pip install sclite-core
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Install directly from GitHub:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
pip install git+https://github.com/rozmiarD/SCLite.git
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
From a local checkout:
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
python -m venv .venv
|
|
156
|
+
. .venv/bin/activate
|
|
157
|
+
python -m pip install -e '.[dev]'
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Runtime dependencies are intentionally empty. The `dev` extra installs `pytest` for local tests.
|
|
161
|
+
|
|
162
|
+
## CLI quickstart
|
|
163
|
+
|
|
164
|
+
Validate the v0.2 lifecycle chain:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
sclite validate-chain sclite/examples/contract-lifecycle-v0.2/artifact_chain_manifest.json
|
|
168
|
+
sclite verify-lifecycle sclite/examples/contract-lifecycle-v0.2/artifact_chain_manifest.json
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Validate the legacy public-safe proof fixture:
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
sclite validate examples/security-contract-proof
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Validate one artifact against a schema:
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
sclite validate-artifact \
|
|
181
|
+
--schema prepared_execution_spec.v0.1 \
|
|
182
|
+
examples/prepared-execution-spec/prepared_execution_spec.json
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Hash one artifact with deterministic SCLite canonical JSON + SHA-256:
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
sclite hash-artifact \
|
|
189
|
+
--schema approved_execution_spec.v0.1 \
|
|
190
|
+
examples/security-contract-proof/approved_execution_spec.json
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Generate a Scope Fidelity report from the approved spec fixture:
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
sclite scope-fidelity \
|
|
197
|
+
--approved-spec examples/security-contract-proof/approved_execution_spec.json \
|
|
198
|
+
--fail-on review
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
Emit a validation receipt for the proof fixture:
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
sclite validation-receipt examples/security-contract-proof
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
Run tests:
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
python -m pytest -q
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
## Python usage
|
|
214
|
+
|
|
215
|
+
```python
|
|
216
|
+
from sclite.integrity import verify_artifact_chain_manifest
|
|
217
|
+
|
|
218
|
+
# Load artifact_chain_manifest.json as a dict and verify it against a local root.
|
|
219
|
+
result = verify_artifact_chain_manifest(manifest, root=fixture_dir)
|
|
220
|
+
assert result["status"] == "passed"
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
## Repository layout
|
|
224
|
+
|
|
225
|
+
```text
|
|
226
|
+
sclite/ Python package
|
|
227
|
+
sclite/schemas/ Packaged schemas
|
|
228
|
+
sclite/examples/contract-lifecycle-v0.2/
|
|
229
|
+
examples/security-contract-proof/ Legacy v0.1 public-safe proof fixture
|
|
230
|
+
schemas/ Source schema copies
|
|
231
|
+
SPEC.md v0.2 draft specification
|
|
232
|
+
CHANGELOG.md Release notes
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
## License
|
|
236
|
+
|
|
237
|
+
MIT. See [`LICENSE`](LICENSE).
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "sclite-core"
|
|
7
|
+
version = "0.2.1"
|
|
8
|
+
description = "Lightweight Security Contract Layer lifecycle artifacts, validation, and cryptographic integrity chain fixtures"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.11"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
authors = [{ name = "Krzysztof Probola" }]
|
|
13
|
+
keywords = ["security", "contracts", "validation", "evidence", "governance"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 3 - Alpha",
|
|
16
|
+
"Intended Audience :: Developers",
|
|
17
|
+
"Intended Audience :: Information Technology",
|
|
18
|
+
"Programming Language :: Python :: 3",
|
|
19
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
20
|
+
"Programming Language :: Python :: 3.11",
|
|
21
|
+
"Programming Language :: Python :: 3.12",
|
|
22
|
+
"Programming Language :: Python :: 3.13",
|
|
23
|
+
"Topic :: Security",
|
|
24
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
25
|
+
]
|
|
26
|
+
dependencies = []
|
|
27
|
+
|
|
28
|
+
[project.urls]
|
|
29
|
+
Homepage = "https://github.com/rozmiarD/SCLite"
|
|
30
|
+
Repository = "https://github.com/rozmiarD/SCLite"
|
|
31
|
+
Issues = "https://github.com/rozmiarD/SCLite/issues"
|
|
32
|
+
Changelog = "https://github.com/rozmiarD/SCLite/blob/main/CHANGELOG.md"
|
|
33
|
+
Documentation = "https://github.com/rozmiarD/SCLite#readme"
|
|
34
|
+
|
|
35
|
+
[project.optional-dependencies]
|
|
36
|
+
dev = [
|
|
37
|
+
"pytest>=8,<9",
|
|
38
|
+
]
|
|
39
|
+
|
|
40
|
+
[project.scripts]
|
|
41
|
+
sclite = "sclite.cli:main"
|
|
42
|
+
scl = "sclite.cli:main"
|
|
43
|
+
|
|
44
|
+
[tool.setuptools]
|
|
45
|
+
include-package-data = true
|
|
46
|
+
|
|
47
|
+
[tool.setuptools.packages.find]
|
|
48
|
+
where = ["."]
|
|
49
|
+
include = ["sclite", "sclite.*"]
|
|
50
|
+
namespaces = false
|
|
51
|
+
|
|
52
|
+
[tool.setuptools.package-data]
|
|
53
|
+
sclite = [
|
|
54
|
+
"schemas/*.json",
|
|
55
|
+
"examples/security-contract-proof/*.json",
|
|
56
|
+
"examples/security-contract-proof/*.md",
|
|
57
|
+
"examples/scope-fidelity-report/*.json",
|
|
58
|
+
"examples/scope-fidelity-report/*.md",
|
|
59
|
+
"examples/prepared-execution-spec/*.json",
|
|
60
|
+
"examples/prepared-execution-spec/*.md",
|
|
61
|
+
"examples/redaction-policy/*.json",
|
|
62
|
+
"examples/redaction-policy/*.md",
|
|
63
|
+
"examples/redaction-receipt/*.json",
|
|
64
|
+
"examples/redaction-receipt/*.md",
|
|
65
|
+
"examples/public-validation-surface-index/*.json",
|
|
66
|
+
"examples/public-validation-surface-index/*.md",
|
|
67
|
+
"examples/public-snapshot-manifest/*.json",
|
|
68
|
+
"examples/public-snapshot-manifest/*.md",
|
|
69
|
+
"examples/contract-lifecycle-v0.2/*.json",
|
|
70
|
+
"examples/contract-lifecycle-v0.2/*.md",
|
|
71
|
+
]
|
|
72
|
+
|
|
73
|
+
[tool.pytest.ini_options]
|
|
74
|
+
addopts = "-q"
|
|
75
|
+
testpaths = ["tests"]
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
__version__ = '0.2.1'
|
|
4
|
+
|
|
5
|
+
from .artifacts import (
|
|
6
|
+
APPROVED_EXECUTION_SPEC_FILE,
|
|
7
|
+
APPROVED_EXECUTION_SPEC_VERSION,
|
|
8
|
+
ARTIFACT_CANONICALIZATION_VERSION,
|
|
9
|
+
ARTIFACT_HASH_ALGORITHM,
|
|
10
|
+
DEMO_PROOF_MODE,
|
|
11
|
+
EVIDENCE_BUNDLE_ARTIFACT_TYPE,
|
|
12
|
+
EVIDENCE_BUNDLE_FILE,
|
|
13
|
+
EVIDENCE_BUNDLE_SCHEMA_VERSION,
|
|
14
|
+
EVIDENCE_SUMMARY_FILE,
|
|
15
|
+
EXECUTION_RECEIPT_ARTIFACT_TYPE,
|
|
16
|
+
EXECUTION_RECEIPT_FILE,
|
|
17
|
+
POLICY_DECISION_FILE,
|
|
18
|
+
POLICY_DECISION_SCHEMA_VERSION,
|
|
19
|
+
PROOF_TRACE_FILES,
|
|
20
|
+
PUBLIC_DEMO_NON_CLAIMS,
|
|
21
|
+
PUBLIC_DEMO_TARGET_HOST,
|
|
22
|
+
REDACTED_PREPARED_EXECUTION_SPEC_FILE,
|
|
23
|
+
JsonSchemaValidationError,
|
|
24
|
+
ProofTraceInvariantError,
|
|
25
|
+
assert_public_proof_trace_artifacts,
|
|
26
|
+
build_demo_success_criteria,
|
|
27
|
+
build_evidence_bundle_artifact,
|
|
28
|
+
build_evidence_summary_markdown,
|
|
29
|
+
build_artifact_hash,
|
|
30
|
+
build_execution_receipt_artifact,
|
|
31
|
+
build_proof_trace_artifacts,
|
|
32
|
+
canonical_artifact_bytes,
|
|
33
|
+
canonicalize_artifact,
|
|
34
|
+
examples_dir,
|
|
35
|
+
load_json_schema,
|
|
36
|
+
proof_trace_manifest,
|
|
37
|
+
repo_root,
|
|
38
|
+
schema_dir,
|
|
39
|
+
artifact_sha256,
|
|
40
|
+
validate_artifact,
|
|
41
|
+
validate_json_schema_value,
|
|
42
|
+
validate_public_proof_trace_artifacts,
|
|
43
|
+
validate_schema_ref,
|
|
44
|
+
validate_trace,
|
|
45
|
+
)
|
|
46
|
+
from .integrity import (
|
|
47
|
+
CHAIN_CANONICALIZATION_VERSION,
|
|
48
|
+
CHAIN_HASH_ALGORITHM,
|
|
49
|
+
ChainVerificationError,
|
|
50
|
+
artifact_descriptor,
|
|
51
|
+
build_artifact_chain_manifest,
|
|
52
|
+
verify_artifact_chain_manifest,
|
|
53
|
+
)
|
|
54
|
+
from .redaction import (
|
|
55
|
+
REDACTION_POLICY_ARTIFACT_TYPE,
|
|
56
|
+
REDACTION_POLICY_SCHEMA_VERSION,
|
|
57
|
+
REDACTION_RECEIPT_ARTIFACT_TYPE,
|
|
58
|
+
REDACTION_RECEIPT_SCHEMA_VERSION,
|
|
59
|
+
build_default_redaction_policy,
|
|
60
|
+
build_redaction_receipt,
|
|
61
|
+
redact_prepared_spec,
|
|
62
|
+
sanitize_public_artifact,
|
|
63
|
+
)
|
|
64
|
+
from .scope_fidelity import (
|
|
65
|
+
SCOPE_FIDELITY_ARTIFACT_TYPE,
|
|
66
|
+
SCOPE_FIDELITY_SCHEMA_REF,
|
|
67
|
+
SCOPE_FIDELITY_SCHEMA_VERSION,
|
|
68
|
+
build_scope_fidelity_report,
|
|
69
|
+
build_scope_fidelity_report_from_approved_spec,
|
|
70
|
+
summarize_scope_fidelity,
|
|
71
|
+
validate_scope_fidelity_report,
|
|
72
|
+
)
|
|
73
|
+
from .surfaces import (
|
|
74
|
+
PUBLIC_SNAPSHOT_MANIFEST_ARTIFACT_TYPE,
|
|
75
|
+
PUBLIC_SNAPSHOT_MANIFEST_SCHEMA_VERSION,
|
|
76
|
+
PUBLIC_VALIDATION_SURFACE_INDEX_ARTIFACT_TYPE,
|
|
77
|
+
PUBLIC_VALIDATION_SURFACE_INDEX_SCHEMA_VERSION,
|
|
78
|
+
build_public_snapshot_manifest,
|
|
79
|
+
build_public_validation_surface_index,
|
|
80
|
+
)
|
|
81
|
+
from .validation import build_validation_receipt, validate_fixture_dir
|
|
82
|
+
|
|
83
|
+
__all__ = [name for name in globals() if not name.startswith('_')]
|