scyvera 1.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- scyvera-1.1.0/LICENSE +21 -0
- scyvera-1.1.0/PKG-INFO +260 -0
- scyvera-1.1.0/README.md +231 -0
- scyvera-1.1.0/pyproject.toml +68 -0
- scyvera-1.1.0/setup.cfg +4 -0
- scyvera-1.1.0/src/scyvera/__init__.py +23 -0
- scyvera-1.1.0/src/scyvera/builder.py +296 -0
- scyvera-1.1.0/src/scyvera/cli.py +290 -0
- scyvera-1.1.0/src/scyvera/linter.py +139 -0
- scyvera-1.1.0/src/scyvera/schemas/v1/contract.schema.json +102 -0
- scyvera-1.1.0/src/scyvera/schemas/v1.1/contract.schema.json +367 -0
- scyvera-1.1.0/src/scyvera/validator.py +141 -0
- scyvera-1.1.0/src/scyvera.egg-info/PKG-INFO +260 -0
- scyvera-1.1.0/src/scyvera.egg-info/SOURCES.txt +22 -0
- scyvera-1.1.0/src/scyvera.egg-info/dependency_links.txt +1 -0
- scyvera-1.1.0/src/scyvera.egg-info/entry_points.txt +2 -0
- scyvera-1.1.0/src/scyvera.egg-info/requires.txt +6 -0
- scyvera-1.1.0/src/scyvera.egg-info/top_level.txt +1 -0
- scyvera-1.1.0/tests/test_builder.py +65 -0
- scyvera-1.1.0/tests/test_cli.py +117 -0
- scyvera-1.1.0/tests/test_linter.py +81 -0
- scyvera-1.1.0/tests/test_schemas_sync.py +29 -0
- scyvera-1.1.0/tests/test_validator.py +53 -0
- scyvera-1.1.0/tests/test_validator_v1_1.py +100 -0
scyvera-1.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Shinjan Das
|
|
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.
|
scyvera-1.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: scyvera
|
|
3
|
+
Version: 1.1.0
|
|
4
|
+
Summary: Framework-independent contracts and validation tooling for AI agents and automated workflows.
|
|
5
|
+
Author: Shinjan Das
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Repository, https://github.com/Skull-boy/agent-contracts
|
|
8
|
+
Project-URL: Issues, https://github.com/Skull-boy/agent-contracts/issues
|
|
9
|
+
Keywords: agent,contracts,governance,validation,schema,specification,automation,workflow
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
18
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
19
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
20
|
+
Requires-Python: >=3.10
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: PyYAML<7.0,>=6.0
|
|
24
|
+
Requires-Dist: jsonschema<5.0,>=4.20
|
|
25
|
+
Provides-Extra: dev
|
|
26
|
+
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
27
|
+
Requires-Dist: build>=1.0; extra == "dev"
|
|
28
|
+
Dynamic: license-file
|
|
29
|
+
|
|
30
|
+
<div align="center">
|
|
31
|
+
|
|
32
|
+
<img src="assets/logo.png" width="450" alt="agent-contracts"/>
|
|
33
|
+
|
|
34
|
+
# Scyvera
|
|
35
|
+
|
|
36
|
+
**Machine-readable, domain-independent, and framework-independent operational contracts for AI agents and automated systems.**
|
|
37
|
+
|
|
38
|
+
MCP and A2A standardize how agents communicate with tools and each other. `Scyvera` defines the layer above: what an intelligent system can do, what resources it can access, what authority it requires, what constraints apply, what side effects it produces, and how it is governed.
|
|
39
|
+
|
|
40
|
+

|
|
41
|
+

|
|
42
|
+

|
|
43
|
+

|
|
44
|
+
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## π§© What This Actually Is
|
|
51
|
+
|
|
52
|
+
`Scyvera` provides a machine-readable specification and Python tooling layer for defining the operational boundary of intelligent or automated systems.
|
|
53
|
+
|
|
54
|
+
It is **NOT**:
|
|
55
|
+
- another agent framework
|
|
56
|
+
- an LLM wrapper
|
|
57
|
+
- an orchestration library
|
|
58
|
+
- a coding-agent framework
|
|
59
|
+
- a security sandbox or malware scanner
|
|
60
|
+
|
|
61
|
+
It **IS**:
|
|
62
|
+
A framework-independent and domain-independent specification layer describing system identity, capabilities, resources, inputs, outputs, permissions, constraints, side effects, approvals, dependencies, state persistence, failure recovery, replay semantics, observability, artifact trust declarations, and risk.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## β‘ Quickstart
|
|
67
|
+
|
|
68
|
+
### 1. Installation
|
|
69
|
+
|
|
70
|
+
Install locally or in your project virtualenv:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
pip install scyvera
|
|
74
|
+
# Or for local development:
|
|
75
|
+
pip install -e .
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### 2. Command-Line Interface (CLI)
|
|
79
|
+
|
|
80
|
+
#### Create a starter Contract template (v1.1)
|
|
81
|
+
```bash
|
|
82
|
+
scyvera init contract.yaml --name "Research Assistant"
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Interactive wizard mode:
|
|
86
|
+
```bash
|
|
87
|
+
scyvera init contract.yaml -i
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
#### Validate an Agent Contract
|
|
91
|
+
The CLI automatically detects the specification version (`1` vs `1.1`) and validates against the corresponding JSON Schema:
|
|
92
|
+
```bash
|
|
93
|
+
scyvera validate contract.yaml
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Output:
|
|
97
|
+
```text
|
|
98
|
+
PASS contract.yaml
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Override with a custom JSON Schema file:
|
|
102
|
+
```bash
|
|
103
|
+
scyvera validate contract.yaml --schema path/to/custom.schema.json
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## π Python API & Programmatic Contract Builder
|
|
109
|
+
|
|
110
|
+
You can programmatically construct, inspect, serialize, and validate Agent Contracts in Python without manually writing YAML:
|
|
111
|
+
|
|
112
|
+
```python
|
|
113
|
+
from scyvera import Contract, validate_contract
|
|
114
|
+
|
|
115
|
+
# Programmatically construct a v1.1 Contract
|
|
116
|
+
contract = (
|
|
117
|
+
Contract(name="Literature Research Assistant", purpose="Analyzes scientific papers")
|
|
118
|
+
.set_domain("research")
|
|
119
|
+
.add_capability("search_documents", description="Queries research repositories")
|
|
120
|
+
.add_resource("paper_db", type="pdf_repository", access="read")
|
|
121
|
+
.add_input("research_topic", type="string", required=True)
|
|
122
|
+
.add_output("summary", type="document")
|
|
123
|
+
.add_permission("paper_db", actions=["read", "search"])
|
|
124
|
+
.set_state("session")
|
|
125
|
+
.set_recovery("retry")
|
|
126
|
+
.set_replay("idempotent")
|
|
127
|
+
.set_observability("basic")
|
|
128
|
+
.set_risk("low", category="misinformation_risk")
|
|
129
|
+
)
|
|
130
|
+
|
|
131
|
+
# Validate directly in code
|
|
132
|
+
result = contract.validate()
|
|
133
|
+
|
|
134
|
+
if result.valid:
|
|
135
|
+
print("Contract is valid!")
|
|
136
|
+
# Save to file
|
|
137
|
+
contract.save("contract.yaml")
|
|
138
|
+
else:
|
|
139
|
+
for err in result.errors:
|
|
140
|
+
print(f"Error at {err.path}: {err.message}")
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Validate an existing YAML file programmatically:
|
|
144
|
+
```python
|
|
145
|
+
from scyvera import validate_contract
|
|
146
|
+
|
|
147
|
+
result = validate_contract("contract.yaml")
|
|
148
|
+
print(f"Valid: {result.valid}")
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## π Every Implementation Documents a Contract
|
|
154
|
+
|
|
155
|
+
Instead of prose documentation alone, systems in this repository specify:
|
|
156
|
+
|
|
157
|
+
- **Identity & Purpose** β system identity, operational scope, and system version
|
|
158
|
+
- **Capabilities** β semantic ability claims
|
|
159
|
+
- **Resources** β data stores, APIs, entities, or systems accessed
|
|
160
|
+
- **Inputs & Outputs** β data entering and produced by the system
|
|
161
|
+
- **Permissions** β exact authorized `{resource, actions[]}` combinations
|
|
162
|
+
- **Constraints** β quantitative limits (e.g. rate limits, transaction caps)
|
|
163
|
+
- **Side Effects** β externally observable mutations
|
|
164
|
+
- **Approvals** β explicit human or expert approval gates
|
|
165
|
+
- **Dependencies** β required external services, models, APIs
|
|
166
|
+
- **State, Recovery, Replay, Observability** β persistence, failure strategy, idempotency, and audit evidence
|
|
167
|
+
- **Artifact Security & Risk** β model/data artifact trust requirements and risk level classification
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## π Repository Structure
|
|
172
|
+
|
|
173
|
+
```text
|
|
174
|
+
agent-contracts/
|
|
175
|
+
βββ README.md
|
|
176
|
+
βββ WORKFLOW-CONTRACT-SPEC.md
|
|
177
|
+
βββ CONTRIBUTING.md
|
|
178
|
+
βββ CONTRIBUTORS.md
|
|
179
|
+
βββ LICENSE
|
|
180
|
+
βββ pyproject.toml
|
|
181
|
+
βββ docs/
|
|
182
|
+
β βββ contract-model-v1.1.md # Normative v1.1 Specification
|
|
183
|
+
β βββ vision.md # Strategic Project Vision
|
|
184
|
+
β βββ design-principles.md # Normative Design Principles
|
|
185
|
+
β βββ terminology.md # Specification Terminology
|
|
186
|
+
βββ schemas/
|
|
187
|
+
β βββ v1/ # Contract v1 JSON Schema
|
|
188
|
+
β β βββ contract.schema.json
|
|
189
|
+
β βββ v1.1/ # Contract v1.1 JSON Schema
|
|
190
|
+
β βββ contract.schema.json
|
|
191
|
+
βββ examples/
|
|
192
|
+
β βββ v1.1/ # Domain-Neutral Examples (v1.1)
|
|
193
|
+
β βββ education-tutor.yaml
|
|
194
|
+
β βββ research-assistant.yaml
|
|
195
|
+
β βββ financial-operations.yaml
|
|
196
|
+
β βββ clinical-information-assistant.yaml
|
|
197
|
+
βββ src/
|
|
198
|
+
β βββ scyvera/ # Python Package
|
|
199
|
+
β βββ __init__.py
|
|
200
|
+
β βββ builder.py # Programmatic Contract Builder API
|
|
201
|
+
β βββ validator.py # Multi-Version Validator Engine
|
|
202
|
+
β βββ cli.py # CLI Application (validate, init)
|
|
203
|
+
β βββ schemas/ # Bundled Package Schemas
|
|
204
|
+
βββ tests/
|
|
205
|
+
β βββ fixtures/ # Test Fixture Files
|
|
206
|
+
β βββ test_validator.py # v1 Validator Unit Tests
|
|
207
|
+
β βββ test_validator_v1_1.py # v1.1 Validator Unit Tests
|
|
208
|
+
β βββ test_builder.py # Programmatic Builder Unit Tests
|
|
209
|
+
β βββ test_cli.py # CLI Unit Tests
|
|
210
|
+
βββ implementations/ # Multi-Framework Reference Implementations
|
|
211
|
+
βββ n8n/
|
|
212
|
+
βββ langgraph/
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
## π Domain-Neutral Example Contracts (v1.1)
|
|
218
|
+
|
|
219
|
+
See [`examples/v1.1/`](./examples/v1.1) for runnable, validated v1.1 contracts across different domains:
|
|
220
|
+
|
|
221
|
+
| Domain | Contract File | Description |
|
|
222
|
+
|---|---|---|
|
|
223
|
+
| **Education** | [`education-tutor.yaml`](./examples/v1.1/education-tutor.yaml) | Guided study tutor, low risk, session state |
|
|
224
|
+
| **Research** | [`research-assistant.yaml`](./examples/v1.1/research-assistant.yaml) | Scientific literature analysis, arXiv API dependency |
|
|
225
|
+
| **Finance** | [`financial-operations.yaml`](./examples/v1.1/financial-operations.yaml) | Critical risk, payment caps ($5000 USD limit), controller approval gate |
|
|
226
|
+
| **Healthcare** | [`clinical-information-assistant.yaml`](./examples/v1.1/clinical-information-assistant.yaml) | High risk, EHR database access, physician approval gate, model integrity requirements |
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## π Security & Governance Boundary Notice
|
|
231
|
+
|
|
232
|
+
> [!IMPORTANT]
|
|
233
|
+
> **Contract Declaration β Security Verification β Runtime Enforcement.**
|
|
234
|
+
> An Agent Contract describes declared operational boundaries. It is not a sandbox, anti-malware scanner, or runtime enforcement proxy. Contract declarations provide structured input upon which external policy engines, verification scanners, and runtime isolation systems operate.
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
## πΊοΈ Where the Spec Is Headed (v1.1)
|
|
239
|
+
|
|
240
|
+
Contract v1 was designed and proven against coding/developer agents. That's now understood to be a starting substrate, not the ceiling β v1.1 is a deliberate audit-and-redesign effort to make the spec:
|
|
241
|
+
|
|
242
|
+
- **Domain-independent** β usable for research, education, finance, business-workflow, and healthcare-workflow agents, not just coding agents
|
|
243
|
+
- **Framework-independent** β already true in principle (n8n + LangGraph prove it), being stress-tested further
|
|
244
|
+
- **Accessible to non-technical authors** β YAML/JSON is a representation format, not meant to be the only way to create a contract
|
|
245
|
+
|
|
246
|
+
This is genuinely in the design/audit phase β classifying existing Contract v1 fields, testing them against non-coding agent archetypes, and only then extending the schema. Nothing in this section describes a shipped feature. Follow progress in [`implementations/rfcs/`](./implementations/rfcs) and open issues tagged `v1.1`.
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
## π€ Contributing
|
|
251
|
+
|
|
252
|
+
Contributions are welcome β new domain profiles, framework reference implementations, specification RFCs, or Python API improvements. See [CONTRIBUTING.md](./CONTRIBUTING.md) for details.
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
## π License
|
|
257
|
+
|
|
258
|
+
Distributed under the MIT License β see [LICENSE](./LICENSE) for details.
|
|
259
|
+
|
|
260
|
+
Built and maintained by [Shinjan Das](https://github.com/Skull-boy) and open-source contributors β see [CONTRIBUTORS.md](./CONTRIBUTORS.md).
|
scyvera-1.1.0/README.md
ADDED
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<img src="assets/logo.png" width="450" alt="agent-contracts"/>
|
|
4
|
+
|
|
5
|
+
# Scyvera
|
|
6
|
+
|
|
7
|
+
**Machine-readable, domain-independent, and framework-independent operational contracts for AI agents and automated systems.**
|
|
8
|
+
|
|
9
|
+
MCP and A2A standardize how agents communicate with tools and each other. `Scyvera` defines the layer above: what an intelligent system can do, what resources it can access, what authority it requires, what constraints apply, what side effects it produces, and how it is governed.
|
|
10
|
+
|
|
11
|
+

|
|
12
|
+

|
|
13
|
+

|
|
14
|
+

|
|
15
|
+
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## π§© What This Actually Is
|
|
22
|
+
|
|
23
|
+
`Scyvera` provides a machine-readable specification and Python tooling layer for defining the operational boundary of intelligent or automated systems.
|
|
24
|
+
|
|
25
|
+
It is **NOT**:
|
|
26
|
+
- another agent framework
|
|
27
|
+
- an LLM wrapper
|
|
28
|
+
- an orchestration library
|
|
29
|
+
- a coding-agent framework
|
|
30
|
+
- a security sandbox or malware scanner
|
|
31
|
+
|
|
32
|
+
It **IS**:
|
|
33
|
+
A framework-independent and domain-independent specification layer describing system identity, capabilities, resources, inputs, outputs, permissions, constraints, side effects, approvals, dependencies, state persistence, failure recovery, replay semantics, observability, artifact trust declarations, and risk.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## β‘ Quickstart
|
|
38
|
+
|
|
39
|
+
### 1. Installation
|
|
40
|
+
|
|
41
|
+
Install locally or in your project virtualenv:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
pip install scyvera
|
|
45
|
+
# Or for local development:
|
|
46
|
+
pip install -e .
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### 2. Command-Line Interface (CLI)
|
|
50
|
+
|
|
51
|
+
#### Create a starter Contract template (v1.1)
|
|
52
|
+
```bash
|
|
53
|
+
scyvera init contract.yaml --name "Research Assistant"
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Interactive wizard mode:
|
|
57
|
+
```bash
|
|
58
|
+
scyvera init contract.yaml -i
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
#### Validate an Agent Contract
|
|
62
|
+
The CLI automatically detects the specification version (`1` vs `1.1`) and validates against the corresponding JSON Schema:
|
|
63
|
+
```bash
|
|
64
|
+
scyvera validate contract.yaml
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Output:
|
|
68
|
+
```text
|
|
69
|
+
PASS contract.yaml
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Override with a custom JSON Schema file:
|
|
73
|
+
```bash
|
|
74
|
+
scyvera validate contract.yaml --schema path/to/custom.schema.json
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## π Python API & Programmatic Contract Builder
|
|
80
|
+
|
|
81
|
+
You can programmatically construct, inspect, serialize, and validate Agent Contracts in Python without manually writing YAML:
|
|
82
|
+
|
|
83
|
+
```python
|
|
84
|
+
from scyvera import Contract, validate_contract
|
|
85
|
+
|
|
86
|
+
# Programmatically construct a v1.1 Contract
|
|
87
|
+
contract = (
|
|
88
|
+
Contract(name="Literature Research Assistant", purpose="Analyzes scientific papers")
|
|
89
|
+
.set_domain("research")
|
|
90
|
+
.add_capability("search_documents", description="Queries research repositories")
|
|
91
|
+
.add_resource("paper_db", type="pdf_repository", access="read")
|
|
92
|
+
.add_input("research_topic", type="string", required=True)
|
|
93
|
+
.add_output("summary", type="document")
|
|
94
|
+
.add_permission("paper_db", actions=["read", "search"])
|
|
95
|
+
.set_state("session")
|
|
96
|
+
.set_recovery("retry")
|
|
97
|
+
.set_replay("idempotent")
|
|
98
|
+
.set_observability("basic")
|
|
99
|
+
.set_risk("low", category="misinformation_risk")
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
# Validate directly in code
|
|
103
|
+
result = contract.validate()
|
|
104
|
+
|
|
105
|
+
if result.valid:
|
|
106
|
+
print("Contract is valid!")
|
|
107
|
+
# Save to file
|
|
108
|
+
contract.save("contract.yaml")
|
|
109
|
+
else:
|
|
110
|
+
for err in result.errors:
|
|
111
|
+
print(f"Error at {err.path}: {err.message}")
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Validate an existing YAML file programmatically:
|
|
115
|
+
```python
|
|
116
|
+
from scyvera import validate_contract
|
|
117
|
+
|
|
118
|
+
result = validate_contract("contract.yaml")
|
|
119
|
+
print(f"Valid: {result.valid}")
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## π Every Implementation Documents a Contract
|
|
125
|
+
|
|
126
|
+
Instead of prose documentation alone, systems in this repository specify:
|
|
127
|
+
|
|
128
|
+
- **Identity & Purpose** β system identity, operational scope, and system version
|
|
129
|
+
- **Capabilities** β semantic ability claims
|
|
130
|
+
- **Resources** β data stores, APIs, entities, or systems accessed
|
|
131
|
+
- **Inputs & Outputs** β data entering and produced by the system
|
|
132
|
+
- **Permissions** β exact authorized `{resource, actions[]}` combinations
|
|
133
|
+
- **Constraints** β quantitative limits (e.g. rate limits, transaction caps)
|
|
134
|
+
- **Side Effects** β externally observable mutations
|
|
135
|
+
- **Approvals** β explicit human or expert approval gates
|
|
136
|
+
- **Dependencies** β required external services, models, APIs
|
|
137
|
+
- **State, Recovery, Replay, Observability** β persistence, failure strategy, idempotency, and audit evidence
|
|
138
|
+
- **Artifact Security & Risk** β model/data artifact trust requirements and risk level classification
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## π Repository Structure
|
|
143
|
+
|
|
144
|
+
```text
|
|
145
|
+
agent-contracts/
|
|
146
|
+
βββ README.md
|
|
147
|
+
βββ WORKFLOW-CONTRACT-SPEC.md
|
|
148
|
+
βββ CONTRIBUTING.md
|
|
149
|
+
βββ CONTRIBUTORS.md
|
|
150
|
+
βββ LICENSE
|
|
151
|
+
βββ pyproject.toml
|
|
152
|
+
βββ docs/
|
|
153
|
+
β βββ contract-model-v1.1.md # Normative v1.1 Specification
|
|
154
|
+
β βββ vision.md # Strategic Project Vision
|
|
155
|
+
β βββ design-principles.md # Normative Design Principles
|
|
156
|
+
β βββ terminology.md # Specification Terminology
|
|
157
|
+
βββ schemas/
|
|
158
|
+
β βββ v1/ # Contract v1 JSON Schema
|
|
159
|
+
β β βββ contract.schema.json
|
|
160
|
+
β βββ v1.1/ # Contract v1.1 JSON Schema
|
|
161
|
+
β βββ contract.schema.json
|
|
162
|
+
βββ examples/
|
|
163
|
+
β βββ v1.1/ # Domain-Neutral Examples (v1.1)
|
|
164
|
+
β βββ education-tutor.yaml
|
|
165
|
+
β βββ research-assistant.yaml
|
|
166
|
+
β βββ financial-operations.yaml
|
|
167
|
+
β βββ clinical-information-assistant.yaml
|
|
168
|
+
βββ src/
|
|
169
|
+
β βββ scyvera/ # Python Package
|
|
170
|
+
β βββ __init__.py
|
|
171
|
+
β βββ builder.py # Programmatic Contract Builder API
|
|
172
|
+
β βββ validator.py # Multi-Version Validator Engine
|
|
173
|
+
β βββ cli.py # CLI Application (validate, init)
|
|
174
|
+
β βββ schemas/ # Bundled Package Schemas
|
|
175
|
+
βββ tests/
|
|
176
|
+
β βββ fixtures/ # Test Fixture Files
|
|
177
|
+
β βββ test_validator.py # v1 Validator Unit Tests
|
|
178
|
+
β βββ test_validator_v1_1.py # v1.1 Validator Unit Tests
|
|
179
|
+
β βββ test_builder.py # Programmatic Builder Unit Tests
|
|
180
|
+
β βββ test_cli.py # CLI Unit Tests
|
|
181
|
+
βββ implementations/ # Multi-Framework Reference Implementations
|
|
182
|
+
βββ n8n/
|
|
183
|
+
βββ langgraph/
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## π Domain-Neutral Example Contracts (v1.1)
|
|
189
|
+
|
|
190
|
+
See [`examples/v1.1/`](./examples/v1.1) for runnable, validated v1.1 contracts across different domains:
|
|
191
|
+
|
|
192
|
+
| Domain | Contract File | Description |
|
|
193
|
+
|---|---|---|
|
|
194
|
+
| **Education** | [`education-tutor.yaml`](./examples/v1.1/education-tutor.yaml) | Guided study tutor, low risk, session state |
|
|
195
|
+
| **Research** | [`research-assistant.yaml`](./examples/v1.1/research-assistant.yaml) | Scientific literature analysis, arXiv API dependency |
|
|
196
|
+
| **Finance** | [`financial-operations.yaml`](./examples/v1.1/financial-operations.yaml) | Critical risk, payment caps ($5000 USD limit), controller approval gate |
|
|
197
|
+
| **Healthcare** | [`clinical-information-assistant.yaml`](./examples/v1.1/clinical-information-assistant.yaml) | High risk, EHR database access, physician approval gate, model integrity requirements |
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## π Security & Governance Boundary Notice
|
|
202
|
+
|
|
203
|
+
> [!IMPORTANT]
|
|
204
|
+
> **Contract Declaration β Security Verification β Runtime Enforcement.**
|
|
205
|
+
> An Agent Contract describes declared operational boundaries. It is not a sandbox, anti-malware scanner, or runtime enforcement proxy. Contract declarations provide structured input upon which external policy engines, verification scanners, and runtime isolation systems operate.
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## πΊοΈ Where the Spec Is Headed (v1.1)
|
|
210
|
+
|
|
211
|
+
Contract v1 was designed and proven against coding/developer agents. That's now understood to be a starting substrate, not the ceiling β v1.1 is a deliberate audit-and-redesign effort to make the spec:
|
|
212
|
+
|
|
213
|
+
- **Domain-independent** β usable for research, education, finance, business-workflow, and healthcare-workflow agents, not just coding agents
|
|
214
|
+
- **Framework-independent** β already true in principle (n8n + LangGraph prove it), being stress-tested further
|
|
215
|
+
- **Accessible to non-technical authors** β YAML/JSON is a representation format, not meant to be the only way to create a contract
|
|
216
|
+
|
|
217
|
+
This is genuinely in the design/audit phase β classifying existing Contract v1 fields, testing them against non-coding agent archetypes, and only then extending the schema. Nothing in this section describes a shipped feature. Follow progress in [`implementations/rfcs/`](./implementations/rfcs) and open issues tagged `v1.1`.
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## π€ Contributing
|
|
222
|
+
|
|
223
|
+
Contributions are welcome β new domain profiles, framework reference implementations, specification RFCs, or Python API improvements. See [CONTRIBUTING.md](./CONTRIBUTING.md) for details.
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
## π License
|
|
228
|
+
|
|
229
|
+
Distributed under the MIT License β see [LICENSE](./LICENSE) for details.
|
|
230
|
+
|
|
231
|
+
Built and maintained by [Shinjan Das](https://github.com/Skull-boy) and open-source contributors β see [CONTRIBUTORS.md](./CONTRIBUTORS.md).
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
[project]
|
|
7
|
+
name = "scyvera"
|
|
8
|
+
version = "1.1.0"
|
|
9
|
+
description = "Framework-independent contracts and validation tooling for AI agents and automated workflows."
|
|
10
|
+
readme = "README.md"
|
|
11
|
+
requires-python = ">=3.10"
|
|
12
|
+
license = "MIT"
|
|
13
|
+
|
|
14
|
+
authors = [
|
|
15
|
+
{ name = "Shinjan Das" }
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
classifiers = [
|
|
19
|
+
"Development Status :: 4 - Beta",
|
|
20
|
+
"Intended Audience :: Developers",
|
|
21
|
+
"Programming Language :: Python :: 3",
|
|
22
|
+
"Programming Language :: Python :: 3.10",
|
|
23
|
+
"Programming Language :: Python :: 3.11",
|
|
24
|
+
"Programming Language :: Python :: 3.12",
|
|
25
|
+
"Programming Language :: Python :: 3.13",
|
|
26
|
+
"Programming Language :: Python :: 3.14",
|
|
27
|
+
"Topic :: Software Development :: Quality Assurance",
|
|
28
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
keywords = [
|
|
32
|
+
"agent",
|
|
33
|
+
"contracts",
|
|
34
|
+
"governance",
|
|
35
|
+
"validation",
|
|
36
|
+
"schema",
|
|
37
|
+
"specification",
|
|
38
|
+
"automation",
|
|
39
|
+
"workflow"
|
|
40
|
+
]
|
|
41
|
+
|
|
42
|
+
dependencies = [
|
|
43
|
+
"PyYAML>=6.0,<7.0",
|
|
44
|
+
"jsonschema>=4.20,<5.0",
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
[project.optional-dependencies]
|
|
48
|
+
dev = [
|
|
49
|
+
"pytest>=8.0",
|
|
50
|
+
"build>=1.0",
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
[project.scripts]
|
|
54
|
+
scyvera = "scyvera.cli:main"
|
|
55
|
+
|
|
56
|
+
[project.urls]
|
|
57
|
+
Repository = "https://github.com/Skull-boy/agent-contracts"
|
|
58
|
+
Issues = "https://github.com/Skull-boy/agent-contracts/issues"
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
[tool.setuptools.packages.find]
|
|
62
|
+
where = ["src"]
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
[tool.setuptools.package-data]
|
|
66
|
+
scyvera = [
|
|
67
|
+
"schemas/*/*.json"
|
|
68
|
+
]
|
scyvera-1.1.0/setup.cfg
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from .builder import AgentIdentity, Contract, SystemIdentity
|
|
2
|
+
from .linter import LintResult, LintWarning, lint_contract
|
|
3
|
+
from .validator import (
|
|
4
|
+
SCHEMA_V1_PATH,
|
|
5
|
+
SCHEMA_V1_1_PATH,
|
|
6
|
+
ValidationError,
|
|
7
|
+
ValidationResult,
|
|
8
|
+
validate_contract,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
__all__ = [
|
|
12
|
+
"AgentIdentity",
|
|
13
|
+
"Contract",
|
|
14
|
+
"LintResult",
|
|
15
|
+
"LintWarning",
|
|
16
|
+
"SCHEMA_V1_PATH",
|
|
17
|
+
"SCHEMA_V1_1_PATH",
|
|
18
|
+
"SystemIdentity",
|
|
19
|
+
"ValidationError",
|
|
20
|
+
"ValidationResult",
|
|
21
|
+
"lint_contract",
|
|
22
|
+
"validate_contract",
|
|
23
|
+
]
|