coreason-manifest 0.7.0__tar.gz → 0.10.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. {coreason_manifest-0.7.0 → coreason_manifest-0.10.0}/PKG-INFO +91 -29
  2. coreason_manifest-0.10.0/README.md +119 -0
  3. {coreason_manifest-0.7.0 → coreason_manifest-0.10.0}/pyproject.toml +2 -2
  4. coreason_manifest-0.10.0/src/coreason_manifest/__init__.py +98 -0
  5. coreason_manifest-0.10.0/src/coreason_manifest/definitions/__init__.py +60 -0
  6. coreason_manifest-0.10.0/src/coreason_manifest/definitions/agent.py +370 -0
  7. coreason_manifest-0.10.0/src/coreason_manifest/definitions/audit.py +181 -0
  8. coreason_manifest-0.10.0/src/coreason_manifest/definitions/base.py +47 -0
  9. coreason_manifest-0.10.0/src/coreason_manifest/definitions/events.py +423 -0
  10. coreason_manifest-0.10.0/src/coreason_manifest/definitions/message.py +188 -0
  11. coreason_manifest-0.10.0/src/coreason_manifest/definitions/simulation.py +79 -0
  12. coreason_manifest-0.10.0/src/coreason_manifest/definitions/simulation_config.py +46 -0
  13. coreason_manifest-0.10.0/src/coreason_manifest/definitions/topology.py +341 -0
  14. coreason_manifest-0.10.0/src/coreason_manifest/recipes.py +84 -0
  15. {coreason_manifest-0.7.0/src/coreason_manifest/utils → coreason_manifest-0.10.0/src/coreason_manifest/schemas}/__init__.py +1 -5
  16. coreason_manifest-0.10.0/src/coreason_manifest/schemas/agent.schema.json +1051 -0
  17. coreason_manifest-0.10.0/src/coreason_manifest/schemas/recipe.schema.json +813 -0
  18. coreason_manifest-0.10.0/src/coreason_manifest/utils/__init__.py +23 -0
  19. {coreason_manifest-0.7.0 → coreason_manifest-0.10.0}/src/coreason_manifest/utils/logger.py +10 -0
  20. coreason_manifest-0.10.0/src/coreason_manifest/v1/__init__.py +15 -0
  21. coreason_manifest-0.7.0/README.md +0 -57
  22. coreason_manifest-0.7.0/src/coreason_manifest/__init__.py +0 -17
  23. coreason_manifest-0.7.0/src/coreason_manifest/definitions/__init__.py +0 -0
  24. coreason_manifest-0.7.0/src/coreason_manifest/definitions/agent.py +0 -231
  25. coreason_manifest-0.7.0/src/coreason_manifest/definitions/audit.py +0 -7
  26. coreason_manifest-0.7.0/src/coreason_manifest/definitions/simulation.py +0 -19
  27. coreason_manifest-0.7.0/src/coreason_manifest/definitions/topology.py +0 -140
  28. coreason_manifest-0.7.0/src/coreason_manifest/recipes.py +0 -38
  29. coreason_manifest-0.7.0/src/coreason_manifest/schemas/__init__.py +0 -1
  30. coreason_manifest-0.7.0/src/coreason_manifest/schemas/agent.schema.json +0 -223
  31. {coreason_manifest-0.7.0 → coreason_manifest-0.10.0}/LICENSE +0 -0
  32. {coreason_manifest-0.7.0 → coreason_manifest-0.10.0}/NOTICE +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: coreason_manifest
3
- Version: 0.7.0
3
+ Version: 0.10.0
4
4
  Summary: This package is the definitive source of truth. If it isn't in the manifest, it doesn't exist. If it violates the manifest, it doesn't run.
5
5
  License: # The Prosperity Public License 3.0.0
6
6
 
@@ -87,17 +87,31 @@ The definitive source of truth for CoReason-AI Asset definitions. "The Blueprint
87
87
 
88
88
  ## Overview
89
89
 
90
- `coreason-manifest` acts as the validator for the "Agent Development Lifecycle" (ADLC). It ensures that every Agent produced meets strict GxP and security standards. If it isn't in the manifest, it doesn't exist. If it violates the manifest, it doesn't run.
90
+ `coreason-manifest` serves as the **Shared Kernel** for the Coreason ecosystem. It contains the canonical Pydantic definitions, schemas, and data structures for Agents, Workflows (Recipes), and Auditing.
91
+
92
+ It provides the **"Blueprint"** that all other services (Builder, Engine, Simulator) rely on. It focuses on strict typing, schema validation, and serialization, ensuring that if it isn't in the manifest, it doesn't exist.
91
93
 
92
94
  ## Features
93
95
 
94
- * **Open Agent Specification (OAS) Validation:** Parses and validates agent definitions against a strict schema.
95
- * **Compliance Enforcement:** Uses Open Policy Agent (OPA) / Rego to enforce complex business rules and allowlists.
96
- * **Integrity Verification:** Calculates and verifies SHA256 hashes of the agent's source code to prevent tampering.
97
- * **Automatic Schema Generation:** Inspects Python functions to generate Agent Interfaces, automatically handling `UserContext` injection.
98
- * **Dependency Pinning:** Enforces strict version pinning for all library dependencies.
99
- * **Trusted Bill of Materials (TBOM):** Validates libraries against an approved list.
100
- * **Compliance Microservice:** Can be run as a standalone API server (Service C) for centralized validation.
96
+ * **Open Agent Specification (OAS):** Strict Pydantic models for Agent definitions (`AgentDefinition`).
97
+ * **Strict Typing:** Enforces type safety and immutable structures for critical interfaces.
98
+ * **Enhanced Serialization:** Includes `CoReasonBaseModel` to ensure consistent JSON serialization of complex types like `UUID` and `datetime`.
99
+ * **Event Protocol:** Defines the `GraphEvent` and `CloudEvent` structures for real-time communication.
100
+ * **Simulation Schemas:** Provides standard models for `SimulationScenario`, `AdversaryProfile`, and `SimulationTrace`.
101
+ * **Audit & Compliance:** Defines the `AuditLog` structure for tamper-evident record keeping.
102
+ * **Ergonomic Factory Methods:** Simplified construction of `ChatMessage` and `GenAIOperation`.
103
+ * **Token Arithmetic:** Support for `+` and `+=` operators on `GenAITokenUsage`.
104
+ * **Flexible Tooling:** `ToolCallRequestPart` accepts JSON strings with automatic parsing.
105
+ * **Enhanced Tracing:** `ReasoningTrace` includes flexible metadata for execution state.
106
+
107
+ ## Serialization & Base Model
108
+
109
+ All core definitions (`AgentDefinition`, `RecipeManifest`, `GraphTopology`, `AuditLog`) inherit from `CoReasonBaseModel`. This provides a consistent interface for serialization, solving common Pydantic v2 issues with `UUID` and `datetime`.
110
+
111
+ * Use `.dump()` to get a JSON-compatible dictionary (where UUIDs/datetimes are strings).
112
+ * Use `.to_json()` to get a JSON string.
113
+
114
+ For a detailed rationale, see [docs/coreason_base_model_rationale.md](docs/coreason_base_model_rationale.md).
101
115
 
102
116
  ## Installation
103
117
 
@@ -107,30 +121,78 @@ pip install coreason-manifest
107
121
 
108
122
  ## Usage
109
123
 
110
- `coreason-manifest` supports two modes: **Library (CLI)** and **Server (Microservice)**.
111
-
112
- ### 1. Library Usage
113
-
114
- Use the python library to validate local agent files and verify source integrity.
124
+ This library is used to define and validate Agent configurations programmatically.
115
125
 
116
126
  ```python
117
- from coreason_manifest import ManifestEngine, ManifestConfig
118
-
119
- # Initialize and Validate
120
- config = ManifestConfig(policy_path="./policies/compliance.rego")
121
- engine = ManifestEngine(config)
122
- agent_def = engine.load_and_validate("agent.yaml", "./src")
123
- ```
124
-
125
- ### 2. Server Mode
126
-
127
- Run the package as a FastAPI server to provide a centralized compliance API.
128
-
129
- ```bash
130
- uvicorn coreason_manifest.server:app --host 0.0.0.0 --port 8000
127
+ import uuid
128
+ from datetime import datetime, timezone
129
+ from coreason_manifest.definitions.agent import (
130
+ AgentDefinition,
131
+ AgentMetadata,
132
+ AgentInterface,
133
+ AgentRuntimeConfig,
134
+ ModelConfig,
135
+ AgentDependencies,
136
+ ToolRequirement,
137
+ ToolRiskLevel,
138
+ PolicyConfig,
139
+ ObservabilityConfig,
140
+ TraceLevel
141
+ )
142
+
143
+ # 1. Define Metadata
144
+ metadata = AgentMetadata(
145
+ id=uuid.uuid4(),
146
+ version="1.0.0", # Strict SemVer
147
+ name="Research Agent",
148
+ author="Coreason AI",
149
+ created_at=datetime.now(timezone.utc)
150
+ )
151
+
152
+ # 2. Instantiate Agent
153
+ agent = AgentDefinition(
154
+ metadata=metadata,
155
+ interface=AgentInterface(
156
+ inputs={"topic": {"type": "string"}},
157
+ outputs={"summary": {"type": "string"}}
158
+ ),
159
+ config=AgentRuntimeConfig(
160
+ model_config=ModelConfig(
161
+ model="gpt-4",
162
+ temperature=0.0,
163
+ system_prompt="You are a helpful assistant."
164
+ )
165
+ ),
166
+ dependencies=AgentDependencies(
167
+ tools=[
168
+ ToolRequirement(
169
+ uri="mcp://search-service/google",
170
+ hash="e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", # Valid SHA256
171
+ scopes=["search:read"],
172
+ risk_level=ToolRiskLevel.STANDARD
173
+ )
174
+ ],
175
+ libraries=("pandas==2.0.0",)
176
+ ),
177
+ policy=PolicyConfig(
178
+ budget_caps={"total_cost": 5.0}
179
+ ),
180
+ observability=ObservabilityConfig(
181
+ trace_level=TraceLevel.FULL,
182
+ retention_policy="90_days"
183
+ ),
184
+ # Mandatory Integrity Hash
185
+ integrity_hash="e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
186
+ )
187
+
188
+ print(f"Agent '{agent.metadata.name}' definition created and validated.")
131
189
  ```
132
190
 
133
191
  For full details, see the [Usage Documentation](docs/usage.md).
134
192
 
135
- For detailed requirements and architecture, please refer to the [Product Requirements](docs/product_requirements.md) or [Requirements](docs/requirements.md).
193
+ ## Documentation
194
+
195
+ * [Frontend Integration](docs/frontend_integration.md): Communicating with the Coreason Engine.
196
+ * [Simulation Architecture](docs/simulation_architecture.md): Details on ATIF compatibility and GAIA scenarios.
197
+ * [Audit & Compliance](docs/audit_compliance.md): Details on EU AI Act compliance, Chain of Custody, and Integrity Hashing.
136
198
 
@@ -0,0 +1,119 @@
1
+ # Coreason Manifest
2
+
3
+ The definitive source of truth for CoReason-AI Asset definitions. "The Blueprint."
4
+
5
+ [![License: Prosperity 3.0](https://img.shields.io/badge/license-Prosperity%203.0-blue)](https://github.com/CoReason-AI/coreason-manifest)
6
+ [![Build Status](https://github.com/CoReason-AI/coreason-manifest/actions/workflows/ci.yml/badge.svg)](https://github.com/CoReason-AI/coreason-manifest/actions)
7
+ [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
8
+ [![Documentation](https://img.shields.io/badge/docs-product_requirements-informational)](docs/product_requirements.md)
9
+
10
+ ## Overview
11
+
12
+ `coreason-manifest` serves as the **Shared Kernel** for the Coreason ecosystem. It contains the canonical Pydantic definitions, schemas, and data structures for Agents, Workflows (Recipes), and Auditing.
13
+
14
+ It provides the **"Blueprint"** that all other services (Builder, Engine, Simulator) rely on. It focuses on strict typing, schema validation, and serialization, ensuring that if it isn't in the manifest, it doesn't exist.
15
+
16
+ ## Features
17
+
18
+ * **Open Agent Specification (OAS):** Strict Pydantic models for Agent definitions (`AgentDefinition`).
19
+ * **Strict Typing:** Enforces type safety and immutable structures for critical interfaces.
20
+ * **Enhanced Serialization:** Includes `CoReasonBaseModel` to ensure consistent JSON serialization of complex types like `UUID` and `datetime`.
21
+ * **Event Protocol:** Defines the `GraphEvent` and `CloudEvent` structures for real-time communication.
22
+ * **Simulation Schemas:** Provides standard models for `SimulationScenario`, `AdversaryProfile`, and `SimulationTrace`.
23
+ * **Audit & Compliance:** Defines the `AuditLog` structure for tamper-evident record keeping.
24
+ * **Ergonomic Factory Methods:** Simplified construction of `ChatMessage` and `GenAIOperation`.
25
+ * **Token Arithmetic:** Support for `+` and `+=` operators on `GenAITokenUsage`.
26
+ * **Flexible Tooling:** `ToolCallRequestPart` accepts JSON strings with automatic parsing.
27
+ * **Enhanced Tracing:** `ReasoningTrace` includes flexible metadata for execution state.
28
+
29
+ ## Serialization & Base Model
30
+
31
+ All core definitions (`AgentDefinition`, `RecipeManifest`, `GraphTopology`, `AuditLog`) inherit from `CoReasonBaseModel`. This provides a consistent interface for serialization, solving common Pydantic v2 issues with `UUID` and `datetime`.
32
+
33
+ * Use `.dump()` to get a JSON-compatible dictionary (where UUIDs/datetimes are strings).
34
+ * Use `.to_json()` to get a JSON string.
35
+
36
+ For a detailed rationale, see [docs/coreason_base_model_rationale.md](docs/coreason_base_model_rationale.md).
37
+
38
+ ## Installation
39
+
40
+ ```bash
41
+ pip install coreason-manifest
42
+ ```
43
+
44
+ ## Usage
45
+
46
+ This library is used to define and validate Agent configurations programmatically.
47
+
48
+ ```python
49
+ import uuid
50
+ from datetime import datetime, timezone
51
+ from coreason_manifest.definitions.agent import (
52
+ AgentDefinition,
53
+ AgentMetadata,
54
+ AgentInterface,
55
+ AgentRuntimeConfig,
56
+ ModelConfig,
57
+ AgentDependencies,
58
+ ToolRequirement,
59
+ ToolRiskLevel,
60
+ PolicyConfig,
61
+ ObservabilityConfig,
62
+ TraceLevel
63
+ )
64
+
65
+ # 1. Define Metadata
66
+ metadata = AgentMetadata(
67
+ id=uuid.uuid4(),
68
+ version="1.0.0", # Strict SemVer
69
+ name="Research Agent",
70
+ author="Coreason AI",
71
+ created_at=datetime.now(timezone.utc)
72
+ )
73
+
74
+ # 2. Instantiate Agent
75
+ agent = AgentDefinition(
76
+ metadata=metadata,
77
+ interface=AgentInterface(
78
+ inputs={"topic": {"type": "string"}},
79
+ outputs={"summary": {"type": "string"}}
80
+ ),
81
+ config=AgentRuntimeConfig(
82
+ model_config=ModelConfig(
83
+ model="gpt-4",
84
+ temperature=0.0,
85
+ system_prompt="You are a helpful assistant."
86
+ )
87
+ ),
88
+ dependencies=AgentDependencies(
89
+ tools=[
90
+ ToolRequirement(
91
+ uri="mcp://search-service/google",
92
+ hash="e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", # Valid SHA256
93
+ scopes=["search:read"],
94
+ risk_level=ToolRiskLevel.STANDARD
95
+ )
96
+ ],
97
+ libraries=("pandas==2.0.0",)
98
+ ),
99
+ policy=PolicyConfig(
100
+ budget_caps={"total_cost": 5.0}
101
+ ),
102
+ observability=ObservabilityConfig(
103
+ trace_level=TraceLevel.FULL,
104
+ retention_policy="90_days"
105
+ ),
106
+ # Mandatory Integrity Hash
107
+ integrity_hash="e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
108
+ )
109
+
110
+ print(f"Agent '{agent.metadata.name}' definition created and validated.")
111
+ ```
112
+
113
+ For full details, see the [Usage Documentation](docs/usage.md).
114
+
115
+ ## Documentation
116
+
117
+ * [Frontend Integration](docs/frontend_integration.md): Communicating with the Coreason Engine.
118
+ * [Simulation Architecture](docs/simulation_architecture.md): Details on ATIF compatibility and GAIA scenarios.
119
+ * [Audit & Compliance](docs/audit_compliance.md): Details on EU AI Act compliance, Chain of Custody, and Integrity Hashing.
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "coreason_manifest"
3
- version = "0.7.0"
3
+ version = "0.10.0"
4
4
  description = "This package is the definitive source of truth. If it isn't in the manifest, it doesn't exist. If it violates the manifest, it doesn't run."
5
5
  authors = ["Gowtham A Rao <gowtham.rao@coreason.ai>"]
6
6
  license = "Prosperity-3.0"
@@ -32,7 +32,7 @@ build-backend = "poetry.core.masonry.api"
32
32
 
33
33
  [project]
34
34
  name = "coreason_manifest"
35
- version = "0.7.0"
35
+ version = "0.10.0"
36
36
  description = "This package is the definitive source of truth. If it isn't in the manifest, it doesn't exist. If it violates the manifest, it doesn't run."
37
37
  readme = "README.md"
38
38
  requires-python = ">=3.12"
@@ -0,0 +1,98 @@
1
+ # Copyright (c) 2025 CoReason, Inc.
2
+ #
3
+ # This software is proprietary and dual-licensed.
4
+ # Licensed under the Prosperity Public License 3.0 (the "License").
5
+ # A copy of the license is available at https://prosperitylicense.com/versions/3.0.0
6
+ # For details, see the LICENSE file.
7
+ # Commercial use beyond a 30-day trial requires a separate license.
8
+ #
9
+ # Source Code: https://github.com/CoReason-AI/coreason-manifest
10
+
11
+ from .definitions.agent import AgentDefinition, Persona
12
+ from .definitions.audit import AuditLog
13
+ from .definitions.events import (
14
+ ArtifactGenerated,
15
+ CloudEvent,
16
+ CouncilVote,
17
+ EdgeTraversed,
18
+ GraphEvent,
19
+ GraphEventArtifactGenerated,
20
+ GraphEventCouncilVote,
21
+ GraphEventEdgeActive,
22
+ GraphEventError,
23
+ GraphEventNodeDone,
24
+ GraphEventNodeInit,
25
+ GraphEventNodeRestored,
26
+ GraphEventNodeSkipped,
27
+ GraphEventNodeStart,
28
+ GraphEventNodeStream,
29
+ NodeCompleted,
30
+ NodeInit,
31
+ NodeRestored,
32
+ NodeSkipped,
33
+ NodeStarted,
34
+ NodeStream,
35
+ WorkflowError,
36
+ migrate_graph_event_to_cloud_event,
37
+ )
38
+ from .definitions.simulation import (
39
+ SimulationMetrics,
40
+ SimulationScenario,
41
+ SimulationStep,
42
+ SimulationTrace,
43
+ StepType,
44
+ )
45
+ from .definitions.simulation_config import AdversaryProfile, ChaosConfig, SimulationRequest
46
+ from .definitions.topology import (
47
+ AgentNode,
48
+ Edge,
49
+ GraphTopology,
50
+ Node,
51
+ StateDefinition,
52
+ Topology,
53
+ )
54
+ from .recipes import RecipeManifest
55
+
56
+ __all__ = [
57
+ "AgentDefinition",
58
+ "Persona",
59
+ "Topology",
60
+ "GraphTopology",
61
+ "Node",
62
+ "AgentNode",
63
+ "Edge",
64
+ "StateDefinition",
65
+ "GraphEvent",
66
+ "CloudEvent",
67
+ "GraphEventNodeInit",
68
+ "GraphEventNodeStart",
69
+ "GraphEventNodeDone",
70
+ "GraphEventNodeStream",
71
+ "GraphEventNodeSkipped",
72
+ "GraphEventNodeRestored",
73
+ "GraphEventEdgeActive",
74
+ "GraphEventCouncilVote",
75
+ "GraphEventError",
76
+ "GraphEventArtifactGenerated",
77
+ "NodeInit",
78
+ "NodeStarted",
79
+ "NodeCompleted",
80
+ "NodeStream",
81
+ "NodeSkipped",
82
+ "NodeRestored",
83
+ "WorkflowError",
84
+ "CouncilVote",
85
+ "ArtifactGenerated",
86
+ "EdgeTraversed",
87
+ "migrate_graph_event_to_cloud_event",
88
+ "SimulationScenario",
89
+ "SimulationTrace",
90
+ "SimulationStep",
91
+ "SimulationMetrics",
92
+ "StepType",
93
+ "AdversaryProfile",
94
+ "ChaosConfig",
95
+ "SimulationRequest",
96
+ "AuditLog",
97
+ "RecipeManifest",
98
+ ]
@@ -0,0 +1,60 @@
1
+ # Copyright (c) 2025 CoReason, Inc.
2
+ #
3
+ # This software is proprietary and dual-licensed.
4
+ # Licensed under the Prosperity Public License 3.0 (the "License").
5
+ # A copy of the license is available at https://prosperitylicense.com/versions/3.0.0
6
+ # For details, see the LICENSE file.
7
+ # Commercial use beyond a 30-day trial requires a separate license.
8
+ #
9
+ # Source Code: https://github.com/CoReason-AI/coreason-manifest
10
+
11
+ from .agent import AgentDefinition, AgentRuntimeConfig, Persona
12
+ from .events import (
13
+ ArtifactGenerated,
14
+ ArtifactGeneratedPayload,
15
+ CouncilVote,
16
+ CouncilVotePayload,
17
+ EdgeTraversed,
18
+ EdgeTraversedPayload,
19
+ GraphEvent,
20
+ NodeCompleted,
21
+ NodeCompletedPayload,
22
+ NodeInit,
23
+ # Export Aliases too
24
+ NodeInitPayload,
25
+ NodeRestored,
26
+ NodeSkipped,
27
+ NodeSkippedPayload,
28
+ NodeStarted,
29
+ NodeStartedPayload,
30
+ NodeStream,
31
+ NodeStreamPayload,
32
+ WorkflowError,
33
+ WorkflowErrorPayload,
34
+ )
35
+
36
+ __all__ = [
37
+ "AgentRuntimeConfig",
38
+ "AgentDefinition",
39
+ "Persona",
40
+ "GraphEvent",
41
+ "NodeInit",
42
+ "NodeStarted",
43
+ "NodeCompleted",
44
+ "NodeRestored",
45
+ "NodeSkipped",
46
+ "NodeStream",
47
+ "ArtifactGenerated",
48
+ "EdgeTraversed",
49
+ "CouncilVote",
50
+ "WorkflowError",
51
+ "NodeInitPayload",
52
+ "NodeStartedPayload",
53
+ "NodeCompletedPayload",
54
+ "NodeSkippedPayload",
55
+ "NodeStreamPayload",
56
+ "EdgeTraversedPayload",
57
+ "ArtifactGeneratedPayload",
58
+ "CouncilVotePayload",
59
+ "WorkflowErrorPayload",
60
+ ]