archctx-contracts 0.3.0 → 0.4.1

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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "schemaVersion": "archcontext.node/v1",
2
+ "schemaVersion": "archcontext.node/v2",
3
3
  "id": "interface.payment-api",
4
4
  "kind": "interface",
5
5
  "name": "Payment API",
@@ -1,5 +1,5 @@
1
1
  {
2
- "schemaVersion": "archcontext.node/v1",
2
+ "schemaVersion": "archcontext.node/v2",
3
3
  "id": "module.subscription",
4
4
  "kind": "module",
5
5
  "name": "Subscription",
@@ -0,0 +1,14 @@
1
+ {
2
+ "schemaVersion": "archcontext.capabilities/v1",
3
+ "package": { "name": "archctx", "version": "0.4.1" },
4
+ "protocols": {
5
+ "projectionRequest": "archcontext.projection-request/v1",
6
+ "projectionResult": "archcontext.projection-result/v1",
7
+ "architectureRefreshSignal": "archcontext.architecture-refresh-signal/v1"
8
+ },
9
+ "renderers": {
10
+ "architectureDocs": "archcontext.docs-renderer/v2",
11
+ "agentContext": "archcontext.agent-context-renderer/v1"
12
+ },
13
+ "features": ["architecture-docs-renderer-v2", "architecture-refresh-signal-v1", "projection-protocol-v1"]
14
+ }
@@ -0,0 +1,53 @@
1
+ {
2
+ "schemaVersion": "archcontext.flow/v1",
3
+ "id": "flow.subscriptions.create",
4
+ "capabilityId": "capability.subscriptions",
5
+ "name": "Create subscription",
6
+ "applicability": "required",
7
+ "participants": [
8
+ { "id": "client", "nodeId": "external.client" },
9
+ { "id": "api", "nodeId": "module.subscription" },
10
+ { "id": "store", "nodeId": "datastore.subscription" }
11
+ ],
12
+ "steps": [
13
+ {
14
+ "id": "request",
15
+ "from": "client",
16
+ "to": "api",
17
+ "label": "Create subscription",
18
+ "evidence": { "entrypointId": "entrypoint.subscription.create", "sourceSymbol": "createSubscription", "sinkId": "sink.subscription.persist" }
19
+ }
20
+ ],
21
+ "outcomes": [
22
+ {
23
+ "id": "accepted",
24
+ "kind": "success",
25
+ "label": "Subscription accepted",
26
+ "steps": [
27
+ {
28
+ "id": "persist",
29
+ "from": "api",
30
+ "to": "store",
31
+ "label": "Persist subscription",
32
+ "evidence": { "entrypointId": "entrypoint.subscription.create", "sourceSymbol": "createSubscription", "sinkId": "sink.subscription.persist" }
33
+ }
34
+ ],
35
+ "terminal": { "participant": "api", "label": "Return subscription ID" }
36
+ },
37
+ {
38
+ "id": "rejected",
39
+ "kind": "error",
40
+ "label": "Subscription rejected",
41
+ "steps": [
42
+ {
43
+ "id": "reject",
44
+ "from": "api",
45
+ "to": "client",
46
+ "label": "Return validation error",
47
+ "evidence": { "entrypointId": "entrypoint.subscription.create", "sourceSymbol": "createSubscription", "sinkId": "sink.subscription.persist" }
48
+ }
49
+ ],
50
+ "terminal": { "participant": "client", "label": "Handle validation error" }
51
+ }
52
+ ]
53
+ }
@@ -1,5 +1,5 @@
1
1
  {
2
- "schemaVersion": "archcontext.node/v1",
2
+ "schemaVersion": "archcontext.node/v2",
3
3
  "id": "module.subscription",
4
4
  "kind": "module",
5
5
  "name": "Subscription",
@@ -10,7 +10,24 @@
10
10
  "source": {
11
11
  "include": ["src/subscription/**"],
12
12
  "exclude": ["src/subscription/generated/**"],
13
- "entrypoints": ["src/subscription/index.ts"]
13
+ "entrypoints": [
14
+ {
15
+ "id": "entrypoint.subscription.create",
16
+ "path": "src/subscription/index.ts",
17
+ "symbols": [
18
+ {
19
+ "name": "createSubscription",
20
+ "sinks": [
21
+ {
22
+ "id": "sink.subscription.persist",
23
+ "path": "src/subscription/store.ts",
24
+ "symbol": "saveSubscription"
25
+ }
26
+ ]
27
+ }
28
+ ]
29
+ }
30
+ ]
14
31
  },
15
32
  "ownership": {
16
33
  "lifecycle": ["subscription"],
@@ -0,0 +1,35 @@
1
+ {
2
+ "schemaVersion": "archcontext.architecture-refresh-signal/v1",
3
+ "signalId": "sha256:1111111111111111111111111111111111111111111111111111111111111111",
4
+ "idempotencyKey": "sha256:2222222222222222222222222222222222222222222222222222222222222222",
5
+ "mode": "refresh-required",
6
+ "repository": { "repositoryId": "repo.example" },
7
+ "worktree": {
8
+ "workspaceId": "ws.example",
9
+ "headSha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
10
+ "worktreeDigest": "sha256:3333333333333333333333333333333333333333333333333333333333333333"
11
+ },
12
+ "cause": "accepted-semantic-delta",
13
+ "acceptedChange": {
14
+ "changeSetId": "changeset.architecture-api-v2",
15
+ "eventId": "architecture_event.changeset_apply.api-v2",
16
+ "reasonCodes": ["entrypoint-changed", "responsibility-changed"],
17
+ "affectedNodeIds": ["capability.api", "capability.runtime"]
18
+ },
19
+ "reasonCodes": ["entrypoint-changed", "responsibility-changed"],
20
+ "affectedNodeIds": ["capability.api", "capability.runtime"],
21
+ "refreshTargets": ["architecture-contract-context", "architecture-readiness", "capability-context", "capability-index"],
22
+ "baseDigests": {
23
+ "modelDigest": "sha256:4444444444444444444444444444444444444444444444444444444444444444",
24
+ "sourceTreeDigest": "sha256:5555555555555555555555555555555555555555555555555555555555555555",
25
+ "flowProofDigest": "sha256:6666666666666666666666666666666666666666666666666666666666666666",
26
+ "projectionDigest": "sha256:7777777777777777777777777777777777777777777777777777777777777777"
27
+ },
28
+ "resultingDigests": {
29
+ "modelDigest": "sha256:8888888888888888888888888888888888888888888888888888888888888888",
30
+ "sourceTreeDigest": "sha256:9999999999999999999999999999999999999999999999999999999999999999",
31
+ "flowProofDigest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
32
+ "projectionDigest": "sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
33
+ },
34
+ "projectionReceiptDigest": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc"
35
+ }
@@ -2,7 +2,7 @@
2
2
  "schemaVersion": "archcontext.product-version-manifest/v1",
3
3
  "product": {
4
4
  "name": "archctx",
5
- "version": "0.3.0",
5
+ "version": "0.4.1",
6
6
  "distribution": "one-package"
7
7
  },
8
8
  "packageManager": "bun@1.3.10",
@@ -12,25 +12,25 @@
12
12
  "surfaces": {
13
13
  "cli": {
14
14
  "packageName": "@archcontext/surfaces",
15
- "version": "0.3.0",
15
+ "version": "0.4.1",
16
16
  "entrypoint": "archctx"
17
17
  },
18
18
  "daemon": {
19
19
  "packageName": "@archcontext/local-runtime",
20
- "version": "0.3.0",
20
+ "version": "0.4.1",
21
21
  "entrypoint": "archctx daemon start",
22
22
  "rpcSchemaVersion": "archcontext.runtime-rpc/v1"
23
23
  },
24
24
  "mcp": {
25
25
  "packageName": "@archcontext/surfaces",
26
- "version": "0.3.0",
26
+ "version": "0.4.1",
27
27
  "entrypoint": "archctx mcp",
28
28
  "transport": "stdio"
29
29
  }
30
30
  },
31
31
  "schemas": {
32
32
  "schemaSetVersion": "2026-06-25.al0-ledger",
33
- "contractsPackageVersion": "0.3.0",
33
+ "contractsPackageVersion": "0.4.1",
34
34
  "reviewChallenge": "archcontext.review-challenge/v2",
35
35
  "attestation": "archcontext.attestation/v2",
36
36
  "deviceIdentity": "archcontext.device-identity/v1",
@@ -44,7 +44,7 @@
44
44
  "sqliteMigrations": "0001_runtime_state..0012_explorer_projection_index",
45
45
  "codeGraph": {
46
46
  "packageName": "@colbymchenry/codegraph",
47
- "requiredVersion": "1.4.0",
47
+ "requiredVersion": "1.5.0",
48
48
  "adapter": "codegraph-cli"
49
49
  }
50
50
  }
@@ -0,0 +1,14 @@
1
+ {
2
+ "schemaVersion": "archcontext.projection-request/v1",
3
+ "requestId": "projection_request.repo_main",
4
+ "profile": "repo-harness/v1",
5
+ "mode": "apply",
6
+ "targets": ["agent-context", "architecture-docs"],
7
+ "changedPaths": ["packages/core/src/index.ts", "src/cli/main.ts"],
8
+ "expected": {
9
+ "repositoryId": "repo.example",
10
+ "workspaceId": "ws.example",
11
+ "headSha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
12
+ "worktreeDigest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
13
+ }
14
+ }
@@ -0,0 +1,47 @@
1
+ {
2
+ "schemaVersion": "archcontext.projection-result/v1",
3
+ "requestId": "projection_request.repo_main",
4
+ "status": "applied",
5
+ "inputSnapshot": {
6
+ "repositoryId": "repo.example",
7
+ "workspaceId": "ws.example",
8
+ "headSha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
9
+ "baseHeadSha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
10
+ "worktreeDigest": "sha256:1111111111111111111111111111111111111111111111111111111111111111",
11
+ "sourceTreeDigest": "sha256:2222222222222222222222222222222222222222222222222222222222222222",
12
+ "modelDigest": "sha256:3333333333333333333333333333333333333333333333333333333333333333",
13
+ "codeGraphDigest": "sha256:4444444444444444444444444444444444444444444444444444444444444444",
14
+ "indexedWorktreeDigest": "sha256:4545454545454545454545454545454545454545454545454545454545454545",
15
+ "projectionInputDigest": "sha256:5555555555555555555555555555555555555555555555555555555555555555",
16
+ "rendererVersion": "archcontext.docs-renderer/v2",
17
+ "layoutVersion": "archcontext.docs-layout/v1",
18
+ "generatedFrom": { "codeGraphPackage": "@colbymchenry/codegraph", "codeGraphVersion": "1.5.0", "codeGraphBinaryDigest": "sha256:4646464646464646464646464646464646464646464646464646464646464646", "codeGraphStatus": "ready" }
19
+ },
20
+ "outputSnapshot": {
21
+ "repositoryId": "repo.example",
22
+ "workspaceId": "ws.example",
23
+ "headSha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
24
+ "baseHeadSha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
25
+ "worktreeDigest": "sha256:6666666666666666666666666666666666666666666666666666666666666666",
26
+ "sourceTreeDigest": "sha256:7777777777777777777777777777777777777777777777777777777777777777",
27
+ "modelDigest": "sha256:8888888888888888888888888888888888888888888888888888888888888888",
28
+ "codeGraphDigest": "sha256:9999999999999999999999999999999999999999999999999999999999999999",
29
+ "indexedWorktreeDigest": "sha256:9898989898989898989898989898989898989898989898989898989898989898",
30
+ "projectionInputDigest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
31
+ "rendererVersion": "archcontext.docs-renderer/v2",
32
+ "layoutVersion": "archcontext.docs-layout/v1",
33
+ "generatedFrom": { "codeGraphPackage": "@colbymchenry/codegraph", "codeGraphVersion": "1.5.0", "codeGraphBinaryDigest": "sha256:9797979797979797979797979797979797979797979797979797979797979797", "codeGraphStatus": "ready" }
34
+ },
35
+ "affectedNodeIds": ["capability.api"],
36
+ "files": [
37
+ {
38
+ "path": "docs/architecture/modules/api.md",
39
+ "action": "update",
40
+ "preimageDigest": "sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
41
+ "outputDigest": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc"
42
+ }
43
+ ],
44
+ "humanActions": [],
45
+ "refreshSignals": [],
46
+ "receiptDigest": "sha256:e41599eb1613796b64b03290c170076af2aa542de043b91672f327475e9d1cad"
47
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "archctx-contracts",
3
- "version": "0.3.0",
3
+ "version": "0.4.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -0,0 +1,97 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://archctx.repoharness.com/schemas/repo/architecture-flow.schema.json",
4
+ "title": "ArchitectureFlowV1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "id", "capabilityId", "name", "applicability"],
8
+ "properties": {
9
+ "schemaVersion": { "const": "archcontext.flow/v1" },
10
+ "id": { "type": "string", "pattern": "^flow\\.[a-z][a-z0-9]*(\\.[a-z0-9][a-z0-9-]*)*$" },
11
+ "capabilityId": { "type": "string", "pattern": "^capability\\.[a-z][a-z0-9]*(\\.[a-z0-9][a-z0-9-]*)*$" },
12
+ "name": { "type": "string", "minLength": 1 },
13
+ "applicability": { "type": "string", "enum": ["required", "not-applicable"] },
14
+ "rationale": { "type": "string", "minLength": 1 },
15
+ "participants": {
16
+ "type": "array",
17
+ "minItems": 1,
18
+ "items": {
19
+ "type": "object",
20
+ "additionalProperties": false,
21
+ "required": ["id", "nodeId"],
22
+ "properties": {
23
+ "id": { "type": "string", "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9][a-z0-9-]*)*$" },
24
+ "nodeId": { "type": "string", "minLength": 1 }
25
+ }
26
+ }
27
+ },
28
+ "steps": {
29
+ "type": "array",
30
+ "minItems": 1,
31
+ "items": { "$ref": "#/$defs/step" }
32
+ },
33
+ "outcomes": {
34
+ "type": "array",
35
+ "minItems": 2,
36
+ "items": {
37
+ "type": "object",
38
+ "additionalProperties": false,
39
+ "required": ["id", "kind", "label", "steps", "terminal"],
40
+ "properties": {
41
+ "id": { "type": "string", "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9][a-z0-9-]*)*$" },
42
+ "kind": { "type": "string", "enum": ["success", "error"] },
43
+ "label": { "type": "string", "minLength": 1 },
44
+ "steps": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/step" } },
45
+ "terminal": {
46
+ "type": "object",
47
+ "additionalProperties": false,
48
+ "required": ["participant", "label"],
49
+ "properties": {
50
+ "participant": { "type": "string", "minLength": 1 },
51
+ "label": { "type": "string", "minLength": 1 }
52
+ }
53
+ }
54
+ }
55
+ },
56
+ "allOf": [
57
+ { "contains": { "type": "object", "properties": { "kind": { "const": "success" } }, "required": ["kind"] }, "minContains": 1 },
58
+ { "contains": { "type": "object", "properties": { "kind": { "const": "error" } }, "required": ["kind"] }, "minContains": 1 }
59
+ ]
60
+ }
61
+ },
62
+ "$defs": {
63
+ "evidenceSelector": {
64
+ "type": "object",
65
+ "additionalProperties": false,
66
+ "required": ["entrypointId", "sourceSymbol", "sinkId"],
67
+ "properties": {
68
+ "entrypointId": { "type": "string", "minLength": 1 },
69
+ "sourceSymbol": { "type": "string", "minLength": 1 },
70
+ "sinkId": { "type": "string", "minLength": 1 }
71
+ }
72
+ },
73
+ "step": {
74
+ "type": "object",
75
+ "additionalProperties": false,
76
+ "required": ["id", "from", "to", "label", "evidence"],
77
+ "properties": {
78
+ "id": { "type": "string", "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9][a-z0-9-]*)*$" },
79
+ "from": { "type": "string", "minLength": 1 },
80
+ "to": { "type": "string", "minLength": 1 },
81
+ "label": { "type": "string", "minLength": 1 },
82
+ "evidence": { "$ref": "#/$defs/evidenceSelector" }
83
+ }
84
+ }
85
+ },
86
+ "oneOf": [
87
+ {
88
+ "properties": { "applicability": { "const": "required" } },
89
+ "required": ["participants", "steps", "outcomes"]
90
+ },
91
+ {
92
+ "properties": { "applicability": { "const": "not-applicable" } },
93
+ "required": ["rationale"],
94
+ "not": { "anyOf": [{ "required": ["participants"] }, { "required": ["steps"] }, { "required": ["outcomes"] }] }
95
+ }
96
+ ]
97
+ }
@@ -6,7 +6,7 @@
6
6
  "additionalProperties": false,
7
7
  "required": ["schemaVersion", "id", "kind", "name", "status", "summary"],
8
8
  "properties": {
9
- "schemaVersion": { "const": "archcontext.node/v1" },
9
+ "schemaVersion": { "const": "archcontext.node/v2" },
10
10
  "id": { "type": "string", "pattern": "^([a-z][a-z0-9]*(\\.[a-z0-9][a-z0-9-]*)*::)?[a-z][a-z0-9]*(\\.[a-z0-9][a-z0-9-]*)+$" },
11
11
  "kind": {
12
12
  "type": "string",
@@ -23,7 +23,44 @@
23
23
  "properties": {
24
24
  "include": { "type": "array", "items": { "type": "string" } },
25
25
  "exclude": { "type": "array", "items": { "type": "string" } },
26
- "entrypoints": { "type": "array", "items": { "type": "string" } }
26
+ "entrypoints": {
27
+ "type": "array",
28
+ "items": {
29
+ "type": "object",
30
+ "additionalProperties": false,
31
+ "required": ["id", "path", "symbols"],
32
+ "properties": {
33
+ "id": { "type": "string", "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9][a-z0-9-]*)+$" },
34
+ "path": { "type": "string", "minLength": 1 },
35
+ "symbols": {
36
+ "type": "array",
37
+ "minItems": 1,
38
+ "items": {
39
+ "type": "object",
40
+ "additionalProperties": false,
41
+ "required": ["name", "sinks"],
42
+ "properties": {
43
+ "name": { "type": "string", "minLength": 1 },
44
+ "sinks": {
45
+ "type": "array",
46
+ "minItems": 1,
47
+ "items": {
48
+ "type": "object",
49
+ "additionalProperties": false,
50
+ "required": ["id", "path", "symbol"],
51
+ "properties": {
52
+ "id": { "type": "string", "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9][a-z0-9-]*)+$" },
53
+ "path": { "type": "string", "minLength": 1 },
54
+ "symbol": { "type": "string", "minLength": 1 }
55
+ }
56
+ }
57
+ }
58
+ }
59
+ }
60
+ }
61
+ }
62
+ }
63
+ }
27
64
  }
28
65
  },
29
66
  "ownership": {
@@ -0,0 +1,45 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://archcontext.dev/schemas/runtime/archctx-capabilities.schema.json",
4
+ "title": "ArchctxCapabilitiesV1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "package", "protocols", "renderers", "features"],
8
+ "properties": {
9
+ "schemaVersion": { "const": "archcontext.capabilities/v1" },
10
+ "package": {
11
+ "type": "object",
12
+ "additionalProperties": false,
13
+ "required": ["name", "version"],
14
+ "properties": {
15
+ "name": { "const": "archctx" },
16
+ "version": { "type": "string", "pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(?:-[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?(?:\\+[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?$" }
17
+ }
18
+ },
19
+ "protocols": {
20
+ "type": "object",
21
+ "additionalProperties": false,
22
+ "required": ["projectionRequest", "projectionResult", "architectureRefreshSignal"],
23
+ "properties": {
24
+ "projectionRequest": { "const": "archcontext.projection-request/v1" },
25
+ "projectionResult": { "const": "archcontext.projection-result/v1" },
26
+ "architectureRefreshSignal": { "const": "archcontext.architecture-refresh-signal/v1" }
27
+ }
28
+ },
29
+ "renderers": {
30
+ "type": "object",
31
+ "additionalProperties": false,
32
+ "required": ["architectureDocs", "agentContext"],
33
+ "properties": {
34
+ "architectureDocs": { "const": "archcontext.docs-renderer/v2" },
35
+ "agentContext": { "const": "archcontext.agent-context-renderer/v1" }
36
+ }
37
+ },
38
+ "features": {
39
+ "type": "array",
40
+ "minItems": 3,
41
+ "uniqueItems": true,
42
+ "items": { "enum": ["architecture-docs-renderer-v2", "architecture-refresh-signal-v1", "projection-protocol-v1"] }
43
+ }
44
+ }
45
+ }
@@ -0,0 +1,88 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://archcontext.dev/schemas/runtime/architecture-refresh-signal.schema.json",
4
+ "title": "ArchitectureRefreshSignalV1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "signalId", "idempotencyKey", "mode", "repository", "worktree", "cause", "reasonCodes", "affectedNodeIds", "refreshTargets", "baseDigests", "resultingDigests", "projectionReceiptDigest"],
8
+ "properties": {
9
+ "schemaVersion": { "const": "archcontext.architecture-refresh-signal/v1" },
10
+ "signalId": { "$ref": "#/$defs/digest" },
11
+ "idempotencyKey": { "$ref": "#/$defs/digest" },
12
+ "mode": { "enum": ["human-action-required", "refresh-required"] },
13
+ "repository": {
14
+ "type": "object",
15
+ "additionalProperties": false,
16
+ "required": ["repositoryId"],
17
+ "properties": { "repositoryId": { "type": "string", "minLength": 1 } }
18
+ },
19
+ "worktree": {
20
+ "type": "object",
21
+ "additionalProperties": false,
22
+ "required": ["workspaceId", "headSha", "worktreeDigest"],
23
+ "properties": {
24
+ "workspaceId": { "type": "string", "minLength": 1 },
25
+ "headSha": { "type": "string", "pattern": "^[a-f0-9]{40}$" },
26
+ "worktreeDigest": { "$ref": "#/$defs/digest" }
27
+ }
28
+ },
29
+ "cause": { "enum": ["accepted-semantic-delta", "unresolved-major-candidate", "verified-flow-proof-delta"] },
30
+ "acceptedChange": { "$ref": "#/$defs/acceptedChange" },
31
+ "reasonCodes": {
32
+ "type": "array",
33
+ "minItems": 1,
34
+ "uniqueItems": true,
35
+ "items": { "$ref": "#/$defs/reasonCode" }
36
+ },
37
+ "affectedNodeIds": {
38
+ "type": "array",
39
+ "minItems": 1,
40
+ "uniqueItems": true,
41
+ "items": { "type": "string", "minLength": 1 }
42
+ },
43
+ "refreshTargets": {
44
+ "type": "array",
45
+ "minItems": 1,
46
+ "uniqueItems": true,
47
+ "items": { "enum": ["architecture-contract-context", "architecture-readiness", "architecture-request-index", "capability-context", "capability-index"] }
48
+ },
49
+ "baseDigests": { "$ref": "#/$defs/digestSet" },
50
+ "resultingDigests": { "$ref": "#/$defs/digestSet" },
51
+ "projectionReceiptDigest": { "$ref": "#/$defs/digest" }
52
+ },
53
+ "allOf": [
54
+ {
55
+ "if": { "properties": { "cause": { "const": "unresolved-major-candidate" } }, "required": ["cause"] },
56
+ "then": { "properties": { "mode": { "const": "human-action-required" } }, "not": { "required": ["acceptedChange"] } },
57
+ "else": { "properties": { "mode": { "const": "refresh-required" } }, "required": ["acceptedChange"] }
58
+ }
59
+ ],
60
+ "$defs": {
61
+ "digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
62
+ "reasonCode": {
63
+ "enum": ["constraint-changed", "entrypoint-changed", "interface-changed", "lifecycle-changed", "node-added", "node-moved", "node-removed", "node-renamed", "ownership-changed", "relation-changed", "responsibility-changed", "risk-boundary-changed", "verified-flow-proof-changed"]
64
+ },
65
+ "acceptedChange": {
66
+ "type": "object",
67
+ "additionalProperties": false,
68
+ "required": ["changeSetId", "eventId", "reasonCodes", "affectedNodeIds"],
69
+ "properties": {
70
+ "changeSetId": { "type": "string", "minLength": 1 },
71
+ "eventId": { "type": "string", "minLength": 1 },
72
+ "reasonCodes": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/reasonCode" } },
73
+ "affectedNodeIds": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "string", "minLength": 1 } }
74
+ }
75
+ },
76
+ "digestSet": {
77
+ "type": "object",
78
+ "additionalProperties": false,
79
+ "required": ["modelDigest", "sourceTreeDigest", "flowProofDigest", "projectionDigest"],
80
+ "properties": {
81
+ "modelDigest": { "$ref": "#/$defs/digest" },
82
+ "sourceTreeDigest": { "$ref": "#/$defs/digest" },
83
+ "flowProofDigest": { "$ref": "#/$defs/digest" },
84
+ "projectionDigest": { "$ref": "#/$defs/digest" }
85
+ }
86
+ }
87
+ }
88
+ }
@@ -36,7 +36,7 @@
36
36
  "additionalProperties": true,
37
37
  "required": ["op", "expectedHash"],
38
38
  "properties": {
39
- "op": { "type": "string", "enum": ["create_entity", "update_entity_fields", "delete_entity", "write_policy", "write_waiver", "render_projection"] },
39
+ "op": { "type": "string", "enum": ["create_entity", "update_entity_fields", "delete_entity", "write_policy", "write_waiver", "render_projection", "render_agent_context"] },
40
40
  "entityId": { "type": "string" },
41
41
  "path": { "type": "string" },
42
42
  "expectedHash": { "type": "string" },