Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Vendored cas-contracts schemas are hashed byte-for-byte — store exactly, no EOL conversion.
tests/contracts/** -text
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ jobs:
- name: Verify dependency consistency
run: python -m pip check

- name: Contract compatibility (pinned cas-contracts v1.1)
# Consumer-side gate: fails red if autogen's pinned CAS contract version
# or the vendored v1.1 schema release drifts. See
# tests/test_contract_compatibility.py for the validated contract surface.
run: python -m pytest tests/test_contract_compatibility.py -q --tb=short

- name: Run full test suite
run: python -m pytest -q --tb=short

Expand Down
3 changes: 0 additions & 3 deletions autogen_dashboard/session_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
from autogen_starter.config import Settings
from autogen_starter.providers import ProviderConfigError, collect_provider_statuses, create_model_client
from maf_starter.approval_policy import (
ApprovalScope,
classify_validation_commands,
classify_write_operations,
is_execution_approved,
Expand All @@ -54,8 +53,6 @@
AutoAnswerRecord,
RunOrchestrationState,
RunStagePauseKind,
SpecialistHandoff,
SpecialistState,
StageName,
StageSummary,
specialist_role_for_stage,
Expand Down
2 changes: 1 addition & 1 deletion maf_starter/provider_fallback.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ async def get_final_response(self):
AnthropicClient = None

from maf_starter.config import Settings, activate_run_scope, reset_run_scope
from maf_starter.execution_profile import CLOUD_SAFE_PROFILE, LOCAL_PROFILE, ExecutionProfile
from maf_starter.execution_profile import LOCAL_PROFILE, ExecutionProfile
from maf_starter.routing_policy import RoutingPlan, build_routing_plan
from maf_starter.routing_types import CapabilityChange, ChainStep, RouteAttempt

Expand Down
2 changes: 1 addition & 1 deletion maf_starter/routing_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from agent_framework import Message

from maf_starter.config import Settings
from maf_starter.routing_types import CapabilityChange, ChainStep, RouteAttempt, RouteLane, parse_chain_steps
from maf_starter.routing_types import CapabilityChange, ChainStep, RouteAttempt, RouteLane


SIMPLE_KEYWORDS = (
Expand Down
2 changes: 1 addition & 1 deletion maf_starter/team_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from agent_framework import WorkflowBuilder

from maf_starter.agent_factory import build_agent, build_agent_for_model
from maf_starter.agent_factory import build_agent_for_model
from maf_starter.config import Settings, load_settings
from maf_starter.orchestration import (
CANONICAL_STAGE_NAMES,
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ autogen-agentchat>=0.7.5,<0.8.0
autogen-core>=0.7.5,<0.8.0
autogen-ext[anthropic,ollama,openai]>=0.7.5,<0.8.0
fastapi>=0.115,<1.0
jsonschema>=4.23,<5.0
openapi-spec-validator>=0.7,<1.0
pydantic>=2.0,<3.0
pytest>=8.0,<10.0
Expand Down
103 changes: 103 additions & 0 deletions tests/contracts/cas-contracts/v1.1.0/common.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.coding-autopilot.dev/v1.1/common.schema.json",
"title": "CAS Common Definitions v1.1",
"$defs": {
"actor": {
"type": "object",
"additionalProperties": false,
"required": ["id", "type"],
"properties": {
"id": { "type": "string", "minLength": 1, "maxLength": 256 },
"type": {
"type": "string",
"enum": ["human", "agent", "service", "workflow"]
},
"displayName": { "type": "string", "minLength": 1, "maxLength": 256 }
}
},
"traceContext": {
"type": "object",
"additionalProperties": false,
"required": ["traceparent"],
"properties": {
"traceparent": {
"type": "string",
"pattern": "^[\\da-f]{2}-[\\da-f]{32}-[\\da-f]{16}-[\\da-f]{2}$"
},
"tracestate": { "type": "string", "maxLength": 512 }
}
},
"lifecycleMetadata": {
"type": "object",
"required": [
"correlationId",
"promptId",
"runId",
"repo",
"actor",
"timestamp",
"schemaVersion",
"traceContext"
],
"properties": {
"correlationId": { "type": "string", "minLength": 1, "maxLength": 128 },
"promptId": { "type": "string", "minLength": 1, "maxLength": 128 },
"runId": { "type": "string", "minLength": 1, "maxLength": 128 },
"repo": {
"type": "string",
"pattern": "^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$"
},
"actor": { "$ref": "#/$defs/actor" },
"timestamp": { "type": "string", "format": "date-time" },
"schemaVersion": { "const": "1.1.0" },
"traceContext": { "$ref": "#/$defs/traceContext" }
}
},
"evidence": {
"type": "object",
"additionalProperties": false,
"required": ["kind", "uri"],
"properties": {
"kind": { "type": "string", "minLength": 1, "maxLength": 64 },
"uri": { "type": "string", "format": "uri" },
"sha256": { "type": "string", "pattern": "^[\\da-f]{64}$" }
}
},
"phaseId": {
"type": "string",
"enum": [
"understand",
"research",
"analyze",
"plan",
"risk-assessment",
"implement",
"verify",
"review",
"improve",
"document",
"update-memory",
"finished"
]
},
"executionBatch": {
"type": "string",
"enum": ["discovery", "design", "change", "assurance", "closure"]
},
"phaseStatus": {
"type": "string",
"enum": [
"pending",
"ready",
"running",
"passed",
"failed",
"invalidated",
"rolled-back",
"waiting",
"terminal"
]
}
}
}
35 changes: 35 additions & 0 deletions tests/contracts/cas-contracts/v1.1.0/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"version": "1.1.0",
"schemas": [
{
"id": "https://schemas.coding-autopilot.dev/v1.1/common.schema.json",
"path": "common.schema.json",
"sha256": "078026d60c219658fe0fc5cf7c4f786acdcf0c492121f7d688d5078b33ca25af"
},
{
"id": "https://schemas.coding-autopilot.dev/v1.1/phase-execution-request.schema.json",
"path": "phase-execution-request.schema.json",
"sha256": "927ffda5ba809e58627ba25b3275355644b510b0ae1c76f446aa7b7f291f08fd"
},
{
"id": "https://schemas.coding-autopilot.dev/v1.1/phase-execution-result.schema.json",
"path": "phase-execution-result.schema.json",
"sha256": "1d353e20cf6338c2de4a9bec0bad83ca0dec6c9feb5434c5e6264fdc075e7c25"
},
{
"id": "https://schemas.coding-autopilot.dev/v1.1/phase-verification-result.schema.json",
"path": "phase-verification-result.schema.json",
"sha256": "ec5b97a2bf75892530442f666d23a8b6dbb8f13bda0efe49553d3f64cd41b995"
},
{
"id": "https://schemas.coding-autopilot.dev/v1.1/sdlc-lifecycle-event.schema.json",
"path": "sdlc-lifecycle-event.schema.json",
"sha256": "bd955637761679d3b6e8ee09fb7b693b1d0362615b0865204c5ae3bacb3809dc"
},
{
"id": "https://schemas.coding-autopilot.dev/v1.1/sdlc-profile.schema.json",
"path": "sdlc-profile.schema.json",
"sha256": "f4974e911e7cb88191c1a331470c8cd7a79d1c7311c963dd70cd9c8f524ebe45"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.coding-autopilot.dev/v1.1/phase-execution-request.schema.json",
"title": "PhaseExecutionRequest",
"type": "object",
"allOf": [
{ "$ref": "common.schema.json#/$defs/lifecycleMetadata" },
{
"type": "object",
"required": ["kind", "profileVersion", "phase", "batch", "goal", "constraints"],
"properties": {
"kind": { "const": "PhaseExecutionRequest" },
"profileVersion": { "type": "string", "const": "v1.1" },
"phase": { "$ref": "common.schema.json#/$defs/phaseId" },
"batch": { "$ref": "common.schema.json#/$defs/executionBatch" },
"goal": { "type": "string", "minLength": 1, "maxLength": 5000 },
"constraints": {
"type": "array",
"items": { "type": "string", "minLength": 1, "maxLength": 1000 }
},
"validatedInputs": { "type": "array", "items": { "type": "string" } },
"priorEvidence": { "type": "array", "items": { "$ref": "common.schema.json#/$defs/evidence" } },
"requiredOutputSchema": { "type": "string", "minLength": 1, "maxLength": 256 },
"requiredArtifacts": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 256 } },
"successCriteria": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 1000 } },
"verifier": { "type": "string", "minLength": 1, "maxLength": 256 },
"failureBehavior": { "type": "string", "minLength": 1, "maxLength": 5000 },
"rollbackBehavior": { "type": "string", "minLength": 1, "maxLength": 5000 },
"memoryCandidateFields": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 256 } },
"humanEscalationConditions": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 1000 } }
}
}
],
"unevaluatedProperties": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.coding-autopilot.dev/v1.1/phase-execution-result.schema.json",
"title": "PhaseExecutionResult",
"type": "object",
"allOf": [
{ "$ref": "common.schema.json#/$defs/lifecycleMetadata" },
{
"type": "object",
"required": ["kind", "phase", "status", "promptDigest"],
"properties": {
"kind": { "const": "PhaseExecutionResult" },
"phase": { "$ref": "common.schema.json#/$defs/phaseId" },
"batch": { "$ref": "common.schema.json#/$defs/executionBatch" },
"status": { "$ref": "common.schema.json#/$defs/phaseStatus" },
"promptDigest": { "type": "string", "pattern": "^[\\da-f]{64}$" },
"artifacts": { "type": "array", "items": { "$ref": "common.schema.json#/$defs/evidence" } },
"output": { "type": "object" },
"promptMetadata": { "type": "object" },
"sanitizedPrompt": { "type": "string", "maxLength": 50000 },
"verifier": { "type": "string", "minLength": 1, "maxLength": 256 },
"checkpoint": { "type": "string", "minLength": 1, "maxLength": 256 }
}
}
],
"unevaluatedProperties": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.coding-autopilot.dev/v1.1/phase-verification-result.schema.json",
"title": "PhaseVerificationResult",
"type": "object",
"allOf": [
{ "$ref": "common.schema.json#/$defs/lifecycleMetadata" },
{
"type": "object",
"required": ["kind", "phase", "verifier", "outcome"],
"properties": {
"kind": { "const": "PhaseVerificationResult" },
"phase": { "$ref": "common.schema.json#/$defs/phaseId" },
"verifier": { "type": "string", "minLength": 1, "maxLength": 256 },
"outcome": { "enum": ["passed", "failed", "inconclusive"] },
"invalidatedPhaseIds": {
"type": "array",
"items": { "$ref": "common.schema.json#/$defs/phaseId" },
"uniqueItems": true
},
"evidence": { "type": "array", "items": { "$ref": "common.schema.json#/$defs/evidence" } },
"reason": { "type": "string", "maxLength": 5000 }
}
}
],
"unevaluatedProperties": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.coding-autopilot.dev/v1.1/sdlc-lifecycle-event.schema.json",
"title": "SdlcLifecycleEvent",
"type": "object",
"allOf": [
{ "$ref": "common.schema.json#/$defs/lifecycleMetadata" },
{
"type": "object",
"required": ["kind", "eventType", "phase"],
"properties": {
"kind": { "const": "SdlcLifecycleEvent" },
"eventType": { "type": "string", "minLength": 1, "maxLength": 128 },
"phase": { "$ref": "common.schema.json#/$defs/phaseId" },
"batch": { "$ref": "common.schema.json#/$defs/executionBatch" },
"status": { "$ref": "common.schema.json#/$defs/phaseStatus" },
"message": { "type": "string", "maxLength": 5000 },
"evidence": { "type": "array", "items": { "$ref": "common.schema.json#/$defs/evidence" } }
}
}
],
"unevaluatedProperties": false
}
67 changes: 67 additions & 0 deletions tests/contracts/cas-contracts/v1.1.0/sdlc-profile.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://schemas.coding-autopilot.dev/v1.1/sdlc-profile.schema.json",
"title": "SdlcProfile",
"type": "object",
"allOf": [
{ "$ref": "common.schema.json#/$defs/lifecycleMetadata" },
{
"type": "object",
"required": ["kind", "profileId", "profileVersion", "phases", "goalBudget"],
"properties": {
"kind": { "const": "SdlcProfile" },
"profileId": { "type": "string", "minLength": 1, "maxLength": 128 },
"profileVersion": { "type": "string", "pattern": "^v1\\.1$" },
"goalBudget": { "type": "integer", "minimum": 1 },
"phases": {
"type": "array",
"minItems": 12,
"maxItems": 12,
"items": {
"type": "object",
"additionalProperties": false,
"required": ["id", "name", "batch", "dependencies", "verifier"],
"properties": {
"id": { "$ref": "common.schema.json#/$defs/phaseId" },
"name": { "type": "string", "minLength": 1, "maxLength": 128 },
"batch": { "$ref": "common.schema.json#/$defs/executionBatch" },
"dependencies": {
"type": "array",
"items": { "$ref": "common.schema.json#/$defs/phaseId" },
"uniqueItems": true
},
"verifier": { "type": "string", "minLength": 1, "maxLength": 256 },
"requiredArtifacts": {
"type": "array",
"items": { "type": "string", "minLength": 1, "maxLength": 256 }
},
"successCriteria": {
"type": "array",
"minItems": 1,
"items": { "type": "string", "minLength": 1, "maxLength": 1000 }
},
"rollbackTo": { "$ref": "common.schema.json#/$defs/phaseId" },
"maxAttempts": { "type": "integer", "minimum": 1 }
}
}
},
"goalAttempts": { "type": "integer", "minimum": 1 },
"iterations": { "type": "integer", "minimum": 1 },
"runtimeMinutes": { "type": "integer", "minimum": 1 },
"modelCalls": { "type": "integer", "minimum": 1 },
"noProgressLimit": { "type": "integer", "minimum": 1 },
"repositoryOverrides": {
"type": "object",
"additionalProperties": false,
"properties": {
"promptFragments": { "type": "object" },
"verifierCommands": { "type": "object" },
"requiredArtifacts": { "type": "object" },
"phaseLimits": { "type": "object" }
}
}
}
}
],
"unevaluatedProperties": false
}
Loading
Loading