@neat.is/types 0.7.0 → 0.7.2
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.cjs
CHANGED
|
@@ -26,6 +26,7 @@ __export(index_exports, {
|
|
|
26
26
|
BlastRadiusResultSchema: () => BlastRadiusResultSchema,
|
|
27
27
|
BlastRadiusRuleSchema: () => BlastRadiusRuleSchema,
|
|
28
28
|
CheckPoliciesScopeSchema: () => CheckPoliciesScopeSchema,
|
|
29
|
+
ColumnAttrSchema: () => ColumnAttrSchema,
|
|
29
30
|
CompatRuleRefSchema: () => CompatRuleRefSchema,
|
|
30
31
|
CompatViolationDivergenceSchema: () => CompatViolationDivergenceSchema,
|
|
31
32
|
CompatibilityRuleSchema: () => CompatibilityRuleSchema,
|
|
@@ -258,141 +259,211 @@ var NodeTypeSchema = import_zod.z.enum([
|
|
|
258
259
|
]);
|
|
259
260
|
|
|
260
261
|
// src/nodes.ts
|
|
262
|
+
var import_zod3 = require("zod");
|
|
263
|
+
|
|
264
|
+
// src/edges.ts
|
|
261
265
|
var import_zod2 = require("zod");
|
|
262
|
-
var
|
|
263
|
-
|
|
264
|
-
|
|
266
|
+
var ProvenanceSchema = import_zod2.z.enum([
|
|
267
|
+
Provenance.EXTRACTED,
|
|
268
|
+
Provenance.INFERRED,
|
|
269
|
+
Provenance.OBSERVED,
|
|
270
|
+
Provenance.STALE
|
|
271
|
+
]);
|
|
272
|
+
var EdgeTypeSchema = import_zod2.z.enum([
|
|
273
|
+
EdgeType.CALLS,
|
|
274
|
+
EdgeType.DEPENDS_ON,
|
|
275
|
+
EdgeType.CONNECTS_TO,
|
|
276
|
+
EdgeType.CONFIGURED_BY,
|
|
277
|
+
EdgeType.PUBLISHES_TO,
|
|
278
|
+
EdgeType.CONSUMES_FROM,
|
|
279
|
+
EdgeType.RUNS_ON,
|
|
280
|
+
EdgeType.CONTAINS,
|
|
281
|
+
EdgeType.IMPORTS,
|
|
282
|
+
EdgeType.INHERITS,
|
|
283
|
+
EdgeType.IMPLEMENTS
|
|
284
|
+
]);
|
|
285
|
+
var EdgeEvidenceSchema = import_zod2.z.object({
|
|
286
|
+
file: import_zod2.z.string(),
|
|
287
|
+
line: import_zod2.z.number().int().nonnegative().optional(),
|
|
288
|
+
snippet: import_zod2.z.string().optional(),
|
|
289
|
+
// HTTP shape of a recognised client call site (ADR-119). Present on a
|
|
290
|
+
// client↔route CALLS edge so the edge records the method + path-template the
|
|
291
|
+
// client named, alongside the file:line it named them at. Absent on every
|
|
292
|
+
// other edge — a config or infra edge has no HTTP method.
|
|
293
|
+
method: import_zod2.z.string().optional(),
|
|
294
|
+
pathTemplate: import_zod2.z.string().optional()
|
|
295
|
+
});
|
|
296
|
+
var EdgeSignalSchema = import_zod2.z.object({
|
|
297
|
+
spanCount: import_zod2.z.number().int().nonnegative(),
|
|
298
|
+
errorCount: import_zod2.z.number().int().nonnegative(),
|
|
299
|
+
lastObservedAgeMs: import_zod2.z.number().nonnegative().optional()
|
|
265
300
|
});
|
|
266
|
-
var
|
|
267
|
-
var ServiceNodeSchema = import_zod2.z.object({
|
|
301
|
+
var GraphEdgeSchema = import_zod2.z.object({
|
|
268
302
|
id: import_zod2.z.string(),
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
303
|
+
source: import_zod2.z.string(),
|
|
304
|
+
target: import_zod2.z.string(),
|
|
305
|
+
type: EdgeTypeSchema,
|
|
306
|
+
provenance: ProvenanceSchema,
|
|
307
|
+
confidence: import_zod2.z.number().min(0).max(1).optional(),
|
|
308
|
+
lastObserved: import_zod2.z.string().datetime().optional(),
|
|
309
|
+
callCount: import_zod2.z.number().int().nonnegative().optional(),
|
|
310
|
+
evidence: EdgeEvidenceSchema.optional(),
|
|
311
|
+
signal: EdgeSignalSchema.optional(),
|
|
312
|
+
// OBSERVED grain (ADR-142): `file` when the edge originates from a source
|
|
313
|
+
// file's call site (a `file:` source + `evidence`), `service` for the coarse
|
|
314
|
+
// fallback where no call site was captured. Makes "service-grained only as a
|
|
315
|
+
// labeled fallback" (connector gate #803) a stored, machine-readable fact
|
|
316
|
+
// instead of a re-derivation from the source prefix. `.optional()` — EXTRACTED
|
|
317
|
+
// edges and legacy snapshots carry none; an OBSERVED edge is backfilled on its
|
|
318
|
+
// next observation.
|
|
319
|
+
grain: import_zod2.z.enum(["file", "service"]).optional()
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
// src/nodes.ts
|
|
323
|
+
var CompatibleDriverSchema = import_zod3.z.object({
|
|
324
|
+
name: import_zod3.z.string(),
|
|
325
|
+
minVersion: import_zod3.z.string()
|
|
326
|
+
});
|
|
327
|
+
var DiscoveredViaSchema = import_zod3.z.enum(["static", "otel", "merged"]);
|
|
328
|
+
var ServiceNodeSchema = import_zod3.z.object({
|
|
329
|
+
id: import_zod3.z.string(),
|
|
330
|
+
type: import_zod3.z.literal(NodeType.ServiceNode),
|
|
331
|
+
name: import_zod3.z.string(),
|
|
332
|
+
language: import_zod3.z.string(),
|
|
272
333
|
// Deployment environment from the OTel `deployment.environment.name` attr
|
|
273
334
|
// (with `deployment.environment` and resource-attr fallbacks). The literal
|
|
274
335
|
// `'unknown'` is the honest sentinel when no env signal is present; static
|
|
275
336
|
// extraction never sees env at extract time, so its ServiceNodes carry
|
|
276
337
|
// `undefined` here and the id stays in the env-less wire format
|
|
277
338
|
// `service:<name>`. See ADR-074 §2 and docs/contracts/env-dimension.md.
|
|
278
|
-
env:
|
|
339
|
+
env: import_zod3.z.string().optional(),
|
|
279
340
|
// Framework recorded by the static extractor when the install plan
|
|
280
341
|
// dispatches a framework-specific path (Next.js, Remix, SvelteKit, Nuxt,
|
|
281
342
|
// Astro). Optional enrichment — `undefined` for lib-only packages and
|
|
282
343
|
// ambiguous repos. See ADR-074 §3 / docs/contracts/framework-installers.md.
|
|
283
|
-
framework:
|
|
344
|
+
framework: import_zod3.z.string().optional(),
|
|
284
345
|
// The hosting platform a static extractor recognized this service as
|
|
285
346
|
// deployed to (`'cloudflare'` today) — a free string, same discipline as
|
|
286
347
|
// `framework`, so a future platform needs no schema change. This is the
|
|
287
348
|
// frontend's icon key at the service-rollup level (ADR-133,
|
|
288
349
|
// docs/contracts/static-extraction.md).
|
|
289
|
-
platform:
|
|
350
|
+
platform: import_zod3.z.string().optional(),
|
|
290
351
|
discoveredVia: DiscoveredViaSchema.optional(),
|
|
291
|
-
version:
|
|
292
|
-
dbConnectionTarget:
|
|
293
|
-
repoPath:
|
|
294
|
-
owner:
|
|
295
|
-
dependencies:
|
|
352
|
+
version: import_zod3.z.string().optional(),
|
|
353
|
+
dbConnectionTarget: import_zod3.z.string().optional(),
|
|
354
|
+
repoPath: import_zod3.z.string().optional(),
|
|
355
|
+
owner: import_zod3.z.string().optional(),
|
|
356
|
+
dependencies: import_zod3.z.record(import_zod3.z.string(), import_zod3.z.string()).optional(),
|
|
296
357
|
// Hostnames OTel spans might mention for this service: compose service
|
|
297
358
|
// names, k8s metadata.name (and the cluster-DNS variants), Dockerfile
|
|
298
359
|
// labels, etc. resolveServiceId in ingest.ts checks these before falling
|
|
299
360
|
// back to a FRONTIER placeholder.
|
|
300
|
-
aliases:
|
|
361
|
+
aliases: import_zod3.z.array(import_zod3.z.string()).optional(),
|
|
301
362
|
// Optional. If set, services declare their `engines.node` here so γ #74's
|
|
302
363
|
// node-engine compat check has something to test against.
|
|
303
|
-
nodeEngine:
|
|
304
|
-
incompatibilities:
|
|
364
|
+
nodeEngine: import_zod3.z.string().optional(),
|
|
365
|
+
incompatibilities: import_zod3.z.array(
|
|
305
366
|
// Discriminated by `kind`. `driver-engine` is the original shape and
|
|
306
367
|
// stays default for backward compatibility — older snapshots without a
|
|
307
368
|
// `kind` field still parse via the union's `.optional()` discriminator
|
|
308
369
|
// fallback. New kinds came in with γ #74.
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
kind:
|
|
312
|
-
driver:
|
|
313
|
-
driverVersion:
|
|
314
|
-
engine:
|
|
315
|
-
engineVersion:
|
|
316
|
-
reason:
|
|
370
|
+
import_zod3.z.union([
|
|
371
|
+
import_zod3.z.object({
|
|
372
|
+
kind: import_zod3.z.literal("driver-engine").optional(),
|
|
373
|
+
driver: import_zod3.z.string(),
|
|
374
|
+
driverVersion: import_zod3.z.string(),
|
|
375
|
+
engine: import_zod3.z.string(),
|
|
376
|
+
engineVersion: import_zod3.z.string(),
|
|
377
|
+
reason: import_zod3.z.string()
|
|
317
378
|
}),
|
|
318
|
-
|
|
319
|
-
kind:
|
|
320
|
-
package:
|
|
321
|
-
packageVersion:
|
|
322
|
-
requiredNodeVersion:
|
|
323
|
-
declaredNodeEngine:
|
|
324
|
-
reason:
|
|
379
|
+
import_zod3.z.object({
|
|
380
|
+
kind: import_zod3.z.literal("node-engine"),
|
|
381
|
+
package: import_zod3.z.string(),
|
|
382
|
+
packageVersion: import_zod3.z.string().optional(),
|
|
383
|
+
requiredNodeVersion: import_zod3.z.string(),
|
|
384
|
+
declaredNodeEngine: import_zod3.z.string().optional(),
|
|
385
|
+
reason: import_zod3.z.string()
|
|
325
386
|
}),
|
|
326
|
-
|
|
327
|
-
kind:
|
|
328
|
-
package:
|
|
329
|
-
packageVersion:
|
|
330
|
-
requires:
|
|
331
|
-
name:
|
|
332
|
-
minVersion:
|
|
387
|
+
import_zod3.z.object({
|
|
388
|
+
kind: import_zod3.z.literal("package-conflict"),
|
|
389
|
+
package: import_zod3.z.string(),
|
|
390
|
+
packageVersion: import_zod3.z.string().optional(),
|
|
391
|
+
requires: import_zod3.z.object({
|
|
392
|
+
name: import_zod3.z.string(),
|
|
393
|
+
minVersion: import_zod3.z.string()
|
|
333
394
|
}),
|
|
334
|
-
foundVersion:
|
|
335
|
-
reason:
|
|
395
|
+
foundVersion: import_zod3.z.string().optional(),
|
|
396
|
+
reason: import_zod3.z.string()
|
|
336
397
|
}),
|
|
337
|
-
|
|
338
|
-
kind:
|
|
339
|
-
package:
|
|
340
|
-
packageVersion:
|
|
341
|
-
reason:
|
|
398
|
+
import_zod3.z.object({
|
|
399
|
+
kind: import_zod3.z.literal("deprecated-api"),
|
|
400
|
+
package: import_zod3.z.string(),
|
|
401
|
+
packageVersion: import_zod3.z.string().optional(),
|
|
402
|
+
reason: import_zod3.z.string()
|
|
342
403
|
})
|
|
343
404
|
])
|
|
344
405
|
).optional()
|
|
345
406
|
});
|
|
346
|
-
var DatabaseNodeSchema =
|
|
347
|
-
id:
|
|
348
|
-
type:
|
|
349
|
-
name:
|
|
350
|
-
engine:
|
|
351
|
-
engineVersion:
|
|
352
|
-
compatibleDrivers:
|
|
353
|
-
host:
|
|
354
|
-
port:
|
|
407
|
+
var DatabaseNodeSchema = import_zod3.z.object({
|
|
408
|
+
id: import_zod3.z.string(),
|
|
409
|
+
type: import_zod3.z.literal(NodeType.DatabaseNode),
|
|
410
|
+
name: import_zod3.z.string(),
|
|
411
|
+
engine: import_zod3.z.string(),
|
|
412
|
+
engineVersion: import_zod3.z.string(),
|
|
413
|
+
compatibleDrivers: import_zod3.z.array(CompatibleDriverSchema),
|
|
414
|
+
host: import_zod3.z.string().optional(),
|
|
415
|
+
port: import_zod3.z.number().optional(),
|
|
355
416
|
discoveredVia: DiscoveredViaSchema.optional()
|
|
356
417
|
});
|
|
357
|
-
var ConfigNodeSchema =
|
|
358
|
-
id:
|
|
359
|
-
type:
|
|
360
|
-
name:
|
|
361
|
-
path:
|
|
362
|
-
fileType:
|
|
418
|
+
var ConfigNodeSchema = import_zod3.z.object({
|
|
419
|
+
id: import_zod3.z.string(),
|
|
420
|
+
type: import_zod3.z.literal(NodeType.ConfigNode),
|
|
421
|
+
name: import_zod3.z.string(),
|
|
422
|
+
path: import_zod3.z.string(),
|
|
423
|
+
fileType: import_zod3.z.string()
|
|
363
424
|
});
|
|
364
|
-
var
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
provider: import_zod2.z.string(),
|
|
369
|
-
region: import_zod2.z.string().optional(),
|
|
370
|
-
kind: import_zod2.z.string().optional()
|
|
425
|
+
var ColumnAttrSchema = import_zod3.z.object({
|
|
426
|
+
name: import_zod3.z.string(),
|
|
427
|
+
provenances: import_zod3.z.array(ProvenanceSchema),
|
|
428
|
+
confidence: import_zod3.z.number().min(0).max(1)
|
|
371
429
|
});
|
|
372
|
-
var
|
|
373
|
-
id:
|
|
374
|
-
type:
|
|
375
|
-
name:
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
430
|
+
var InfraNodeSchema = import_zod3.z.object({
|
|
431
|
+
id: import_zod3.z.string(),
|
|
432
|
+
type: import_zod3.z.literal(NodeType.InfraNode),
|
|
433
|
+
name: import_zod3.z.string(),
|
|
434
|
+
provider: import_zod3.z.string(),
|
|
435
|
+
region: import_zod3.z.string().optional(),
|
|
436
|
+
kind: import_zod3.z.string().optional(),
|
|
437
|
+
// Column-grain attributes on a table InfraNode (`sql-table`, `supabase-table`).
|
|
438
|
+
// Absent on a non-table InfraNode (a project node, a queue, a route). Optional
|
|
439
|
+
// schema growth (ADR-031); ADR-157 stamps the snapshot version because the field
|
|
440
|
+
// records a new grain the graph can now carry. See docs/contracts/schema.md.
|
|
441
|
+
columns: import_zod3.z.array(ColumnAttrSchema).optional()
|
|
379
442
|
});
|
|
380
|
-
var
|
|
381
|
-
id:
|
|
382
|
-
type:
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
443
|
+
var FrontierNodeSchema = import_zod3.z.object({
|
|
444
|
+
id: import_zod3.z.string(),
|
|
445
|
+
type: import_zod3.z.literal(NodeType.FrontierNode),
|
|
446
|
+
name: import_zod3.z.string(),
|
|
447
|
+
host: import_zod3.z.string(),
|
|
448
|
+
firstObserved: import_zod3.z.string().datetime().optional(),
|
|
449
|
+
lastObserved: import_zod3.z.string().datetime().optional()
|
|
450
|
+
});
|
|
451
|
+
var FileNodeSchema = import_zod3.z.object({
|
|
452
|
+
id: import_zod3.z.string(),
|
|
453
|
+
type: import_zod3.z.literal(NodeType.FileNode),
|
|
454
|
+
service: import_zod3.z.string(),
|
|
455
|
+
path: import_zod3.z.string(),
|
|
456
|
+
language: import_zod3.z.string().optional(),
|
|
386
457
|
discoveredVia: DiscoveredViaSchema.optional(),
|
|
387
458
|
// The raw compiled `dist/...js` frame an OBSERVED call site was captured on,
|
|
388
459
|
// preserved for diagnostic when ingest resolved it through a source map to
|
|
389
460
|
// this original `src/...ts` (file-awareness.md §4 / `code.original_filepath`).
|
|
390
461
|
// Absent when the call site was already source-grained.
|
|
391
|
-
originalPath:
|
|
462
|
+
originalPath: import_zod3.z.string().optional(),
|
|
392
463
|
// The hosting platform this file is the entry point for (`'cloudflare'`
|
|
393
464
|
// today) — set on a Worker/Pages-Function's entry file only, mirroring
|
|
394
465
|
// ServiceNode's own `platform` field. See `platformName` below.
|
|
395
|
-
platform:
|
|
466
|
+
platform: import_zod3.z.string().optional(),
|
|
396
467
|
// The platform's own name for this file's service, when the platform names
|
|
397
468
|
// things differently than NEAT's manifest-derived serviceId (a Cloudflare
|
|
398
469
|
// Worker's wrangler.toml/jsonc `name`, not `package.json#name`). This is the
|
|
@@ -400,67 +471,67 @@ var FileNodeSchema = import_zod2.z.object({
|
|
|
400
471
|
// connector's resolveTarget looks up against to fuse an OBSERVED signal onto
|
|
401
472
|
// this exact FileNode (ADR-133, docs/contracts/static-extraction.md /
|
|
402
473
|
// docs/contracts/connectors.md).
|
|
403
|
-
platformName:
|
|
474
|
+
platformName: import_zod3.z.string().optional()
|
|
404
475
|
});
|
|
405
|
-
var RouteNodeSchema =
|
|
406
|
-
id:
|
|
407
|
-
type:
|
|
408
|
-
name:
|
|
409
|
-
service:
|
|
410
|
-
method:
|
|
411
|
-
pathTemplate:
|
|
412
|
-
path:
|
|
413
|
-
line:
|
|
414
|
-
framework:
|
|
476
|
+
var RouteNodeSchema = import_zod3.z.object({
|
|
477
|
+
id: import_zod3.z.string(),
|
|
478
|
+
type: import_zod3.z.literal(NodeType.RouteNode),
|
|
479
|
+
name: import_zod3.z.string(),
|
|
480
|
+
service: import_zod3.z.string(),
|
|
481
|
+
method: import_zod3.z.string(),
|
|
482
|
+
pathTemplate: import_zod3.z.string(),
|
|
483
|
+
path: import_zod3.z.string(),
|
|
484
|
+
line: import_zod3.z.number().int().nonnegative().optional(),
|
|
485
|
+
framework: import_zod3.z.string().optional(),
|
|
415
486
|
discoveredVia: DiscoveredViaSchema.optional()
|
|
416
487
|
});
|
|
417
|
-
var GraphQLOperationNodeSchema =
|
|
418
|
-
id:
|
|
419
|
-
type:
|
|
420
|
-
name:
|
|
421
|
-
service:
|
|
422
|
-
operationType:
|
|
423
|
-
operationName:
|
|
424
|
-
path:
|
|
425
|
-
line:
|
|
488
|
+
var GraphQLOperationNodeSchema = import_zod3.z.object({
|
|
489
|
+
id: import_zod3.z.string(),
|
|
490
|
+
type: import_zod3.z.literal(NodeType.GraphQLOperationNode),
|
|
491
|
+
name: import_zod3.z.string(),
|
|
492
|
+
service: import_zod3.z.string(),
|
|
493
|
+
operationType: import_zod3.z.string(),
|
|
494
|
+
operationName: import_zod3.z.string(),
|
|
495
|
+
path: import_zod3.z.string().optional(),
|
|
496
|
+
line: import_zod3.z.number().int().nonnegative().optional(),
|
|
426
497
|
discoveredVia: DiscoveredViaSchema.optional()
|
|
427
498
|
});
|
|
428
|
-
var GrpcMethodNodeSchema =
|
|
429
|
-
id:
|
|
430
|
-
type:
|
|
431
|
-
name:
|
|
432
|
-
rpcService:
|
|
433
|
-
rpcMethod:
|
|
434
|
-
path:
|
|
435
|
-
line:
|
|
499
|
+
var GrpcMethodNodeSchema = import_zod3.z.object({
|
|
500
|
+
id: import_zod3.z.string(),
|
|
501
|
+
type: import_zod3.z.literal(NodeType.GrpcMethodNode),
|
|
502
|
+
name: import_zod3.z.string(),
|
|
503
|
+
rpcService: import_zod3.z.string(),
|
|
504
|
+
rpcMethod: import_zod3.z.string(),
|
|
505
|
+
path: import_zod3.z.string().optional(),
|
|
506
|
+
line: import_zod3.z.number().int().nonnegative().optional(),
|
|
436
507
|
discoveredVia: DiscoveredViaSchema.optional()
|
|
437
508
|
});
|
|
438
|
-
var WebSocketChannelNodeSchema =
|
|
439
|
-
id:
|
|
440
|
-
type:
|
|
441
|
-
name:
|
|
442
|
-
service:
|
|
443
|
-
channel:
|
|
444
|
-
path:
|
|
445
|
-
line:
|
|
509
|
+
var WebSocketChannelNodeSchema = import_zod3.z.object({
|
|
510
|
+
id: import_zod3.z.string(),
|
|
511
|
+
type: import_zod3.z.literal(NodeType.WebSocketChannelNode),
|
|
512
|
+
name: import_zod3.z.string(),
|
|
513
|
+
service: import_zod3.z.string(),
|
|
514
|
+
channel: import_zod3.z.string(),
|
|
515
|
+
path: import_zod3.z.string().optional(),
|
|
516
|
+
line: import_zod3.z.number().int().nonnegative().optional(),
|
|
446
517
|
discoveredVia: DiscoveredViaSchema.optional()
|
|
447
518
|
});
|
|
448
|
-
var SymbolKindSchema =
|
|
449
|
-
var SymbolSpanSchema =
|
|
450
|
-
startLine:
|
|
451
|
-
endLine:
|
|
519
|
+
var SymbolKindSchema = import_zod3.z.enum(["function", "method", "constructor", "class"]);
|
|
520
|
+
var SymbolSpanSchema = import_zod3.z.object({
|
|
521
|
+
startLine: import_zod3.z.number().int().nonnegative(),
|
|
522
|
+
endLine: import_zod3.z.number().int().nonnegative()
|
|
452
523
|
});
|
|
453
|
-
var SymbolNodeSchema =
|
|
454
|
-
id:
|
|
455
|
-
type:
|
|
524
|
+
var SymbolNodeSchema = import_zod3.z.object({
|
|
525
|
+
id: import_zod3.z.string(),
|
|
526
|
+
type: import_zod3.z.literal(NodeType.SymbolNode),
|
|
456
527
|
kind: SymbolKindSchema,
|
|
457
|
-
qualname:
|
|
528
|
+
qualname: import_zod3.z.string(),
|
|
458
529
|
span: SymbolSpanSchema,
|
|
459
|
-
service:
|
|
460
|
-
relPath:
|
|
530
|
+
service: import_zod3.z.string(),
|
|
531
|
+
relPath: import_zod3.z.string(),
|
|
461
532
|
discoveredVia: DiscoveredViaSchema.optional()
|
|
462
533
|
});
|
|
463
|
-
var GraphNodeSchema =
|
|
534
|
+
var GraphNodeSchema = import_zod3.z.discriminatedUnion("type", [
|
|
464
535
|
ServiceNodeSchema,
|
|
465
536
|
DatabaseNodeSchema,
|
|
466
537
|
ConfigNodeSchema,
|
|
@@ -474,64 +545,6 @@ var GraphNodeSchema = import_zod2.z.discriminatedUnion("type", [
|
|
|
474
545
|
SymbolNodeSchema
|
|
475
546
|
]);
|
|
476
547
|
|
|
477
|
-
// src/edges.ts
|
|
478
|
-
var import_zod3 = require("zod");
|
|
479
|
-
var ProvenanceSchema = import_zod3.z.enum([
|
|
480
|
-
Provenance.EXTRACTED,
|
|
481
|
-
Provenance.INFERRED,
|
|
482
|
-
Provenance.OBSERVED,
|
|
483
|
-
Provenance.STALE
|
|
484
|
-
]);
|
|
485
|
-
var EdgeTypeSchema = import_zod3.z.enum([
|
|
486
|
-
EdgeType.CALLS,
|
|
487
|
-
EdgeType.DEPENDS_ON,
|
|
488
|
-
EdgeType.CONNECTS_TO,
|
|
489
|
-
EdgeType.CONFIGURED_BY,
|
|
490
|
-
EdgeType.PUBLISHES_TO,
|
|
491
|
-
EdgeType.CONSUMES_FROM,
|
|
492
|
-
EdgeType.RUNS_ON,
|
|
493
|
-
EdgeType.CONTAINS,
|
|
494
|
-
EdgeType.IMPORTS,
|
|
495
|
-
EdgeType.INHERITS,
|
|
496
|
-
EdgeType.IMPLEMENTS
|
|
497
|
-
]);
|
|
498
|
-
var EdgeEvidenceSchema = import_zod3.z.object({
|
|
499
|
-
file: import_zod3.z.string(),
|
|
500
|
-
line: import_zod3.z.number().int().nonnegative().optional(),
|
|
501
|
-
snippet: import_zod3.z.string().optional(),
|
|
502
|
-
// HTTP shape of a recognised client call site (ADR-119). Present on a
|
|
503
|
-
// client↔route CALLS edge so the edge records the method + path-template the
|
|
504
|
-
// client named, alongside the file:line it named them at. Absent on every
|
|
505
|
-
// other edge — a config or infra edge has no HTTP method.
|
|
506
|
-
method: import_zod3.z.string().optional(),
|
|
507
|
-
pathTemplate: import_zod3.z.string().optional()
|
|
508
|
-
});
|
|
509
|
-
var EdgeSignalSchema = import_zod3.z.object({
|
|
510
|
-
spanCount: import_zod3.z.number().int().nonnegative(),
|
|
511
|
-
errorCount: import_zod3.z.number().int().nonnegative(),
|
|
512
|
-
lastObservedAgeMs: import_zod3.z.number().nonnegative().optional()
|
|
513
|
-
});
|
|
514
|
-
var GraphEdgeSchema = import_zod3.z.object({
|
|
515
|
-
id: import_zod3.z.string(),
|
|
516
|
-
source: import_zod3.z.string(),
|
|
517
|
-
target: import_zod3.z.string(),
|
|
518
|
-
type: EdgeTypeSchema,
|
|
519
|
-
provenance: ProvenanceSchema,
|
|
520
|
-
confidence: import_zod3.z.number().min(0).max(1).optional(),
|
|
521
|
-
lastObserved: import_zod3.z.string().datetime().optional(),
|
|
522
|
-
callCount: import_zod3.z.number().int().nonnegative().optional(),
|
|
523
|
-
evidence: EdgeEvidenceSchema.optional(),
|
|
524
|
-
signal: EdgeSignalSchema.optional(),
|
|
525
|
-
// OBSERVED grain (ADR-142): `file` when the edge originates from a source
|
|
526
|
-
// file's call site (a `file:` source + `evidence`), `service` for the coarse
|
|
527
|
-
// fallback where no call site was captured. Makes "service-grained only as a
|
|
528
|
-
// labeled fallback" (connector gate #803) a stored, machine-readable fact
|
|
529
|
-
// instead of a re-derivation from the source prefix. `.optional()` — EXTRACTED
|
|
530
|
-
// edges and legacy snapshots carry none; an OBSERVED edge is backfilled on its
|
|
531
|
-
// next observation.
|
|
532
|
-
grain: import_zod3.z.enum(["file", "service"]).optional()
|
|
533
|
-
});
|
|
534
|
-
|
|
535
548
|
// src/events.ts
|
|
536
549
|
var import_zod4 = require("zod");
|
|
537
550
|
var SpanAttributesSchema = import_zod4.z.record(
|
|
@@ -1051,14 +1064,20 @@ var commonFields = {
|
|
|
1051
1064
|
var MissingObservedDivergenceSchema = import_zod8.z.object({
|
|
1052
1065
|
type: import_zod8.z.literal("missing-observed"),
|
|
1053
1066
|
...commonFields,
|
|
1054
|
-
edgeType: EdgeTypeSchema,
|
|
1055
|
-
extracted: GraphEdgeSchema
|
|
1067
|
+
edgeType: EdgeTypeSchema.optional(),
|
|
1068
|
+
extracted: GraphEdgeSchema.optional(),
|
|
1069
|
+
// Column locus (ADR-157 §4): the `sql-table` node id and the declared-only column.
|
|
1070
|
+
table: import_zod8.z.string().optional(),
|
|
1071
|
+
column: import_zod8.z.string().optional()
|
|
1056
1072
|
});
|
|
1057
1073
|
var MissingExtractedDivergenceSchema = import_zod8.z.object({
|
|
1058
1074
|
type: import_zod8.z.literal("missing-extracted"),
|
|
1059
1075
|
...commonFields,
|
|
1060
|
-
edgeType: EdgeTypeSchema,
|
|
1061
|
-
observed: GraphEdgeSchema
|
|
1076
|
+
edgeType: EdgeTypeSchema.optional(),
|
|
1077
|
+
observed: GraphEdgeSchema.optional(),
|
|
1078
|
+
// Column locus (ADR-157 §4): the `sql-table` node id and the observed-only column.
|
|
1079
|
+
table: import_zod8.z.string().optional(),
|
|
1080
|
+
column: import_zod8.z.string().optional()
|
|
1062
1081
|
});
|
|
1063
1082
|
var CompatibilityVerdictSchema = import_zod8.z.enum(["incompatible", "deprecated", "unknown"]);
|
|
1064
1083
|
var VersionMismatchDivergenceSchema = import_zod8.z.object({
|
|
@@ -1312,6 +1331,7 @@ function passesExtractedFloor(confidence) {
|
|
|
1312
1331
|
BlastRadiusResultSchema,
|
|
1313
1332
|
BlastRadiusRuleSchema,
|
|
1314
1333
|
CheckPoliciesScopeSchema,
|
|
1334
|
+
ColumnAttrSchema,
|
|
1315
1335
|
CompatRuleRefSchema,
|
|
1316
1336
|
CompatViolationDivergenceSchema,
|
|
1317
1337
|
CompatibilityRuleSchema,
|