archctx 0.3.0 → 0.4.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "archctx",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Local architecture context CLI for agentic coding workflows.",
5
5
  "private": false,
6
6
  "type": "module",
@@ -23,7 +23,7 @@
23
23
  "node": ">=24 <26"
24
24
  },
25
25
  "dependencies": {
26
- "@colbymchenry/codegraph": "1.4.0",
26
+ "@colbymchenry/codegraph": "1.5.0",
27
27
  "@node-rs/jieba": "^2.0.1"
28
28
  }
29
29
  }
@@ -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" },
@@ -0,0 +1,61 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://archcontext.dev/schemas/runtime/projection-request.schema.json",
4
+ "title": "ProjectionRequestV1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "requestId", "profile", "mode", "targets", "changedPaths", "expected"],
8
+ "properties": {
9
+ "schemaVersion": { "const": "archcontext.projection-request/v1" },
10
+ "requestId": { "type": "string", "pattern": "^[a-zA-Z0-9_.:-]+$", "minLength": 1 },
11
+ "profile": { "const": "repo-harness/v1" },
12
+ "mode": { "enum": ["check", "plan", "apply", "adopt"] },
13
+ "targets": {
14
+ "type": "array",
15
+ "minItems": 1,
16
+ "uniqueItems": true,
17
+ "description": "Canonical wire order is lexicographic and is enforced by projectionRequestInvariantIssues.",
18
+ "items": { "enum": ["agent-context", "architecture-docs"] }
19
+ },
20
+ "changedPaths": {
21
+ "type": "array",
22
+ "uniqueItems": true,
23
+ "description": "Canonical wire order is lexicographic and is enforced by projectionRequestInvariantIssues.",
24
+ "items": { "$ref": "#/$defs/repoPath" }
25
+ },
26
+ "expected": { "$ref": "#/$defs/expectedSnapshot" },
27
+ "adoptionPlanId": { "type": "string", "pattern": "^adoption_plan\\.[a-zA-Z0-9_.-]+$" }
28
+ },
29
+ "allOf": [
30
+ {
31
+ "if": { "properties": { "mode": { "const": "adopt" } }, "required": ["mode"] },
32
+ "then": { "required": ["adoptionPlanId"] },
33
+ "else": { "not": { "required": ["adoptionPlanId"] } }
34
+ }
35
+ ],
36
+ "$defs": {
37
+ "digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
38
+ "repoPath": {
39
+ "type": "string",
40
+ "minLength": 1,
41
+ "not": {
42
+ "anyOf": [
43
+ { "pattern": "^/" },
44
+ { "pattern": "\\\\" },
45
+ { "pattern": "(^|/)\\.\\.(/|$)" }
46
+ ]
47
+ }
48
+ },
49
+ "expectedSnapshot": {
50
+ "type": "object",
51
+ "additionalProperties": false,
52
+ "required": ["repositoryId", "workspaceId", "headSha", "worktreeDigest"],
53
+ "properties": {
54
+ "repositoryId": { "type": "string", "minLength": 1 },
55
+ "workspaceId": { "type": "string", "minLength": 1 },
56
+ "headSha": { "type": "string", "pattern": "^[a-f0-9]{40}$" },
57
+ "worktreeDigest": { "$ref": "#/$defs/digest" }
58
+ }
59
+ }
60
+ }
61
+ }
@@ -0,0 +1,162 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://archcontext.dev/schemas/runtime/projection-result.schema.json",
4
+ "title": "ProjectionResultV1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "requestId", "status", "inputSnapshot", "outputSnapshot", "affectedNodeIds", "files", "humanActions", "refreshSignals", "receiptDigest"],
8
+ "properties": {
9
+ "schemaVersion": { "const": "archcontext.projection-result/v1" },
10
+ "requestId": { "type": "string", "pattern": "^[a-zA-Z0-9_.:-]+$", "minLength": 1 },
11
+ "status": { "enum": ["adoption-required", "applied", "blocked", "human-action-required", "noop", "permanent-failure", "planned", "retryable-failure"] },
12
+ "inputSnapshot": { "$ref": "#/$defs/snapshot" },
13
+ "outputSnapshot": { "$ref": "#/$defs/snapshot" },
14
+ "affectedNodeIds": { "type": "array", "uniqueItems": true, "description": "Canonical wire order is lexicographic and is enforced by projectionResultInvariantIssues.", "items": { "type": "string", "minLength": 1 } },
15
+ "files": { "type": "array", "description": "Canonical wire order is by path and is enforced by projectionResultInvariantIssues.", "items": { "$ref": "#/$defs/file" } },
16
+ "humanActions": { "type": "array", "items": { "$ref": "#/$defs/humanAction" } },
17
+ "refreshSignals": { "type": "array", "description": "Canonical wire order is by signalId and cross-object receipt/snapshot bindings are enforced by projectionResultInvariantIssues.", "items": { "$ref": "#/$defs/refreshSignal" } },
18
+ "receiptDigest": { "$ref": "#/$defs/digest" }
19
+ },
20
+ "allOf": [
21
+ {
22
+ "if": { "properties": { "status": { "enum": ["adoption-required", "human-action-required"] } }, "required": ["status"] },
23
+ "then": { "properties": { "humanActions": { "minItems": 1 } } },
24
+ "else": { "properties": { "humanActions": { "maxItems": 0 } } }
25
+ }
26
+ ],
27
+ "$defs": {
28
+ "digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
29
+ "nullableDigest": { "type": ["string", "null"], "pattern": "^sha256:[a-f0-9]{64}$" },
30
+ "snapshot": {
31
+ "type": "object",
32
+ "additionalProperties": false,
33
+ "required": ["repositoryId", "workspaceId", "headSha", "baseHeadSha", "worktreeDigest", "sourceTreeDigest", "modelDigest", "codeGraphDigest", "indexedWorktreeDigest", "projectionInputDigest", "rendererVersion", "layoutVersion", "generatedFrom"],
34
+ "properties": {
35
+ "repositoryId": { "type": "string", "minLength": 1 },
36
+ "workspaceId": { "type": "string", "minLength": 1 },
37
+ "headSha": { "type": "string", "pattern": "^[a-f0-9]{40}$" },
38
+ "baseHeadSha": { "type": "string", "pattern": "^[a-f0-9]{40}$" },
39
+ "worktreeDigest": { "$ref": "#/$defs/digest" },
40
+ "sourceTreeDigest": { "$ref": "#/$defs/digest" },
41
+ "modelDigest": { "$ref": "#/$defs/digest" },
42
+ "codeGraphDigest": { "$ref": "#/$defs/digest" },
43
+ "indexedWorktreeDigest": { "$ref": "#/$defs/nullableDigest" },
44
+ "projectionInputDigest": { "$ref": "#/$defs/digest" },
45
+ "rendererVersion": { "const": "archcontext.docs-renderer/v2" },
46
+ "layoutVersion": { "const": "archcontext.docs-layout/v1" },
47
+ "generatedFrom": {
48
+ "type": "object",
49
+ "additionalProperties": false,
50
+ "required": ["codeGraphPackage", "codeGraphVersion", "codeGraphBinaryDigest", "codeGraphStatus"],
51
+ "properties": {
52
+ "codeGraphPackage": { "const": "@colbymchenry/codegraph" },
53
+ "codeGraphVersion": { "const": "1.5.0" },
54
+ "codeGraphBinaryDigest": { "$ref": "#/$defs/digest" },
55
+ "codeGraphStatus": { "enum": ["ready", "unavailable"] }
56
+ }
57
+ }
58
+ }
59
+ },
60
+ "file": {
61
+ "type": "object",
62
+ "additionalProperties": false,
63
+ "required": ["path", "action", "preimageDigest", "outputDigest"],
64
+ "properties": {
65
+ "path": {
66
+ "type": "string",
67
+ "minLength": 1,
68
+ "not": { "anyOf": [{ "pattern": "^/" }, { "pattern": "\\\\" }, { "pattern": "(^|/)\\.\\.(/|$)" }] }
69
+ },
70
+ "action": { "enum": ["create", "delete", "unchanged", "update"] },
71
+ "preimageDigest": { "$ref": "#/$defs/nullableDigest" },
72
+ "outputDigest": { "$ref": "#/$defs/nullableDigest" }
73
+ },
74
+ "allOf": [
75
+ {
76
+ "if": { "properties": { "action": { "const": "create" } }, "required": ["action"] },
77
+ "then": { "properties": { "preimageDigest": { "const": null }, "outputDigest": { "$ref": "#/$defs/digest" } } }
78
+ },
79
+ {
80
+ "if": { "properties": { "action": { "const": "delete" } }, "required": ["action"] },
81
+ "then": { "properties": { "preimageDigest": { "$ref": "#/$defs/digest" }, "outputDigest": { "const": null } } }
82
+ },
83
+ {
84
+ "if": { "properties": { "action": { "enum": ["unchanged", "update"] } }, "required": ["action"] },
85
+ "then": { "properties": { "preimageDigest": { "$ref": "#/$defs/digest" }, "outputDigest": { "$ref": "#/$defs/digest" } } }
86
+ }
87
+ ]
88
+ },
89
+ "humanAction": {
90
+ "type": "object",
91
+ "additionalProperties": false,
92
+ "required": ["reasonCode", "affectedNodeIds", "requestPayloadDigest"],
93
+ "properties": {
94
+ "reasonCode": { "enum": ["adoption-required", "manual-region-conflict", "target-collision", "unprovable-required-flow", "unresolved-major-change"] },
95
+ "affectedNodeIds": { "type": "array", "uniqueItems": true, "items": { "type": "string", "minLength": 1 } },
96
+ "requestPayloadDigest": { "$ref": "#/$defs/digest" }
97
+ }
98
+ },
99
+ "digestSet": {
100
+ "type": "object",
101
+ "additionalProperties": false,
102
+ "required": ["modelDigest", "sourceTreeDigest", "flowProofDigest", "projectionDigest"],
103
+ "properties": {
104
+ "modelDigest": { "$ref": "#/$defs/digest" },
105
+ "sourceTreeDigest": { "$ref": "#/$defs/digest" },
106
+ "flowProofDigest": { "$ref": "#/$defs/digest" },
107
+ "projectionDigest": { "$ref": "#/$defs/digest" }
108
+ }
109
+ },
110
+ "reasonCode": {
111
+ "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"]
112
+ },
113
+ "refreshSignal": {
114
+ "type": "object",
115
+ "additionalProperties": false,
116
+ "required": ["schemaVersion", "signalId", "idempotencyKey", "mode", "repository", "worktree", "cause", "reasonCodes", "affectedNodeIds", "refreshTargets", "baseDigests", "resultingDigests", "projectionReceiptDigest"],
117
+ "properties": {
118
+ "schemaVersion": { "const": "archcontext.architecture-refresh-signal/v1" },
119
+ "signalId": { "$ref": "#/$defs/digest" },
120
+ "idempotencyKey": { "$ref": "#/$defs/digest" },
121
+ "mode": { "enum": ["human-action-required", "refresh-required"] },
122
+ "repository": { "type": "object", "additionalProperties": false, "required": ["repositoryId"], "properties": { "repositoryId": { "type": "string", "minLength": 1 } } },
123
+ "worktree": {
124
+ "type": "object",
125
+ "additionalProperties": false,
126
+ "required": ["workspaceId", "headSha", "worktreeDigest"],
127
+ "properties": {
128
+ "workspaceId": { "type": "string", "minLength": 1 },
129
+ "headSha": { "type": "string", "pattern": "^[a-f0-9]{40}$" },
130
+ "worktreeDigest": { "$ref": "#/$defs/digest" }
131
+ }
132
+ },
133
+ "cause": { "enum": ["accepted-semantic-delta", "unresolved-major-candidate", "verified-flow-proof-delta"] },
134
+ "acceptedChange": { "$ref": "#/$defs/acceptedChange" },
135
+ "reasonCodes": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/reasonCode" } },
136
+ "affectedNodeIds": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "string", "minLength": 1 } },
137
+ "refreshTargets": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "enum": ["architecture-contract-context", "architecture-readiness", "architecture-request-index", "capability-context", "capability-index"] } },
138
+ "baseDigests": { "$ref": "#/$defs/digestSet" },
139
+ "resultingDigests": { "$ref": "#/$defs/digestSet" },
140
+ "projectionReceiptDigest": { "$ref": "#/$defs/digest" }
141
+ },
142
+ "allOf": [
143
+ {
144
+ "if": { "properties": { "cause": { "const": "unresolved-major-candidate" } }, "required": ["cause"] },
145
+ "then": { "properties": { "mode": { "const": "human-action-required" } }, "not": { "required": ["acceptedChange"] } },
146
+ "else": { "properties": { "mode": { "const": "refresh-required" } }, "required": ["acceptedChange"] }
147
+ }
148
+ ]
149
+ },
150
+ "acceptedChange": {
151
+ "type": "object",
152
+ "additionalProperties": false,
153
+ "required": ["changeSetId", "eventId", "reasonCodes", "affectedNodeIds"],
154
+ "properties": {
155
+ "changeSetId": { "type": "string", "minLength": 1 },
156
+ "eventId": { "type": "string", "minLength": 1 },
157
+ "reasonCodes": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/reasonCode" } },
158
+ "affectedNodeIds": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "string", "minLength": 1 } }
159
+ }
160
+ }
161
+ }
162
+ }