coreason-manifest 0.6.0__py3-none-any.whl → 0.9.0__py3-none-any.whl

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.
@@ -1,67 +0,0 @@
1
- # Prosperity-3.0
2
- """Schema validation functionality.
3
-
4
- This module provides the `SchemaValidator` class, which uses JSON Schema to
5
- validate the structure and types of agent definitions.
6
- """
7
-
8
- from __future__ import annotations
9
-
10
- import json
11
- from importlib.resources import files
12
- from typing import Any
13
-
14
- from jsonschema import FormatChecker, ValidationError, validate
15
-
16
- from coreason_manifest.errors import ManifestSyntaxError
17
-
18
-
19
- class SchemaValidator:
20
- """Component B: SchemaValidator (The Structural Engineer).
21
-
22
- Responsibility:
23
- - Validate the dictionary against the Master JSON Schema.
24
- - Check required fields, data types, and format constraints.
25
- """
26
-
27
- def __init__(self) -> None:
28
- """Initialize the validator by loading the schema."""
29
- self.schema = self._load_schema()
30
-
31
- def _load_schema(self) -> dict[str, Any]:
32
- """Loads the JSON schema from the package resources.
33
-
34
- Returns:
35
- The JSON schema dictionary.
36
-
37
- Raises:
38
- ManifestSyntaxError: If the schema file cannot be loaded or is invalid.
39
- """
40
- try:
41
- schema_path = files("coreason_manifest.schemas").joinpath("agent.schema.json")
42
- with schema_path.open("r", encoding="utf-8") as f:
43
- schema = json.load(f)
44
- if not isinstance(schema, dict):
45
- raise ManifestSyntaxError("Schema file is not a valid JSON object.")
46
- return schema
47
- except (IOError, json.JSONDecodeError) as e:
48
- raise ManifestSyntaxError(f"Failed to load agent schema: {e}") from e
49
-
50
- def validate(self, data: dict[str, Any]) -> bool:
51
- """Validates the given dictionary against the agent schema.
52
-
53
- Args:
54
- data: The raw dictionary to validate.
55
-
56
- Returns:
57
- True if validation passes.
58
-
59
- Raises:
60
- ManifestSyntaxError: If validation fails.
61
- """
62
- try:
63
- validate(instance=data, schema=self.schema, format_checker=FormatChecker())
64
- return True
65
- except ValidationError as e:
66
- # We treat schema validation errors as syntax errors in the manifest
67
- raise ManifestSyntaxError(f"Schema validation failed: {e.message}") from e
@@ -1,22 +0,0 @@
1
- coreason_manifest/__init__.py,sha256=wDlmlYxr29P_fX5Et6pP-jcMtQe6eTzKvpUrh7zFMOM,1857
2
- coreason_manifest/engine.py,sha256=ENAkRuGFd1uY_5u4EYEsTZUMrqw5HgijKtkF9lk-E-c,8199
3
- coreason_manifest/errors.py,sha256=CKFWSucncoPLYUJcsuXtLIfneyr2d89oHRTiWPT4psU,1437
4
- coreason_manifest/integrity.py,sha256=CMBaa2A8DpC9hDSO-aj-YOzss6if1CajaeLEmTC703c,5344
5
- coreason_manifest/loader.py,sha256=WET8HAnSw4dgon_zdiZaaU1dIUrsIQPYZzxlp0crTYo,10027
6
- coreason_manifest/main.py,sha256=YQO98w2wxkfNs-DpSLmiDTs9DtUeGsC48GEfbElXVPk,357
7
- coreason_manifest/models.py,sha256=EuaE1Wl5T8f_eI9vF1VFp5hd0y9C7E52zAjB52EulKw,7497
8
- coreason_manifest/policies/compliance.rego,sha256=-drMuno6YkGOXKjvdLWawCZWK8iUxY7OcXpoXa_9Oyo,3035
9
- coreason_manifest/policies/tbom.json,sha256=rSn4V44_IdFqCC86J3Jc31qQKTV4J5BdmyO0CI4iOu0,167
10
- coreason_manifest/policy.py,sha256=vvEivq5HSjv-bMSrZ5VMM3eTomYFp39SBtuFajG9RU4,5009
11
- coreason_manifest/recipes.py,sha256=tMNOE-JYJtG6NYRH1a-IoCLD4gXo7qoTb8dypLkmHC0,5849
12
- coreason_manifest/schemas/__init__.py,sha256=9TMs6jWKCIewAKkj-u0tq9c6N_-0CU6b5s9q6MTS6v4,17
13
- coreason_manifest/schemas/agent.schema.json,sha256=VigUX3ltX7YaW9P7n0DNYGNOf8C6VCuXNy71u3LB9i4,6812
14
- coreason_manifest/server.py,sha256=ezuk-4sABF92U4cY1ppYJGJf8q6yeoteVlrwnmk7Jis,4253
15
- coreason_manifest/utils/__init__.py,sha256=Q9gXiBtX3mD9GTu4z0JDHSHkbXC-MRHagrOaOmRH_1Q,435
16
- coreason_manifest/utils/logger.py,sha256=A7E6Hd_Jk1XDUajNEJQl-WtUv9M2LT76b4_TsbxnILw,1227
17
- coreason_manifest/validator.py,sha256=v33EzKroRwLEjZeuRRpTB7cqB38op3DV2EZpZhJ80a0,2240
18
- coreason_manifest-0.6.0.dist-info/METADATA,sha256=nkC0JpE_Itg26p5U7-mS8KizLv-lBc9eZM2FrB3oioM,7421
19
- coreason_manifest-0.6.0.dist-info/WHEEL,sha256=3ny-bZhpXrU6vSQ1UPG34FoxZBp3lVcvK0LkgUz6VLk,88
20
- coreason_manifest-0.6.0.dist-info/licenses/LICENSE,sha256=3tYb7ZQe7sVXcbNmX22fDESFjOSIlCZodUGpZMkuSlk,3063
21
- coreason_manifest-0.6.0.dist-info/licenses/NOTICE,sha256=tqzUyP9VTCGxoHLgBI0AC1i0G7m_PSyESFL8Jwuw0dA,610
22
- coreason_manifest-0.6.0.dist-info/RECORD,,