@neat.is/types 0.7.0 → 0.7.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/dist/index.cjs +214 -194
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1625 -1263
- package/dist/index.d.ts +1625 -1263
- package/dist/index.js +213 -194
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -109,141 +109,211 @@ var NodeTypeSchema = z.enum([
|
|
|
109
109
|
]);
|
|
110
110
|
|
|
111
111
|
// src/nodes.ts
|
|
112
|
+
import { z as z3 } from "zod";
|
|
113
|
+
|
|
114
|
+
// src/edges.ts
|
|
112
115
|
import { z as z2 } from "zod";
|
|
113
|
-
var
|
|
114
|
-
|
|
115
|
-
|
|
116
|
+
var ProvenanceSchema = z2.enum([
|
|
117
|
+
Provenance.EXTRACTED,
|
|
118
|
+
Provenance.INFERRED,
|
|
119
|
+
Provenance.OBSERVED,
|
|
120
|
+
Provenance.STALE
|
|
121
|
+
]);
|
|
122
|
+
var EdgeTypeSchema = z2.enum([
|
|
123
|
+
EdgeType.CALLS,
|
|
124
|
+
EdgeType.DEPENDS_ON,
|
|
125
|
+
EdgeType.CONNECTS_TO,
|
|
126
|
+
EdgeType.CONFIGURED_BY,
|
|
127
|
+
EdgeType.PUBLISHES_TO,
|
|
128
|
+
EdgeType.CONSUMES_FROM,
|
|
129
|
+
EdgeType.RUNS_ON,
|
|
130
|
+
EdgeType.CONTAINS,
|
|
131
|
+
EdgeType.IMPORTS,
|
|
132
|
+
EdgeType.INHERITS,
|
|
133
|
+
EdgeType.IMPLEMENTS
|
|
134
|
+
]);
|
|
135
|
+
var EdgeEvidenceSchema = z2.object({
|
|
136
|
+
file: z2.string(),
|
|
137
|
+
line: z2.number().int().nonnegative().optional(),
|
|
138
|
+
snippet: z2.string().optional(),
|
|
139
|
+
// HTTP shape of a recognised client call site (ADR-119). Present on a
|
|
140
|
+
// client↔route CALLS edge so the edge records the method + path-template the
|
|
141
|
+
// client named, alongside the file:line it named them at. Absent on every
|
|
142
|
+
// other edge — a config or infra edge has no HTTP method.
|
|
143
|
+
method: z2.string().optional(),
|
|
144
|
+
pathTemplate: z2.string().optional()
|
|
145
|
+
});
|
|
146
|
+
var EdgeSignalSchema = z2.object({
|
|
147
|
+
spanCount: z2.number().int().nonnegative(),
|
|
148
|
+
errorCount: z2.number().int().nonnegative(),
|
|
149
|
+
lastObservedAgeMs: z2.number().nonnegative().optional()
|
|
116
150
|
});
|
|
117
|
-
var
|
|
118
|
-
var ServiceNodeSchema = z2.object({
|
|
151
|
+
var GraphEdgeSchema = z2.object({
|
|
119
152
|
id: z2.string(),
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
153
|
+
source: z2.string(),
|
|
154
|
+
target: z2.string(),
|
|
155
|
+
type: EdgeTypeSchema,
|
|
156
|
+
provenance: ProvenanceSchema,
|
|
157
|
+
confidence: z2.number().min(0).max(1).optional(),
|
|
158
|
+
lastObserved: z2.string().datetime().optional(),
|
|
159
|
+
callCount: z2.number().int().nonnegative().optional(),
|
|
160
|
+
evidence: EdgeEvidenceSchema.optional(),
|
|
161
|
+
signal: EdgeSignalSchema.optional(),
|
|
162
|
+
// OBSERVED grain (ADR-142): `file` when the edge originates from a source
|
|
163
|
+
// file's call site (a `file:` source + `evidence`), `service` for the coarse
|
|
164
|
+
// fallback where no call site was captured. Makes "service-grained only as a
|
|
165
|
+
// labeled fallback" (connector gate #803) a stored, machine-readable fact
|
|
166
|
+
// instead of a re-derivation from the source prefix. `.optional()` — EXTRACTED
|
|
167
|
+
// edges and legacy snapshots carry none; an OBSERVED edge is backfilled on its
|
|
168
|
+
// next observation.
|
|
169
|
+
grain: z2.enum(["file", "service"]).optional()
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
// src/nodes.ts
|
|
173
|
+
var CompatibleDriverSchema = z3.object({
|
|
174
|
+
name: z3.string(),
|
|
175
|
+
minVersion: z3.string()
|
|
176
|
+
});
|
|
177
|
+
var DiscoveredViaSchema = z3.enum(["static", "otel", "merged"]);
|
|
178
|
+
var ServiceNodeSchema = z3.object({
|
|
179
|
+
id: z3.string(),
|
|
180
|
+
type: z3.literal(NodeType.ServiceNode),
|
|
181
|
+
name: z3.string(),
|
|
182
|
+
language: z3.string(),
|
|
123
183
|
// Deployment environment from the OTel `deployment.environment.name` attr
|
|
124
184
|
// (with `deployment.environment` and resource-attr fallbacks). The literal
|
|
125
185
|
// `'unknown'` is the honest sentinel when no env signal is present; static
|
|
126
186
|
// extraction never sees env at extract time, so its ServiceNodes carry
|
|
127
187
|
// `undefined` here and the id stays in the env-less wire format
|
|
128
188
|
// `service:<name>`. See ADR-074 §2 and docs/contracts/env-dimension.md.
|
|
129
|
-
env:
|
|
189
|
+
env: z3.string().optional(),
|
|
130
190
|
// Framework recorded by the static extractor when the install plan
|
|
131
191
|
// dispatches a framework-specific path (Next.js, Remix, SvelteKit, Nuxt,
|
|
132
192
|
// Astro). Optional enrichment — `undefined` for lib-only packages and
|
|
133
193
|
// ambiguous repos. See ADR-074 §3 / docs/contracts/framework-installers.md.
|
|
134
|
-
framework:
|
|
194
|
+
framework: z3.string().optional(),
|
|
135
195
|
// The hosting platform a static extractor recognized this service as
|
|
136
196
|
// deployed to (`'cloudflare'` today) — a free string, same discipline as
|
|
137
197
|
// `framework`, so a future platform needs no schema change. This is the
|
|
138
198
|
// frontend's icon key at the service-rollup level (ADR-133,
|
|
139
199
|
// docs/contracts/static-extraction.md).
|
|
140
|
-
platform:
|
|
200
|
+
platform: z3.string().optional(),
|
|
141
201
|
discoveredVia: DiscoveredViaSchema.optional(),
|
|
142
|
-
version:
|
|
143
|
-
dbConnectionTarget:
|
|
144
|
-
repoPath:
|
|
145
|
-
owner:
|
|
146
|
-
dependencies:
|
|
202
|
+
version: z3.string().optional(),
|
|
203
|
+
dbConnectionTarget: z3.string().optional(),
|
|
204
|
+
repoPath: z3.string().optional(),
|
|
205
|
+
owner: z3.string().optional(),
|
|
206
|
+
dependencies: z3.record(z3.string(), z3.string()).optional(),
|
|
147
207
|
// Hostnames OTel spans might mention for this service: compose service
|
|
148
208
|
// names, k8s metadata.name (and the cluster-DNS variants), Dockerfile
|
|
149
209
|
// labels, etc. resolveServiceId in ingest.ts checks these before falling
|
|
150
210
|
// back to a FRONTIER placeholder.
|
|
151
|
-
aliases:
|
|
211
|
+
aliases: z3.array(z3.string()).optional(),
|
|
152
212
|
// Optional. If set, services declare their `engines.node` here so γ #74's
|
|
153
213
|
// node-engine compat check has something to test against.
|
|
154
|
-
nodeEngine:
|
|
155
|
-
incompatibilities:
|
|
214
|
+
nodeEngine: z3.string().optional(),
|
|
215
|
+
incompatibilities: z3.array(
|
|
156
216
|
// Discriminated by `kind`. `driver-engine` is the original shape and
|
|
157
217
|
// stays default for backward compatibility — older snapshots without a
|
|
158
218
|
// `kind` field still parse via the union's `.optional()` discriminator
|
|
159
219
|
// fallback. New kinds came in with γ #74.
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
kind:
|
|
163
|
-
driver:
|
|
164
|
-
driverVersion:
|
|
165
|
-
engine:
|
|
166
|
-
engineVersion:
|
|
167
|
-
reason:
|
|
220
|
+
z3.union([
|
|
221
|
+
z3.object({
|
|
222
|
+
kind: z3.literal("driver-engine").optional(),
|
|
223
|
+
driver: z3.string(),
|
|
224
|
+
driverVersion: z3.string(),
|
|
225
|
+
engine: z3.string(),
|
|
226
|
+
engineVersion: z3.string(),
|
|
227
|
+
reason: z3.string()
|
|
168
228
|
}),
|
|
169
|
-
|
|
170
|
-
kind:
|
|
171
|
-
package:
|
|
172
|
-
packageVersion:
|
|
173
|
-
requiredNodeVersion:
|
|
174
|
-
declaredNodeEngine:
|
|
175
|
-
reason:
|
|
229
|
+
z3.object({
|
|
230
|
+
kind: z3.literal("node-engine"),
|
|
231
|
+
package: z3.string(),
|
|
232
|
+
packageVersion: z3.string().optional(),
|
|
233
|
+
requiredNodeVersion: z3.string(),
|
|
234
|
+
declaredNodeEngine: z3.string().optional(),
|
|
235
|
+
reason: z3.string()
|
|
176
236
|
}),
|
|
177
|
-
|
|
178
|
-
kind:
|
|
179
|
-
package:
|
|
180
|
-
packageVersion:
|
|
181
|
-
requires:
|
|
182
|
-
name:
|
|
183
|
-
minVersion:
|
|
237
|
+
z3.object({
|
|
238
|
+
kind: z3.literal("package-conflict"),
|
|
239
|
+
package: z3.string(),
|
|
240
|
+
packageVersion: z3.string().optional(),
|
|
241
|
+
requires: z3.object({
|
|
242
|
+
name: z3.string(),
|
|
243
|
+
minVersion: z3.string()
|
|
184
244
|
}),
|
|
185
|
-
foundVersion:
|
|
186
|
-
reason:
|
|
245
|
+
foundVersion: z3.string().optional(),
|
|
246
|
+
reason: z3.string()
|
|
187
247
|
}),
|
|
188
|
-
|
|
189
|
-
kind:
|
|
190
|
-
package:
|
|
191
|
-
packageVersion:
|
|
192
|
-
reason:
|
|
248
|
+
z3.object({
|
|
249
|
+
kind: z3.literal("deprecated-api"),
|
|
250
|
+
package: z3.string(),
|
|
251
|
+
packageVersion: z3.string().optional(),
|
|
252
|
+
reason: z3.string()
|
|
193
253
|
})
|
|
194
254
|
])
|
|
195
255
|
).optional()
|
|
196
256
|
});
|
|
197
|
-
var DatabaseNodeSchema =
|
|
198
|
-
id:
|
|
199
|
-
type:
|
|
200
|
-
name:
|
|
201
|
-
engine:
|
|
202
|
-
engineVersion:
|
|
203
|
-
compatibleDrivers:
|
|
204
|
-
host:
|
|
205
|
-
port:
|
|
257
|
+
var DatabaseNodeSchema = z3.object({
|
|
258
|
+
id: z3.string(),
|
|
259
|
+
type: z3.literal(NodeType.DatabaseNode),
|
|
260
|
+
name: z3.string(),
|
|
261
|
+
engine: z3.string(),
|
|
262
|
+
engineVersion: z3.string(),
|
|
263
|
+
compatibleDrivers: z3.array(CompatibleDriverSchema),
|
|
264
|
+
host: z3.string().optional(),
|
|
265
|
+
port: z3.number().optional(),
|
|
206
266
|
discoveredVia: DiscoveredViaSchema.optional()
|
|
207
267
|
});
|
|
208
|
-
var ConfigNodeSchema =
|
|
209
|
-
id:
|
|
210
|
-
type:
|
|
211
|
-
name:
|
|
212
|
-
path:
|
|
213
|
-
fileType:
|
|
268
|
+
var ConfigNodeSchema = z3.object({
|
|
269
|
+
id: z3.string(),
|
|
270
|
+
type: z3.literal(NodeType.ConfigNode),
|
|
271
|
+
name: z3.string(),
|
|
272
|
+
path: z3.string(),
|
|
273
|
+
fileType: z3.string()
|
|
214
274
|
});
|
|
215
|
-
var
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
provider: z2.string(),
|
|
220
|
-
region: z2.string().optional(),
|
|
221
|
-
kind: z2.string().optional()
|
|
275
|
+
var ColumnAttrSchema = z3.object({
|
|
276
|
+
name: z3.string(),
|
|
277
|
+
provenances: z3.array(ProvenanceSchema),
|
|
278
|
+
confidence: z3.number().min(0).max(1)
|
|
222
279
|
});
|
|
223
|
-
var
|
|
224
|
-
id:
|
|
225
|
-
type:
|
|
226
|
-
name:
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
280
|
+
var InfraNodeSchema = z3.object({
|
|
281
|
+
id: z3.string(),
|
|
282
|
+
type: z3.literal(NodeType.InfraNode),
|
|
283
|
+
name: z3.string(),
|
|
284
|
+
provider: z3.string(),
|
|
285
|
+
region: z3.string().optional(),
|
|
286
|
+
kind: z3.string().optional(),
|
|
287
|
+
// Column-grain attributes on a table InfraNode (`sql-table`, `supabase-table`).
|
|
288
|
+
// Absent on a non-table InfraNode (a project node, a queue, a route). Optional
|
|
289
|
+
// schema growth (ADR-031); ADR-157 stamps the snapshot version because the field
|
|
290
|
+
// records a new grain the graph can now carry. See docs/contracts/schema.md.
|
|
291
|
+
columns: z3.array(ColumnAttrSchema).optional()
|
|
230
292
|
});
|
|
231
|
-
var
|
|
232
|
-
id:
|
|
233
|
-
type:
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
293
|
+
var FrontierNodeSchema = z3.object({
|
|
294
|
+
id: z3.string(),
|
|
295
|
+
type: z3.literal(NodeType.FrontierNode),
|
|
296
|
+
name: z3.string(),
|
|
297
|
+
host: z3.string(),
|
|
298
|
+
firstObserved: z3.string().datetime().optional(),
|
|
299
|
+
lastObserved: z3.string().datetime().optional()
|
|
300
|
+
});
|
|
301
|
+
var FileNodeSchema = z3.object({
|
|
302
|
+
id: z3.string(),
|
|
303
|
+
type: z3.literal(NodeType.FileNode),
|
|
304
|
+
service: z3.string(),
|
|
305
|
+
path: z3.string(),
|
|
306
|
+
language: z3.string().optional(),
|
|
237
307
|
discoveredVia: DiscoveredViaSchema.optional(),
|
|
238
308
|
// The raw compiled `dist/...js` frame an OBSERVED call site was captured on,
|
|
239
309
|
// preserved for diagnostic when ingest resolved it through a source map to
|
|
240
310
|
// this original `src/...ts` (file-awareness.md §4 / `code.original_filepath`).
|
|
241
311
|
// Absent when the call site was already source-grained.
|
|
242
|
-
originalPath:
|
|
312
|
+
originalPath: z3.string().optional(),
|
|
243
313
|
// The hosting platform this file is the entry point for (`'cloudflare'`
|
|
244
314
|
// today) — set on a Worker/Pages-Function's entry file only, mirroring
|
|
245
315
|
// ServiceNode's own `platform` field. See `platformName` below.
|
|
246
|
-
platform:
|
|
316
|
+
platform: z3.string().optional(),
|
|
247
317
|
// The platform's own name for this file's service, when the platform names
|
|
248
318
|
// things differently than NEAT's manifest-derived serviceId (a Cloudflare
|
|
249
319
|
// Worker's wrangler.toml/jsonc `name`, not `package.json#name`). This is the
|
|
@@ -251,67 +321,67 @@ var FileNodeSchema = z2.object({
|
|
|
251
321
|
// connector's resolveTarget looks up against to fuse an OBSERVED signal onto
|
|
252
322
|
// this exact FileNode (ADR-133, docs/contracts/static-extraction.md /
|
|
253
323
|
// docs/contracts/connectors.md).
|
|
254
|
-
platformName:
|
|
324
|
+
platformName: z3.string().optional()
|
|
255
325
|
});
|
|
256
|
-
var RouteNodeSchema =
|
|
257
|
-
id:
|
|
258
|
-
type:
|
|
259
|
-
name:
|
|
260
|
-
service:
|
|
261
|
-
method:
|
|
262
|
-
pathTemplate:
|
|
263
|
-
path:
|
|
264
|
-
line:
|
|
265
|
-
framework:
|
|
326
|
+
var RouteNodeSchema = z3.object({
|
|
327
|
+
id: z3.string(),
|
|
328
|
+
type: z3.literal(NodeType.RouteNode),
|
|
329
|
+
name: z3.string(),
|
|
330
|
+
service: z3.string(),
|
|
331
|
+
method: z3.string(),
|
|
332
|
+
pathTemplate: z3.string(),
|
|
333
|
+
path: z3.string(),
|
|
334
|
+
line: z3.number().int().nonnegative().optional(),
|
|
335
|
+
framework: z3.string().optional(),
|
|
266
336
|
discoveredVia: DiscoveredViaSchema.optional()
|
|
267
337
|
});
|
|
268
|
-
var GraphQLOperationNodeSchema =
|
|
269
|
-
id:
|
|
270
|
-
type:
|
|
271
|
-
name:
|
|
272
|
-
service:
|
|
273
|
-
operationType:
|
|
274
|
-
operationName:
|
|
275
|
-
path:
|
|
276
|
-
line:
|
|
338
|
+
var GraphQLOperationNodeSchema = z3.object({
|
|
339
|
+
id: z3.string(),
|
|
340
|
+
type: z3.literal(NodeType.GraphQLOperationNode),
|
|
341
|
+
name: z3.string(),
|
|
342
|
+
service: z3.string(),
|
|
343
|
+
operationType: z3.string(),
|
|
344
|
+
operationName: z3.string(),
|
|
345
|
+
path: z3.string().optional(),
|
|
346
|
+
line: z3.number().int().nonnegative().optional(),
|
|
277
347
|
discoveredVia: DiscoveredViaSchema.optional()
|
|
278
348
|
});
|
|
279
|
-
var GrpcMethodNodeSchema =
|
|
280
|
-
id:
|
|
281
|
-
type:
|
|
282
|
-
name:
|
|
283
|
-
rpcService:
|
|
284
|
-
rpcMethod:
|
|
285
|
-
path:
|
|
286
|
-
line:
|
|
349
|
+
var GrpcMethodNodeSchema = z3.object({
|
|
350
|
+
id: z3.string(),
|
|
351
|
+
type: z3.literal(NodeType.GrpcMethodNode),
|
|
352
|
+
name: z3.string(),
|
|
353
|
+
rpcService: z3.string(),
|
|
354
|
+
rpcMethod: z3.string(),
|
|
355
|
+
path: z3.string().optional(),
|
|
356
|
+
line: z3.number().int().nonnegative().optional(),
|
|
287
357
|
discoveredVia: DiscoveredViaSchema.optional()
|
|
288
358
|
});
|
|
289
|
-
var WebSocketChannelNodeSchema =
|
|
290
|
-
id:
|
|
291
|
-
type:
|
|
292
|
-
name:
|
|
293
|
-
service:
|
|
294
|
-
channel:
|
|
295
|
-
path:
|
|
296
|
-
line:
|
|
359
|
+
var WebSocketChannelNodeSchema = z3.object({
|
|
360
|
+
id: z3.string(),
|
|
361
|
+
type: z3.literal(NodeType.WebSocketChannelNode),
|
|
362
|
+
name: z3.string(),
|
|
363
|
+
service: z3.string(),
|
|
364
|
+
channel: z3.string(),
|
|
365
|
+
path: z3.string().optional(),
|
|
366
|
+
line: z3.number().int().nonnegative().optional(),
|
|
297
367
|
discoveredVia: DiscoveredViaSchema.optional()
|
|
298
368
|
});
|
|
299
|
-
var SymbolKindSchema =
|
|
300
|
-
var SymbolSpanSchema =
|
|
301
|
-
startLine:
|
|
302
|
-
endLine:
|
|
369
|
+
var SymbolKindSchema = z3.enum(["function", "method", "constructor", "class"]);
|
|
370
|
+
var SymbolSpanSchema = z3.object({
|
|
371
|
+
startLine: z3.number().int().nonnegative(),
|
|
372
|
+
endLine: z3.number().int().nonnegative()
|
|
303
373
|
});
|
|
304
|
-
var SymbolNodeSchema =
|
|
305
|
-
id:
|
|
306
|
-
type:
|
|
374
|
+
var SymbolNodeSchema = z3.object({
|
|
375
|
+
id: z3.string(),
|
|
376
|
+
type: z3.literal(NodeType.SymbolNode),
|
|
307
377
|
kind: SymbolKindSchema,
|
|
308
|
-
qualname:
|
|
378
|
+
qualname: z3.string(),
|
|
309
379
|
span: SymbolSpanSchema,
|
|
310
|
-
service:
|
|
311
|
-
relPath:
|
|
380
|
+
service: z3.string(),
|
|
381
|
+
relPath: z3.string(),
|
|
312
382
|
discoveredVia: DiscoveredViaSchema.optional()
|
|
313
383
|
});
|
|
314
|
-
var GraphNodeSchema =
|
|
384
|
+
var GraphNodeSchema = z3.discriminatedUnion("type", [
|
|
315
385
|
ServiceNodeSchema,
|
|
316
386
|
DatabaseNodeSchema,
|
|
317
387
|
ConfigNodeSchema,
|
|
@@ -325,64 +395,6 @@ var GraphNodeSchema = z2.discriminatedUnion("type", [
|
|
|
325
395
|
SymbolNodeSchema
|
|
326
396
|
]);
|
|
327
397
|
|
|
328
|
-
// src/edges.ts
|
|
329
|
-
import { z as z3 } from "zod";
|
|
330
|
-
var ProvenanceSchema = z3.enum([
|
|
331
|
-
Provenance.EXTRACTED,
|
|
332
|
-
Provenance.INFERRED,
|
|
333
|
-
Provenance.OBSERVED,
|
|
334
|
-
Provenance.STALE
|
|
335
|
-
]);
|
|
336
|
-
var EdgeTypeSchema = z3.enum([
|
|
337
|
-
EdgeType.CALLS,
|
|
338
|
-
EdgeType.DEPENDS_ON,
|
|
339
|
-
EdgeType.CONNECTS_TO,
|
|
340
|
-
EdgeType.CONFIGURED_BY,
|
|
341
|
-
EdgeType.PUBLISHES_TO,
|
|
342
|
-
EdgeType.CONSUMES_FROM,
|
|
343
|
-
EdgeType.RUNS_ON,
|
|
344
|
-
EdgeType.CONTAINS,
|
|
345
|
-
EdgeType.IMPORTS,
|
|
346
|
-
EdgeType.INHERITS,
|
|
347
|
-
EdgeType.IMPLEMENTS
|
|
348
|
-
]);
|
|
349
|
-
var EdgeEvidenceSchema = z3.object({
|
|
350
|
-
file: z3.string(),
|
|
351
|
-
line: z3.number().int().nonnegative().optional(),
|
|
352
|
-
snippet: z3.string().optional(),
|
|
353
|
-
// HTTP shape of a recognised client call site (ADR-119). Present on a
|
|
354
|
-
// client↔route CALLS edge so the edge records the method + path-template the
|
|
355
|
-
// client named, alongside the file:line it named them at. Absent on every
|
|
356
|
-
// other edge — a config or infra edge has no HTTP method.
|
|
357
|
-
method: z3.string().optional(),
|
|
358
|
-
pathTemplate: z3.string().optional()
|
|
359
|
-
});
|
|
360
|
-
var EdgeSignalSchema = z3.object({
|
|
361
|
-
spanCount: z3.number().int().nonnegative(),
|
|
362
|
-
errorCount: z3.number().int().nonnegative(),
|
|
363
|
-
lastObservedAgeMs: z3.number().nonnegative().optional()
|
|
364
|
-
});
|
|
365
|
-
var GraphEdgeSchema = z3.object({
|
|
366
|
-
id: z3.string(),
|
|
367
|
-
source: z3.string(),
|
|
368
|
-
target: z3.string(),
|
|
369
|
-
type: EdgeTypeSchema,
|
|
370
|
-
provenance: ProvenanceSchema,
|
|
371
|
-
confidence: z3.number().min(0).max(1).optional(),
|
|
372
|
-
lastObserved: z3.string().datetime().optional(),
|
|
373
|
-
callCount: z3.number().int().nonnegative().optional(),
|
|
374
|
-
evidence: EdgeEvidenceSchema.optional(),
|
|
375
|
-
signal: EdgeSignalSchema.optional(),
|
|
376
|
-
// OBSERVED grain (ADR-142): `file` when the edge originates from a source
|
|
377
|
-
// file's call site (a `file:` source + `evidence`), `service` for the coarse
|
|
378
|
-
// fallback where no call site was captured. Makes "service-grained only as a
|
|
379
|
-
// labeled fallback" (connector gate #803) a stored, machine-readable fact
|
|
380
|
-
// instead of a re-derivation from the source prefix. `.optional()` — EXTRACTED
|
|
381
|
-
// edges and legacy snapshots carry none; an OBSERVED edge is backfilled on its
|
|
382
|
-
// next observation.
|
|
383
|
-
grain: z3.enum(["file", "service"]).optional()
|
|
384
|
-
});
|
|
385
|
-
|
|
386
398
|
// src/events.ts
|
|
387
399
|
import { z as z4 } from "zod";
|
|
388
400
|
var SpanAttributesSchema = z4.record(
|
|
@@ -902,14 +914,20 @@ var commonFields = {
|
|
|
902
914
|
var MissingObservedDivergenceSchema = z8.object({
|
|
903
915
|
type: z8.literal("missing-observed"),
|
|
904
916
|
...commonFields,
|
|
905
|
-
edgeType: EdgeTypeSchema,
|
|
906
|
-
extracted: GraphEdgeSchema
|
|
917
|
+
edgeType: EdgeTypeSchema.optional(),
|
|
918
|
+
extracted: GraphEdgeSchema.optional(),
|
|
919
|
+
// Column locus (ADR-157 §4): the `sql-table` node id and the declared-only column.
|
|
920
|
+
table: z8.string().optional(),
|
|
921
|
+
column: z8.string().optional()
|
|
907
922
|
});
|
|
908
923
|
var MissingExtractedDivergenceSchema = z8.object({
|
|
909
924
|
type: z8.literal("missing-extracted"),
|
|
910
925
|
...commonFields,
|
|
911
|
-
edgeType: EdgeTypeSchema,
|
|
912
|
-
observed: GraphEdgeSchema
|
|
926
|
+
edgeType: EdgeTypeSchema.optional(),
|
|
927
|
+
observed: GraphEdgeSchema.optional(),
|
|
928
|
+
// Column locus (ADR-157 §4): the `sql-table` node id and the observed-only column.
|
|
929
|
+
table: z8.string().optional(),
|
|
930
|
+
column: z8.string().optional()
|
|
913
931
|
});
|
|
914
932
|
var CompatibilityVerdictSchema = z8.enum(["incompatible", "deprecated", "unknown"]);
|
|
915
933
|
var VersionMismatchDivergenceSchema = z8.object({
|
|
@@ -1162,6 +1180,7 @@ export {
|
|
|
1162
1180
|
BlastRadiusResultSchema,
|
|
1163
1181
|
BlastRadiusRuleSchema,
|
|
1164
1182
|
CheckPoliciesScopeSchema,
|
|
1183
|
+
ColumnAttrSchema,
|
|
1165
1184
|
CompatRuleRefSchema,
|
|
1166
1185
|
CompatViolationDivergenceSchema,
|
|
1167
1186
|
CompatibilityRuleSchema,
|