archctx-contracts 0.11.3 → 0.12.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.
Files changed (38) hide show
  1. package/fixtures/valid/archctx-capabilities.json +1 -1
  2. package/fixtures/valid/dependency-constraint-evaluation.json +17 -0
  3. package/fixtures/valid/product-version-manifest.json +5 -9
  4. package/package.json +1 -1
  5. package/schemas/runtime/dependency-constraint-evaluation.schema.json +207 -0
  6. package/schemas/runtime/product-version-manifest.schema.json +2 -6
  7. package/src/architecture.ts +16 -0
  8. package/src/failure.ts +0 -8
  9. package/src/index.ts +1 -2
  10. package/src/ports.ts +0 -35
  11. package/src/product-version.ts +1 -9
  12. package/src/review-guards.ts +90 -0
  13. package/src/schema.ts +0 -2
  14. package/fixtures/boundary/attestation-v2-error.json +0 -43
  15. package/fixtures/boundary/check-delivery-dead-letter.json +0 -14
  16. package/fixtures/boundary/review-challenge-v2-organization.json +0 -15
  17. package/fixtures/boundary/runner-identity-organization-scope.json +0 -16
  18. package/fixtures/invalid/attestation-v2-finding-field.json +0 -39
  19. package/fixtures/invalid/check-delivery-legacy-check-name.json +0 -14
  20. package/fixtures/invalid/review-challenge-v2-private-field.json +0 -16
  21. package/fixtures/valid/attestation-v2.json +0 -38
  22. package/fixtures/valid/attestation.json +0 -25
  23. package/fixtures/valid/check-delivery.json +0 -14
  24. package/fixtures/valid/device-identity.json +0 -10
  25. package/fixtures/valid/governance-key-status.json +0 -11
  26. package/fixtures/valid/org-runner-identity.json +0 -10
  27. package/fixtures/valid/review-challenge-v2.json +0 -15
  28. package/fixtures/valid/runner-identity.json +0 -13
  29. package/schemas/cloud/attestation-v2.schema.json +0 -85
  30. package/schemas/cloud/attestation.schema.json +0 -49
  31. package/schemas/cloud/check-delivery.schema.json +0 -25
  32. package/schemas/cloud/device-identity.schema.json +0 -18
  33. package/schemas/cloud/governance-key-status.schema.json +0 -19
  34. package/schemas/cloud/org-runner-identity.schema.json +0 -21
  35. package/schemas/cloud/review-challenge-v2.schema.json +0 -23
  36. package/schemas/cloud/runner-identity.schema.json +0 -42
  37. package/src/control-plane-routes.ts +0 -35
  38. package/src/github-governance.ts +0 -850
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": "archcontext.capabilities/v1",
3
- "package": { "name": "archctx", "version": "0.11.3" },
3
+ "package": { "name": "archctx", "version": "0.12.0" },
4
4
  "protocols": {
5
5
  "projectionRequest": "archcontext.projection-request/v1",
6
6
  "projectionResult": "archcontext.projection-result/v2",
@@ -0,0 +1,17 @@
1
+ {
2
+ "schemaVersion": "archcontext.dependency-constraint-evaluation/v1",
3
+ "status": "pass",
4
+ "coverage": "complete",
5
+ "reasonCodes": [],
6
+ "constraintIds": [
7
+ "constraint.architecture-context.cloud-not-local-runtime",
8
+ "constraint.architecture-context.cloud-not-surfaces",
9
+ "constraint.architecture-context.contracts-depends-on-nothing",
10
+ "constraint.architecture-context.core-stays-pure",
11
+ "constraint.architecture-context.local-runtime-not-surfaces-or-cloud"
12
+ ],
13
+ "importEdgeCount": 2858,
14
+ "unresolvedImports": [],
15
+ "violations": [],
16
+ "warnings": []
17
+ }
@@ -2,7 +2,7 @@
2
2
  "schemaVersion": "archcontext.product-version-manifest/v1",
3
3
  "product": {
4
4
  "name": "archctx",
5
- "version": "0.11.3",
5
+ "version": "0.12.0",
6
6
  "distribution": "one-package"
7
7
  },
8
8
  "packageManager": "bun@1.4.3",
@@ -12,29 +12,25 @@
12
12
  "surfaces": {
13
13
  "cli": {
14
14
  "packageName": "@archcontext/surfaces",
15
- "version": "0.11.3",
15
+ "version": "0.12.0",
16
16
  "entrypoint": "archctx"
17
17
  },
18
18
  "daemon": {
19
19
  "packageName": "@archcontext/local-runtime",
20
- "version": "0.11.3",
20
+ "version": "0.12.0",
21
21
  "entrypoint": "archctx daemon start",
22
22
  "rpcSchemaVersion": "archcontext.runtime-rpc/v2"
23
23
  },
24
24
  "mcp": {
25
25
  "packageName": "@archcontext/surfaces",
26
- "version": "0.11.3",
26
+ "version": "0.12.0",
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.11.3",
34
- "reviewChallenge": "archcontext.review-challenge/v2",
35
- "attestation": "archcontext.attestation/v2",
36
- "deviceIdentity": "archcontext.device-identity/v1",
37
- "runnerIdentity": "archcontext.runner-identity/v1"
33
+ "contractsPackageVersion": "0.12.0"
38
34
  },
39
35
  "runtime": {
40
36
  "localRpc": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "archctx-contracts",
3
- "version": "0.11.3",
3
+ "version": "0.12.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -0,0 +1,207 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://archcontext.dev/schemas/runtime/dependency-constraint-evaluation.schema.json",
4
+ "title": "DependencyConstraintEvaluationV1",
5
+ "description": "The data of `archctx constraints check`: a read-only evaluation of the model's dependency constraints against observed import edges. `warnings` is added by the constraints-check command from the declaration reader, so it is not part of the evaluator's own type. Without code facts that attest to the measured tree, the evaluation still answers, but `coverage` is not `complete` and the import observations are dropped rather than reported as facts about some other tree.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "schemaVersion",
10
+ "status",
11
+ "coverage",
12
+ "reasonCodes",
13
+ "constraintIds",
14
+ "importEdgeCount",
15
+ "unresolvedImports",
16
+ "violations",
17
+ "warnings"
18
+ ],
19
+ "properties": {
20
+ "schemaVersion": {
21
+ "const": "archcontext.dependency-constraint-evaluation/v1"
22
+ },
23
+ "status": {
24
+ "enum": [
25
+ "not-applicable",
26
+ "pass",
27
+ "undetermined",
28
+ "violated"
29
+ ]
30
+ },
31
+ "coverage": {
32
+ "enum": [
33
+ "complete",
34
+ "partial",
35
+ "unknown"
36
+ ],
37
+ "description": "`complete` only when an index attested to the evaluated worktree and was not truncated."
38
+ },
39
+ "reasonCodes": {
40
+ "type": "array",
41
+ "uniqueItems": true,
42
+ "description": "Why a result is not a complete observation, sorted.",
43
+ "items": {
44
+ "enum": [
45
+ "code-facts-import-limit",
46
+ "code-facts-stale",
47
+ "code-facts-truncated",
48
+ "code-facts-unavailable",
49
+ "unresolved-import",
50
+ "layer-endpoint-unclassified",
51
+ "workspace-resolution-failed"
52
+ ]
53
+ }
54
+ },
55
+ "constraintIds": {
56
+ "type": "array",
57
+ "description": "The constraints this evaluation covered, in declaration order.",
58
+ "items": {
59
+ "type": "string",
60
+ "minLength": 1
61
+ }
62
+ },
63
+ "importEdgeCount": {
64
+ "type": "integer",
65
+ "minimum": 0,
66
+ "description": "Import observations the evaluation read; zero when the index did not attest to this tree."
67
+ },
68
+ "unresolvedImports": {
69
+ "type": "array",
70
+ "description": "Repository-local specifiers from constrained files that resolved to no file.",
71
+ "items": {
72
+ "type": "object",
73
+ "additionalProperties": false,
74
+ "required": [
75
+ "from",
76
+ "specifier"
77
+ ],
78
+ "properties": {
79
+ "from": {
80
+ "type": "string",
81
+ "minLength": 1
82
+ },
83
+ "specifier": {
84
+ "type": "string",
85
+ "minLength": 1
86
+ }
87
+ }
88
+ }
89
+ },
90
+ "violations": {
91
+ "type": "array",
92
+ "description": "One record per (constraint, from path, to path), sorted by those keys.",
93
+ "items": {
94
+ "type": "object",
95
+ "additionalProperties": false,
96
+ "required": [
97
+ "constraintId",
98
+ "fromPath",
99
+ "toPath",
100
+ "fromNode",
101
+ "toNode",
102
+ "severity"
103
+ ],
104
+ "properties": {
105
+ "constraintId": {
106
+ "type": "string",
107
+ "minLength": 1
108
+ },
109
+ "fromPath": {
110
+ "type": "string",
111
+ "minLength": 1
112
+ },
113
+ "toPath": {
114
+ "type": "string",
115
+ "minLength": 1
116
+ },
117
+ "fromNode": {
118
+ "type": "string",
119
+ "minLength": 1
120
+ },
121
+ "toNode": {
122
+ "type": "string",
123
+ "minLength": 1
124
+ },
125
+ "fromLayer": {
126
+ "type": "string",
127
+ "minLength": 1
128
+ },
129
+ "toLayer": {
130
+ "type": "string",
131
+ "minLength": 1
132
+ },
133
+ "severity": {
134
+ "enum": [
135
+ "error",
136
+ "warning"
137
+ ]
138
+ }
139
+ }
140
+ }
141
+ },
142
+ "layerEdges": {
143
+ "type": "array",
144
+ "description": "Resolved imports between two layers of one `layer-direction` constraint. An import counts only when every owner of each endpoint carries one shared layer listed in the rule. Present only with a `layer-direction` constraint, `status` `pass` or `violated`, and `coverage` `complete`; otherwise absent. When present it may be an empty list, and it is sorted by `(constraintId, fromLayer, toLayer)`.",
145
+ "items": {
146
+ "type": "object",
147
+ "additionalProperties": false,
148
+ "required": [
149
+ "constraintId",
150
+ "fromLayer",
151
+ "toLayer",
152
+ "imports"
153
+ ],
154
+ "properties": {
155
+ "constraintId": {
156
+ "type": "string",
157
+ "minLength": 1
158
+ },
159
+ "fromLayer": {
160
+ "type": "string",
161
+ "minLength": 1
162
+ },
163
+ "toLayer": {
164
+ "type": "string",
165
+ "minLength": 1
166
+ },
167
+ "imports": {
168
+ "type": "integer",
169
+ "minimum": 1,
170
+ "description": "Import edges, so two specifiers from one file to the same target count twice."
171
+ }
172
+ }
173
+ }
174
+ },
175
+ "warnings": {
176
+ "type": "array",
177
+ "description": "Declaration-reader warnings, such as an unsupported rule. Every unevaluated constraint type produces one, because a validated constraint is not proof that its rule was evaluated.",
178
+ "items": {
179
+ "type": "string",
180
+ "minLength": 1
181
+ }
182
+ }
183
+ },
184
+ "allOf": [
185
+ {
186
+ "description": "The layer edges are an observation, so they exist only for a settled verdict over complete coverage.",
187
+ "if": {
188
+ "required": [
189
+ "layerEdges"
190
+ ]
191
+ },
192
+ "then": {
193
+ "properties": {
194
+ "status": {
195
+ "enum": [
196
+ "pass",
197
+ "violated"
198
+ ]
199
+ },
200
+ "coverage": {
201
+ "const": "complete"
202
+ }
203
+ }
204
+ }
205
+ }
206
+ ]
207
+ }
@@ -58,14 +58,10 @@
58
58
  "schemas": {
59
59
  "type": "object",
60
60
  "additionalProperties": false,
61
- "required": ["schemaSetVersion", "contractsPackageVersion", "reviewChallenge", "attestation", "deviceIdentity", "runnerIdentity"],
61
+ "required": ["schemaSetVersion", "contractsPackageVersion"],
62
62
  "properties": {
63
63
  "schemaSetVersion": { "type": "string", "minLength": 1 },
64
- "contractsPackageVersion": { "$ref": "#/$defs/semver" },
65
- "reviewChallenge": { "const": "archcontext.review-challenge/v2" },
66
- "attestation": { "const": "archcontext.attestation/v2" },
67
- "deviceIdentity": { "const": "archcontext.device-identity/v1" },
68
- "runnerIdentity": { "const": "archcontext.runner-identity/v1" }
64
+ "contractsPackageVersion": { "$ref": "#/$defs/semver" }
69
65
  }
70
66
  },
71
67
  "runtime": {
@@ -118,6 +118,17 @@ export interface DependencyConstraintViolationV1 {
118
118
  severity: "error" | "warning";
119
119
  }
120
120
 
121
+ /**
122
+ * Resolved imports between two layers of one `layer-direction` constraint. An import counts only
123
+ * when every owner of each endpoint carries one shared layer listed in `rule.layers`.
124
+ */
125
+ export interface DependencyLayerEdgeV1 {
126
+ constraintId: string;
127
+ fromLayer: string;
128
+ toLayer: string;
129
+ imports: number;
130
+ }
131
+
121
132
  export interface DependencyConstraintEvaluationV1 {
122
133
  schemaVersion: "archcontext.dependency-constraint-evaluation/v1";
123
134
  status: DependencyConstraintStatus;
@@ -130,6 +141,11 @@ export interface DependencyConstraintEvaluationV1 {
130
141
  /** Repository-local specifiers from constrained files that resolved to no file. */
131
142
  unresolvedImports: { from: string; specifier: string }[];
132
143
  violations: DependencyConstraintViolationV1[];
144
+ /**
145
+ * Present only with a `layer-direction` constraint, status `pass` or `violated`, and `complete`
146
+ * coverage; one row per `(constraintId, fromLayer, toLayer)`, sorted by those keys.
147
+ */
148
+ layerEdges?: DependencyLayerEdgeV1[];
133
149
  }
134
150
 
135
151
  /**
package/src/failure.ts CHANGED
@@ -73,14 +73,8 @@ const policies: Record<string, Policy> = {
73
73
  };
74
74
  // C1 policies are selected at explicit producer branches, never from diagnostic text.
75
75
  Object.assign(policies, {
76
- "developer-review-run-not-owned": {code:"AC_PRECONDITION_FAILED",message:"developer-review-run-not-owned",facts:{refusal:"reviewOwnershipRefusal"}},
77
- "developer-review-attestation-input-invalid": {code:"AC_SCHEMA_INVALID",message:"Caller-provided attestation fields are forbidden.",facts:{issueCount:"uint"}},
78
76
  "init-would-overwrite-existing-model": {"code": "AC_PRECONDITION_FAILED", "message": "init-would-overwrite-existing-model: an existing architecture model must not be overwritten.", "facts": {}},
79
77
  "waiver-list-unreadable": {"code": "AC_SCHEMA_INVALID", "message": "Practice waiver list or owner registry could not be read.", "facts": {}},
80
- "developer-review-run-already-active": {"code": "AC_PRECONDITION_FAILED", "message": "developer-review-run-already-active", "facts": {"challengeId": "id"}},
81
- "developer-review-run-prepare-failed": {"code": "AC_PRECONDITION_FAILED", "message": "developer-review-run-prepare-failed", "facts": {}},
82
- "developer-review-worktree-invalid": {"code": "AC_PRECONDITION_FAILED", "message": "developer-review-worktree-invalid", "facts": {"refusal":"reviewWorktreeRefusal"}},
83
- "device-private-key-signer-unavailable": {"code": "AC_PRECONDITION_FAILED", "message": "device-private-key-signer-unavailable", "facts": {}},
84
78
 
85
79
  "ledger-worktree-claim-required": {code:"AC_PRECONDITION_FAILED", message:"Ledger write requires expectedWorktreeDigest.", facts:{}},
86
80
  "ledger-worktree-claim-changed": {code:"AC_PRECONDITION_FAILED", message:"Worktree digest changed before ledger write.", facts:{expectedWorktreeDigest:"sha256",actualWorktreeDigest:"sha256"}},
@@ -380,8 +374,6 @@ function dataRecord(value: unknown): Record<string, PropertyDescriptor> {
380
374
  return fields;
381
375
  }
382
376
  const localEnums: Readonly<Record<string, readonly string[]>> = {
383
- reviewWorktreeRefusal: ["UNKNOWN","HEAD_UNAVAILABLE","HEAD_SHA_MISMATCH","TREE_OID_MISMATCH","WORKTREE_NOT_DETACHED","WORKTREE_NOT_CLEAN"],
384
- reviewOwnershipRefusal: ["persisted-manifest-missing","persisted-manifest-identity-mismatch","run-id","manifest-path","lock-path","persisted-manifest-mismatch","persisted-lock-mismatch","run-root-name","worktree-temp-root","codegraph-temporary-state-root","run-root-not-a-directory","run-root-owner-marker-missing","run-root-owner-marker-mismatch","worktree-temporary-root","worktree-root","worktree-source-root"],
385
377
  projectionInputField: ["headSha","worktreeDigest","sourceFiles"],
386
378
  upgradeAction: ["upgrade-archctx-runtime"],
387
379
  upgradeCommand: ["archctx daemon upgrade"],
package/src/index.ts CHANGED
@@ -1,10 +1,9 @@
1
- export * from "./control-plane-routes";
2
1
  export * from "./architecture";
3
2
  export * from "./architecture-history";
4
3
  export * from "./architecture-debt";
5
4
  export * from "./docs-anchors";
6
5
  export * from "./external-docs";
7
- export * from "./github-governance";
6
+ export * from "./review-guards";
8
7
  export * from "./ledger";
9
8
  export * from "./native-context";
10
9
  export * from "./ref-impact";
package/src/ports.ts CHANGED
@@ -247,7 +247,6 @@ export interface RendererPort {
247
247
 
248
248
  export interface CloudMetadataPort {
249
249
  verifyEntitlement(input: { repositoryVisibility: "public" | "private"; accountId?: string }): Promise<{ allowed: boolean; reason?: string }>;
250
- submitAttestation(input: unknown): Promise<{ accepted: boolean; checkRunId?: string; reason?: string }>;
251
250
  }
252
251
 
253
252
  export type NotificationResult = "pass" | "pass_with_warnings" | "fail_action_required";
@@ -800,40 +799,6 @@ export interface ChatGptGaToolContract {
800
799
  disclosure: string;
801
800
  }
802
801
 
803
- export type DetachedReviewWorktreeReason =
804
- | "HEAD_UNAVAILABLE"
805
- | "HEAD_SHA_MISMATCH"
806
- | "TREE_OID_MISMATCH"
807
- | "WORKTREE_NOT_DETACHED"
808
- | "WORKTREE_NOT_CLEAN";
809
-
810
- export interface DetachedReviewWorktreeVerification {
811
- schemaVersion: "archcontext.detached-review-worktree-verification/v1";
812
- accepted: boolean;
813
- reasonCode?: DetachedReviewWorktreeReason;
814
- expected: {
815
- headSha: string;
816
- headTreeOid?: string;
817
- };
818
- observed: {
819
- headSha?: string;
820
- headTreeOid?: string;
821
- detached?: boolean;
822
- clean?: boolean;
823
- };
824
- }
825
-
826
-
827
- export interface ReviewCheckoutGitPort {
828
- findRepositoryRoot(start: string): string;
829
- readOriginUrl(root: string): string | null;
830
- verifyDetachedWorktree(input: {
831
- worktreeRoot: string;
832
- expectedHeadSha: string;
833
- expectedHeadTreeOid?: string;
834
- }): DetachedReviewWorktreeVerification;
835
- }
836
-
837
802
  export interface NonLocalEgressChannel {
838
803
  channel: "context7" | "agent-audit" | "github-issue-publishing" | "npm-update-check" | "projection-publishing" | "codegraph-telemetry";
839
804
  destination: string;
@@ -1,5 +1,5 @@
1
1
  export const ARCHCONTEXT_PRODUCT_NAME = "archctx";
2
- export const ARCHCONTEXT_PRODUCT_VERSION = "0.11.3";
2
+ export const ARCHCONTEXT_PRODUCT_VERSION = "0.12.0";
3
3
  export const ARCHCONTEXT_PACKAGE_MANAGER = "bun@1.4.3";
4
4
  export const ARCHCONTEXT_NODE_RANGE = ">=22.22 <26";
5
5
  export const LOCAL_RUNTIME_RPC_SCHEMA_VERSION = "archcontext.runtime-rpc/v2";
@@ -28,10 +28,6 @@ export interface ProductVersionManifest {
28
28
  schemas: {
29
29
  schemaSetVersion: typeof ARCHCONTEXT_SCHEMA_SET_VERSION;
30
30
  contractsPackageVersion: typeof ARCHCONTEXT_PRODUCT_VERSION;
31
- reviewChallenge: "archcontext.review-challenge/v2";
32
- attestation: "archcontext.attestation/v2";
33
- deviceIdentity: "archcontext.device-identity/v1";
34
- runnerIdentity: "archcontext.runner-identity/v1";
35
31
  };
36
32
  runtime: {
37
33
  localRpc: {
@@ -87,10 +83,6 @@ export function productVersionManifest(): ProductVersionManifest {
87
83
  schemas: {
88
84
  schemaSetVersion: ARCHCONTEXT_SCHEMA_SET_VERSION,
89
85
  contractsPackageVersion: ARCHCONTEXT_PRODUCT_VERSION,
90
- reviewChallenge: "archcontext.review-challenge/v2",
91
- attestation: "archcontext.attestation/v2",
92
- deviceIdentity: "archcontext.device-identity/v1",
93
- runnerIdentity: "archcontext.runner-identity/v1"
94
86
  },
95
87
  runtime: {
96
88
  localRpc: {
@@ -0,0 +1,90 @@
1
+ /**
2
+ * Guards that keep a caller from forging a review conclusion, and the envelope shape the remaining
3
+ * Cloud surfaces still record.
4
+ *
5
+ * These live here, not with the rest of the retired governance surface, because they survive ADR-0053:
6
+ * the runtime daemon's `completeTask` and the mcp-local `complete-task` tool use the attestation-field
7
+ * guards for local review, and `schemas/cloud/cloud-egress-envelope.schema.json` plus the ADR-0035
8
+ * privacy rule keep `CloudEgressEnvelope`. Keeping them in `github-governance.ts` would have made that
9
+ * file undeletable without breaking local review.
10
+ */
11
+
12
+ export const CALLER_PROVIDED_ATTESTATION_FIELDS = [
13
+ "result",
14
+ "reviewDigest",
15
+ "policyDigest",
16
+ "modelDigest",
17
+ "signature",
18
+ "practiceEnforcement",
19
+ "practiceViolations",
20
+ "waiversApplied",
21
+ "actionsRequired",
22
+ "practiceCatalogDigest",
23
+ "practicePolicyDigest",
24
+ "practiceCheckResultDigest"
25
+ ] as const;
26
+ export type CallerProvidedAttestationField = (typeof CALLER_PROVIDED_ATTESTATION_FIELDS)[number];
27
+
28
+ export const LLM_ADVISORY_FORBIDDEN_FIELDS = [
29
+ ...CALLER_PROVIDED_ATTESTATION_FIELDS,
30
+ "conclusion",
31
+ "checkConclusion",
32
+ "attestationResult"
33
+ ] as const;
34
+ export type LlmAdvisoryForbiddenField = (typeof LLM_ADVISORY_FORBIDDEN_FIELDS)[number];
35
+
36
+ function collectForbiddenFields<T extends string>(value: unknown, found: Set<T>, forbiddenFields: readonly T[]): void {
37
+ if (!value || typeof value !== "object") return;
38
+ if (Array.isArray(value)) {
39
+ for (const item of value) collectForbiddenFields(item, found, forbiddenFields);
40
+ return;
41
+ }
42
+ for (const [key, child] of Object.entries(value as Record<string, unknown>)) {
43
+ if ((forbiddenFields as readonly string[]).includes(key)) {
44
+ found.add(key as T);
45
+ }
46
+ collectForbiddenFields(child, found, forbiddenFields);
47
+ }
48
+ }
49
+
50
+ function collectCallerProvidedAttestationFields(value: unknown, found: Set<CallerProvidedAttestationField>): void {
51
+ collectForbiddenFields(value, found, CALLER_PROVIDED_ATTESTATION_FIELDS);
52
+ }
53
+
54
+ export function findCallerProvidedAttestationFields(value: unknown): CallerProvidedAttestationField[] {
55
+ const found = new Set<CallerProvidedAttestationField>();
56
+ collectCallerProvidedAttestationFields(value, found);
57
+ return CALLER_PROVIDED_ATTESTATION_FIELDS.filter((field) => found.has(field));
58
+ }
59
+
60
+ export function assertNoCallerProvidedAttestationFields(value: unknown, boundary = "review request"): void {
61
+ const fields = findCallerProvidedAttestationFields(value);
62
+ if (fields.length > 0) throw new Error(`${boundary}-caller-provided-attestation-field-forbidden: ${fields.join(",")}`);
63
+ }
64
+
65
+ export function findLlmAdvisoryForbiddenFields(value: unknown): LlmAdvisoryForbiddenField[] {
66
+ const found = new Set<LlmAdvisoryForbiddenField>();
67
+ collectForbiddenFields(value, found, LLM_ADVISORY_FORBIDDEN_FIELDS);
68
+ return LLM_ADVISORY_FORBIDDEN_FIELDS.filter((field) => found.has(field));
69
+ }
70
+
71
+ export function assertNoLlmAdvisoryConclusionFields(value: unknown): void {
72
+ const fields = findLlmAdvisoryForbiddenFields(value);
73
+ if (fields.length > 0) throw new Error(`llm-advisory-conclusion-field-forbidden: ${fields.join(",")}`);
74
+ }
75
+
76
+ /**
77
+ * What a remaining Cloud surface records when it calls the GitHub API. ADR-0035's privacy rule and
78
+ * `schemas/cloud/cloud-egress-envelope.schema.json` both depend on this shape.
79
+ */
80
+ export interface CloudEgressEnvelope {
81
+ schemaVersion: "archcontext.cloud-egress/v1";
82
+ requestId: string;
83
+ category: "github.metadata" | "github.pull-head" | "github.check-list-for-ref" | "github.check-create" | "github.check-update";
84
+ method: "GET" | "POST" | "PATCH";
85
+ host: "api.github.com";
86
+ pathTemplate: string;
87
+ statusCode: number;
88
+ latencyMs: number;
89
+ recordedAt: string;
90
+ }
package/src/schema.ts CHANGED
@@ -32,7 +32,6 @@ export type ArchContextErrorCode =
32
32
  | "AC_COMPAT_CONTRACT_REQUIRED"
33
33
  | "AC_USER_CONFIRMATION_REQUIRED"
34
34
  | "AC_ENTITLEMENT_REQUIRED"
35
- | "AC_ATTESTATION_REJECTED"
36
35
  | "AC_TUNNEL_SCOPE_DENIED"
37
36
  | "AC_MODEL_ADOPTION_REQUIRED"
38
37
  | "AC_REFACTOR_STALE"
@@ -83,7 +82,6 @@ export const ERROR_CATALOG: Record<ArchContextErrorCode, Omit<ArchContextError,
83
82
  AC_COMPAT_CONTRACT_REQUIRED: { code: "AC_COMPAT_CONTRACT_REQUIRED", severity: "error", retryable: false, action: "delete-or-contract" },
84
83
  AC_USER_CONFIRMATION_REQUIRED: { code: "AC_USER_CONFIRMATION_REQUIRED", severity: "warning", retryable: true, action: "show-human-decision" },
85
84
  AC_ENTITLEMENT_REQUIRED: { code: "AC_ENTITLEMENT_REQUIRED", severity: "error", retryable: false, action: "login-or-subscribe" },
86
- AC_ATTESTATION_REJECTED: { code: "AC_ATTESTATION_REJECTED", severity: "error", retryable: false, action: "review-again" },
87
85
  AC_TUNNEL_SCOPE_DENIED: { code: "AC_TUNNEL_SCOPE_DENIED", severity: "error", retryable: false, action: "reduce-scope" },
88
86
  AC_MODEL_ADOPTION_REQUIRED: { code: "AC_MODEL_ADOPTION_REQUIRED", severity: "error", retryable: false, action: "adopt-architecture-model" },
89
87
  AC_REFACTOR_STALE: { code: "AC_REFACTOR_STALE", severity: "warning", retryable: true, action: "rerun-refactor-scan" },
@@ -1,43 +0,0 @@
1
- {
2
- "schemaVersion": "archcontext.attestation/v2",
3
- "attestationId": "att_20260620_error",
4
- "challengeId": "chal_20260620_0001",
5
- "installationId": 10001,
6
- "repositoryId": 20002,
7
- "pullRequestNumber": 42,
8
- "headSha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
9
- "baseSha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
10
- "mergeBaseSha": "cccccccccccccccccccccccccccccccccccccccc",
11
- "headTreeOid": "tree_aaaaaaaa",
12
- "worktreeDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000",
13
- "modelDigest": "sha256:1111111111111111111111111111111111111111111111111111111111111111",
14
- "policyDigest": "sha256:2222222222222222222222222222222222222222222222222222222222222222",
15
- "codeFactsDigest": "sha256:3333333333333333333333333333333333333333333333333333333333333333",
16
- "reviewDigest": "sha256:4444444444444444444444444444444444444444444444444444444444444444",
17
- "result": "error",
18
- "errorCode": "CODEGRAPH_FAILED",
19
- "execution": {
20
- "trustLevel": "organization",
21
- "source": "organization-runner-checkout",
22
- "principalId": "runner_0001",
23
- "publicKeyId": "key_runner_0001",
24
- "runnerId": "runner_0001",
25
- "workflowRef": "owner/repo/.github/workflows/archcontext-review.yml@refs/heads/main",
26
- "runId": "1234567890",
27
- "runAttempt": 1
28
- },
29
- "runtime": {
30
- "version": "0.2.1",
31
- "buildDigest": "sha256:5555555555555555555555555555555555555555555555555555555555555555",
32
- "codeGraphVersion": "1.0.1",
33
- "capabilitiesDigest": "sha256:6666666666666666666666666666666666666666666666666666666666666666"
34
- },
35
- "nonce": "nonce_base64url_0001",
36
- "startedAt": "2026-06-20T09:03:00Z",
37
- "completedAt": "2026-06-20T09:04:00Z",
38
- "expiresAt": "2026-06-20T09:15:00Z",
39
- "signature": {
40
- "algorithm": "ed25519",
41
- "value": "base64url_signature"
42
- }
43
- }
@@ -1,14 +0,0 @@
1
- {
2
- "schemaVersion": "archcontext.check-delivery/v1",
3
- "deliveryId": "delivery_dead_letter",
4
- "challengeId": "chal_20260620_0001",
5
- "checkRunId": null,
6
- "checkName": "ArchContext / Organization Runner",
7
- "headSha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
8
- "status": "DEAD_LETTER",
9
- "attemptCount": 5,
10
- "nextAttemptAt": null,
11
- "lastErrorCode": "CHALLENGE_SUPERSEDED",
12
- "createdAt": "2026-06-20T09:00:00Z",
13
- "updatedAt": "2026-06-20T09:30:00Z"
14
- }
@@ -1,15 +0,0 @@
1
- {
2
- "schemaVersion": "archcontext.review-challenge/v2",
3
- "challengeId": "chal_20260620_org",
4
- "installationId": 10001,
5
- "repositoryId": 20002,
6
- "pullRequestNumber": 42,
7
- "headSha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
8
- "baseSha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
9
- "nonce": "nonce_base64url_org",
10
- "requiredTrust": "organization",
11
- "policyProfileId": "policy.organization",
12
- "createdAt": "2026-06-20T09:00:00Z",
13
- "expiresAt": "2026-06-20T09:15:00Z",
14
- "status": "LEASED"
15
- }
@@ -1,16 +0,0 @@
1
- {
2
- "schemaVersion": "archcontext.runner-identity/v1",
3
- "runnerId": "runner_org_0001",
4
- "installationId": 10001,
5
- "repositoryIds": [],
6
- "scope": {
7
- "kind": "organization"
8
- },
9
- "workflowRef": "owner/repo/.github/workflows/archcontext-review.yml@refs/heads/main",
10
- "publicKeyId": "key_runner_org_0001",
11
- "publicKeyFingerprint": "sha256:8888888888888888888888888888888888888888888888888888888888888888",
12
- "status": "active",
13
- "createdAt": "2026-06-20T09:00:00Z",
14
- "rotatedAt": null,
15
- "revokedAt": null
16
- }