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.
@@ -0,0 +1,101 @@
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
+ "acceptedChange": { "$ref": "#/$defs/acceptedChange" }
29
+ },
30
+ "allOf": [
31
+ {
32
+ "if": { "properties": { "mode": { "const": "adopt" } }, "required": ["mode"] },
33
+ "then": { "required": ["adoptionPlanId"] },
34
+ "else": { "not": { "required": ["adoptionPlanId"] } }
35
+ }
36
+ ],
37
+ "$defs": {
38
+ "digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
39
+ "repoPath": {
40
+ "type": "string",
41
+ "minLength": 1,
42
+ "not": {
43
+ "anyOf": [
44
+ { "pattern": "^/" },
45
+ { "pattern": "\\\\" },
46
+ { "pattern": "(^|/)\\.\\.(/|$)" }
47
+ ]
48
+ }
49
+ },
50
+ "acceptedChange": {
51
+ "type": "object",
52
+ "additionalProperties": false,
53
+ "required": ["changeSetId", "eventId", "reasonCodes", "affectedNodeIds"],
54
+ "properties": {
55
+ "changeSetId": { "type": "string", "minLength": 1 },
56
+ "eventId": { "type": "string", "minLength": 1 },
57
+ "reasonCodes": {
58
+ "type": "array",
59
+ "minItems": 1,
60
+ "uniqueItems": true,
61
+ "description": "Canonical wire order is lexicographic and is enforced by projectionRequestInvariantIssues.",
62
+ "items": {
63
+ "enum": [
64
+ "constraint-changed",
65
+ "entrypoint-changed",
66
+ "interface-changed",
67
+ "lifecycle-changed",
68
+ "node-added",
69
+ "node-moved",
70
+ "node-removed",
71
+ "node-renamed",
72
+ "ownership-changed",
73
+ "relation-changed",
74
+ "responsibility-changed",
75
+ "risk-boundary-changed",
76
+ "verified-flow-proof-changed"
77
+ ]
78
+ }
79
+ },
80
+ "affectedNodeIds": {
81
+ "type": "array",
82
+ "minItems": 1,
83
+ "uniqueItems": true,
84
+ "description": "Canonical wire order is lexicographic and is enforced by projectionRequestInvariantIssues.",
85
+ "items": { "type": "string", "minLength": 1 }
86
+ }
87
+ }
88
+ },
89
+ "expectedSnapshot": {
90
+ "type": "object",
91
+ "additionalProperties": false,
92
+ "required": ["repositoryId", "workspaceId", "headSha", "worktreeDigest"],
93
+ "properties": {
94
+ "repositoryId": { "type": "string", "minLength": 1 },
95
+ "workspaceId": { "type": "string", "minLength": 1 },
96
+ "headSha": { "type": "string", "pattern": "^[a-f0-9]{40}$" },
97
+ "worktreeDigest": { "$ref": "#/$defs/digest" }
98
+ }
99
+ }
100
+ }
101
+ }
@@ -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
+ }
@@ -0,0 +1,73 @@
1
+ export interface ArchitectureSinkSelectorV2 {
2
+ id: string;
3
+ path: string;
4
+ symbol: string;
5
+ }
6
+
7
+ export interface ArchitectureEntrypointSymbolV2 {
8
+ name: string;
9
+ sinks: ArchitectureSinkSelectorV2[];
10
+ }
11
+
12
+ export interface ArchitectureEntrypointV2 {
13
+ id: string;
14
+ path: string;
15
+ symbols: ArchitectureEntrypointSymbolV2[];
16
+ }
17
+
18
+ export interface ArchitectureNodeSourceV2 {
19
+ include?: string[];
20
+ exclude?: string[];
21
+ entrypoints?: ArchitectureEntrypointV2[];
22
+ }
23
+
24
+ export interface ArchitectureFlowEvidenceSelectorV1 {
25
+ entrypointId: string;
26
+ sourceSymbol: string;
27
+ sinkId: string;
28
+ }
29
+
30
+ export interface ArchitectureFlowParticipantV1 {
31
+ id: string;
32
+ nodeId: string;
33
+ }
34
+
35
+ export interface ArchitectureFlowStepV1 {
36
+ id: string;
37
+ from: string;
38
+ to: string;
39
+ label: string;
40
+ evidence: ArchitectureFlowEvidenceSelectorV1;
41
+ }
42
+
43
+ export interface ArchitectureFlowOutcomeV1 {
44
+ id: string;
45
+ kind: "success" | "error";
46
+ label: string;
47
+ steps: ArchitectureFlowStepV1[];
48
+ terminal: {
49
+ participant: string;
50
+ label: string;
51
+ };
52
+ }
53
+
54
+ export type ArchitectureFlowV1 = ArchitectureRequiredFlowV1 | ArchitectureNotApplicableFlowV1;
55
+
56
+ interface ArchitectureFlowBaseV1 {
57
+ schemaVersion: "archcontext.flow/v1";
58
+ id: string;
59
+ capabilityId: string;
60
+ name: string;
61
+ }
62
+
63
+ export interface ArchitectureRequiredFlowV1 extends ArchitectureFlowBaseV1 {
64
+ applicability: "required";
65
+ participants: ArchitectureFlowParticipantV1[];
66
+ steps: ArchitectureFlowStepV1[];
67
+ outcomes: ArchitectureFlowOutcomeV1[];
68
+ }
69
+
70
+ export interface ArchitectureNotApplicableFlowV1 extends ArchitectureFlowBaseV1 {
71
+ applicability: "not-applicable";
72
+ rationale: string;
73
+ }
package/src/index.ts CHANGED
@@ -1,9 +1,11 @@
1
1
  export * from "./control-plane-routes";
2
+ export * from "./architecture";
2
3
  export * from "./external-docs";
3
4
  export * from "./github-governance";
4
5
  export * from "./ledger";
5
6
  export * from "./ports";
6
7
  export * from "./practices";
8
+ export * from "./projection";
7
9
  export * from "./product-version";
8
10
  export * from "./schema";
9
11
  export * from "./validator";
@@ -1,5 +1,5 @@
1
1
  export const ARCHCONTEXT_PRODUCT_NAME = "archctx";
2
- export const ARCHCONTEXT_PRODUCT_VERSION = "0.3.0";
2
+ export const ARCHCONTEXT_PRODUCT_VERSION = "0.4.1";
3
3
  export const ARCHCONTEXT_PACKAGE_MANAGER = "bun@1.3.10";
4
4
  export const ARCHCONTEXT_NODE_RANGE = ">=24 <26";
5
5
  export const LOCAL_RUNTIME_RPC_SCHEMA_VERSION = "archcontext.runtime-rpc/v1";
@@ -41,7 +41,7 @@ export interface ProductVersionManifest {
41
41
  sqliteMigrations: string;
42
42
  codeGraph: {
43
43
  packageName: "@colbymchenry/codegraph";
44
- requiredVersion: "1.4.0";
44
+ requiredVersion: "1.5.0";
45
45
  adapter: "codegraph-cli";
46
46
  };
47
47
  };
@@ -100,7 +100,7 @@ export function productVersionManifest(): ProductVersionManifest {
100
100
  sqliteMigrations: "0001_runtime_state..0012_explorer_projection_index",
101
101
  codeGraph: {
102
102
  packageName: "@colbymchenry/codegraph",
103
- requiredVersion: "1.4.0",
103
+ requiredVersion: "1.5.0",
104
104
  adapter: "codegraph-cli"
105
105
  }
106
106
  }