@neat.is/types 0.10.6 → 0.10.7-dev.20261012

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.js CHANGED
@@ -257,6 +257,27 @@ var GraphEdgeSchema = z2.object({
257
257
  });
258
258
 
259
259
  // src/nodes.ts
260
+ var DeployContextSchema = z3.object({
261
+ // The deploy fault classification: crash-loop / image-pull / scaled-to-zero /
262
+ // no-ready-replicas.
263
+ fault: z3.string().optional(),
264
+ // The container's waiting reason (CrashLoopBackOff / ImagePullBackOff / …).
265
+ waitingReason: z3.string().optional(),
266
+ image: z3.string().optional(),
267
+ restartCount: z3.number().int().nonnegative().optional(),
268
+ terminatedReason: z3.string().optional(),
269
+ exitCode: z3.number().int().optional(),
270
+ // Redacted, bounded descriptors (ADR-237): a secret-keyed value is masked whole,
271
+ // a valueFrom is a reference descriptor, never a raw secret.
272
+ containerEnv: z3.array(z3.string()).optional(),
273
+ containerArgs: z3.array(z3.string()).optional(),
274
+ // The last-terminated (or current, ADR-239) stdout tail — the boot traceback.
275
+ processLog: z3.string().optional()
276
+ });
277
+ var ObservedDeployContextSchema = DeployContextSchema.extend({
278
+ incidentId: z3.string(),
279
+ observedAt: z3.string()
280
+ });
260
281
  var CompatibleDriverSchema = z3.object({
261
282
  name: z3.string(),
262
283
  minVersion: z3.string()
@@ -285,6 +306,10 @@ var ServiceNodeSchema = z3.object({
285
306
  // frontend's icon key at the service-rollup level (ADR-133,
286
307
  // docs/contracts/static-extraction.md).
287
308
  platform: z3.string().optional(),
309
+ // The platform's own name for this service where its config declares one:
310
+ // the Vercel project name from `.vercel/project.json`, the Supabase
311
+ // `project_id` (ADR-138). Optional growth (ADR-031); absent elsewhere.
312
+ platformName: z3.string().optional(),
288
313
  discoveredVia: DiscoveredViaSchema.optional(),
289
314
  version: z3.string().optional(),
290
315
  dbConnectionTarget: z3.string().optional(),
@@ -307,6 +332,11 @@ var ServiceNodeSchema = z3.object({
307
332
  // (ADR-031, ADR-225), absent on a non-k8s service.
308
333
  observedImage: z3.string().optional(),
309
334
  observedReadyReplicas: z3.number().optional(),
335
+ // The faulted workload's observed deploy/process/config context, fused here at
336
+ // ingest by the k8s observed reader (ADR-243, amending ADR-237/240). The one copy:
337
+ // the incident card, `neat incidents` and MCP read it from this node. Optional
338
+ // growth (ADR-031), absent on a non-k8s or healthy service.
339
+ observedDeployContext: ObservedDeployContextSchema.optional(),
310
340
  repoPath: z3.string().optional(),
311
341
  owner: z3.string().optional(),
312
342
  dependencies: z3.record(z3.string(), z3.string()).optional(),
@@ -391,6 +421,28 @@ var ColumnAttrSchema = z3.object({
391
421
  // (`kind` is an open string); folded by `foldSdkWrites`, never `foldColumns`.
392
422
  sdkWrites: z3.array(z3.enum(["client", "admin"])).optional()
393
423
  });
424
+ var FlagDefinitionSchema = z3.object({
425
+ state: z3.string(),
426
+ defaultVariant: z3.string().nullable(),
427
+ variants: z3.record(z3.unknown()),
428
+ targeting: z3.unknown().optional()
429
+ });
430
+ var FlagAttrSchema = z3.object({
431
+ key: z3.string(),
432
+ provenances: z3.array(ProvenanceSchema),
433
+ declared: FlagDefinitionSchema.optional(),
434
+ // The flag file the declaration came from, relative to the scan root.
435
+ declaredIn: z3.string().optional(),
436
+ observed: FlagDefinitionSchema.optional(),
437
+ observedAt: z3.string().optional(),
438
+ observedVariant: z3.string().optional(),
439
+ // The OpenFeature resolution reason that came with it (STATIC, DEFAULT,
440
+ // TARGETING_MATCH, SPLIT, ERROR...). A targeted variant is the flag working as
441
+ // committed, so only a STATIC/DEFAULT resolution is compared to the default.
442
+ observedVariantReason: z3.string().optional(),
443
+ observedVariantAt: z3.string().optional(),
444
+ readers: z3.array(z3.object({ file: z3.string(), service: z3.string(), line: z3.number().int().optional() })).optional()
445
+ });
394
446
  var InfraNodeSchema = z3.object({
395
447
  id: z3.string(),
396
448
  type: z3.literal(NodeType.InfraNode),
@@ -421,7 +473,10 @@ var InfraNodeSchema = z3.object({
421
473
  // carry the same declared facts on the topology node for traversal/blast-radius.
422
474
  image: z3.string().optional(),
423
475
  replicas: z3.number().optional(),
424
- namespace: z3.string().optional()
476
+ namespace: z3.string().optional(),
477
+ // The flag grain on a `flag-store` InfraNode (ADR-242), one entry per flag key.
478
+ // Absent on every other InfraNode. Optional growth (ADR-031).
479
+ flags: z3.array(FlagAttrSchema).optional()
425
480
  });
426
481
  var FrontierNodeSchema = z3.object({
427
482
  id: z3.string(),
@@ -957,15 +1012,18 @@ var IncidentGradeSchema = z6.object({
957
1012
  urgency: z6.object({ value: z6.number().min(0).max(1).nullable(), reason: z6.string().optional() }),
958
1013
  priorsVersion: z6.string()
959
1014
  });
1015
+ var IncidentDeployContextSchema = DeployContextSchema;
960
1016
  var IncidentCardSchema = z6.object({
961
1017
  kind: z6.literal("incident"),
962
- id: z6.string(),
1018
+ id: z6.string().nullable(),
963
1019
  // ISO8601 — the incident's own time.
964
- at: z6.string(),
965
- incidentKind: IncidentKindSchema,
966
- service: z6.string(),
1020
+ at: z6.string().nullable(),
1021
+ incidentKind: IncidentKindSchema.nullable(),
1022
+ service: z6.string().nullable(),
967
1023
  affectedNode: z6.string(),
968
- message: z6.string(),
1024
+ message: z6.string().nullable(),
1025
+ // Present only on a card composed for a node with no recorded incident.
1026
+ noIncident: z6.object({ reason: z6.string() }).optional(),
969
1027
  exceptionType: z6.string().optional(),
970
1028
  httpStatusCode: z6.number().int().optional(),
971
1029
  // Coalesced burst size (ErrorEvent.incidentCount).
@@ -978,6 +1036,9 @@ var IncidentCardSchema = z6.object({
978
1036
  blastRadius: IncidentBlastRadiusSchema.optional(),
979
1037
  policies: z6.array(IncidentPolicySchema).optional(),
980
1038
  divergence: z6.array(IncidentDivergenceSchema).optional(),
1039
+ // The OBSERVED deploy/process/config context for a pre-span failure (ADR-240),
1040
+ // present only when the incident carries it (a k8s deploy fault).
1041
+ deployContext: IncidentDeployContextSchema.optional(),
981
1042
  // The rendered one-line sentence — a human/loose-LLM read over the structured
982
1043
  // body, never the wire format.
983
1044
  headline: z6.string(),
@@ -1526,6 +1587,16 @@ var DeployMismatchDivergenceSchema = z9.object({
1526
1587
  declaredReplicas: z9.number().optional(),
1527
1588
  observedReplicas: z9.number().optional()
1528
1589
  });
1590
+ var FlagMismatchDivergenceSchema = z9.object({
1591
+ type: z9.literal("flag-mismatch"),
1592
+ ...commonFields,
1593
+ flagKey: z9.string(),
1594
+ changed: z9.array(z9.string()),
1595
+ declaredVariant: z9.string().nullable().optional(),
1596
+ observedVariant: z9.string().nullable().optional(),
1597
+ // The code locations that read the key in the source service (`file:line`).
1598
+ readers: z9.array(z9.string()).optional()
1599
+ });
1529
1600
  var DivergenceSchema = z9.discriminatedUnion("type", [
1530
1601
  MissingObservedDivergenceSchema,
1531
1602
  MissingExtractedDivergenceSchema,
@@ -1534,7 +1605,8 @@ var DivergenceSchema = z9.discriminatedUnion("type", [
1534
1605
  CompatViolationDivergenceSchema,
1535
1606
  ObservedSymbolMismatchDivergenceSchema,
1536
1607
  ObservedFailingDivergenceSchema,
1537
- DeployMismatchDivergenceSchema
1608
+ DeployMismatchDivergenceSchema,
1609
+ FlagMismatchDivergenceSchema
1538
1610
  ]);
1539
1611
  var DivergenceResultSchema = z9.object({
1540
1612
  divergences: z9.array(DivergenceSchema),
@@ -1551,7 +1623,8 @@ var DivergenceTypeSchema = z9.enum([
1551
1623
  "compat-violation",
1552
1624
  "observed-symbol-mismatch",
1553
1625
  "observed-failing",
1554
- "deploy-mismatch"
1626
+ "deploy-mismatch",
1627
+ "flag-mismatch"
1555
1628
  ]);
1556
1629
 
1557
1630
  // src/mcp-tools.ts
@@ -1833,6 +1906,7 @@ export {
1833
1906
  DEFAULT_EXTRACTED_PRECISION_FLOOR,
1834
1907
  DaemonHealthResponseSchema,
1835
1908
  DatabaseNodeSchema,
1909
+ DeployContextSchema,
1836
1910
  DeployMismatchDivergenceSchema,
1837
1911
  DeployMismatchKindSchema,
1838
1912
  DiscoveredViaSchema,
@@ -1853,6 +1927,9 @@ export {
1853
1927
  ExtractionCoverageSchema,
1854
1928
  FieldGuardRuleSchema,
1855
1929
  FileNodeSchema,
1930
+ FlagAttrSchema,
1931
+ FlagDefinitionSchema,
1932
+ FlagMismatchDivergenceSchema,
1856
1933
  FrontierNodeSchema,
1857
1934
  GraphDiffResultSchema,
1858
1935
  GraphEdgeSchema,
@@ -1867,6 +1944,7 @@ export {
1867
1944
  IncidentBlastRadiusSchema,
1868
1945
  IncidentCardSchema,
1869
1946
  IncidentChainHopSchema,
1947
+ IncidentDeployContextSchema,
1870
1948
  IncidentDivergenceSchema,
1871
1949
  IncidentEventPayloadSchema,
1872
1950
  IncidentGradeBandSchema,
@@ -1891,6 +1969,7 @@ export {
1891
1969
  NodeType,
1892
1970
  NodeTypeSchema,
1893
1971
  ObservedDependenciesResultSchema,
1972
+ ObservedDeployContextSchema,
1894
1973
  ObservedFailingDivergenceSchema,
1895
1974
  ObservedFailureKindSchema,
1896
1975
  ObservedSymbolMismatchDivergenceSchema,