@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 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 CompatibleDriverSchema = import_zod2.z.object({
263
- name: import_zod2.z.string(),
264
- minVersion: import_zod2.z.string()
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 DiscoveredViaSchema = import_zod2.z.enum(["static", "otel", "merged"]);
267
- var ServiceNodeSchema = import_zod2.z.object({
301
+ var GraphEdgeSchema = import_zod2.z.object({
268
302
  id: import_zod2.z.string(),
269
- type: import_zod2.z.literal(NodeType.ServiceNode),
270
- name: import_zod2.z.string(),
271
- language: import_zod2.z.string(),
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: import_zod2.z.string().optional(),
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: import_zod2.z.string().optional(),
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: import_zod2.z.string().optional(),
350
+ platform: import_zod3.z.string().optional(),
290
351
  discoveredVia: DiscoveredViaSchema.optional(),
291
- version: import_zod2.z.string().optional(),
292
- dbConnectionTarget: import_zod2.z.string().optional(),
293
- repoPath: import_zod2.z.string().optional(),
294
- owner: import_zod2.z.string().optional(),
295
- dependencies: import_zod2.z.record(import_zod2.z.string(), import_zod2.z.string()).optional(),
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: import_zod2.z.array(import_zod2.z.string()).optional(),
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: import_zod2.z.string().optional(),
304
- incompatibilities: import_zod2.z.array(
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
- import_zod2.z.union([
310
- import_zod2.z.object({
311
- kind: import_zod2.z.literal("driver-engine").optional(),
312
- driver: import_zod2.z.string(),
313
- driverVersion: import_zod2.z.string(),
314
- engine: import_zod2.z.string(),
315
- engineVersion: import_zod2.z.string(),
316
- reason: import_zod2.z.string()
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
- import_zod2.z.object({
319
- kind: import_zod2.z.literal("node-engine"),
320
- package: import_zod2.z.string(),
321
- packageVersion: import_zod2.z.string().optional(),
322
- requiredNodeVersion: import_zod2.z.string(),
323
- declaredNodeEngine: import_zod2.z.string().optional(),
324
- reason: import_zod2.z.string()
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
- import_zod2.z.object({
327
- kind: import_zod2.z.literal("package-conflict"),
328
- package: import_zod2.z.string(),
329
- packageVersion: import_zod2.z.string().optional(),
330
- requires: import_zod2.z.object({
331
- name: import_zod2.z.string(),
332
- minVersion: import_zod2.z.string()
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: import_zod2.z.string().optional(),
335
- reason: import_zod2.z.string()
395
+ foundVersion: import_zod3.z.string().optional(),
396
+ reason: import_zod3.z.string()
336
397
  }),
337
- import_zod2.z.object({
338
- kind: import_zod2.z.literal("deprecated-api"),
339
- package: import_zod2.z.string(),
340
- packageVersion: import_zod2.z.string().optional(),
341
- reason: import_zod2.z.string()
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 = import_zod2.z.object({
347
- id: import_zod2.z.string(),
348
- type: import_zod2.z.literal(NodeType.DatabaseNode),
349
- name: import_zod2.z.string(),
350
- engine: import_zod2.z.string(),
351
- engineVersion: import_zod2.z.string(),
352
- compatibleDrivers: import_zod2.z.array(CompatibleDriverSchema),
353
- host: import_zod2.z.string().optional(),
354
- port: import_zod2.z.number().optional(),
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 = import_zod2.z.object({
358
- id: import_zod2.z.string(),
359
- type: import_zod2.z.literal(NodeType.ConfigNode),
360
- name: import_zod2.z.string(),
361
- path: import_zod2.z.string(),
362
- fileType: import_zod2.z.string()
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 InfraNodeSchema = import_zod2.z.object({
365
- id: import_zod2.z.string(),
366
- type: import_zod2.z.literal(NodeType.InfraNode),
367
- name: import_zod2.z.string(),
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 FrontierNodeSchema = import_zod2.z.object({
373
- id: import_zod2.z.string(),
374
- type: import_zod2.z.literal(NodeType.FrontierNode),
375
- name: import_zod2.z.string(),
376
- host: import_zod2.z.string(),
377
- firstObserved: import_zod2.z.string().datetime().optional(),
378
- lastObserved: import_zod2.z.string().datetime().optional()
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 FileNodeSchema = import_zod2.z.object({
381
- id: import_zod2.z.string(),
382
- type: import_zod2.z.literal(NodeType.FileNode),
383
- service: import_zod2.z.string(),
384
- path: import_zod2.z.string(),
385
- language: import_zod2.z.string().optional(),
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: import_zod2.z.string().optional(),
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: import_zod2.z.string().optional(),
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: import_zod2.z.string().optional()
474
+ platformName: import_zod3.z.string().optional()
404
475
  });
405
- var RouteNodeSchema = import_zod2.z.object({
406
- id: import_zod2.z.string(),
407
- type: import_zod2.z.literal(NodeType.RouteNode),
408
- name: import_zod2.z.string(),
409
- service: import_zod2.z.string(),
410
- method: import_zod2.z.string(),
411
- pathTemplate: import_zod2.z.string(),
412
- path: import_zod2.z.string(),
413
- line: import_zod2.z.number().int().nonnegative().optional(),
414
- framework: import_zod2.z.string().optional(),
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 = import_zod2.z.object({
418
- id: import_zod2.z.string(),
419
- type: import_zod2.z.literal(NodeType.GraphQLOperationNode),
420
- name: import_zod2.z.string(),
421
- service: import_zod2.z.string(),
422
- operationType: import_zod2.z.string(),
423
- operationName: import_zod2.z.string(),
424
- path: import_zod2.z.string().optional(),
425
- line: import_zod2.z.number().int().nonnegative().optional(),
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 = import_zod2.z.object({
429
- id: import_zod2.z.string(),
430
- type: import_zod2.z.literal(NodeType.GrpcMethodNode),
431
- name: import_zod2.z.string(),
432
- rpcService: import_zod2.z.string(),
433
- rpcMethod: import_zod2.z.string(),
434
- path: import_zod2.z.string().optional(),
435
- line: import_zod2.z.number().int().nonnegative().optional(),
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 = import_zod2.z.object({
439
- id: import_zod2.z.string(),
440
- type: import_zod2.z.literal(NodeType.WebSocketChannelNode),
441
- name: import_zod2.z.string(),
442
- service: import_zod2.z.string(),
443
- channel: import_zod2.z.string(),
444
- path: import_zod2.z.string().optional(),
445
- line: import_zod2.z.number().int().nonnegative().optional(),
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 = import_zod2.z.enum(["function", "method", "constructor", "class"]);
449
- var SymbolSpanSchema = import_zod2.z.object({
450
- startLine: import_zod2.z.number().int().nonnegative(),
451
- endLine: import_zod2.z.number().int().nonnegative()
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 = import_zod2.z.object({
454
- id: import_zod2.z.string(),
455
- type: import_zod2.z.literal(NodeType.SymbolNode),
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: import_zod2.z.string(),
528
+ qualname: import_zod3.z.string(),
458
529
  span: SymbolSpanSchema,
459
- service: import_zod2.z.string(),
460
- relPath: import_zod2.z.string(),
530
+ service: import_zod3.z.string(),
531
+ relPath: import_zod3.z.string(),
461
532
  discoveredVia: DiscoveredViaSchema.optional()
462
533
  });
463
- var GraphNodeSchema = import_zod2.z.discriminatedUnion("type", [
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,