archctx-contracts 0.17.1 → 0.18.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.
- package/fixtures/valid/archctx-capabilities.json +2 -2
- package/fixtures/valid/product-version-manifest.json +4 -10
- package/package.json +4 -1
- package/schemas/repo/refactor-decision.schema.json +307 -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 +209 -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 +262 -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 +120 -0
- package/schemas/runtime/product-version-manifest.schema.json +142 -54
- 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 +1392 -0
- package/schemas/runtime/refactor-simulate.schema.json +553 -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 +77 -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 +4 -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 +6 -541
- package/src/product-version.ts +74 -55
- 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 +351 -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 +554 -0
- package/src/refactor-validation-helpers.ts +199 -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 +187 -0
- package/src/schema-registry.ts +73 -0
- package/src/schema.ts +15 -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
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
import type { EvidenceCoverageLevelV2 } from "./ledger";
|
|
2
|
+
import {
|
|
3
|
+
Const,
|
|
4
|
+
CountSchema,
|
|
5
|
+
GitCommitShaSchema,
|
|
6
|
+
NonEmptyStringSchema,
|
|
7
|
+
NullableType,
|
|
8
|
+
PositiveIntSchema,
|
|
9
|
+
RawEnum,
|
|
10
|
+
SchemaDocument,
|
|
11
|
+
Sha256DigestSchema,
|
|
12
|
+
StrictObject,
|
|
13
|
+
Type,
|
|
14
|
+
UniqueStringArray,
|
|
15
|
+
type Static
|
|
16
|
+
} from "./schema-kit";
|
|
2
17
|
|
|
3
18
|
// --- ChangeSet ownership delta (plan preview) ---
|
|
4
19
|
//
|
|
@@ -71,7 +86,10 @@ export type ChangeSetOwnershipDeltaV1 = ChangeSetOwnershipDeltaComputedV1 | Chan
|
|
|
71
86
|
export const CAPABILITY_DEPENDENCIES_SCHEMA_VERSION = "archcontext.capability-dependencies/v1" as const;
|
|
72
87
|
/** Default number of file-level edges `archctx deps` lists. `edges.count` always holds the full total. */
|
|
73
88
|
export const CAPABILITY_DEPENDENCIES_EDGE_LIMIT = 200;
|
|
74
|
-
/**
|
|
89
|
+
/** Bounded repository-wide symbol call edge limit for `archctx deps` (#636). */
|
|
90
|
+
export const CAPABILITY_DEPENDENCIES_CALL_EDGE_LIMIT = 128_000;
|
|
91
|
+
export const CAPABILITY_DEPENDENCIES_CALL_LIMIT_REASON = "code-facts-call-limit" as const;
|
|
92
|
+
/** Fallback reason when callers invoke `measureCapabilityDependencies` without call facts. */
|
|
75
93
|
export const CAPABILITY_DEPENDENCIES_CALLS_UNAVAILABLE_REASON = "call-edges-not-exposed" as const;
|
|
76
94
|
/**
|
|
77
95
|
* The relation kinds that declare an import dependency: every `archcontext.relation/v1` kind in
|
|
@@ -104,8 +122,8 @@ export interface CapabilityDependencyCellV1 {
|
|
|
104
122
|
to: string;
|
|
105
123
|
/** Distinct file-to-file import edges from `from` into `to`. */
|
|
106
124
|
imports: number;
|
|
107
|
-
/**
|
|
108
|
-
calls: null;
|
|
125
|
+
/** Bounded symbol `calls` + `references` edges from `from` into `to`, or `null` when unavailable (#636). */
|
|
126
|
+
calls: number | null;
|
|
109
127
|
/**
|
|
110
128
|
* Whether the model declares this dependency (rule: CAPABILITY_DEPENDENCY_DECLARING_RELATION_KINDS).
|
|
111
129
|
* A cell with `from === to` stays inside one capability and needs no relation: it is always
|
|
@@ -161,9 +179,101 @@ export interface CapabilityDependenciesV1 {
|
|
|
161
179
|
unattributed: { unownedEndpoint: number; contestedEndpoint: number; noCapabilityEndpoint: number };
|
|
162
180
|
};
|
|
163
181
|
calls: {
|
|
164
|
-
coverage:
|
|
165
|
-
reasonCodes: [
|
|
182
|
+
coverage: EvidenceCoverageLevelV2;
|
|
183
|
+
reasonCodes: string[];
|
|
184
|
+
edgeCount?: number;
|
|
185
|
+
edgeLimit?: number;
|
|
186
|
+
limitExceeded?: boolean;
|
|
166
187
|
};
|
|
167
188
|
/** Attributed file-level edges behind `matrix`, sorted by path. */
|
|
168
189
|
edges: { limit: number; count: number; omittedCount: number; items: CapabilityDependencyEdgeV1[] };
|
|
169
190
|
}
|
|
191
|
+
|
|
192
|
+
export const CapabilityDependenciesBodySchema = StrictObject({
|
|
193
|
+
schemaVersion: Const(CAPABILITY_DEPENDENCIES_SCHEMA_VERSION),
|
|
194
|
+
ownershipRule: Const("parent-chain"),
|
|
195
|
+
filter: StrictObject({
|
|
196
|
+
from: NullableType("string"),
|
|
197
|
+
into: NullableType("string")
|
|
198
|
+
}),
|
|
199
|
+
capabilities: UniqueStringArray(NonEmptyStringSchema),
|
|
200
|
+
matrix: Type.Array(
|
|
201
|
+
StrictObject(
|
|
202
|
+
{
|
|
203
|
+
from: NonEmptyStringSchema,
|
|
204
|
+
to: NonEmptyStringSchema,
|
|
205
|
+
imports: CountSchema,
|
|
206
|
+
calls: NullableType("integer", { minimum: 0 }),
|
|
207
|
+
declared: Type.Boolean({
|
|
208
|
+
description:
|
|
209
|
+
"A relation of a declaring kind (every kind but deployed-on, spawns, runs-in and mounts) runs from a node that rolls up to `from` into a node that rolls up to `to`. A cell with from equal to to is always declared and lists no relation ids."
|
|
210
|
+
}),
|
|
211
|
+
relationIds: UniqueStringArray(NonEmptyStringSchema, {
|
|
212
|
+
description: "The declaring relation ids, sorted. Non-empty exactly when a cross-capability cell is declared."
|
|
213
|
+
})
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
if: { properties: { relationIds: { minItems: 1 } } },
|
|
217
|
+
then: { properties: { declared: { const: true } } }
|
|
218
|
+
}
|
|
219
|
+
)
|
|
220
|
+
),
|
|
221
|
+
imports: StrictObject({
|
|
222
|
+
coverage: RawEnum(["complete", "partial"] as const),
|
|
223
|
+
reasonCodes: UniqueStringArray(RawEnum(["code-facts-import-limit", "code-facts-truncated"] as const)),
|
|
224
|
+
truncated: Type.Boolean(),
|
|
225
|
+
importNodeCount: NullableType("integer", { minimum: 0 }),
|
|
226
|
+
importNodeLimit: PositiveIntSchema,
|
|
227
|
+
importNodeLimitExceeded: Type.Boolean(),
|
|
228
|
+
edgeCount: CountSchema,
|
|
229
|
+
unresolvedCount: CountSchema,
|
|
230
|
+
unattributed: StrictObject({
|
|
231
|
+
unownedEndpoint: CountSchema,
|
|
232
|
+
contestedEndpoint: CountSchema,
|
|
233
|
+
noCapabilityEndpoint: CountSchema
|
|
234
|
+
})
|
|
235
|
+
}),
|
|
236
|
+
calls: StrictObject({
|
|
237
|
+
coverage: RawEnum(["complete", "partial", "unknown"] as const),
|
|
238
|
+
reasonCodes: UniqueStringArray(
|
|
239
|
+
RawEnum([
|
|
240
|
+
CAPABILITY_DEPENDENCIES_CALLS_UNAVAILABLE_REASON,
|
|
241
|
+
CAPABILITY_DEPENDENCIES_CALL_LIMIT_REASON,
|
|
242
|
+
"code-facts-truncated",
|
|
243
|
+
"code-facts-unavailable"
|
|
244
|
+
] as const)
|
|
245
|
+
),
|
|
246
|
+
edgeCount: Type.Optional(CountSchema),
|
|
247
|
+
edgeLimit: Type.Optional(PositiveIntSchema),
|
|
248
|
+
limitExceeded: Type.Optional(Type.Boolean())
|
|
249
|
+
}),
|
|
250
|
+
edges: StrictObject({
|
|
251
|
+
limit: CountSchema,
|
|
252
|
+
count: CountSchema,
|
|
253
|
+
omittedCount: CountSchema,
|
|
254
|
+
items: Type.Array(
|
|
255
|
+
StrictObject({
|
|
256
|
+
fromPath: NonEmptyStringSchema,
|
|
257
|
+
toPath: NonEmptyStringSchema,
|
|
258
|
+
fromCapability: NonEmptyStringSchema,
|
|
259
|
+
toCapability: NonEmptyStringSchema
|
|
260
|
+
})
|
|
261
|
+
)
|
|
262
|
+
}),
|
|
263
|
+
worktree: StrictObject({
|
|
264
|
+
headSha: GitCommitShaSchema,
|
|
265
|
+
worktreeDigest: Sha256DigestSchema
|
|
266
|
+
}),
|
|
267
|
+
privacy: StrictObject({
|
|
268
|
+
writes: Const("none")
|
|
269
|
+
})
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
export const CapabilityDependenciesSchema = SchemaDocument({
|
|
273
|
+
$id: "https://archcontext.dev/schemas/runtime/capability-dependencies.schema.json",
|
|
274
|
+
title: "CapabilityDependenciesV1",
|
|
275
|
+
description:
|
|
276
|
+
"The data of `archctx deps`: a read-only capability x capability import matrix. Owners come from the parent-chain rule `refactor scan` uses, rolled up to the nearest capability. Each cell says whether a model relation declares it. Call counts are not available in v1. Without code facts that attest to the measured tree, deps refuses with AC_CODE_FACTS_UNAVAILABLE instead of returning this data.",
|
|
277
|
+
schema: CapabilityDependenciesBodySchema
|
|
278
|
+
});
|
|
279
|
+
export type CapabilityDependenciesReportV1 = Static<typeof CapabilityDependenciesSchema>;
|