@neat.is/types 0.10.7-dev.20261011 → 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()
@@ -311,6 +332,11 @@ var ServiceNodeSchema = z3.object({
311
332
  // (ADR-031, ADR-225), absent on a non-k8s service.
312
333
  observedImage: z3.string().optional(),
313
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(),
314
340
  repoPath: z3.string().optional(),
315
341
  owner: z3.string().optional(),
316
342
  dependencies: z3.record(z3.string(), z3.string()).optional(),
@@ -395,6 +421,28 @@ var ColumnAttrSchema = z3.object({
395
421
  // (`kind` is an open string); folded by `foldSdkWrites`, never `foldColumns`.
396
422
  sdkWrites: z3.array(z3.enum(["client", "admin"])).optional()
397
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
+ });
398
446
  var InfraNodeSchema = z3.object({
399
447
  id: z3.string(),
400
448
  type: z3.literal(NodeType.InfraNode),
@@ -425,7 +473,10 @@ var InfraNodeSchema = z3.object({
425
473
  // carry the same declared facts on the topology node for traversal/blast-radius.
426
474
  image: z3.string().optional(),
427
475
  replicas: z3.number().optional(),
428
- 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()
429
480
  });
430
481
  var FrontierNodeSchema = z3.object({
431
482
  id: z3.string(),
@@ -961,32 +1012,18 @@ var IncidentGradeSchema = z6.object({
961
1012
  urgency: z6.object({ value: z6.number().min(0).max(1).nullable(), reason: z6.string().optional() }),
962
1013
  priorsVersion: z6.string()
963
1014
  });
964
- var IncidentDeployContextSchema = z6.object({
965
- // The deploy fault classification (k8s.fault): crash-loop / image-pull /
966
- // scaled-to-zero / no-ready-replicas.
967
- fault: z6.string().optional(),
968
- // The container's waiting reason (CrashLoopBackOff / ImagePullBackOff / …).
969
- waitingReason: z6.string().optional(),
970
- image: z6.string().optional(),
971
- restartCount: z6.number().int().nonnegative().optional(),
972
- terminatedReason: z6.string().optional(),
973
- exitCode: z6.number().int().optional(),
974
- // Redacted, bounded descriptors (ADR-237): a secret-keyed value is masked whole,
975
- // a valueFrom is a reference descriptor, never a raw secret.
976
- containerEnv: z6.array(z6.string()).optional(),
977
- containerArgs: z6.array(z6.string()).optional(),
978
- // The last-terminated (or current, ADR-239) stdout tail — the boot traceback.
979
- processLog: z6.string().optional()
980
- });
1015
+ var IncidentDeployContextSchema = DeployContextSchema;
981
1016
  var IncidentCardSchema = z6.object({
982
1017
  kind: z6.literal("incident"),
983
- id: z6.string(),
1018
+ id: z6.string().nullable(),
984
1019
  // ISO8601 — the incident's own time.
985
- at: z6.string(),
986
- incidentKind: IncidentKindSchema,
987
- service: z6.string(),
1020
+ at: z6.string().nullable(),
1021
+ incidentKind: IncidentKindSchema.nullable(),
1022
+ service: z6.string().nullable(),
988
1023
  affectedNode: z6.string(),
989
- 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(),
990
1027
  exceptionType: z6.string().optional(),
991
1028
  httpStatusCode: z6.number().int().optional(),
992
1029
  // Coalesced burst size (ErrorEvent.incidentCount).
@@ -1550,6 +1587,16 @@ var DeployMismatchDivergenceSchema = z9.object({
1550
1587
  declaredReplicas: z9.number().optional(),
1551
1588
  observedReplicas: z9.number().optional()
1552
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
+ });
1553
1600
  var DivergenceSchema = z9.discriminatedUnion("type", [
1554
1601
  MissingObservedDivergenceSchema,
1555
1602
  MissingExtractedDivergenceSchema,
@@ -1558,7 +1605,8 @@ var DivergenceSchema = z9.discriminatedUnion("type", [
1558
1605
  CompatViolationDivergenceSchema,
1559
1606
  ObservedSymbolMismatchDivergenceSchema,
1560
1607
  ObservedFailingDivergenceSchema,
1561
- DeployMismatchDivergenceSchema
1608
+ DeployMismatchDivergenceSchema,
1609
+ FlagMismatchDivergenceSchema
1562
1610
  ]);
1563
1611
  var DivergenceResultSchema = z9.object({
1564
1612
  divergences: z9.array(DivergenceSchema),
@@ -1575,7 +1623,8 @@ var DivergenceTypeSchema = z9.enum([
1575
1623
  "compat-violation",
1576
1624
  "observed-symbol-mismatch",
1577
1625
  "observed-failing",
1578
- "deploy-mismatch"
1626
+ "deploy-mismatch",
1627
+ "flag-mismatch"
1579
1628
  ]);
1580
1629
 
1581
1630
  // src/mcp-tools.ts
@@ -1857,6 +1906,7 @@ export {
1857
1906
  DEFAULT_EXTRACTED_PRECISION_FLOOR,
1858
1907
  DaemonHealthResponseSchema,
1859
1908
  DatabaseNodeSchema,
1909
+ DeployContextSchema,
1860
1910
  DeployMismatchDivergenceSchema,
1861
1911
  DeployMismatchKindSchema,
1862
1912
  DiscoveredViaSchema,
@@ -1877,6 +1927,9 @@ export {
1877
1927
  ExtractionCoverageSchema,
1878
1928
  FieldGuardRuleSchema,
1879
1929
  FileNodeSchema,
1930
+ FlagAttrSchema,
1931
+ FlagDefinitionSchema,
1932
+ FlagMismatchDivergenceSchema,
1880
1933
  FrontierNodeSchema,
1881
1934
  GraphDiffResultSchema,
1882
1935
  GraphEdgeSchema,
@@ -1916,6 +1969,7 @@ export {
1916
1969
  NodeType,
1917
1970
  NodeTypeSchema,
1918
1971
  ObservedDependenciesResultSchema,
1972
+ ObservedDeployContextSchema,
1919
1973
  ObservedFailingDivergenceSchema,
1920
1974
  ObservedFailureKindSchema,
1921
1975
  ObservedSymbolMismatchDivergenceSchema,