Skip to content

Commit 5127cb9

Browse files
OgeonX-AiAitomatesclaude
authored
fix(audit): resolve linting and formatting errors (#5)
* fix(audit): resolve linting and formatting errors * test(contracts): add consumer-side contract-compatibility gate Pins cas-contracts v1.1.0 and validates the SDLC wire payload in CI. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(contracts): re-vendor authoritative v1.1.0 schemas; pin LF via gitattributes The vendored common.schema.json content diverged from the pinned cas-contracts release manifest; the compatibility test correctly caught it. Re-vendored byte-identical from registry/releases/v1.1.0 and marked contracts as -text. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Kim Harjamäki <kim.harjamaki@prosimo.fi> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 8fba78e commit 5127cb9

20 files changed

Lines changed: 535 additions & 14 deletions

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Vendored cas-contracts schemas are hashed byte-for-byte — store exactly, no EOL conversion.
2+
tests/contracts/** -text

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ jobs:
3838
- name: Verify dependency consistency
3939
run: python -m pip check
4040

41+
- name: Contract compatibility (pinned cas-contracts v1.1)
42+
# Consumer-side gate: fails red if autogen's pinned CAS contract version
43+
# or the vendored v1.1 schema release drifts. See
44+
# tests/test_contract_compatibility.py for the validated contract surface.
45+
run: python -m pytest tests/test_contract_compatibility.py -q --tb=short
46+
4147
- name: Run full test suite
4248
run: python -m pytest -q --tb=short
4349

autogen_dashboard/session_runner.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
from autogen_starter.config import Settings
4444
from autogen_starter.providers import ProviderConfigError, collect_provider_statuses, create_model_client
4545
from maf_starter.approval_policy import (
46-
ApprovalScope,
4746
classify_validation_commands,
4847
classify_write_operations,
4948
is_execution_approved,
@@ -54,8 +53,6 @@
5453
AutoAnswerRecord,
5554
RunOrchestrationState,
5655
RunStagePauseKind,
57-
SpecialistHandoff,
58-
SpecialistState,
5956
StageName,
6057
StageSummary,
6158
specialist_role_for_stage,

maf_starter/provider_fallback.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ async def get_final_response(self):
6565
AnthropicClient = None
6666

6767
from maf_starter.config import Settings, activate_run_scope, reset_run_scope
68-
from maf_starter.execution_profile import CLOUD_SAFE_PROFILE, LOCAL_PROFILE, ExecutionProfile
68+
from maf_starter.execution_profile import LOCAL_PROFILE, ExecutionProfile
6969
from maf_starter.routing_policy import RoutingPlan, build_routing_plan
7070
from maf_starter.routing_types import CapabilityChange, ChainStep, RouteAttempt
7171

maf_starter/routing_policy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from agent_framework import Message
77

88
from maf_starter.config import Settings
9-
from maf_starter.routing_types import CapabilityChange, ChainStep, RouteAttempt, RouteLane, parse_chain_steps
9+
from maf_starter.routing_types import CapabilityChange, ChainStep, RouteAttempt, RouteLane
1010

1111

1212
SIMPLE_KEYWORDS = (

maf_starter/team_factory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from agent_framework import WorkflowBuilder
66

7-
from maf_starter.agent_factory import build_agent, build_agent_for_model
7+
from maf_starter.agent_factory import build_agent_for_model
88
from maf_starter.config import Settings, load_settings
99
from maf_starter.orchestration import (
1010
CANONICAL_STAGE_NAMES,

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ autogen-agentchat>=0.7.5,<0.8.0
55
autogen-core>=0.7.5,<0.8.0
66
autogen-ext[anthropic,ollama,openai]>=0.7.5,<0.8.0
77
fastapi>=0.115,<1.0
8+
jsonschema>=4.23,<5.0
89
openapi-spec-validator>=0.7,<1.0
910
pydantic>=2.0,<3.0
1011
pytest>=8.0,<10.0
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://schemas.coding-autopilot.dev/v1.1/common.schema.json",
4+
"title": "CAS Common Definitions v1.1",
5+
"$defs": {
6+
"actor": {
7+
"type": "object",
8+
"additionalProperties": false,
9+
"required": ["id", "type"],
10+
"properties": {
11+
"id": { "type": "string", "minLength": 1, "maxLength": 256 },
12+
"type": {
13+
"type": "string",
14+
"enum": ["human", "agent", "service", "workflow"]
15+
},
16+
"displayName": { "type": "string", "minLength": 1, "maxLength": 256 }
17+
}
18+
},
19+
"traceContext": {
20+
"type": "object",
21+
"additionalProperties": false,
22+
"required": ["traceparent"],
23+
"properties": {
24+
"traceparent": {
25+
"type": "string",
26+
"pattern": "^[\\da-f]{2}-[\\da-f]{32}-[\\da-f]{16}-[\\da-f]{2}$"
27+
},
28+
"tracestate": { "type": "string", "maxLength": 512 }
29+
}
30+
},
31+
"lifecycleMetadata": {
32+
"type": "object",
33+
"required": [
34+
"correlationId",
35+
"promptId",
36+
"runId",
37+
"repo",
38+
"actor",
39+
"timestamp",
40+
"schemaVersion",
41+
"traceContext"
42+
],
43+
"properties": {
44+
"correlationId": { "type": "string", "minLength": 1, "maxLength": 128 },
45+
"promptId": { "type": "string", "minLength": 1, "maxLength": 128 },
46+
"runId": { "type": "string", "minLength": 1, "maxLength": 128 },
47+
"repo": {
48+
"type": "string",
49+
"pattern": "^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$"
50+
},
51+
"actor": { "$ref": "#/$defs/actor" },
52+
"timestamp": { "type": "string", "format": "date-time" },
53+
"schemaVersion": { "const": "1.1.0" },
54+
"traceContext": { "$ref": "#/$defs/traceContext" }
55+
}
56+
},
57+
"evidence": {
58+
"type": "object",
59+
"additionalProperties": false,
60+
"required": ["kind", "uri"],
61+
"properties": {
62+
"kind": { "type": "string", "minLength": 1, "maxLength": 64 },
63+
"uri": { "type": "string", "format": "uri" },
64+
"sha256": { "type": "string", "pattern": "^[\\da-f]{64}$" }
65+
}
66+
},
67+
"phaseId": {
68+
"type": "string",
69+
"enum": [
70+
"understand",
71+
"research",
72+
"analyze",
73+
"plan",
74+
"risk-assessment",
75+
"implement",
76+
"verify",
77+
"review",
78+
"improve",
79+
"document",
80+
"update-memory",
81+
"finished"
82+
]
83+
},
84+
"executionBatch": {
85+
"type": "string",
86+
"enum": ["discovery", "design", "change", "assurance", "closure"]
87+
},
88+
"phaseStatus": {
89+
"type": "string",
90+
"enum": [
91+
"pending",
92+
"ready",
93+
"running",
94+
"passed",
95+
"failed",
96+
"invalidated",
97+
"rolled-back",
98+
"waiting",
99+
"terminal"
100+
]
101+
}
102+
}
103+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"version": "1.1.0",
3+
"schemas": [
4+
{
5+
"id": "https://schemas.coding-autopilot.dev/v1.1/common.schema.json",
6+
"path": "common.schema.json",
7+
"sha256": "078026d60c219658fe0fc5cf7c4f786acdcf0c492121f7d688d5078b33ca25af"
8+
},
9+
{
10+
"id": "https://schemas.coding-autopilot.dev/v1.1/phase-execution-request.schema.json",
11+
"path": "phase-execution-request.schema.json",
12+
"sha256": "927ffda5ba809e58627ba25b3275355644b510b0ae1c76f446aa7b7f291f08fd"
13+
},
14+
{
15+
"id": "https://schemas.coding-autopilot.dev/v1.1/phase-execution-result.schema.json",
16+
"path": "phase-execution-result.schema.json",
17+
"sha256": "1d353e20cf6338c2de4a9bec0bad83ca0dec6c9feb5434c5e6264fdc075e7c25"
18+
},
19+
{
20+
"id": "https://schemas.coding-autopilot.dev/v1.1/phase-verification-result.schema.json",
21+
"path": "phase-verification-result.schema.json",
22+
"sha256": "ec5b97a2bf75892530442f666d23a8b6dbb8f13bda0efe49553d3f64cd41b995"
23+
},
24+
{
25+
"id": "https://schemas.coding-autopilot.dev/v1.1/sdlc-lifecycle-event.schema.json",
26+
"path": "sdlc-lifecycle-event.schema.json",
27+
"sha256": "bd955637761679d3b6e8ee09fb7b693b1d0362615b0865204c5ae3bacb3809dc"
28+
},
29+
{
30+
"id": "https://schemas.coding-autopilot.dev/v1.1/sdlc-profile.schema.json",
31+
"path": "sdlc-profile.schema.json",
32+
"sha256": "f4974e911e7cb88191c1a331470c8cd7a79d1c7311c963dd70cd9c8f524ebe45"
33+
}
34+
]
35+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://schemas.coding-autopilot.dev/v1.1/phase-execution-request.schema.json",
4+
"title": "PhaseExecutionRequest",
5+
"type": "object",
6+
"allOf": [
7+
{ "$ref": "common.schema.json#/$defs/lifecycleMetadata" },
8+
{
9+
"type": "object",
10+
"required": ["kind", "profileVersion", "phase", "batch", "goal", "constraints"],
11+
"properties": {
12+
"kind": { "const": "PhaseExecutionRequest" },
13+
"profileVersion": { "type": "string", "const": "v1.1" },
14+
"phase": { "$ref": "common.schema.json#/$defs/phaseId" },
15+
"batch": { "$ref": "common.schema.json#/$defs/executionBatch" },
16+
"goal": { "type": "string", "minLength": 1, "maxLength": 5000 },
17+
"constraints": {
18+
"type": "array",
19+
"items": { "type": "string", "minLength": 1, "maxLength": 1000 }
20+
},
21+
"validatedInputs": { "type": "array", "items": { "type": "string" } },
22+
"priorEvidence": { "type": "array", "items": { "$ref": "common.schema.json#/$defs/evidence" } },
23+
"requiredOutputSchema": { "type": "string", "minLength": 1, "maxLength": 256 },
24+
"requiredArtifacts": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 256 } },
25+
"successCriteria": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 1000 } },
26+
"verifier": { "type": "string", "minLength": 1, "maxLength": 256 },
27+
"failureBehavior": { "type": "string", "minLength": 1, "maxLength": 5000 },
28+
"rollbackBehavior": { "type": "string", "minLength": 1, "maxLength": 5000 },
29+
"memoryCandidateFields": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 256 } },
30+
"humanEscalationConditions": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 1000 } }
31+
}
32+
}
33+
],
34+
"unevaluatedProperties": false
35+
}

0 commit comments

Comments
 (0)