@neat.is/types 0.10.6-dev.20261007 → 0.10.6-dev.20261009

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
@@ -57,6 +57,7 @@ __export(index_exports, {
57
57
  EMPTY_REGISTRY: () => EMPTY_REGISTRY,
58
58
  EXTRACTED_CONFIDENCE: () => EXTRACTED_CONFIDENCE,
59
59
  EdgeAnomalySchema: () => EdgeAnomalySchema,
60
+ EdgeErrorExemplarSchema: () => EdgeErrorExemplarSchema,
60
61
  EdgeEvidenceSchema: () => EdgeEvidenceSchema,
61
62
  EdgeSignalSchema: () => EdgeSignalSchema,
62
63
  EdgeType: () => EdgeType,
@@ -83,6 +84,10 @@ __export(index_exports, {
83
84
  IncidentChainHopSchema: () => IncidentChainHopSchema,
84
85
  IncidentDivergenceSchema: () => IncidentDivergenceSchema,
85
86
  IncidentEventPayloadSchema: () => IncidentEventPayloadSchema,
87
+ IncidentGradeBandSchema: () => IncidentGradeBandSchema,
88
+ IncidentGradeFactorSchema: () => IncidentGradeFactorSchema,
89
+ IncidentGradeGateSchema: () => IncidentGradeGateSchema,
90
+ IncidentGradeSchema: () => IncidentGradeSchema,
86
91
  IncidentKindSchema: () => IncidentKindSchema,
87
92
  IncidentLocusSchema: () => IncidentLocusSchema,
88
93
  IncidentPolicySchema: () => IncidentPolicySchema,
@@ -393,6 +398,12 @@ var EdgeAnomalySchema = import_zod2.z.union([
393
398
  import_zod2.z.object({ source: import_zod2.z.string(), rule: import_zod2.z.string() }),
394
399
  import_zod2.z.boolean()
395
400
  ]);
401
+ var EdgeErrorExemplarSchema = import_zod2.z.object({
402
+ exceptionType: import_zod2.z.string().optional(),
403
+ message: import_zod2.z.string().optional(),
404
+ at: import_zod2.z.string().optional(),
405
+ httpStatusCode: import_zod2.z.number().optional()
406
+ });
396
407
  var EdgeSignalSchema = import_zod2.z.object({
397
408
  spanCount: import_zod2.z.number().int().nonnegative(),
398
409
  errorCount: import_zod2.z.number().int().nonnegative(),
@@ -408,7 +419,12 @@ var EdgeSignalSchema = import_zod2.z.object({
408
419
  latencyHist: import_zod2.z.record(import_zod2.z.string(), import_zod2.z.number().int().nonnegative()).optional(),
409
420
  // A pre-thresholded external alert riding on the edge (ADR-190). Optional and
410
421
  // empty until an alert source is wired.
411
- anomalous: EdgeAnomalySchema.optional()
422
+ anomalous: EdgeAnomalySchema.optional(),
423
+ // A bounded last-error exemplar (ADR-236) — the most recent failing
424
+ // observation's exception type/message/status, so the edge carries WHAT
425
+ // failed, not just how many times. Additive optional growth (ADR-031); absent
426
+ // on a clean edge, on a legacy edge, and on a connector edge with no detail.
427
+ lastError: EdgeErrorExemplarSchema.optional()
412
428
  });
413
429
  var GraphEdgeSchema = import_zod2.z.object({
414
430
  id: import_zod2.z.string(),
@@ -1077,12 +1093,54 @@ var IncidentBlastRadiusSchema = import_zod6.z.object({
1077
1093
  var IncidentPolicySchema = import_zod6.z.object({
1078
1094
  policyName: import_zod6.z.string(),
1079
1095
  severity: import_zod6.z.string(),
1080
- message: import_zod6.z.string().optional()
1096
+ message: import_zod6.z.string().optional(),
1097
+ // What the policy does when violated, as the policy overlay already resolves it
1098
+ // (explicit onViolation, else the severity default, ADR-044). The grade's
1099
+ // policy gate reads it.
1100
+ onViolation: import_zod6.z.enum(["log", "alert", "block"]).optional()
1081
1101
  });
1082
1102
  var IncidentDivergenceSchema = import_zod6.z.object({
1083
1103
  type: import_zod6.z.string(),
1084
1104
  summary: import_zod6.z.string()
1085
1105
  });
1106
+ var GradeEvidenceSchema = import_zod6.z.array(import_zod6.z.string());
1107
+ var IncidentGradeGateSchema = import_zod6.z.object({
1108
+ passed: import_zod6.z.boolean(),
1109
+ evidence: GradeEvidenceSchema
1110
+ });
1111
+ var IncidentGradeFactorSchema = import_zod6.z.object({
1112
+ value: import_zod6.z.number().min(0).max(1).nullable(),
1113
+ weight: import_zod6.z.number().positive(),
1114
+ // The card fields the value was computed from.
1115
+ evidence: GradeEvidenceSchema,
1116
+ // Why the value is null, or what it rests on when that isn't obvious.
1117
+ reason: import_zod6.z.string().optional()
1118
+ });
1119
+ var IncidentGradeBandSchema = import_zod6.z.enum(["full", "diagnose-only", "out"]);
1120
+ var IncidentGradeSchema = import_zod6.z.object({
1121
+ G: import_zod6.z.number().min(0).max(1),
1122
+ gamma: import_zod6.z.union([import_zod6.z.literal(0), import_zod6.z.literal(1)]),
1123
+ gates: import_zod6.z.object({
1124
+ policyNotBlock: IncidentGradeGateSchema,
1125
+ notSymptomOnly: IncidentGradeGateSchema,
1126
+ locusResolves: IncidentGradeGateSchema
1127
+ }),
1128
+ C: import_zod6.z.number().min(0).max(1),
1129
+ factors: import_zod6.z.object({
1130
+ evidence: IncidentGradeFactorSchema,
1131
+ locus: IncidentGradeFactorSchema,
1132
+ tests: IncidentGradeFactorSchema,
1133
+ reach: IncidentGradeFactorSchema,
1134
+ kind: IncidentGradeFactorSchema,
1135
+ chain: IncidentGradeFactorSchema,
1136
+ recur: IncidentGradeFactorSchema,
1137
+ div: IncidentGradeFactorSchema
1138
+ }),
1139
+ band: IncidentGradeBandSchema,
1140
+ // Orders incidents within a band; never raises or lowers a grade.
1141
+ urgency: import_zod6.z.object({ value: import_zod6.z.number().min(0).max(1).nullable(), reason: import_zod6.z.string().optional() }),
1142
+ priorsVersion: import_zod6.z.string()
1143
+ });
1086
1144
  var IncidentCardSchema = import_zod6.z.object({
1087
1145
  kind: import_zod6.z.literal("incident"),
1088
1146
  id: import_zod6.z.string(),
@@ -1106,7 +1164,9 @@ var IncidentCardSchema = import_zod6.z.object({
1106
1164
  divergence: import_zod6.z.array(IncidentDivergenceSchema).optional(),
1107
1165
  // The rendered one-line sentence — a human/loose-LLM read over the structured
1108
1166
  // body, never the wire format.
1109
- headline: import_zod6.z.string()
1167
+ headline: import_zod6.z.string(),
1168
+ // Derived from the fields above (ADR-238). Optional so older cards still parse.
1169
+ grade: IncidentGradeSchema.optional()
1110
1170
  });
1111
1171
  var IncidentEventPayloadSchema = import_zod6.z.object({
1112
1172
  incidentId: import_zod6.z.string(),
@@ -1629,6 +1689,10 @@ var ObservedFailingDivergenceSchema = import_zod9.z.object({
1629
1689
  spanCount: import_zod9.z.number().int().nonnegative().optional(),
1630
1690
  errorCount: import_zod9.z.number().int().nonnegative().optional(),
1631
1691
  errorRate: import_zod9.z.number().min(0).max(1).optional(),
1692
+ // The failing edge's bounded last-error exemplar (ADR-236) — WHAT failed,
1693
+ // alongside the error-rate evidence. Edge locus only; absent when the edge
1694
+ // carried no exception/status detail.
1695
+ lastError: EdgeErrorExemplarSchema.optional(),
1632
1696
  // Incident locus (the declared external call whose incident shows a failure).
1633
1697
  location: import_zod9.z.string().optional(),
1634
1698
  incidentId: import_zod9.z.string().optional(),
@@ -1956,6 +2020,7 @@ var PrVerdictBodySchema = import_zod11.z.object({
1956
2020
  EMPTY_REGISTRY,
1957
2021
  EXTRACTED_CONFIDENCE,
1958
2022
  EdgeAnomalySchema,
2023
+ EdgeErrorExemplarSchema,
1959
2024
  EdgeEvidenceSchema,
1960
2025
  EdgeSignalSchema,
1961
2026
  EdgeType,
@@ -1982,6 +2047,10 @@ var PrVerdictBodySchema = import_zod11.z.object({
1982
2047
  IncidentChainHopSchema,
1983
2048
  IncidentDivergenceSchema,
1984
2049
  IncidentEventPayloadSchema,
2050
+ IncidentGradeBandSchema,
2051
+ IncidentGradeFactorSchema,
2052
+ IncidentGradeGateSchema,
2053
+ IncidentGradeSchema,
1985
2054
  IncidentKindSchema,
1986
2055
  IncidentLocusSchema,
1987
2056
  IncidentPolicySchema,