@tt-a1i/mco 0.1.2

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.
@@ -0,0 +1,94 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "ReviewFindingsEnvelope",
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "required": [
7
+ "findings"
8
+ ],
9
+ "properties": {
10
+ "findings": {
11
+ "type": "array",
12
+ "items": {
13
+ "type": "object",
14
+ "additionalProperties": true,
15
+ "required": [
16
+ "finding_id",
17
+ "severity",
18
+ "category",
19
+ "title",
20
+ "evidence",
21
+ "recommendation",
22
+ "confidence",
23
+ "fingerprint"
24
+ ],
25
+ "properties": {
26
+ "finding_id": {
27
+ "type": "string"
28
+ },
29
+ "severity": {
30
+ "type": "string",
31
+ "enum": [
32
+ "critical",
33
+ "high",
34
+ "medium",
35
+ "low"
36
+ ]
37
+ },
38
+ "category": {
39
+ "type": "string",
40
+ "enum": [
41
+ "bug",
42
+ "security",
43
+ "performance",
44
+ "maintainability",
45
+ "test-gap"
46
+ ]
47
+ },
48
+ "title": {
49
+ "type": "string"
50
+ },
51
+ "evidence": {
52
+ "type": "object",
53
+ "additionalProperties": true,
54
+ "required": [
55
+ "file",
56
+ "line",
57
+ "symbol",
58
+ "snippet"
59
+ ],
60
+ "properties": {
61
+ "file": {
62
+ "type": "string"
63
+ },
64
+ "line": {
65
+ "type": [
66
+ "integer",
67
+ "null"
68
+ ]
69
+ },
70
+ "symbol": {
71
+ "type": [
72
+ "string",
73
+ "null"
74
+ ]
75
+ },
76
+ "snippet": {
77
+ "type": "string"
78
+ }
79
+ }
80
+ },
81
+ "recommendation": {
82
+ "type": "string"
83
+ },
84
+ "confidence": {
85
+ "type": "number"
86
+ },
87
+ "fingerprint": {
88
+ "type": "string"
89
+ }
90
+ }
91
+ }
92
+ }
93
+ }
94
+ }
@@ -0,0 +1,71 @@
1
+ from __future__ import annotations
2
+
3
+ from dataclasses import dataclass, field
4
+ from enum import Enum
5
+ from typing import Any, Dict, List, Optional
6
+
7
+
8
+ class ErrorKind(str, Enum):
9
+ RETRYABLE_TIMEOUT = "retryable_timeout"
10
+ RETRYABLE_RATE_LIMIT = "retryable_rate_limit"
11
+ RETRYABLE_TRANSIENT_NETWORK = "retryable_transient_network"
12
+ NON_RETRYABLE_AUTH = "non_retryable_auth"
13
+ NON_RETRYABLE_INVALID_INPUT = "non_retryable_invalid_input"
14
+ NON_RETRYABLE_UNSUPPORTED_CAPABILITY = "non_retryable_unsupported_capability"
15
+ NORMALIZATION_ERROR = "normalization_error"
16
+
17
+
18
+ class WarningKind(str, Enum):
19
+ PROVIDER_WARNING_MCP_STARTUP = "provider_warning_mcp_startup"
20
+
21
+
22
+ RUN_RESULT_SCHEMA_VERSION = "stage-a-v1"
23
+ RUN_RESULT_FIELDS = (
24
+ "task_id",
25
+ "provider",
26
+ "dispatch_key",
27
+ "success",
28
+ "attempts",
29
+ "delays_seconds",
30
+ "output",
31
+ "final_error",
32
+ "warnings",
33
+ "deduped_dispatch",
34
+ )
35
+
36
+
37
+ class TaskState(str, Enum):
38
+ DRAFT = "DRAFT"
39
+ QUEUED = "QUEUED"
40
+ DISPATCHED = "DISPATCHED"
41
+ RUNNING = "RUNNING"
42
+ RETRYING = "RETRYING"
43
+ AGGREGATING = "AGGREGATING"
44
+ COMPLETED = "COMPLETED"
45
+ PARTIAL_SUCCESS = "PARTIAL_SUCCESS"
46
+ FAILED = "FAILED"
47
+ CANCELLED = "CANCELLED"
48
+ EXPIRED = "EXPIRED"
49
+
50
+
51
+ @dataclass
52
+ class AttemptResult:
53
+ success: bool
54
+ output: Optional[Dict[str, Any]] = None
55
+ error_kind: Optional[ErrorKind] = None
56
+ stderr: str = ""
57
+ warnings: List[WarningKind] = field(default_factory=list)
58
+
59
+
60
+ @dataclass
61
+ class RunResult:
62
+ task_id: str
63
+ provider: str
64
+ dispatch_key: str
65
+ success: bool
66
+ attempts: int
67
+ delays_seconds: List[float]
68
+ output: Optional[Dict[str, Any]]
69
+ final_error: Optional[ErrorKind]
70
+ warnings: List[WarningKind]
71
+ deduped_dispatch: bool = False