kailash-pact 0.4.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.
- kailash_pact-0.4.0/.gitignore +144 -0
- kailash_pact-0.4.0/PKG-INFO +98 -0
- kailash_pact-0.4.0/README.md +55 -0
- kailash_pact-0.4.0/docs/api.md +537 -0
- kailash_pact-0.4.0/docs/architecture.md +272 -0
- kailash_pact-0.4.0/docs/cookbook.md +407 -0
- kailash_pact-0.4.0/docs/quickstart.md +271 -0
- kailash_pact-0.4.0/docs/vertical-guide.md +373 -0
- kailash_pact-0.4.0/docs/yaml-schema.md +343 -0
- kailash_pact-0.4.0/pyproject.toml +83 -0
- kailash_pact-0.4.0/src/pact/__init__.py +293 -0
- kailash_pact-0.4.0/src/pact/costs.py +128 -0
- kailash_pact-0.4.0/src/pact/engine.py +494 -0
- kailash_pact-0.4.0/src/pact/events.py +126 -0
- kailash_pact-0.4.0/src/pact/examples/__init__.py +3 -0
- kailash_pact-0.4.0/src/pact/examples/university/__init__.py +38 -0
- kailash_pact-0.4.0/src/pact/examples/university/barriers.py +93 -0
- kailash_pact-0.4.0/src/pact/examples/university/clearance.py +219 -0
- kailash_pact-0.4.0/src/pact/examples/university/demo.py +492 -0
- kailash_pact-0.4.0/src/pact/examples/university/envelopes.py +168 -0
- kailash_pact-0.4.0/src/pact/examples/university/org.py +193 -0
- kailash_pact-0.4.0/src/pact/governance/__init__.py +9 -0
- kailash_pact-0.4.0/src/pact/governance/api/__init__.py +41 -0
- kailash_pact-0.4.0/src/pact/governance/api/auth.py +178 -0
- kailash_pact-0.4.0/src/pact/governance/api/endpoints.py +448 -0
- kailash_pact-0.4.0/src/pact/governance/api/events.py +261 -0
- kailash_pact-0.4.0/src/pact/governance/api/router.py +113 -0
- kailash_pact-0.4.0/src/pact/governance/api/schemas.py +432 -0
- kailash_pact-0.4.0/src/pact/governance/cli.py +180 -0
- kailash_pact-0.4.0/src/pact/governance/testing.py +123 -0
- kailash_pact-0.4.0/src/pact/mcp/__init__.py +80 -0
- kailash_pact-0.4.0/src/pact/mcp/audit.py +220 -0
- kailash_pact-0.4.0/src/pact/mcp/enforcer.py +512 -0
- kailash_pact-0.4.0/src/pact/mcp/middleware.py +164 -0
- kailash_pact-0.4.0/src/pact/mcp/types.py +256 -0
- kailash_pact-0.4.0/src/pact/work.py +121 -0
- kailash_pact-0.4.0/tests/integration/__init__.py +0 -0
- kailash_pact-0.4.0/tests/integration/test_kaizen_governed.py +210 -0
- kailash_pact-0.4.0/tests/integration/test_trust_bridge.py +233 -0
- kailash_pact-0.4.0/tests/unit/governance/fixtures/minimal-org.yaml +23 -0
- kailash_pact-0.4.0/tests/unit/governance/fixtures/university-org.yaml +137 -0
- kailash_pact-0.4.0/tests/unit/governance/test_access.py +1011 -0
- kailash_pact-0.4.0/tests/unit/governance/test_access_matrix.py +848 -0
- kailash_pact-0.4.0/tests/unit/governance/test_addressing.py +440 -0
- kailash_pact-0.4.0/tests/unit/governance/test_adversarial.py +538 -0
- kailash_pact-0.4.0/tests/unit/governance/test_agent_mapping.py +275 -0
- kailash_pact-0.4.0/tests/unit/governance/test_api_auth.py +178 -0
- kailash_pact-0.4.0/tests/unit/governance/test_api_endpoints.py +667 -0
- kailash_pact-0.4.0/tests/unit/governance/test_api_schemas.py +514 -0
- kailash_pact-0.4.0/tests/unit/governance/test_audit.py +177 -0
- kailash_pact-0.4.0/tests/unit/governance/test_audit_integrity.py +236 -0
- kailash_pact-0.4.0/tests/unit/governance/test_backup.py +331 -0
- kailash_pact-0.4.0/tests/unit/governance/test_clearance.py +284 -0
- kailash_pact-0.4.0/tests/unit/governance/test_compilation.py +670 -0
- kailash_pact-0.4.0/tests/unit/governance/test_compilation_security.py +450 -0
- kailash_pact-0.4.0/tests/unit/governance/test_context.py +332 -0
- kailash_pact-0.4.0/tests/unit/governance/test_decorators.py +193 -0
- kailash_pact-0.4.0/tests/unit/governance/test_deprecation.py +167 -0
- kailash_pact-0.4.0/tests/unit/governance/test_engine.py +806 -0
- kailash_pact-0.4.0/tests/unit/governance/test_envelope_adapter.py +256 -0
- kailash_pact-0.4.0/tests/unit/governance/test_envelope_properties.py +902 -0
- kailash_pact-0.4.0/tests/unit/governance/test_envelope_unification.py +745 -0
- kailash_pact-0.4.0/tests/unit/governance/test_envelopes.py +906 -0
- kailash_pact-0.4.0/tests/unit/governance/test_explain.py +371 -0
- kailash_pact-0.4.0/tests/unit/governance/test_flagship_scenario.py +496 -0
- kailash_pact-0.4.0/tests/unit/governance/test_governed_agent.py +447 -0
- kailash_pact-0.4.0/tests/unit/governance/test_knowledge.py +90 -0
- kailash_pact-0.4.0/tests/unit/governance/test_middleware.py +239 -0
- kailash_pact-0.4.0/tests/unit/governance/test_mock_agent.py +262 -0
- kailash_pact-0.4.0/tests/unit/governance/test_nan_security.py +459 -0
- kailash_pact-0.4.0/tests/unit/governance/test_redteam_rt21.py +1188 -0
- kailash_pact-0.4.0/tests/unit/governance/test_security.py +506 -0
- kailash_pact-0.4.0/tests/unit/governance/test_self_modification_defense.py +257 -0
- kailash_pact-0.4.0/tests/unit/governance/test_sqlite_stores.py +762 -0
- kailash_pact-0.4.0/tests/unit/governance/test_store_thread_safety.py +674 -0
- kailash_pact-0.4.0/tests/unit/governance/test_stores.py +521 -0
- kailash_pact-0.4.0/tests/unit/governance/test_university_e2e.py +527 -0
- kailash_pact-0.4.0/tests/unit/governance/test_yaml_loader.py +575 -0
- kailash_pact-0.4.0/tests/unit/mcp/__init__.py +0 -0
- kailash_pact-0.4.0/tests/unit/mcp/test_audit.py +254 -0
- kailash_pact-0.4.0/tests/unit/mcp/test_enforcer.py +610 -0
- kailash_pact-0.4.0/tests/unit/mcp/test_middleware.py +265 -0
- kailash_pact-0.4.0/tests/unit/mcp/test_redteam_fixes.py +434 -0
- kailash_pact-0.4.0/tests/unit/mcp/test_types.py +267 -0
- kailash_pact-0.4.0/tests/unit/test_pact_engine.py +512 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
# Dependencies
|
|
2
|
+
node_modules/
|
|
3
|
+
|
|
4
|
+
# Python
|
|
5
|
+
__pycache__/
|
|
6
|
+
*.py[cod]
|
|
7
|
+
*$py.class
|
|
8
|
+
*.so
|
|
9
|
+
.Python
|
|
10
|
+
build/
|
|
11
|
+
develop-eggs/
|
|
12
|
+
dist/
|
|
13
|
+
downloads/
|
|
14
|
+
eggs/
|
|
15
|
+
.eggs/
|
|
16
|
+
lib/
|
|
17
|
+
!scripts/hooks/lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
*.egg-info/
|
|
24
|
+
.installed.cfg
|
|
25
|
+
*.egg
|
|
26
|
+
MANIFEST
|
|
27
|
+
|
|
28
|
+
# Virtual environments
|
|
29
|
+
.env
|
|
30
|
+
.venv
|
|
31
|
+
env/
|
|
32
|
+
venv/
|
|
33
|
+
ENV/
|
|
34
|
+
env.bak/
|
|
35
|
+
venv.bak/
|
|
36
|
+
.python-version
|
|
37
|
+
|
|
38
|
+
# IDE specific files
|
|
39
|
+
.idea/
|
|
40
|
+
.vscode/
|
|
41
|
+
.cursor/
|
|
42
|
+
*.swp
|
|
43
|
+
*.swo
|
|
44
|
+
.DS_Store
|
|
45
|
+
.jbeval/
|
|
46
|
+
|
|
47
|
+
# Testing
|
|
48
|
+
.pytest_cache/
|
|
49
|
+
.coverage.*
|
|
50
|
+
htmlcov/
|
|
51
|
+
test_*.db
|
|
52
|
+
test_shared_*.db
|
|
53
|
+
demo_mcp.db
|
|
54
|
+
mcp_registry.db
|
|
55
|
+
mcp_registry.json
|
|
56
|
+
test-env
|
|
57
|
+
*.db
|
|
58
|
+
*.db-wal
|
|
59
|
+
*.db-shm
|
|
60
|
+
default.db
|
|
61
|
+
|
|
62
|
+
# Kaizen checkpoints (local agent state)
|
|
63
|
+
.kaizen/
|
|
64
|
+
|
|
65
|
+
# Internal task tracking
|
|
66
|
+
todos/
|
|
67
|
+
**/todos/
|
|
68
|
+
|
|
69
|
+
# Claude Code session data (keep agents/skills/rules, ignore session artifacts)
|
|
70
|
+
.claude/learning/
|
|
71
|
+
.claude/settings.local.json
|
|
72
|
+
**/.claude/learning/
|
|
73
|
+
|
|
74
|
+
# Coverage artifacts
|
|
75
|
+
.coverage
|
|
76
|
+
**/.coverage
|
|
77
|
+
|
|
78
|
+
# Hypothesis test cache
|
|
79
|
+
.hypothesis/
|
|
80
|
+
**/.hypothesis/
|
|
81
|
+
|
|
82
|
+
# Playwright MCP artifacts
|
|
83
|
+
.playwright-mcp/
|
|
84
|
+
|
|
85
|
+
# Benchmarks
|
|
86
|
+
.benchmarks/
|
|
87
|
+
|
|
88
|
+
# Mypy / Ruff caches
|
|
89
|
+
.mypy_cache/
|
|
90
|
+
.ruff_cache/
|
|
91
|
+
|
|
92
|
+
# Housekeeping
|
|
93
|
+
.temp_cleanup/
|
|
94
|
+
|
|
95
|
+
# Documentation builds
|
|
96
|
+
docs/_build/
|
|
97
|
+
docs/api/_build/
|
|
98
|
+
docs/*/_build/
|
|
99
|
+
_build/
|
|
100
|
+
site/
|
|
101
|
+
*.doctree
|
|
102
|
+
|
|
103
|
+
# Data
|
|
104
|
+
data/
|
|
105
|
+
|
|
106
|
+
# Generated outputs - all output directories
|
|
107
|
+
outputs/
|
|
108
|
+
output/
|
|
109
|
+
examples/outputs/
|
|
110
|
+
examples/output/
|
|
111
|
+
|
|
112
|
+
# Generated files in root and examples directories
|
|
113
|
+
/*.csv
|
|
114
|
+
/*.json
|
|
115
|
+
/examples/*.csv
|
|
116
|
+
/examples/*.json
|
|
117
|
+
/examples/customer_*.csv
|
|
118
|
+
/examples/processed_data.csv
|
|
119
|
+
|
|
120
|
+
# Task tracking storage (if they exist outside examples/data)
|
|
121
|
+
**/task_storage/
|
|
122
|
+
**/tasks/runs/
|
|
123
|
+
**/tasks/tasks/
|
|
124
|
+
**/tasks/metrics/
|
|
125
|
+
**/*_tracking/
|
|
126
|
+
|
|
127
|
+
# Jupyter Notebooks
|
|
128
|
+
.ipynb_checkpoints
|
|
129
|
+
|
|
130
|
+
# Local development
|
|
131
|
+
.env.local
|
|
132
|
+
.env.development.local
|
|
133
|
+
.env.test.local
|
|
134
|
+
.env.production.local
|
|
135
|
+
.env.test
|
|
136
|
+
docs/build_output.txt
|
|
137
|
+
output.txt
|
|
138
|
+
|
|
139
|
+
# Build/release artifacts
|
|
140
|
+
test-release/
|
|
141
|
+
dist/
|
|
142
|
+
|
|
143
|
+
# Secrets baseline (local security scanning)
|
|
144
|
+
.secrets.baseline
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: kailash-pact
|
|
3
|
+
Version: 0.4.0
|
|
4
|
+
Summary: PACT governance framework — D/T/R accountability grammar, operating envelopes, knowledge clearance, and verification gradient for AI agent organizations
|
|
5
|
+
Project-URL: Documentation, https://docs.terrene.foundation/kailash-pact
|
|
6
|
+
Project-URL: Repository, https://github.com/terrene-foundation/kailash-py/tree/main/packages/kailash-pact
|
|
7
|
+
Project-URL: Issues, https://github.com/terrene-foundation/kailash-py/issues
|
|
8
|
+
Author: Terrene Foundation
|
|
9
|
+
License-Expression: Apache-2.0
|
|
10
|
+
Keywords: AI,D/T/R,EATP,agent,clearance,envelopes,governance,pact,trust
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Topic :: Security
|
|
19
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
20
|
+
Classifier: Typing :: Typed
|
|
21
|
+
Requires-Python: >=3.11
|
|
22
|
+
Requires-Dist: click>=8.0
|
|
23
|
+
Requires-Dist: fastapi>=0.109
|
|
24
|
+
Requires-Dist: kailash[pact]>=2.1.0
|
|
25
|
+
Provides-Extra: all
|
|
26
|
+
Requires-Dist: kailash-kaizen>=2.0.0; extra == 'all'
|
|
27
|
+
Requires-Dist: psycopg-pool>=3.0; extra == 'all'
|
|
28
|
+
Requires-Dist: psycopg[binary]>=3.0; extra == 'all'
|
|
29
|
+
Provides-Extra: dev
|
|
30
|
+
Requires-Dist: httpx>=0.27; extra == 'dev'
|
|
31
|
+
Requires-Dist: hypothesis>=6.98; extra == 'dev'
|
|
32
|
+
Requires-Dist: mypy>=1.8; extra == 'dev'
|
|
33
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
|
|
34
|
+
Requires-Dist: pytest-timeout>=2.0; extra == 'dev'
|
|
35
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
36
|
+
Requires-Dist: ruff>=0.3; extra == 'dev'
|
|
37
|
+
Provides-Extra: kaizen
|
|
38
|
+
Requires-Dist: kailash-kaizen>=2.0.0; extra == 'kaizen'
|
|
39
|
+
Provides-Extra: postgres
|
|
40
|
+
Requires-Dist: psycopg-pool>=3.0; extra == 'postgres'
|
|
41
|
+
Requires-Dist: psycopg[binary]>=3.0; extra == 'postgres'
|
|
42
|
+
Description-Content-Type: text/markdown
|
|
43
|
+
|
|
44
|
+
# kailash-pact
|
|
45
|
+
|
|
46
|
+
**PACT governance framework** — D/T/R accountability grammar, operating envelopes, knowledge clearance, and verification gradient for AI agent organizations.
|
|
47
|
+
|
|
48
|
+
Part of the [Kailash](https://github.com/terrene-foundation/kailash-py) enterprise AI platform.
|
|
49
|
+
|
|
50
|
+
## Quick Start
|
|
51
|
+
|
|
52
|
+
```python
|
|
53
|
+
from pact.governance import GovernanceEngine
|
|
54
|
+
|
|
55
|
+
engine = GovernanceEngine.from_yaml("my-org.yaml")
|
|
56
|
+
verdict = engine.verify_action("D1-R1-T1-R1", "write_report", {"cost": 50.0})
|
|
57
|
+
|
|
58
|
+
if verdict.allowed:
|
|
59
|
+
print("Approved:", verdict.reason)
|
|
60
|
+
else:
|
|
61
|
+
print("Blocked:", verdict.reason)
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Installation
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
pip install kailash-pact
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
With Kaizen agent integration:
|
|
71
|
+
```bash
|
|
72
|
+
pip install kailash-pact[kaizen]
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Features
|
|
76
|
+
|
|
77
|
+
- **D/T/R Grammar Engine** — Accountability grammar (Department/Team/Role) with positional addressing
|
|
78
|
+
- **Three-Layer Envelopes** — Role (standing) + Task (ephemeral) = Effective (computed intersection)
|
|
79
|
+
- **Knowledge Clearance** — Five-level classification independent of authority/seniority
|
|
80
|
+
- **5-Step Access Enforcement** — Clearance → Classification → Compartment → Containment → Deny
|
|
81
|
+
- **GovernanceEngine** — Single facade composing all primitives
|
|
82
|
+
- **PactGovernedAgent** — Wrap any Kaizen agent with governance enforcement
|
|
83
|
+
- **SQLite/PostgreSQL Stores** — Persistent governance state
|
|
84
|
+
- **REST API** — 9 governance endpoints with auth and rate limiting
|
|
85
|
+
- **CLI** — `kailash-pact validate org.yaml`
|
|
86
|
+
|
|
87
|
+
## Documentation
|
|
88
|
+
|
|
89
|
+
- [Quickstart](docs/quickstart.md) — Zero to governance in 10 minutes
|
|
90
|
+
- [Architecture](docs/architecture.md) — How it all fits together
|
|
91
|
+
- [Vertical Guide](docs/vertical-guide.md) — Build your own governed platform
|
|
92
|
+
- [API Reference](docs/api.md) — REST endpoints
|
|
93
|
+
- [Cookbook](docs/cookbook.md) — Common patterns
|
|
94
|
+
- [YAML Schema](docs/yaml-schema.md) — Org definition format
|
|
95
|
+
|
|
96
|
+
## License
|
|
97
|
+
|
|
98
|
+
Apache 2.0 — Terrene Foundation
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# kailash-pact
|
|
2
|
+
|
|
3
|
+
**PACT governance framework** — D/T/R accountability grammar, operating envelopes, knowledge clearance, and verification gradient for AI agent organizations.
|
|
4
|
+
|
|
5
|
+
Part of the [Kailash](https://github.com/terrene-foundation/kailash-py) enterprise AI platform.
|
|
6
|
+
|
|
7
|
+
## Quick Start
|
|
8
|
+
|
|
9
|
+
```python
|
|
10
|
+
from pact.governance import GovernanceEngine
|
|
11
|
+
|
|
12
|
+
engine = GovernanceEngine.from_yaml("my-org.yaml")
|
|
13
|
+
verdict = engine.verify_action("D1-R1-T1-R1", "write_report", {"cost": 50.0})
|
|
14
|
+
|
|
15
|
+
if verdict.allowed:
|
|
16
|
+
print("Approved:", verdict.reason)
|
|
17
|
+
else:
|
|
18
|
+
print("Blocked:", verdict.reason)
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Installation
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pip install kailash-pact
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
With Kaizen agent integration:
|
|
28
|
+
```bash
|
|
29
|
+
pip install kailash-pact[kaizen]
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Features
|
|
33
|
+
|
|
34
|
+
- **D/T/R Grammar Engine** — Accountability grammar (Department/Team/Role) with positional addressing
|
|
35
|
+
- **Three-Layer Envelopes** — Role (standing) + Task (ephemeral) = Effective (computed intersection)
|
|
36
|
+
- **Knowledge Clearance** — Five-level classification independent of authority/seniority
|
|
37
|
+
- **5-Step Access Enforcement** — Clearance → Classification → Compartment → Containment → Deny
|
|
38
|
+
- **GovernanceEngine** — Single facade composing all primitives
|
|
39
|
+
- **PactGovernedAgent** — Wrap any Kaizen agent with governance enforcement
|
|
40
|
+
- **SQLite/PostgreSQL Stores** — Persistent governance state
|
|
41
|
+
- **REST API** — 9 governance endpoints with auth and rate limiting
|
|
42
|
+
- **CLI** — `kailash-pact validate org.yaml`
|
|
43
|
+
|
|
44
|
+
## Documentation
|
|
45
|
+
|
|
46
|
+
- [Quickstart](docs/quickstart.md) — Zero to governance in 10 minutes
|
|
47
|
+
- [Architecture](docs/architecture.md) — How it all fits together
|
|
48
|
+
- [Vertical Guide](docs/vertical-guide.md) — Build your own governed platform
|
|
49
|
+
- [API Reference](docs/api.md) — REST endpoints
|
|
50
|
+
- [Cookbook](docs/cookbook.md) — Common patterns
|
|
51
|
+
- [YAML Schema](docs/yaml-schema.md) — Org definition format
|
|
52
|
+
|
|
53
|
+
## License
|
|
54
|
+
|
|
55
|
+
Apache 2.0 — Terrene Foundation
|