archctx-contracts 0.17.0 → 0.18.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/fixtures/invalid/projection-result-applied-incomplete-coverage.json +3 -3
- package/fixtures/valid/archctx-capabilities.json +2 -2
- package/fixtures/valid/flow-selector-check.json +1 -1
- package/fixtures/valid/product-version-manifest.json +5 -11
- package/fixtures/valid/projection-manifest.json +1 -1
- package/fixtures/valid/projection-result.json +3 -3
- package/package.json +4 -1
- package/schemas/repo/refactor-decision.schema.json +283 -37
- package/schemas/runtime/archctx-capabilities.schema.json +144 -20
- package/schemas/runtime/architecture-debt-delta.schema.json +58 -19
- package/schemas/runtime/architecture-debt.schema.json +42 -42
- package/schemas/runtime/architecture-event.schema.json +1 -1
- package/schemas/runtime/architecture-history.schema.json +354 -0
- package/schemas/runtime/capability-dependencies.schema.json +266 -59
- package/schemas/runtime/cli-check.schema.json +197 -0
- package/schemas/runtime/cli-help.schema.json +28 -0
- package/schemas/runtime/dependency-constraint-evaluation.schema.json +67 -68
- package/schemas/runtime/docs-anchors.schema.json +250 -67
- package/schemas/runtime/doctor-code-facts.schema.json +49 -0
- package/schemas/runtime/evidence-binding.schema.json +1 -1
- package/schemas/runtime/flow-selector-check.schema.json +179 -46
- package/schemas/runtime/hook-debt-checkpoint.schema.json +12 -12
- package/schemas/runtime/index-seed.schema.json +56 -0
- package/schemas/runtime/path-context.schema.json +108 -0
- package/schemas/runtime/product-version-manifest.schema.json +142 -54
- package/schemas/runtime/projection-apply-readback.schema.json +2 -2
- package/schemas/runtime/projection-apply-recovery.schema.json +1 -1
- package/schemas/runtime/projection-result.schema.json +1 -1
- package/schemas/runtime/projection-slice.schema.json +34 -34
- package/schemas/runtime/recommendation-v3.schema.json +372 -1
- package/schemas/runtime/ref-impact-batch-request.schema.json +20 -7
- package/schemas/runtime/ref-impact-batch.schema.json +83 -13
- package/schemas/runtime/ref-impact.schema.json +68 -61
- package/schemas/runtime/refactor-scan-v2.schema.json +434 -0
- package/schemas/runtime/refactor-simulate.schema.json +505 -0
- package/schemas/runtime/refactor-verify-v2.schema.json +172 -0
- package/schemas/runtime/resolve-path.schema.json +69 -0
- package/schemas/runtime/runtime-recommendation-show.schema.json +531 -2
- package/schemas/runtime/runtime-refactor-scan.schema.json +498 -2
- package/schemas/runtime/runtime-verify.schema.json +274 -56
- package/schemas/runtime/state-machine-check.schema.json +357 -89
- package/schemas/runtime/structural-observation-payload.schema.json +372 -1
- package/schemas/runtime/sync-check.schema.json +65 -0
- package/src/architecture-debt.ts +125 -38
- package/src/architecture-history.ts +168 -42
- package/src/architecture.ts +100 -0
- package/src/cli-read.ts +228 -0
- package/src/docs-anchors.ts +105 -50
- package/src/explorer-occurrence-ports.ts +175 -0
- package/src/explorer-query-ports.ts +270 -0
- package/src/failure.ts +3 -0
- package/src/index-seed.ts +42 -0
- package/src/index.ts +5 -0
- package/src/ledger-records.ts +262 -0
- package/src/ledger.ts +27 -566
- package/src/ownership-dependencies.ts +115 -5
- package/src/ports.ts +12 -543
- package/src/product-version.ts +75 -56
- package/src/projection-apply-types.ts +216 -0
- package/src/projection-apply-validators.ts +355 -0
- package/src/projection-capabilities.ts +181 -0
- package/src/projection-constants.ts +317 -0
- package/src/projection-manifest-types.ts +298 -0
- package/src/projection-manifest.ts +12 -299
- package/src/projection-recovery-validators.ts +229 -0
- package/src/projection-request-validators.ts +326 -0
- package/src/projection-types.ts +365 -0
- package/src/projection-validation-helpers.ts +15 -0
- package/src/projection.ts +7 -1689
- package/src/ref-impact.ts +225 -33
- package/src/refactor-constants.ts +213 -0
- package/src/refactor-decision-validators.ts +350 -0
- package/src/refactor-evidence-types.ts +286 -0
- package/src/refactor-observation-validators.ts +359 -0
- package/src/refactor-resolution-validators.ts +229 -0
- package/src/refactor-snapshot-validators.ts +368 -0
- package/src/refactor-types.ts +270 -0
- package/src/refactor-v2.ts +389 -0
- package/src/refactor-validation-helpers.ts +195 -0
- package/src/refactor.ts +7 -1849
- package/src/review-guards.ts +3 -23
- package/src/runtime-verify.ts +87 -0
- package/src/schema-kit.ts +183 -0
- package/src/schema-registry.ts +73 -0
- package/src/schema.ts +0 -4
- package/src/state-machine-schemas.ts +192 -0
- package/src/state-machine-types.ts +188 -0
- package/src/state-machine.ts +9 -189
- package/fixtures/boundary/agent-job-expired.json +0 -33
- package/fixtures/invalid/adapter-fidelity-reverse-sync.json +0 -9
- package/fixtures/invalid/agent-job-direct-mutation.json +0 -32
- package/fixtures/invalid/cloud-egress-envelope-private-field.json +0 -12
- package/fixtures/invalid/investigation-report-direct-mutation.json +0 -38
- package/fixtures/invalid/investigation-report-missing-proposed-delta.json +0 -19
- package/fixtures/invalid/notification-event-code-field.json +0 -11
- package/fixtures/valid/adapter-fidelity.json +0 -9
- package/fixtures/valid/agent-job.json +0 -33
- package/fixtures/valid/architecture-candidate-delta-policy.json +0 -45
- package/fixtures/valid/architecture-candidate-delta.json +0 -188
- package/fixtures/valid/chatgpt-ga-tool.json +0 -9
- package/fixtures/valid/cloud-egress-envelope.json +0 -11
- package/fixtures/valid/entitlement.json +0 -12
- package/fixtures/valid/investigation-report.json +0 -38
- package/fixtures/valid/likec4-mapping.json +0 -14
- package/fixtures/valid/notification-event.json +0 -10
- package/fixtures/valid/notification-provider.json +0 -12
- package/fixtures/valid/structurizr-mapping.json +0 -15
- package/schemas/cloud/cloud-egress-envelope.schema.json +0 -19
- package/schemas/cloud/entitlement.schema.json +0 -24
- package/schemas/integrations/adapter-fidelity.schema.json +0 -21
- package/schemas/integrations/chatgpt-ga-tool.schema.json +0 -25
- package/schemas/integrations/likec4-mapping.schema.json +0 -32
- package/schemas/integrations/structurizr-mapping.schema.json +0 -33
- package/schemas/runtime/agent-job.schema.json +0 -63
- package/schemas/runtime/architecture-candidate-delta-policy.schema.json +0 -129
- package/schemas/runtime/architecture-candidate-delta.schema.json +0 -386
- package/schemas/runtime/investigation-report.schema.json +0 -119
- package/schemas/runtime/notification-event.schema.json +0 -18
- package/schemas/runtime/notification-provider.schema.json +0 -26
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
export const STATE_MACHINE_SCHEMA_VERSION = "archcontext.state-machine/v1";
|
|
2
|
+
export const STATE_MACHINE_CHECK_SCHEMA_VERSION = "archcontext.state-machine-check/v1";
|
|
3
|
+
/** The largest product of region sizes that a model may declare; the check enumerates at most this many global states. */
|
|
4
|
+
export const STATE_MACHINE_PRODUCT_LIMIT = 100_000;
|
|
5
|
+
|
|
6
|
+
export interface StateMachineCodeSource {
|
|
7
|
+
kind: "code";
|
|
8
|
+
/** A repository-relative POSIX path. */
|
|
9
|
+
path: string;
|
|
10
|
+
symbol?: string;
|
|
11
|
+
confirmedDigest?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface StateMachineEnvironmentSource {
|
|
15
|
+
kind: "environment";
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface StateMachineState {
|
|
19
|
+
id: string;
|
|
20
|
+
label: string;
|
|
21
|
+
terminal?: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface StateMachineRegion {
|
|
25
|
+
id: string;
|
|
26
|
+
label: string;
|
|
27
|
+
initial: string;
|
|
28
|
+
states: StateMachineState[];
|
|
29
|
+
/** The code that owns the region. A region without one is a history region. */
|
|
30
|
+
source?: StateMachineCodeSource;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** `when` maps a region to the states the step accepts; `then` maps a region to the state the step writes. */
|
|
34
|
+
export interface StateMachineStep {
|
|
35
|
+
when: Record<string, string[]>;
|
|
36
|
+
then: Record<string, string>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface StateMachineEvent {
|
|
40
|
+
id: string;
|
|
41
|
+
label: string;
|
|
42
|
+
source: StateMachineCodeSource | StateMachineEnvironmentSource;
|
|
43
|
+
steps: StateMachineStep[];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface StateMachineFinding {
|
|
47
|
+
/** An https URL of the issue that tracks the known break. */
|
|
48
|
+
tracking: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
interface StateMachineRuleBase {
|
|
52
|
+
id: string;
|
|
53
|
+
label: string;
|
|
54
|
+
finding?: StateMachineFinding;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** No reachable global state has every named region in one of its listed states. */
|
|
58
|
+
export interface StateMachineNeverRule extends StateMachineRuleBase {
|
|
59
|
+
never: Record<string, string[]>;
|
|
60
|
+
final?: never;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** Once its one region is in a listed state, no enabled step moves it to another state. */
|
|
64
|
+
export interface StateMachineFinalRule extends StateMachineRuleBase {
|
|
65
|
+
final: Record<string, string[]>;
|
|
66
|
+
never?: never;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export type StateMachineRule = StateMachineNeverRule | StateMachineFinalRule;
|
|
70
|
+
|
|
71
|
+
/** `schemas/repo/architecture-state-machine.schema.json`, one file under `.archcontext/model/state-machines/`. */
|
|
72
|
+
export interface StateMachineV1 {
|
|
73
|
+
schemaVersion: typeof STATE_MACHINE_SCHEMA_VERSION;
|
|
74
|
+
id: string;
|
|
75
|
+
capabilityId: string;
|
|
76
|
+
name: string;
|
|
77
|
+
regions: StateMachineRegion[];
|
|
78
|
+
events: StateMachineEvent[];
|
|
79
|
+
rules: StateMachineRule[];
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export type StateMachineInvariant =
|
|
83
|
+
| "state-machine-id-duplicate"
|
|
84
|
+
| "state-machine-capability-missing"
|
|
85
|
+
| "state-machine-initial-unknown"
|
|
86
|
+
| "state-machine-region-unknown"
|
|
87
|
+
| "state-machine-state-unknown"
|
|
88
|
+
| "state-machine-step-source-missing"
|
|
89
|
+
| "state-machine-product-too-large";
|
|
90
|
+
|
|
91
|
+
export interface StateMachineIssue {
|
|
92
|
+
/** The machine id. */
|
|
93
|
+
entityId: string;
|
|
94
|
+
/** The path of the value inside the machine, for example `regions[1].initial`. */
|
|
95
|
+
field: string;
|
|
96
|
+
invariant: StateMachineInvariant;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** One state per region, keyed by region id in declaration order. */
|
|
100
|
+
export type StateMachineGlobalState = Record<string, string>;
|
|
101
|
+
|
|
102
|
+
/** `step` is the 1-based index of the step in its event. */
|
|
103
|
+
export interface StateMachinePathStep {
|
|
104
|
+
event: string;
|
|
105
|
+
step: number;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export interface StateMachineGuard {
|
|
109
|
+
event: string;
|
|
110
|
+
step: number;
|
|
111
|
+
region: string;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export type StateMachineRuleStatus = "holds" | "broken" | "finding-open" | "finding-resolved";
|
|
115
|
+
|
|
116
|
+
export interface StateMachineRuleResult {
|
|
117
|
+
id: string;
|
|
118
|
+
kind: "never" | "final";
|
|
119
|
+
status: StateMachineRuleStatus;
|
|
120
|
+
/** Present when the rule carries a finding. */
|
|
121
|
+
tracking?: string;
|
|
122
|
+
/** Present when the rule is broken. */
|
|
123
|
+
state?: StateMachineGlobalState;
|
|
124
|
+
/** Present when the rule is broken: the shortest path to `state`; for a `final` rule it ends with the step that moves the region. */
|
|
125
|
+
path?: StateMachinePathStep[];
|
|
126
|
+
/** Present when the rule holds and the check ran the protection analysis. */
|
|
127
|
+
protectedBy?: StateMachineGuard[];
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export type StateMachineBreak =
|
|
131
|
+
| { kind: "unreachable-state"; region: string; state: string }
|
|
132
|
+
| { kind: "dead-step"; event: string; step: number }
|
|
133
|
+
| { kind: "deadlock"; state: StateMachineGlobalState; path: StateMachinePathStep[]; count: number };
|
|
134
|
+
|
|
135
|
+
/** The built-in check of one machine by the model alone: rules and breaks, no code read. */
|
|
136
|
+
export interface StateMachineMachineReport {
|
|
137
|
+
id: string;
|
|
138
|
+
capabilityId: string;
|
|
139
|
+
reachableStates: number;
|
|
140
|
+
transitions: number;
|
|
141
|
+
rules: StateMachineRuleResult[];
|
|
142
|
+
breaks: StateMachineBreak[];
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export type StateMachineAnchorStatus =
|
|
146
|
+
| "anchor-missing-path"
|
|
147
|
+
| "anchor-language-unsupported"
|
|
148
|
+
| "anchor-missing-symbol"
|
|
149
|
+
| "anchor-ambiguous-symbol"
|
|
150
|
+
| "unchecked"
|
|
151
|
+
| "anchor-unconfirmed"
|
|
152
|
+
| "anchor-changed"
|
|
153
|
+
| "confirmed";
|
|
154
|
+
|
|
155
|
+
/** The status of one `code` source of a region or an event, measured against the current file. */
|
|
156
|
+
export interface StateMachineAnchor {
|
|
157
|
+
owner: "region" | "event";
|
|
158
|
+
ownerId: string;
|
|
159
|
+
path: string;
|
|
160
|
+
symbol?: string;
|
|
161
|
+
status: StateMachineAnchorStatus;
|
|
162
|
+
/** Present for `anchor-unconfirmed`, `anchor-changed` and `confirmed`. */
|
|
163
|
+
digest?: string;
|
|
164
|
+
/** Present for a symbol anchor with a digest: the direct callees that the digest covers, in digest order. */
|
|
165
|
+
callees?: StateMachineAnchorCallee[];
|
|
166
|
+
/**
|
|
167
|
+
* Present for `unchecked`: the symbol reader is unavailable, or the index does not hold the
|
|
168
|
+
* current content of the anchor's file or of a callee's file.
|
|
169
|
+
*/
|
|
170
|
+
reason?: "index-missing" | "index-open-failed" | "index-stale";
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export interface StateMachineAnchorCallee {
|
|
174
|
+
path: string;
|
|
175
|
+
qualifiedName: string;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export interface StateMachineCheckMachineV1 extends StateMachineMachineReport {
|
|
179
|
+
/** Every code anchor, regions first, then events, each in declaration order. */
|
|
180
|
+
anchors: StateMachineAnchor[];
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/** `schemas/runtime/state-machine-check.schema.json`, the data of `archctx state-machines check`. */
|
|
184
|
+
export interface StateMachineCheckReportV1 {
|
|
185
|
+
schemaVersion: typeof STATE_MACHINE_CHECK_SCHEMA_VERSION;
|
|
186
|
+
/** Sorted by machine id. */
|
|
187
|
+
machines: StateMachineCheckMachineV1[];
|
|
188
|
+
}
|
package/src/state-machine.ts
CHANGED
|
@@ -1,193 +1,13 @@
|
|
|
1
1
|
import type { Json } from "./schema";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
path: string;
|
|
12
|
-
symbol?: string;
|
|
13
|
-
confirmedDigest?: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface StateMachineEnvironmentSource {
|
|
17
|
-
kind: "environment";
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface StateMachineState {
|
|
21
|
-
id: string;
|
|
22
|
-
label: string;
|
|
23
|
-
terminal?: boolean;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export interface StateMachineRegion {
|
|
27
|
-
id: string;
|
|
28
|
-
label: string;
|
|
29
|
-
initial: string;
|
|
30
|
-
states: StateMachineState[];
|
|
31
|
-
/** The code that owns the region. A region without one is a history region. */
|
|
32
|
-
source?: StateMachineCodeSource;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/** `when` maps a region to the states the step accepts; `then` maps a region to the state the step writes. */
|
|
36
|
-
export interface StateMachineStep {
|
|
37
|
-
when: Record<string, string[]>;
|
|
38
|
-
then: Record<string, string>;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface StateMachineEvent {
|
|
42
|
-
id: string;
|
|
43
|
-
label: string;
|
|
44
|
-
source: StateMachineCodeSource | StateMachineEnvironmentSource;
|
|
45
|
-
steps: StateMachineStep[];
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export interface StateMachineFinding {
|
|
49
|
-
/** An https URL of the issue that tracks the known break. */
|
|
50
|
-
tracking: string;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
interface StateMachineRuleBase {
|
|
54
|
-
id: string;
|
|
55
|
-
label: string;
|
|
56
|
-
finding?: StateMachineFinding;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/** No reachable global state has every named region in one of its listed states. */
|
|
60
|
-
export interface StateMachineNeverRule extends StateMachineRuleBase {
|
|
61
|
-
never: Record<string, string[]>;
|
|
62
|
-
final?: never;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/** Once its one region is in a listed state, no enabled step moves it to another state. */
|
|
66
|
-
export interface StateMachineFinalRule extends StateMachineRuleBase {
|
|
67
|
-
final: Record<string, string[]>;
|
|
68
|
-
never?: never;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export type StateMachineRule = StateMachineNeverRule | StateMachineFinalRule;
|
|
72
|
-
|
|
73
|
-
/** `schemas/repo/architecture-state-machine.schema.json`, one file under `.archcontext/model/state-machines/`. */
|
|
74
|
-
export interface StateMachineV1 {
|
|
75
|
-
schemaVersion: typeof STATE_MACHINE_SCHEMA_VERSION;
|
|
76
|
-
id: string;
|
|
77
|
-
capabilityId: string;
|
|
78
|
-
name: string;
|
|
79
|
-
regions: StateMachineRegion[];
|
|
80
|
-
events: StateMachineEvent[];
|
|
81
|
-
rules: StateMachineRule[];
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export type StateMachineInvariant =
|
|
85
|
-
| "state-machine-id-duplicate"
|
|
86
|
-
| "state-machine-capability-missing"
|
|
87
|
-
| "state-machine-initial-unknown"
|
|
88
|
-
| "state-machine-region-unknown"
|
|
89
|
-
| "state-machine-state-unknown"
|
|
90
|
-
| "state-machine-step-source-missing"
|
|
91
|
-
| "state-machine-product-too-large";
|
|
92
|
-
|
|
93
|
-
export interface StateMachineIssue {
|
|
94
|
-
/** The machine id. */
|
|
95
|
-
entityId: string;
|
|
96
|
-
/** The path of the value inside the machine, for example `regions[1].initial`. */
|
|
97
|
-
field: string;
|
|
98
|
-
invariant: StateMachineInvariant;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/** One state per region, keyed by region id in declaration order. */
|
|
102
|
-
export type StateMachineGlobalState = Record<string, string>;
|
|
103
|
-
|
|
104
|
-
/** `step` is the 1-based index of the step in its event. */
|
|
105
|
-
export interface StateMachinePathStep {
|
|
106
|
-
event: string;
|
|
107
|
-
step: number;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export interface StateMachineGuard {
|
|
111
|
-
event: string;
|
|
112
|
-
step: number;
|
|
113
|
-
region: string;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
export type StateMachineRuleStatus = "holds" | "broken" | "finding-open" | "finding-resolved";
|
|
117
|
-
|
|
118
|
-
export interface StateMachineRuleResult {
|
|
119
|
-
id: string;
|
|
120
|
-
kind: "never" | "final";
|
|
121
|
-
status: StateMachineRuleStatus;
|
|
122
|
-
/** Present when the rule carries a finding. */
|
|
123
|
-
tracking?: string;
|
|
124
|
-
/** Present when the rule is broken. */
|
|
125
|
-
state?: StateMachineGlobalState;
|
|
126
|
-
/** Present when the rule is broken: the shortest path to `state`; for a `final` rule it ends with the step that moves the region. */
|
|
127
|
-
path?: StateMachinePathStep[];
|
|
128
|
-
/** Present when the rule holds and the check ran the protection analysis. */
|
|
129
|
-
protectedBy?: StateMachineGuard[];
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
export type StateMachineBreak =
|
|
133
|
-
| { kind: "unreachable-state"; region: string; state: string }
|
|
134
|
-
| { kind: "dead-step"; event: string; step: number }
|
|
135
|
-
| { kind: "deadlock"; state: StateMachineGlobalState; path: StateMachinePathStep[]; count: number };
|
|
136
|
-
|
|
137
|
-
/** The built-in check of one machine by the model alone: rules and breaks, no code read. */
|
|
138
|
-
export interface StateMachineMachineReport {
|
|
139
|
-
id: string;
|
|
140
|
-
capabilityId: string;
|
|
141
|
-
reachableStates: number;
|
|
142
|
-
transitions: number;
|
|
143
|
-
rules: StateMachineRuleResult[];
|
|
144
|
-
breaks: StateMachineBreak[];
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
export type StateMachineAnchorStatus =
|
|
148
|
-
| "anchor-missing-path"
|
|
149
|
-
| "anchor-language-unsupported"
|
|
150
|
-
| "anchor-missing-symbol"
|
|
151
|
-
| "anchor-ambiguous-symbol"
|
|
152
|
-
| "unchecked"
|
|
153
|
-
| "anchor-unconfirmed"
|
|
154
|
-
| "anchor-changed"
|
|
155
|
-
| "confirmed";
|
|
156
|
-
|
|
157
|
-
/** The status of one `code` source of a region or an event, measured against the current file. */
|
|
158
|
-
export interface StateMachineAnchor {
|
|
159
|
-
owner: "region" | "event";
|
|
160
|
-
ownerId: string;
|
|
161
|
-
path: string;
|
|
162
|
-
symbol?: string;
|
|
163
|
-
status: StateMachineAnchorStatus;
|
|
164
|
-
/** Present for `anchor-unconfirmed`, `anchor-changed` and `confirmed`. */
|
|
165
|
-
digest?: string;
|
|
166
|
-
/** Present for a symbol anchor with a digest: the direct callees that the digest covers, in digest order. */
|
|
167
|
-
callees?: StateMachineAnchorCallee[];
|
|
168
|
-
/**
|
|
169
|
-
* Present for `unchecked`: the symbol reader is unavailable, or the index does not hold the
|
|
170
|
-
* current content of the anchor's file or of a callee's file.
|
|
171
|
-
*/
|
|
172
|
-
reason?: "index-missing" | "index-open-failed" | "index-stale";
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
export interface StateMachineAnchorCallee {
|
|
176
|
-
path: string;
|
|
177
|
-
qualifiedName: string;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
export interface StateMachineCheckMachineV1 extends StateMachineMachineReport {
|
|
181
|
-
/** Every code anchor, regions first, then events, each in declaration order. */
|
|
182
|
-
anchors: StateMachineAnchor[];
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
/** `schemas/runtime/state-machine-check.schema.json`, the data of `archctx state-machines check`. */
|
|
186
|
-
export interface StateMachineCheckReportV1 {
|
|
187
|
-
schemaVersion: typeof STATE_MACHINE_CHECK_SCHEMA_VERSION;
|
|
188
|
-
/** Sorted by machine id. */
|
|
189
|
-
machines: StateMachineCheckMachineV1[];
|
|
190
|
-
}
|
|
2
|
+
import {
|
|
3
|
+
STATE_MACHINE_PRODUCT_LIMIT,
|
|
4
|
+
type StateMachineInvariant,
|
|
5
|
+
type StateMachineIssue,
|
|
6
|
+
type StateMachineV1
|
|
7
|
+
} from "./state-machine-types";
|
|
8
|
+
|
|
9
|
+
export * from "./state-machine-types";
|
|
10
|
+
export * from "./state-machine-schemas";
|
|
191
11
|
|
|
192
12
|
type NodeRecord = Readonly<Record<string, Json | undefined>>;
|
|
193
13
|
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"schemaVersion": "archcontext.agent-job/v1",
|
|
3
|
-
"jobId": "agent_job.al0_expired",
|
|
4
|
-
"status": "expired",
|
|
5
|
-
"runnerPort": "fake-provider",
|
|
6
|
-
"repository": {
|
|
7
|
-
"repositoryId": "repo.archcontext",
|
|
8
|
-
"storageRepositoryId": "storage-repo.archcontext"
|
|
9
|
-
},
|
|
10
|
-
"worktree": {
|
|
11
|
-
"workspaceId": "workspace.main",
|
|
12
|
-
"storageWorkspaceId": "storage-workspace.main",
|
|
13
|
-
"branch": "main",
|
|
14
|
-
"headSha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
15
|
-
"worktreeDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
16
|
-
},
|
|
17
|
-
"fingerprint": "sha256:1212121212121212121212121212121212121212121212121212121212121212",
|
|
18
|
-
"trigger": {
|
|
19
|
-
"source": "checkpoint",
|
|
20
|
-
"reason": "stale queued job expired before execution"
|
|
21
|
-
},
|
|
22
|
-
"budget": {
|
|
23
|
-
"maxRunsPerTask": 0,
|
|
24
|
-
"maxRunsPerRepositoryPerDay": 0,
|
|
25
|
-
"maxRunsPerDay": 0
|
|
26
|
-
},
|
|
27
|
-
"inputDigest": "sha256:1313131313131313131313131313131313131313131313131313131313131313",
|
|
28
|
-
"promptTemplateDigest": "sha256:1414141414141414141414141414141414141414141414141414141414141414",
|
|
29
|
-
"stalePolicy": "advisory-only-on-stale",
|
|
30
|
-
"directMutationAllowed": false,
|
|
31
|
-
"queuedAt": "2026-06-25T00:00:00.000Z",
|
|
32
|
-
"updatedAt": "2026-06-25T00:00:00.000Z"
|
|
33
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"schemaVersion": "archcontext.adapter-fidelity/v1",
|
|
3
|
-
"id": "adapter-fidelity.native-sot",
|
|
4
|
-
"direction": "export-first",
|
|
5
|
-
"importScope": "initialization-only",
|
|
6
|
-
"nativeIsSourceOfTruth": false,
|
|
7
|
-
"reverseSync": "allowed",
|
|
8
|
-
"protectedNativeFields": ["evidence", "verification", "constraint", "intervention"]
|
|
9
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"schemaVersion": "archcontext.agent-job/v1",
|
|
3
|
-
"jobId": "agent_job.invalid_direct_mutation",
|
|
4
|
-
"status": "queued",
|
|
5
|
-
"runnerPort": "codex",
|
|
6
|
-
"repository": {
|
|
7
|
-
"repositoryId": "repo.archcontext",
|
|
8
|
-
"storageRepositoryId": "storage-repo.archcontext"
|
|
9
|
-
},
|
|
10
|
-
"worktree": {
|
|
11
|
-
"workspaceId": "workspace.main",
|
|
12
|
-
"storageWorkspaceId": "storage-workspace.main",
|
|
13
|
-
"branch": "main",
|
|
14
|
-
"headSha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
15
|
-
"worktreeDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
16
|
-
},
|
|
17
|
-
"fingerprint": "sha256:1212121212121212121212121212121212121212121212121212121212121212",
|
|
18
|
-
"trigger": {
|
|
19
|
-
"source": "checkpoint",
|
|
20
|
-
"reason": "invalid direct mutation"
|
|
21
|
-
},
|
|
22
|
-
"budget": {
|
|
23
|
-
"maxRunsPerTask": 1,
|
|
24
|
-
"maxRunsPerRepositoryPerDay": 3
|
|
25
|
-
},
|
|
26
|
-
"inputDigest": "sha256:1313131313131313131313131313131313131313131313131313131313131313",
|
|
27
|
-
"promptTemplateDigest": "sha256:1414141414141414141414141414141414141414141414141414141414141414",
|
|
28
|
-
"stalePolicy": "cancel-on-head-change",
|
|
29
|
-
"directMutationAllowed": true,
|
|
30
|
-
"queuedAt": "2026-06-25T00:00:00.000Z",
|
|
31
|
-
"updatedAt": "2026-06-25T00:00:00.000Z"
|
|
32
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"schemaVersion": "archcontext.cloud-egress/v1",
|
|
3
|
-
"requestId": "req_bad_private_field",
|
|
4
|
-
"category": "github.pull-head",
|
|
5
|
-
"method": "GET",
|
|
6
|
-
"host": "api.github.com",
|
|
7
|
-
"pathTemplate": "/repos/{owner}/{repo}/pulls/{pull_number}/files",
|
|
8
|
-
"statusCode": 200,
|
|
9
|
-
"latencyMs": 42,
|
|
10
|
-
"recordedAt": "2026-06-20T09:00:00Z",
|
|
11
|
-
"patch": "@@ private diff"
|
|
12
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"schemaVersion": "archcontext.investigation-report/v1",
|
|
3
|
-
"reportId": "investigation_report.invalid_direct_mutation",
|
|
4
|
-
"jobId": "agent_job.al0_investigate",
|
|
5
|
-
"status": "succeeded",
|
|
6
|
-
"findings": [
|
|
7
|
-
{
|
|
8
|
-
"findingId": "finding.boundary-import",
|
|
9
|
-
"hypothesis": "Invalid report asks to mutate directly.",
|
|
10
|
-
"evidenceBindingIds": ["binding.evidence.al0.boundary-import"],
|
|
11
|
-
"unknowns": [],
|
|
12
|
-
"falsifier": "A declared relation allowing this dependency exists at the same HEAD.",
|
|
13
|
-
"proposedDelta": {
|
|
14
|
-
"candidateChangeId": "candidate_change.al0.boundary-import",
|
|
15
|
-
"kind": "node-materially-changed",
|
|
16
|
-
"target": {
|
|
17
|
-
"kind": "node",
|
|
18
|
-
"id": "module.checkout"
|
|
19
|
-
},
|
|
20
|
-
"stateDimension": "target-state",
|
|
21
|
-
"changeKind": "materially_changed",
|
|
22
|
-
"subjectSelectorIds": ["subject.path.src-checkout-service"],
|
|
23
|
-
"mappingIds": ["mapping.checkout-service"],
|
|
24
|
-
"ambiguityIds": [],
|
|
25
|
-
"evidenceIds": ["evidence.al0.boundary-import"],
|
|
26
|
-
"confidence": "medium",
|
|
27
|
-
"heuristic": true,
|
|
28
|
-
"summary": "Invalid report asks to mutate directly.",
|
|
29
|
-
"digest": "sha256:1515151515151515151515151515151515151515151515151515151515151515"
|
|
30
|
-
},
|
|
31
|
-
"proposedDeltaDigest": "sha256:1515151515151515151515151515151515151515151515151515151515151515",
|
|
32
|
-
"confidence": "medium"
|
|
33
|
-
}
|
|
34
|
-
],
|
|
35
|
-
"outputDigest": "sha256:1616161616161616161616161616161616161616161616161616161616161616",
|
|
36
|
-
"createdAt": "2026-06-25T00:00:00.000Z",
|
|
37
|
-
"directMutationAllowed": true
|
|
38
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"schemaVersion": "archcontext.investigation-report/v1",
|
|
3
|
-
"reportId": "investigation_report.invalid_missing_delta",
|
|
4
|
-
"jobId": "agent_job.al0_investigate",
|
|
5
|
-
"status": "succeeded",
|
|
6
|
-
"findings": [
|
|
7
|
-
{
|
|
8
|
-
"findingId": "finding.boundary-import",
|
|
9
|
-
"hypothesis": "Invalid report omits the typed proposed delta.",
|
|
10
|
-
"evidenceBindingIds": ["binding.evidence.al0.boundary-import"],
|
|
11
|
-
"unknowns": [],
|
|
12
|
-
"falsifier": "A declared relation allowing this dependency exists at the same HEAD.",
|
|
13
|
-
"confidence": "medium"
|
|
14
|
-
}
|
|
15
|
-
],
|
|
16
|
-
"outputDigest": "sha256:1616161616161616161616161616161616161616161616161616161616161616",
|
|
17
|
-
"createdAt": "2026-06-25T00:00:00.000Z",
|
|
18
|
-
"directMutationAllowed": false
|
|
19
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"schemaVersion": "archcontext.notification-event/v1",
|
|
3
|
-
"eventId": "notification.review-complete",
|
|
4
|
-
"prUrl": "https://github.com/ancienttwo/arch-context/pull/12",
|
|
5
|
-
"result": "pass",
|
|
6
|
-
"riskLevel": "low",
|
|
7
|
-
"commitSha": "abc1234",
|
|
8
|
-
"runtimeVersion": "archctx/1.1.0",
|
|
9
|
-
"occurredAt": "2026-06-19T00:00:00Z",
|
|
10
|
-
"code": "console.log('leak')"
|
|
11
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"schemaVersion": "archcontext.adapter-fidelity/v1",
|
|
3
|
-
"id": "adapter-fidelity.native-sot",
|
|
4
|
-
"direction": "export-first",
|
|
5
|
-
"importScope": "initialization-only",
|
|
6
|
-
"nativeIsSourceOfTruth": true,
|
|
7
|
-
"reverseSync": "forbidden",
|
|
8
|
-
"protectedNativeFields": ["evidence", "verification", "constraint", "intervention"]
|
|
9
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"schemaVersion": "archcontext.agent-job/v1",
|
|
3
|
-
"jobId": "agent_job.al0_investigate",
|
|
4
|
-
"status": "queued",
|
|
5
|
-
"runnerPort": "codex",
|
|
6
|
-
"repository": {
|
|
7
|
-
"repositoryId": "repo.archcontext",
|
|
8
|
-
"storageRepositoryId": "storage-repo.archcontext"
|
|
9
|
-
},
|
|
10
|
-
"worktree": {
|
|
11
|
-
"workspaceId": "workspace.main",
|
|
12
|
-
"storageWorkspaceId": "storage-workspace.main",
|
|
13
|
-
"branch": "codex/architecture-ledger-al0",
|
|
14
|
-
"headSha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
15
|
-
"worktreeDigest": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
16
|
-
},
|
|
17
|
-
"fingerprint": "sha256:1212121212121212121212121212121212121212121212121212121212121212",
|
|
18
|
-
"trigger": {
|
|
19
|
-
"source": "checkpoint",
|
|
20
|
-
"reason": "medium risk with unresolved evidence coverage"
|
|
21
|
-
},
|
|
22
|
-
"budget": {
|
|
23
|
-
"maxRunsPerTask": 1,
|
|
24
|
-
"maxRunsPerRepositoryPerDay": 3,
|
|
25
|
-
"maxRunsPerDay": 10
|
|
26
|
-
},
|
|
27
|
-
"inputDigest": "sha256:1313131313131313131313131313131313131313131313131313131313131313",
|
|
28
|
-
"promptTemplateDigest": "sha256:1414141414141414141414141414141414141414141414141414141414141414",
|
|
29
|
-
"stalePolicy": "cancel-on-head-change",
|
|
30
|
-
"directMutationAllowed": false,
|
|
31
|
-
"queuedAt": "2026-06-25T00:00:00.000Z",
|
|
32
|
-
"updatedAt": "2026-06-25T00:00:00.000Z"
|
|
33
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"schemaVersion": "archcontext.architecture-candidate-delta-policy/v1",
|
|
3
|
-
"evaluationId": "candidate_delta_policy.checkout-service",
|
|
4
|
-
"deltaId": "delta.checkout-service",
|
|
5
|
-
"repository": {
|
|
6
|
-
"repositoryId": "repo.checkout",
|
|
7
|
-
"storageRepositoryId": "repo.storage.checkout"
|
|
8
|
-
},
|
|
9
|
-
"worktree": {
|
|
10
|
-
"workspaceId": "workspace.checkout.main",
|
|
11
|
-
"storageWorkspaceId": "workspace.storage.checkout.main",
|
|
12
|
-
"branch": "main",
|
|
13
|
-
"headSha": "abc123",
|
|
14
|
-
"worktreeDigest": "sha256:1111111111111111111111111111111111111111111111111111111111111111"
|
|
15
|
-
},
|
|
16
|
-
"deltaDigest": "sha256:9999999999999999999999999999999999999999999999999999999999999999",
|
|
17
|
-
"policyVersion": "architecture-candidate-delta-policy/v1",
|
|
18
|
-
"evaluatedAt": "2026-06-26T00:00:00.000Z",
|
|
19
|
-
"decisions": [
|
|
20
|
-
{
|
|
21
|
-
"decisionId": "candidate_delta_policy_decision.checkout-service",
|
|
22
|
-
"candidateChangeId": "candidate_change.checkout-service",
|
|
23
|
-
"target": {
|
|
24
|
-
"kind": "node",
|
|
25
|
-
"id": "module.checkout"
|
|
26
|
-
},
|
|
27
|
-
"stateDimension": "target-state",
|
|
28
|
-
"changeKind": "materially_changed",
|
|
29
|
-
"confidence": "medium",
|
|
30
|
-
"action": "require-checkpoint",
|
|
31
|
-
"reasonCodes": ["medium-confidence", "partial-evidence"],
|
|
32
|
-
"evidenceIds": ["evidence.al5.src-checkout-service"],
|
|
33
|
-
"digest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
|
34
|
-
}
|
|
35
|
-
],
|
|
36
|
-
"summary": {
|
|
37
|
-
"candidateChanges": 1,
|
|
38
|
-
"autoAccept": 0,
|
|
39
|
-
"requireCheckpoint": 1,
|
|
40
|
-
"requireProof": 0,
|
|
41
|
-
"requireHumanApproval": 0,
|
|
42
|
-
"mappingAmbiguities": 0
|
|
43
|
-
},
|
|
44
|
-
"evaluationDigest": "sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
|
|
45
|
-
}
|