correctover 1.2.0__tar.gz → 2.0.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.
Files changed (61) hide show
  1. correctover-2.0.1/LICENSE +8 -0
  2. correctover-2.0.1/PKG-INFO +94 -0
  3. correctover-2.0.1/README.md +55 -0
  4. correctover-2.0.1/correctover/__init__.py +12 -0
  5. correctover-2.0.1/correctover/validator.py +111 -0
  6. correctover-2.0.1/correctover.egg-info/PKG-INFO +94 -0
  7. correctover-2.0.1/correctover.egg-info/SOURCES.txt +10 -0
  8. correctover-2.0.1/correctover.egg-info/requires.txt +1 -0
  9. {correctover-1.2.0 → correctover-2.0.1}/setup.cfg +4 -4
  10. correctover-2.0.1/setup.py +39 -0
  11. correctover-1.2.0/LICENSE +0 -3
  12. correctover-1.2.0/MANIFEST.in +0 -2
  13. correctover-1.2.0/PKG-INFO +0 -24
  14. correctover-1.2.0/README.md +0 -3
  15. correctover-1.2.0/correctover/__init__.py +0 -278
  16. correctover-1.2.0/correctover/__pycache__/__init__.cpython-312.pyc +0 -0
  17. correctover-1.2.0/correctover/_checkup.pyc +0 -0
  18. correctover-1.2.0/correctover/_core.pyc +0 -0
  19. correctover-1.2.0/correctover/_device.pyc +0 -0
  20. correctover-1.2.0/correctover/_engine.pyc +0 -0
  21. correctover-1.2.0/correctover/_fixes.pyc +0 -0
  22. correctover-1.2.0/correctover/_fixes2.pyc +0 -0
  23. correctover-1.2.0/correctover/_ping.pyc +0 -0
  24. correctover-1.2.0/correctover/_stats.pyc +0 -0
  25. correctover-1.2.0/correctover/_tracker.pyc +0 -0
  26. correctover-1.2.0/correctover/_version.pyc +0 -0
  27. correctover-1.2.0/correctover/benchmark/__init__.py +0 -1
  28. correctover-1.2.0/correctover/benchmark/__init__.pyc +0 -0
  29. correctover-1.2.0/correctover/benchmark/fault_injector.pyc +0 -0
  30. correctover-1.2.0/correctover/benchmark/metrics_collector.pyc +0 -0
  31. correctover-1.2.0/correctover/benchmark/run_benchmark.pyc +0 -0
  32. correctover-1.2.0/correctover/benchmark/scenarios.pyc +0 -0
  33. correctover-1.2.0/correctover/carbon.pyc +0 -0
  34. correctover-1.2.0/correctover/checkpoint.pyc +0 -0
  35. correctover-1.2.0/correctover/classifier.pyc +0 -0
  36. correctover-1.2.0/correctover/cli.pyc +0 -0
  37. correctover-1.2.0/correctover/client.pyc +0 -0
  38. correctover-1.2.0/correctover/cost_tracker.pyc +0 -0
  39. correctover-1.2.0/correctover/dashboard.pyc +0 -0
  40. correctover-1.2.0/correctover/diagnoser.pyc +0 -0
  41. correctover-1.2.0/correctover/drift.pyc +0 -0
  42. correctover-1.2.0/correctover/gateway.pyc +0 -0
  43. correctover-1.2.0/correctover/health_scorer.pyc +0 -0
  44. correctover-1.2.0/correctover/integrity.pyc +0 -0
  45. correctover-1.2.0/correctover/license.pyc +0 -0
  46. correctover-1.2.0/correctover/logging_config.pyc +0 -0
  47. correctover-1.2.0/correctover/router.pyc +0 -0
  48. correctover-1.2.0/correctover/run.pyc +0 -0
  49. correctover-1.2.0/correctover/shield.pyc +0 -0
  50. correctover-1.2.0/correctover/smart_router.pyc +0 -0
  51. correctover-1.2.0/correctover/state_machine.pyc +0 -0
  52. correctover-1.2.0/correctover/telemetry.pyc +0 -0
  53. correctover-1.2.0/correctover/tracing.pyc +0 -0
  54. correctover-1.2.0/correctover/types.pyc +0 -0
  55. correctover-1.2.0/correctover.egg-info/PKG-INFO +0 -24
  56. correctover-1.2.0/correctover.egg-info/SOURCES.txt +0 -50
  57. correctover-1.2.0/correctover.egg-info/requires.txt +0 -2
  58. correctover-1.2.0/pyproject.toml +0 -21
  59. correctover-1.2.0/setup.py +0 -40
  60. {correctover-1.2.0 → correctover-2.0.1}/correctover.egg-info/dependency_links.txt +0 -0
  61. {correctover-1.2.0 → correctover-2.0.1}/correctover.egg-info/top_level.txt +0 -0
@@ -0,0 +1,8 @@
1
+ Proprietary Commercial License
2
+
3
+ Copyright (c) 2026 Guigui Wang
4
+
5
+ This software is proprietary and confidential. Unauthorized copying,
6
+ distribution, or use is strictly prohibited.
7
+
8
+ For licensing inquiries, contact: wangguigui@correctover.com
@@ -0,0 +1,94 @@
1
+ Metadata-Version: 2.4
2
+ Name: correctover
3
+ Version: 2.0.1
4
+ Summary: CCS v1.0 - Conformance Protocol for Agentic Runtime Systems
5
+ Home-page: https://correctover.github.io
6
+ Author: Guigui Wang
7
+ Author-email: wangguigui@correctover.com
8
+ Project-URL: Bug Tracker, https://github.com/Correctover/standards/issues
9
+ Project-URL: Documentation, https://correctover.github.io
10
+ Project-URL: Source, https://github.com/Correctover/standards
11
+ Project-URL: DOI, https://doi.org/10.5281/zenodo.21234580
12
+ Keywords: llm,validation,conformance,compliance,hipaa,gdpr,soc2,agent,mcp
13
+ Classifier: Development Status :: 5 - Production/Stable
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
16
+ Classifier: License :: Other/Proprietary License
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.8
19
+ Classifier: Programming Language :: Python :: 3.9
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Operating System :: OS Independent
23
+ Requires-Python: >=3.8
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ Requires-Dist: pydantic>=2.0.0
27
+ Dynamic: author
28
+ Dynamic: author-email
29
+ Dynamic: classifier
30
+ Dynamic: description
31
+ Dynamic: description-content-type
32
+ Dynamic: home-page
33
+ Dynamic: keywords
34
+ Dynamic: license-file
35
+ Dynamic: project-url
36
+ Dynamic: requires-dist
37
+ Dynamic: requires-python
38
+ Dynamic: summary
39
+
40
+ # Correctover - CCS v1.0
41
+
42
+ **Conformance Protocol for Agentic Runtime Systems**
43
+
44
+ DOI: [10.5281/zenodo.21234580](https://doi.org/10.5281/zenodo.21234580)
45
+
46
+ ## Overview
47
+
48
+ Correctover implements the CCS v1.0 standard for validating LLM outputs in agentic systems. It provides provider-agnostic, framework-agnostic conformance verification.
49
+
50
+ ## Quick Start
51
+
52
+ ```python
53
+ from correctover import CCSValidator
54
+
55
+ validator = CCSValidator(
56
+ required_fields=["decision", "confidence", "trace_id"],
57
+ supported_fields=["reasoning", "metadata"],
58
+ forbidden_fields=["pii", "credentials"]
59
+ )
60
+
61
+ result = validator.validate({
62
+ "decision": "approve",
63
+ "confidence": 0.95,
64
+ "trace_id": "abc-123"
65
+ })
66
+
67
+ print(f"Valid: {result.is_valid}")
68
+ ```
69
+
70
+ ## Components
71
+
72
+ - **CCS-Core**: Schema validation (Required/Supported/Forbidden)
73
+ - **CCS-Compliance**: HIPAA, GDPR, SOC2 mapping
74
+ - **CCS-Cost-Flow-Analysis**: Token budget enforcement
75
+ - **CCS-Integrity**: HMAC-based output binding
76
+ - **CCS-Audit**: Comprehensive audit logging
77
+
78
+ ## Integration
79
+
80
+ Framework adapters available:
81
+ - LangChain
82
+ - CrewAI
83
+ - AutoGen
84
+ - LlamaIndex
85
+
86
+ ## License
87
+
88
+ Proprietary Commercial License — see LICENSE file
89
+
90
+ ## Resources
91
+
92
+ - Website: https://correctover.github.io
93
+ - Specification: https://github.com/Correctover/standards
94
+ - DOI: https://doi.org/10.5281/zenodo.21234580
@@ -0,0 +1,55 @@
1
+ # Correctover - CCS v1.0
2
+
3
+ **Conformance Protocol for Agentic Runtime Systems**
4
+
5
+ DOI: [10.5281/zenodo.21234580](https://doi.org/10.5281/zenodo.21234580)
6
+
7
+ ## Overview
8
+
9
+ Correctover implements the CCS v1.0 standard for validating LLM outputs in agentic systems. It provides provider-agnostic, framework-agnostic conformance verification.
10
+
11
+ ## Quick Start
12
+
13
+ ```python
14
+ from correctover import CCSValidator
15
+
16
+ validator = CCSValidator(
17
+ required_fields=["decision", "confidence", "trace_id"],
18
+ supported_fields=["reasoning", "metadata"],
19
+ forbidden_fields=["pii", "credentials"]
20
+ )
21
+
22
+ result = validator.validate({
23
+ "decision": "approve",
24
+ "confidence": 0.95,
25
+ "trace_id": "abc-123"
26
+ })
27
+
28
+ print(f"Valid: {result.is_valid}")
29
+ ```
30
+
31
+ ## Components
32
+
33
+ - **CCS-Core**: Schema validation (Required/Supported/Forbidden)
34
+ - **CCS-Compliance**: HIPAA, GDPR, SOC2 mapping
35
+ - **CCS-Cost-Flow-Analysis**: Token budget enforcement
36
+ - **CCS-Integrity**: HMAC-based output binding
37
+ - **CCS-Audit**: Comprehensive audit logging
38
+
39
+ ## Integration
40
+
41
+ Framework adapters available:
42
+ - LangChain
43
+ - CrewAI
44
+ - AutoGen
45
+ - LlamaIndex
46
+
47
+ ## License
48
+
49
+ Proprietary Commercial License — see LICENSE file
50
+
51
+ ## Resources
52
+
53
+ - Website: https://correctover.github.io
54
+ - Specification: https://github.com/Correctover/standards
55
+ - DOI: https://doi.org/10.5281/zenodo.21234580
@@ -0,0 +1,12 @@
1
+ """
2
+ Correctover - CCS v1.0
3
+ Conformance Protocol for Agentic Runtime Systems
4
+ """
5
+
6
+ __version__ = "2.0.1"
7
+ __author__ = "Guigui Wang"
8
+ __email__ = "wangguigui@correctover.com"
9
+
10
+ from .validator import CCSValidator, ValidationResult
11
+
12
+ __all__ = ["CCSValidator", "ValidationResult"]
@@ -0,0 +1,111 @@
1
+ """
2
+ CCS v1.0 Validator
3
+ Validates LLM outputs against Required/Supported/Forbidden schemas
4
+ """
5
+
6
+ from typing import Dict, List, Any, Optional
7
+ from pydantic import BaseModel, Field
8
+ from datetime import datetime
9
+ import hashlib
10
+ import hmac
11
+
12
+
13
+ class ValidationResult(BaseModel):
14
+ """Result of CCS validation"""
15
+ is_valid: bool
16
+ errors: List[str] = Field(default_factory=list)
17
+ warnings: List[str] = Field(default_factory=list)
18
+ validated_at: str = Field(default_factory=lambda: datetime.utcnow().isoformat())
19
+ trace_id: Optional[str] = None
20
+
21
+
22
+ class CCSValidator:
23
+ """
24
+ CCS v1.0 Validator
25
+
26
+ Validates LLM outputs against Required/Supported/Forbidden schemas.
27
+ """
28
+
29
+ def __init__(
30
+ self,
31
+ required_fields: List[str] = None,
32
+ supported_fields: List[str] = None,
33
+ forbidden_fields: List[str] = None,
34
+ enable_integrity: bool = False,
35
+ integrity_key: str = None
36
+ ):
37
+ self.required_fields = set(required_fields or [])
38
+ self.supported_fields = set(supported_fields or [])
39
+ self.forbidden_fields = set(forbidden_fields or [])
40
+ self.enable_integrity = enable_integrity
41
+ self.integrity_key = integrity_key or "default-key"
42
+
43
+ def validate(self, output: Dict[str, Any], trace_id: str = None) -> ValidationResult:
44
+ """
45
+ Validate LLM output against CCS schema
46
+
47
+ Args:
48
+ output: LLM output dictionary
49
+ trace_id: Optional trace ID for audit logging
50
+
51
+ Returns:
52
+ ValidationResult with is_valid flag and errors/warnings
53
+ """
54
+ errors = []
55
+ warnings = []
56
+
57
+ # Check required fields
58
+ for field in self.required_fields:
59
+ if field not in output:
60
+ errors.append(f"Missing required field: {field}")
61
+
62
+ # Check forbidden fields
63
+ for field in self.forbidden_fields:
64
+ if field in output:
65
+ errors.append(f"Forbidden field present: {field}")
66
+
67
+ # Check supported fields (warning only)
68
+ output_fields = set(output.keys())
69
+ all_allowed = self.required_fields | self.supported_fields
70
+ unexpected = output_fields - all_allowed - self.forbidden_fields
71
+ for field in unexpected:
72
+ warnings.append(f"Unexpected field: {field}")
73
+
74
+ # Integrity check (if enabled)
75
+ if self.enable_integrity:
76
+ stored_hash = output.get("integrity_hash")
77
+ computed_hash = self._compute_integrity(output)
78
+
79
+ if stored_hash is None:
80
+ warnings.append("No integrity hash in output")
81
+ elif stored_hash != computed_hash:
82
+ errors.append("Integrity hash mismatch")
83
+
84
+ return ValidationResult(
85
+ is_valid=len(errors) == 0,
86
+ errors=errors,
87
+ warnings=warnings,
88
+ trace_id=trace_id
89
+ )
90
+
91
+ def _compute_integrity(self, output: Dict[str, Any]) -> str:
92
+ """Compute HMAC-based integrity hash (excludes integrity_hash field)"""
93
+ # Exclude integrity_hash from computation
94
+ filtered = {k: v for k, v in output.items() if k != "integrity_hash"}
95
+ sorted_items = sorted(filtered.items())
96
+ data_str = str(sorted_items)
97
+
98
+ # Compute HMAC
99
+ signature = hmac.new(
100
+ self.integrity_key.encode(),
101
+ data_str.encode(),
102
+ hashlib.sha256
103
+ ).hexdigest()
104
+
105
+ return signature
106
+
107
+ def add_integrity_hash(self, output: Dict[str, Any]) -> Dict[str, Any]:
108
+ """Add integrity hash to output"""
109
+ output_copy = output.copy()
110
+ output_copy["integrity_hash"] = self._compute_integrity(output_copy)
111
+ return output_copy
@@ -0,0 +1,94 @@
1
+ Metadata-Version: 2.4
2
+ Name: correctover
3
+ Version: 2.0.1
4
+ Summary: CCS v1.0 - Conformance Protocol for Agentic Runtime Systems
5
+ Home-page: https://correctover.github.io
6
+ Author: Guigui Wang
7
+ Author-email: wangguigui@correctover.com
8
+ Project-URL: Bug Tracker, https://github.com/Correctover/standards/issues
9
+ Project-URL: Documentation, https://correctover.github.io
10
+ Project-URL: Source, https://github.com/Correctover/standards
11
+ Project-URL: DOI, https://doi.org/10.5281/zenodo.21234580
12
+ Keywords: llm,validation,conformance,compliance,hipaa,gdpr,soc2,agent,mcp
13
+ Classifier: Development Status :: 5 - Production/Stable
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
16
+ Classifier: License :: Other/Proprietary License
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.8
19
+ Classifier: Programming Language :: Python :: 3.9
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Operating System :: OS Independent
23
+ Requires-Python: >=3.8
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ Requires-Dist: pydantic>=2.0.0
27
+ Dynamic: author
28
+ Dynamic: author-email
29
+ Dynamic: classifier
30
+ Dynamic: description
31
+ Dynamic: description-content-type
32
+ Dynamic: home-page
33
+ Dynamic: keywords
34
+ Dynamic: license-file
35
+ Dynamic: project-url
36
+ Dynamic: requires-dist
37
+ Dynamic: requires-python
38
+ Dynamic: summary
39
+
40
+ # Correctover - CCS v1.0
41
+
42
+ **Conformance Protocol for Agentic Runtime Systems**
43
+
44
+ DOI: [10.5281/zenodo.21234580](https://doi.org/10.5281/zenodo.21234580)
45
+
46
+ ## Overview
47
+
48
+ Correctover implements the CCS v1.0 standard for validating LLM outputs in agentic systems. It provides provider-agnostic, framework-agnostic conformance verification.
49
+
50
+ ## Quick Start
51
+
52
+ ```python
53
+ from correctover import CCSValidator
54
+
55
+ validator = CCSValidator(
56
+ required_fields=["decision", "confidence", "trace_id"],
57
+ supported_fields=["reasoning", "metadata"],
58
+ forbidden_fields=["pii", "credentials"]
59
+ )
60
+
61
+ result = validator.validate({
62
+ "decision": "approve",
63
+ "confidence": 0.95,
64
+ "trace_id": "abc-123"
65
+ })
66
+
67
+ print(f"Valid: {result.is_valid}")
68
+ ```
69
+
70
+ ## Components
71
+
72
+ - **CCS-Core**: Schema validation (Required/Supported/Forbidden)
73
+ - **CCS-Compliance**: HIPAA, GDPR, SOC2 mapping
74
+ - **CCS-Cost-Flow-Analysis**: Token budget enforcement
75
+ - **CCS-Integrity**: HMAC-based output binding
76
+ - **CCS-Audit**: Comprehensive audit logging
77
+
78
+ ## Integration
79
+
80
+ Framework adapters available:
81
+ - LangChain
82
+ - CrewAI
83
+ - AutoGen
84
+ - LlamaIndex
85
+
86
+ ## License
87
+
88
+ Proprietary Commercial License — see LICENSE file
89
+
90
+ ## Resources
91
+
92
+ - Website: https://correctover.github.io
93
+ - Specification: https://github.com/Correctover/standards
94
+ - DOI: https://doi.org/10.5281/zenodo.21234580
@@ -0,0 +1,10 @@
1
+ LICENSE
2
+ README.md
3
+ setup.py
4
+ correctover/__init__.py
5
+ correctover/validator.py
6
+ correctover.egg-info/PKG-INFO
7
+ correctover.egg-info/SOURCES.txt
8
+ correctover.egg-info/dependency_links.txt
9
+ correctover.egg-info/requires.txt
10
+ correctover.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ pydantic>=2.0.0
@@ -1,4 +1,4 @@
1
- [egg_info]
2
- tag_build =
3
- tag_date = 0
4
-
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,39 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ with open("README.md", "r", encoding="utf-8") as fh:
4
+ long_description = fh.read()
5
+
6
+ setup(
7
+ name="correctover",
8
+ version="2.0.1",
9
+ author="Guigui Wang",
10
+ author_email="wangguigui@correctover.com",
11
+ description="CCS v1.0 - Conformance Protocol for Agentic Runtime Systems",
12
+ long_description=long_description,
13
+ long_description_content_type="text/markdown",
14
+ url="https://correctover.github.io",
15
+ project_urls={
16
+ "Bug Tracker": "https://github.com/Correctover/standards/issues",
17
+ "Documentation": "https://correctover.github.io",
18
+ "Source": "https://github.com/Correctover/standards",
19
+ "DOI": "https://doi.org/10.5281/zenodo.21234580",
20
+ },
21
+ packages=find_packages(),
22
+ classifiers=[
23
+ "Development Status :: 5 - Production/Stable",
24
+ "Intended Audience :: Developers",
25
+ "Topic :: Software Development :: Libraries :: Python Modules",
26
+ "License :: Other/Proprietary License",
27
+ "Programming Language :: Python :: 3",
28
+ "Programming Language :: Python :: 3.8",
29
+ "Programming Language :: Python :: 3.9",
30
+ "Programming Language :: Python :: 3.10",
31
+ "Programming Language :: Python :: 3.11",
32
+ "Operating System :: OS Independent",
33
+ ],
34
+ python_requires=">=3.8",
35
+ install_requires=[
36
+ "pydantic>=2.0.0",
37
+ ],
38
+ keywords="llm, validation, conformance, compliance, hipaa, gdpr, soc2, agent, mcp",
39
+ )
correctover-1.2.0/LICENSE DELETED
@@ -1,3 +0,0 @@
1
- PROPRIETARY COMMERCIAL LICENSE
2
- Copyright (c) 2024-2026 Correctover Team. All rights reserved.
3
- This software is NOT open source.
@@ -1,2 +0,0 @@
1
- recursive-include correctover *.pyc
2
- recursive-include correctover/benchmark *.pyc
@@ -1,24 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: correctover
3
- Version: 1.2.0
4
- Summary: Correctover — Protocol-level contract validation with automatic verified failover for LLM APIs.
5
- Home-page: https://correctover.com
6
- Author: Correctover Team
7
- Author-email: Correctover Team <team@correctover.com>
8
- License: Proprietary Commercial License
9
- Keywords: llm,self-healing,failover,circuit-breaker,api-resilience
10
- Classifier: Development Status :: 5 - Production/Stable
11
- Classifier: Intended Audience :: Developers
12
- Classifier: License :: Other/Proprietary License
13
- Classifier: Operating System :: OS Independent
14
- Classifier: Programming Language :: Python :: 3
15
- Classifier: Programming Language :: Python :: 3.12
16
- Requires-Python: >=3.12
17
- Description-Content-Type: text/markdown
18
- License-File: LICENSE
19
- Requires-Dist: httpx>=0.24.0
20
- Requires-Dist: aiohttp>=3.8.0
21
-
22
- # Correctover SDK v1.0.2
23
-
24
- Closed-source compiled package. See https://correctover.com
@@ -1,3 +0,0 @@
1
- # Correctover SDK v1.0.2
2
-
3
- Closed-source compiled package. See https://correctover.com
@@ -1,278 +0,0 @@
1
- # Copyright 2024-2026 Correctover Team
2
- # Licensed under the Apache License, Version 2.0 (the "License")
3
- # Correctover™ — Proprietary MAPE-K Adaptive Loop Architecture
4
- # Patent Pending. See NOTICE file for full IP attribution.
5
- #
6
- """Correctover SDK — Agent stability SDK. Smart routing, auto-failover, crash recovery."""
7
- from correctover._version import __version__
8
- version = __version__
9
-
10
- # 懒加载字典:所有模块延迟加载
11
- _lazy = {
12
- # Core engine
13
- "SelfHealingEngine": ("correctover._engine", "SelfHealingEngine"),
14
- "CallResult": ("correctover._engine", "CallResult"),
15
- "ProviderConfig": ("correctover._engine", "ProviderConfig"),
16
- "APIError": ("correctover._engine", "APIError"),
17
- # Diagnoser
18
- "FaultCategory": ("correctover._engine", "FaultCategory"),
19
- "Diagnosis": ("correctover._engine", "Diagnosis"),
20
- "Diagnoser": ("correctover.diagnoser", "Diagnoser"),
21
- # HA components
22
- "CircuitBreaker": ("correctover._engine", "CircuitBreaker"),
23
- "CircuitState": ("correctover._engine", "CircuitState"),
24
- "RateLimiter": ("correctover._engine", "RateLimiter"),
25
- "Bulkhead": ("correctover._engine", "Bulkhead"),
26
- # Semantic topology
27
- "SemanticTopology": ("correctover._engine", "SemanticTopology"),
28
- "SemanticDomain": ("correctover._engine", "SemanticDomain"),
29
- "SemanticClassification": ("correctover._engine", "SemanticClassification"),
30
- # Flywheel
31
- "FlywheelLearner": ("correctover._engine", "FlywheelLearner"),
32
- "LearnedRule": ("correctover._engine", "LearnedRule"),
33
- "MetricsCollector": ("correctover._engine", "MetricsCollector"),
34
- # MAPE-K Trace
35
- "MapeKPhase": ("correctover._engine", "MapeKPhase"),
36
- "MapeKTrace": ("correctover._engine", "MapeKTrace"),
37
- # Contract Validator
38
- "Contract": ("correctover._engine", "Contract"),
39
- "ContractCheck": ("correctover._engine", "ContractCheck"),
40
- "ContractResult": ("correctover._engine", "ContractResult"),
41
- "ContractViolationError": ("correctover._engine", "ContractViolationError"),
42
- "SemanticBoundaryViolationError": ("correctover._engine", "SemanticBoundaryViolationError"),
43
- # Compatibility modules
44
- "HealthScorer": ("correctover.health_scorer", "HealthScorer"),
45
- "CostTracker": ("correctover.cost_tracker", "CostTracker"),
46
- "IntegrityChecker": ("correctover.integrity", "IntegrityChecker"),
47
- "EngineStateMachine": ("correctover.state_machine", "EngineStateMachine"),
48
- "CorrectoverTelemetry": ("correctover.telemetry", "CorrectoverTelemetry"),
49
- "TelemetryCollector": ("correctover.telemetry", "TelemetryCollector"),
50
- "TelemetryConfig": ("correctover.telemetry", "TelemetryConfig"),
51
- "run": ("correctover.run", "run"),
52
- "Run": ("correctover.run", "Run"),
53
- "RecoveryLevel": ("correctover.types", "RecoveryLevel"),
54
- "DiagnosisResult": ("correctover.types", "DiagnosisResult"),
55
- "RecoveryAction": ("correctover.types", "RecoveryAction"),
56
- "RoutingStrategy": ("correctover.types", "RoutingStrategy"),
57
- # Gateway proxy
58
- "GatewayConfig": ("correctover.gateway", "GatewayConfig"),
59
- "serve": ("correctover.gateway", "serve"),
60
- # License system
61
- "activate": ("correctover.license", "activate"),
62
- "verify": ("correctover.license", "verify"),
63
- "get_plan": ("correctover.license", "get_plan"),
64
- "is_pro": ("correctover.license", "is_pro"),
65
- "is_trial": ("correctover.license", "is_trial"),
66
- "is_enterprise": ("correctover.license", "is_enterprise"),
67
- "is_expired": ("correctover.license", "is_expired"),
68
- "is_device_bound": ("correctover.license", "is_device_bound"),
69
- "require_pro": ("correctover.license", "require_pro"),
70
- "days_remaining": ("correctover.license", "days_remaining"),
71
- "max_providers": ("correctover.license", "max_providers"),
72
- "max_heal_level": ("correctover.license", "max_heal_level"),
73
- "feature_gate": ("correctover.license", "feature_gate"),
74
- "watermark_enabled": ("correctover.license", "watermark_enabled"),
75
- "consume_repair": ("correctover.license", "consume_repair"),
76
- "can_repair": ("correctover.license", "can_repair"),
77
- "diagnose_free": ("correctover.license", "diagnose_free"),
78
- "plan_summary": ("correctover.license", "plan_summary"),
79
- "LicenseInfo": ("correctover.license", "LicenseInfo"),
80
- "LicenseError": ("correctover.license", "LicenseError"),
81
- "RepairLockedError": ("correctover.license", "RepairLockedError"),
82
- "LicenseExpiredError": ("correctover.license", "LicenseExpiredError"),
83
- "DeviceMismatchError": ("correctover.license", "DeviceMismatchError"),
84
- "PLAN_PRICES": ("correctover.license", "PLAN_PRICES"),
85
- "PLAN_LABELS": ("correctover.license", "PLAN_LABELS"),
86
- "REPAIR_ACTIONS": ("correctover.license", "REPAIR_ACTIONS"),
87
- # Device fingerprint
88
- "device_fingerprint": ("correctover._device", "device_fingerprint"),
89
- "device_info": ("correctover._device", "device_info"),
90
- # Stats & ROI
91
- "savings_report": ("correctover._stats", "savings_report"),
92
- "console_summary": ("correctover._stats", "console_summary"),
93
- "dashboard_data": ("correctover._stats", "dashboard_data"),
94
- "weekly_summary": ("correctover._stats", "weekly_summary"),
95
- "upgrade_triggers": ("correctover._stats", "upgrade_triggers"),
96
- # Router + Client (v5.0)
97
- "Client": ("correctover.client", "Client"),
98
- "ChatResponse": ("correctover.client", "ChatResponse"),
99
- "CostReport": ("correctover.client", "CostReport"),
100
- "Router": ("correctover.router", "Router"),
101
- "RoutingDecision": ("correctover.router", "RoutingDecision"),
102
- "Strategy": ("correctover.router", "Strategy"),
103
- "Complexity": ("correctover.classifier", "Complexity"),
104
- "classify": ("correctover.classifier", "classify"),
105
- # Checkpoint — Agent crash recovery (v4.3)
106
- "Checkpoint": ("correctover.checkpoint", "Checkpoint"),
107
- "StepResult": ("correctover.checkpoint", "StepResult"),
108
- "AgentSession": ("correctover.checkpoint", "AgentSession"),
109
- "RunContext": ("correctover.checkpoint", "RunContext"),
110
- "CheckpointStore": ("correctover.checkpoint", "CheckpointStore"),
111
- "FileCheckpointStore": ("correctover.checkpoint", "FileCheckpointStore"),
112
- "MemoryCheckpointStore": ("correctover.checkpoint", "MemoryCheckpointStore"),
113
- # Telemetry
114
- "ping": ("correctover._ping", "ping"),
115
- # Carbon Tracker (v4.4.2)
116
- "CarbonTracker": ("correctover.carbon", "CarbonTracker"),
117
- "estimate_wh": ("correctover.carbon", "estimate_wh"),
118
- "estimate_co2_kg": ("correctover.carbon", "estimate_co2_kg"),
119
- "MODEL_ENERGY": ("correctover.carbon", "MODEL_ENERGY"),
120
- "CARBON_INTENSITY_GRID": ("correctover.carbon", "CARBON_INTENSITY_GRID"),
121
- "DriftMonitor": ("correctover.drift", "DriftMonitor"),
122
- "DriftAlert": ("correctover.drift", "DriftAlert"),
123
- # Dashboard (v4.4.2)
124
- "dashboard": ("correctover.dashboard", "dashboard"),
125
- "stop_dashboard": ("correctover.dashboard", "stop_dashboard"),
126
- "dashboard_url": ("correctover.dashboard", "dashboard_url"),
127
- "dashboard_status": ("correctover.dashboard", "dashboard_status"),
128
- }
129
-
130
- __all__ = list(_lazy.keys()) + ["checkup"]
131
-
132
-
133
- def __getattr__(name):
134
- """懒加载:只在首次访问时导入模块"""
135
- if name in _lazy:
136
- import importlib
137
- mod_path, cls_name = _lazy[name]
138
- mod = importlib.import_module(mod_path)
139
- obj = getattr(mod, cls_name)
140
- globals()[name] = obj
141
- return obj
142
- raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
143
-
144
-
145
- def __dir__():
146
- """返回完整的导出列表"""
147
- return __all__
148
-
149
-
150
- # ── Telemetry (opt-in, default OFF) ──────────────────────────────
151
- import os as _os
152
- # Telemetry is OFF by default. Set CORRECTOVER_TELEMETRY=1 to enable.
153
- # This collects anonymous usage data (version, OS, plan) to improve the SDK.
154
- # See https://correctover.cn/docs/telemetry for details.
155
- # Telemetry is OFF by default. Set CORRECTOVER_TELEMETRY=1 to enable.
156
- if _os.environ.get("CORRECTOVER_TELEMETRY") != "1":
157
- _os.environ["CORRECTOVER_TELEMETRY"] = "0"
158
- if not _os.environ.get("CORRECTOVER_TELEMETRY_URL"):
159
- _os.environ["CORRECTOVER_TELEMETRY_URL"] = "https://license-api-correctover-hk-rewfrmblft.cn-hongkong.fcapp.run/api/v1/telemetry"
160
-
161
- # ── Auto-ping on import (only if telemetry is opted-in) ─────────
162
- if _os.environ.get("CORRECTOVER_TELEMETRY") == "1":
163
- try:
164
- from correctover._ping import ping as _auto_ping
165
- _auto_ping()
166
- except Exception:
167
- pass
168
-
169
-
170
- # ── First-run checkup ────────────────────────────────────────────
171
- def checkup():
172
- """手动触发体检 (重新检测所有 provider 和连通性)."""
173
- from correctover._checkup import force_run
174
- force_run()
175
-
176
- try:
177
- from correctover._checkup import run as _checkup_run
178
- _checkup_run()
179
- except Exception:
180
- pass
181
-
182
-
183
- # ══════════════════════════════════════════════════════════════════
184
- # SECURITY LAYER — All logic lives in _security.so (compiled)
185
- # ══════════════════════════════════════════════════════════════════
186
-
187
- # ── Step 1: Initialize tracker (silent, non-blocking) ──────────
188
- try:
189
- # [FIXED] tracker only loaded when telemetry explicitly opted in
190
- if _os.environ.get('CORRECTOVER_TELEMETRY') == '1':
191
- from correctover._tracker import report as _track_report
192
- from correctover._tracker import flush as _track_flush
193
- else:
194
- _track_report = None
195
- _track_flush = None
196
- except ImportError as _e:
197
- _track_report = None
198
- _track_flush = None
199
- import sys as _sys
200
- if "cpython" in str(_e).lower() or "magic" in str(_e).lower():
201
- print(f"[Correctover] WARNING: _tracker module incompatible with Python {_sys.version_info.major}.{_sys.version_info.minor}. "
202
- f"Security tracking disabled. Reinstall from source: pip install --no-binary correctover-sdk correctover-sdk", file=_sys.stderr)
203
- except Exception:
204
- _track_report = None
205
- _track_flush = None
206
-
207
-
208
- # ── Step 2-5: Security init — removed in Open Core v5.7.0 ─────
209
-
210
-
211
- # ── Step 6: Flush pending tracker events ───────────────────────
212
- try:
213
- if _track_flush:
214
- _track_flush()
215
- except Exception:
216
- pass
217
-
218
-
219
- # ── Step 7: Cloud Kill-Switch — removed in Open Core v5.7.0 ────
220
-
221
-
222
- # ══════════════════════════════════════════════════════════════════
223
- # Anthropic 推荐:最简一行调用(Less is More + ACI 设计原则)
224
- # ══════════════════════════════════════════════════════════════════
225
-
226
- def run(prompt="", provider="", **kwargs):
227
- """一行代码调用 AI,自动配置、自动自愈。
228
-
229
- Anthropic《构建高效的 Agents》核心原则:
230
- - Less is More:从最简单开始,一行代码
231
- - 好的 ACI 设计:用户不需要了解内部细节
232
-
233
- 用法:
234
- import correctover as nb
235
- result = nb.run("你好") # 自动读环境变量
236
- print(result.summary()) # 透明度:看到完整调用链
237
-
238
- 环境变量: DEEPSEEK_API_KEY, OPENAI_API_KEY, ANTHROPIC_API_KEY, DASHSCOPE_API_KEY
239
- """
240
- import asyncio, os
241
- from correctover._engine import SelfHealingEngine, ProviderConfig
242
-
243
- engine = SelfHealingEngine()
244
- api_key = kwargs.pop("api_key", "") or os.environ.get("CUSTOM_API_KEY", "")
245
- candidates = [provider] if provider else ["deepseek", "openai", "anthropic", "dashscope", "agnes"]
246
-
247
- for p in candidates:
248
- env_key = api_key or os.environ.get(f"{p.upper()}_API_KEY", "")
249
- if not env_key:
250
- continue
251
- try:
252
- cfg = ProviderConfig(name=p, base_url=ProviderConfig._get_base_url(p), api_key=env_key)
253
- engine.add_provider(cfg)
254
- except Exception:
255
- continue
256
- break
257
-
258
- if prompt:
259
- return asyncio.run(engine.call(prompt, **kwargs))
260
- return engine
261
-
262
-
263
- # ── Apply runtime patches for known bugs ──────────────────────────
264
- # Bug #2 (latency), #3 (5xx), and the historical fixes in _fixes.pyc
265
- # are applied here at import time.
266
- try:
267
- from correctover._fixes import _apply_patches as _apply_fixes
268
- _apply_fixes()
269
- except Exception as _fix_err:
270
- if _os.environ.get("CORRECTOVER_DEBUG"):
271
- print(f"[Correctover] _fixes load warning: {_fix_err}")
272
-
273
- try:
274
- from correctover._fixes2 import _apply_patches as _apply_fixes2
275
- _apply_fixes2()
276
- except Exception as _fix2_err:
277
- if _os.environ.get("CORRECTOVER_DEBUG"):
278
- print(f"[Correctover] _fixes2 load warning: {_fix2_err}")
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1 +0,0 @@
1
- # benchmark package marker
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,24 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: correctover
3
- Version: 1.2.0
4
- Summary: Correctover — Protocol-level contract validation with automatic verified failover for LLM APIs.
5
- Home-page: https://correctover.com
6
- Author: Correctover Team
7
- Author-email: Correctover Team <team@correctover.com>
8
- License: Proprietary Commercial License
9
- Keywords: llm,self-healing,failover,circuit-breaker,api-resilience
10
- Classifier: Development Status :: 5 - Production/Stable
11
- Classifier: Intended Audience :: Developers
12
- Classifier: License :: Other/Proprietary License
13
- Classifier: Operating System :: OS Independent
14
- Classifier: Programming Language :: Python :: 3
15
- Classifier: Programming Language :: Python :: 3.12
16
- Requires-Python: >=3.12
17
- Description-Content-Type: text/markdown
18
- License-File: LICENSE
19
- Requires-Dist: httpx>=0.24.0
20
- Requires-Dist: aiohttp>=3.8.0
21
-
22
- # Correctover SDK v1.0.2
23
-
24
- Closed-source compiled package. See https://correctover.com
@@ -1,50 +0,0 @@
1
- LICENSE
2
- MANIFEST.in
3
- README.md
4
- pyproject.toml
5
- setup.py
6
- correctover/__init__.py
7
- correctover/_checkup.pyc
8
- correctover/_core.pyc
9
- correctover/_device.pyc
10
- correctover/_engine.pyc
11
- correctover/_fixes.pyc
12
- correctover/_fixes2.pyc
13
- correctover/_ping.pyc
14
- correctover/_stats.pyc
15
- correctover/_tracker.pyc
16
- correctover/_version.pyc
17
- correctover/carbon.pyc
18
- correctover/checkpoint.pyc
19
- correctover/classifier.pyc
20
- correctover/cli.pyc
21
- correctover/client.pyc
22
- correctover/cost_tracker.pyc
23
- correctover/dashboard.pyc
24
- correctover/diagnoser.pyc
25
- correctover/drift.pyc
26
- correctover/gateway.pyc
27
- correctover/health_scorer.pyc
28
- correctover/integrity.pyc
29
- correctover/license.pyc
30
- correctover/logging_config.pyc
31
- correctover/router.pyc
32
- correctover/run.pyc
33
- correctover/shield.pyc
34
- correctover/smart_router.pyc
35
- correctover/state_machine.pyc
36
- correctover/telemetry.pyc
37
- correctover/tracing.pyc
38
- correctover/types.pyc
39
- correctover.egg-info/PKG-INFO
40
- correctover.egg-info/SOURCES.txt
41
- correctover.egg-info/dependency_links.txt
42
- correctover.egg-info/requires.txt
43
- correctover.egg-info/top_level.txt
44
- correctover/__pycache__/__init__.cpython-312.pyc
45
- correctover/benchmark/__init__.py
46
- correctover/benchmark/__init__.pyc
47
- correctover/benchmark/fault_injector.pyc
48
- correctover/benchmark/metrics_collector.pyc
49
- correctover/benchmark/run_benchmark.pyc
50
- correctover/benchmark/scenarios.pyc
@@ -1,2 +0,0 @@
1
- httpx>=0.24.0
2
- aiohttp>=3.8.0
@@ -1,21 +0,0 @@
1
- [build-system]
2
- requires = ["setuptools>=64,<75"]
3
- build-backend = "setuptools.build_meta"
4
-
5
- [project]
6
- name = "correctover"
7
- version = "1.2.0"
8
- description = "Correctover \u2014 Protocol-level contract validation with automatic verified failover for LLM APIs."
9
- readme = "README.md"
10
- requires-python = ">=3.12"
11
- license = {text = "Proprietary Commercial License"}
12
- keywords = ["llm","self-healing","failover","circuit-breaker","api-resilience"]
13
- authors = [{name = "Correctover Team", email = "team@correctover.com"}]
14
- classifiers = ["Development Status :: 5 - Production/Stable","Intended Audience :: Developers","License :: Other/Proprietary License","Operating System :: OS Independent","Programming Language :: Python :: 3","Programming Language :: Python :: 3.12"]
15
- dependencies = ["httpx>=0.24.0","aiohttp>=3.8.0"]
16
-
17
- [tool.setuptools.packages.find]
18
- include = ["correctover*"]
19
-
20
- [tool.setuptools.package-data]
21
- correctover = ["*.pyc"]
@@ -1,40 +0,0 @@
1
- #!/usr/bin/env python3
2
- """Setup for correctover SDK v1.0.2 (compiled .pyc distribution)."""
3
- from setuptools import setup, find_packages
4
-
5
- setup(
6
- name="correctover",
7
- version="1.2.0",
8
- description="Correctover - Protocol-level contract validation with automatic verified failover for LLM APIs.",
9
- long_description="Closed-source compiled package. See https://correctover.com",
10
- long_description_content_type="text/markdown",
11
- author="Correctover Team",
12
- author_email="team@correctover.com",
13
- url="https://correctover.com",
14
- packages=find_packages() + ["correctover.benchmark"],
15
- package_data={
16
- "correctover": ["*.pyc"],
17
- "correctover.benchmark": ["*.pyc"],
18
- },
19
- include_package_data=True,
20
- python_requires=">=3.12",
21
- install_requires=[
22
- "httpx>=0.24.0",
23
- "aiohttp>=3.8.0",
24
- ],
25
- classifiers=[
26
- "Development Status :: 5 - Production/Stable",
27
- "Intended Audience :: Developers",
28
- "License :: Other/Proprietary License",
29
- "Operating System :: OS Independent",
30
- "Programming Language :: Python :: 3",
31
- "Programming Language :: Python :: 3.12",
32
- "Topic :: Scientific/Engineering :: Artificial Intelligence",
33
- ],
34
- entry_points={
35
- "console_scripts": [
36
- "correctover-shield=correctover.shield:main",
37
- ],
38
- },
39
- license="Proprietary Commercial License",
40
- )