Skip to content

Commit 12dcd6c

Browse files
committed
fix(contracts): pin canonical v1.1.1 release
1 parent b8efa18 commit 12dcd6c

9 files changed

Lines changed: 328 additions & 10 deletions

.github/workflows/contract-registry-live.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ jobs:
1414
timeout-minutes: 10
1515
steps:
1616
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
17-
- name: Compare published v1.1.0 release with vendored contracts
17+
- name: Compare published v1.1.1 release with vendored contracts
1818
env:
1919
REGISTRY_BASE: https://coding-autopilot-system.github.io/cas-contracts/registry
20-
PINNED_VERSION: 1.1.0
21-
VENDORED_ROOT: src/GsdOrchestrator.Tests/Contracts/cas-contracts/v1.1.0
20+
PINNED_VERSION: 1.1.1
21+
VENDORED_ROOT: src/GsdOrchestrator.Tests/Contracts/cas-contracts/v1.1.1
2222
shell: python
2323
run: |
2424
import hashlib, json, os, pathlib, urllib.request
@@ -27,7 +27,7 @@ jobs:
2727
return data.replace(b"\r\n", b"\n").replace(b"\n", b"\r\n")
2828
2929
def sha256_hex(data: bytes) -> str:
30-
return hashlib.sha256(canonical_bytes(data)).hexdigest()
30+
return hashlib.sha256(data).hexdigest()
3131
3232
base = os.environ["REGISTRY_BASE"]
3333
version = os.environ["PINNED_VERSION"]

src/GsdOrchestrator.Tests/ContractCompatibilityTests.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,21 @@ namespace GsdOrchestrator.Tests;
1919
/// check self-contained and offline (no JSON-Schema validator NuGet dependency).
2020
///
2121
/// Cross-repo reference note: cas-contracts is a separate repo. In isolated CI only
22-
/// this repo is checked out, so the pinned v1.1.0 release is vendored under
23-
/// GsdOrchestrator.Tests/Contracts/cas-contracts/v1.1.0/ (same convention as the
22+
/// this repo is checked out, so the pinned v1.1.1 release is vendored under
23+
/// GsdOrchestrator.Tests/Contracts/cas-contracts/v1.1.1/ (same convention as the
2424
/// Python consumers). When the sibling ../cas-contracts checkout is present
2525
/// (local dev), an extra test asserts the vendored copy has not drifted upstream.
2626
/// </summary>
2727
public class ContractCompatibilityTests
2828
{
2929
// The cas-contracts version this consumer targets. Kept in lockstep with the
3030
// vendored release and with SdlcProfile.CasSdlcV1.ProfileVersion.
31+
private const string PinnedReleaseVersion = "1.1.1";
3132
private const string PinnedSchemaVersion = "1.1.0";
3233
private const string PinnedProfileVersion = "v1.1";
3334

3435
private static string ContractRoot { get; } = Path.Combine(
35-
AppContext.BaseDirectory, "Contracts", "cas-contracts", $"v{PinnedSchemaVersion}");
36+
AppContext.BaseDirectory, "Contracts", "cas-contracts", $"v{PinnedReleaseVersion}");
3637

3738
private static JsonNode LoadSchema(string name) =>
3839
JsonNode.Parse(File.ReadAllText(Path.Combine(ContractRoot, name)))!;
@@ -55,7 +56,7 @@ private static string Sha256Hex(byte[] bytes) =>
5556
while (dir is not null)
5657
{
5758
var candidate = Path.Combine(
58-
dir.FullName, "cas-contracts", "registry", "releases", $"v{PinnedSchemaVersion}");
59+
dir.FullName, "cas-contracts", "registry", "releases", $"v{PinnedReleaseVersion}");
5960
if (Directory.Exists(candidate))
6061
{
6162
return candidate;
@@ -126,13 +127,13 @@ private static JsonObject BuildProfileWirePayload()
126127
public void VendoredRelease_MatchesManifestHashes()
127128
{
128129
var manifest = LoadSchema("manifest.json");
129-
Assert.Equal(PinnedSchemaVersion, (string?)manifest["version"]);
130+
Assert.Equal(PinnedReleaseVersion, (string?)manifest["version"]);
130131

131132
foreach (var entry in manifest["schemas"]!.AsArray())
132133
{
133134
var path = (string)entry!["path"]!;
134135
var expected = (string)entry["sha256"]!;
135-
var bytes = ReadCanonicalUtf8Bytes(Path.Combine(ContractRoot, path));
136+
var bytes = File.ReadAllBytes(Path.Combine(ContractRoot, path));
136137
var actual = Sha256Hex(bytes);
137138
Assert.Equal(expected, actual);
138139
}
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.1",
3+
"schemas": [
4+
{
5+
"id": "https://schemas.coding-autopilot.dev/v1.1/common.schema.json",
6+
"path": "common.schema.json",
7+
"sha256": "e3173585d5e04eb2f4455de7d821903a45cf2d8edff3b33bbc81f43e97b2aa82"
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": "6ca1e9cc51877d412e059546722d0b82654c7f925fce1616f4961ebae1142cbb"
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": "d756f56a484972b379f520b0bd38bbcb07d948a884d4f373939867700eb03e5b"
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": "704b05f99d67323eddf4599536a545dbb50412654248aa58abad0af5dae25b3c"
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": "6f0bc68f7b74966bb1f654250463291b19398cc80d73a9bbae5aaba8ca1d226a"
28+
},
29+
{
30+
"id": "https://schemas.coding-autopilot.dev/v1.1/sdlc-profile.schema.json",
31+
"path": "sdlc-profile.schema.json",
32+
"sha256": "c9a643302f8762848ab1b5063ac07d344fb30f2904fc162fb55ae2f4552b6904"
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+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://schemas.coding-autopilot.dev/v1.1/phase-execution-result.schema.json",
4+
"title": "PhaseExecutionResult",
5+
"type": "object",
6+
"allOf": [
7+
{ "$ref": "common.schema.json#/$defs/lifecycleMetadata" },
8+
{
9+
"type": "object",
10+
"required": ["kind", "phase", "status", "promptDigest"],
11+
"properties": {
12+
"kind": { "const": "PhaseExecutionResult" },
13+
"phase": { "$ref": "common.schema.json#/$defs/phaseId" },
14+
"batch": { "$ref": "common.schema.json#/$defs/executionBatch" },
15+
"status": { "$ref": "common.schema.json#/$defs/phaseStatus" },
16+
"promptDigest": { "type": "string", "pattern": "^[\\da-f]{64}$" },
17+
"artifacts": { "type": "array", "items": { "$ref": "common.schema.json#/$defs/evidence" } },
18+
"output": { "type": "object" },
19+
"promptMetadata": { "type": "object" },
20+
"sanitizedPrompt": { "type": "string", "maxLength": 50000 },
21+
"verifier": { "type": "string", "minLength": 1, "maxLength": 256 },
22+
"checkpoint": { "type": "string", "minLength": 1, "maxLength": 256 }
23+
}
24+
}
25+
],
26+
"unevaluatedProperties": false
27+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://schemas.coding-autopilot.dev/v1.1/phase-verification-result.schema.json",
4+
"title": "PhaseVerificationResult",
5+
"type": "object",
6+
"allOf": [
7+
{ "$ref": "common.schema.json#/$defs/lifecycleMetadata" },
8+
{
9+
"type": "object",
10+
"required": ["kind", "phase", "verifier", "outcome"],
11+
"properties": {
12+
"kind": { "const": "PhaseVerificationResult" },
13+
"phase": { "$ref": "common.schema.json#/$defs/phaseId" },
14+
"verifier": { "type": "string", "minLength": 1, "maxLength": 256 },
15+
"outcome": { "enum": ["passed", "failed", "inconclusive"] },
16+
"invalidatedPhaseIds": {
17+
"type": "array",
18+
"items": { "$ref": "common.schema.json#/$defs/phaseId" },
19+
"uniqueItems": true
20+
},
21+
"evidence": { "type": "array", "items": { "$ref": "common.schema.json#/$defs/evidence" } },
22+
"reason": { "type": "string", "maxLength": 5000 }
23+
}
24+
}
25+
],
26+
"unevaluatedProperties": false
27+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://schemas.coding-autopilot.dev/v1.1/sdlc-lifecycle-event.schema.json",
4+
"title": "SdlcLifecycleEvent",
5+
"type": "object",
6+
"allOf": [
7+
{ "$ref": "common.schema.json#/$defs/lifecycleMetadata" },
8+
{
9+
"type": "object",
10+
"required": ["kind", "eventType", "phase"],
11+
"properties": {
12+
"kind": { "const": "SdlcLifecycleEvent" },
13+
"eventType": { "type": "string", "minLength": 1, "maxLength": 128 },
14+
"phase": { "$ref": "common.schema.json#/$defs/phaseId" },
15+
"batch": { "$ref": "common.schema.json#/$defs/executionBatch" },
16+
"status": { "$ref": "common.schema.json#/$defs/phaseStatus" },
17+
"message": { "type": "string", "maxLength": 5000 },
18+
"evidence": { "type": "array", "items": { "$ref": "common.schema.json#/$defs/evidence" } }
19+
}
20+
}
21+
],
22+
"unevaluatedProperties": false
23+
}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://schemas.coding-autopilot.dev/v1.1/sdlc-profile.schema.json",
4+
"title": "SdlcProfile",
5+
"type": "object",
6+
"allOf": [
7+
{ "$ref": "common.schema.json#/$defs/lifecycleMetadata" },
8+
{
9+
"type": "object",
10+
"required": ["kind", "profileId", "profileVersion", "phases", "goalBudget"],
11+
"properties": {
12+
"kind": { "const": "SdlcProfile" },
13+
"profileId": { "type": "string", "minLength": 1, "maxLength": 128 },
14+
"profileVersion": { "type": "string", "pattern": "^v1\\.1$" },
15+
"goalBudget": { "type": "integer", "minimum": 1 },
16+
"phases": {
17+
"type": "array",
18+
"minItems": 12,
19+
"maxItems": 12,
20+
"items": {
21+
"type": "object",
22+
"additionalProperties": false,
23+
"required": ["id", "name", "batch", "dependencies", "verifier"],
24+
"properties": {
25+
"id": { "$ref": "common.schema.json#/$defs/phaseId" },
26+
"name": { "type": "string", "minLength": 1, "maxLength": 128 },
27+
"batch": { "$ref": "common.schema.json#/$defs/executionBatch" },
28+
"dependencies": {
29+
"type": "array",
30+
"items": { "$ref": "common.schema.json#/$defs/phaseId" },
31+
"uniqueItems": true
32+
},
33+
"verifier": { "type": "string", "minLength": 1, "maxLength": 256 },
34+
"requiredArtifacts": {
35+
"type": "array",
36+
"items": { "type": "string", "minLength": 1, "maxLength": 256 }
37+
},
38+
"successCriteria": {
39+
"type": "array",
40+
"minItems": 1,
41+
"items": { "type": "string", "minLength": 1, "maxLength": 1000 }
42+
},
43+
"rollbackTo": { "$ref": "common.schema.json#/$defs/phaseId" },
44+
"maxAttempts": { "type": "integer", "minimum": 1 }
45+
}
46+
}
47+
},
48+
"goalAttempts": { "type": "integer", "minimum": 1 },
49+
"iterations": { "type": "integer", "minimum": 1 },
50+
"runtimeMinutes": { "type": "integer", "minimum": 1 },
51+
"modelCalls": { "type": "integer", "minimum": 1 },
52+
"noProgressLimit": { "type": "integer", "minimum": 1 },
53+
"repositoryOverrides": {
54+
"type": "object",
55+
"additionalProperties": false,
56+
"properties": {
57+
"promptFragments": { "type": "object" },
58+
"verifierCommands": { "type": "object" },
59+
"requiredArtifacts": { "type": "object" },
60+
"phaseLimits": { "type": "object" }
61+
}
62+
}
63+
}
64+
}
65+
],
66+
"unevaluatedProperties": false
67+
}

0 commit comments

Comments
 (0)