@neat.is/core 0.9.10 → 0.9.12-dev.20260831

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/neatd.js CHANGED
@@ -2,11 +2,11 @@
2
2
  import {
3
3
  reconcileDaemonRecordSync,
4
4
  startDaemon
5
- } from "./chunk-UHNE7LGF.js";
5
+ } from "./chunk-UNO3X6ZV.js";
6
6
  import {
7
7
  listProjects,
8
8
  registryPath
9
- } from "./chunk-C3LHXC55.js";
9
+ } from "./chunk-3UAUMPIY.js";
10
10
  import {
11
11
  BindAuthorityError,
12
12
  __require
package/dist/server.cjs CHANGED
@@ -5704,6 +5704,26 @@ function sanitizeAttributes(attrs) {
5704
5704
  }
5705
5705
  return out;
5706
5706
  }
5707
+ function buildErrorEventForReceiver(span, graph, scanPath) {
5708
+ if (span.statusCode !== 2) return null;
5709
+ const ts = span.startTimeIso ?? (/* @__PURE__ */ new Date()).toISOString();
5710
+ const locus = incidentLocus(span, graph, scanPath);
5711
+ const attrs = withRecoveredCodeAttrs(sanitizeAttributes(span.attributes), locus);
5712
+ const httpStatus = httpResponseStatus(span);
5713
+ return {
5714
+ id: `${span.traceId}:${span.spanId}`,
5715
+ timestamp: ts,
5716
+ service: span.service,
5717
+ traceId: span.traceId,
5718
+ spanId: span.spanId,
5719
+ errorMessage: incidentMessage(span),
5720
+ ...span.exception?.type ? { exceptionType: span.exception.type } : {},
5721
+ ...span.exception?.stacktrace ? { exceptionStacktrace: span.exception.stacktrace } : {},
5722
+ ...httpStatus !== void 0 ? { httpStatusCode: httpStatus } : {},
5723
+ ...Object.keys(attrs).length > 0 ? { attributes: attrs } : {},
5724
+ affectedNode: locus.affectedNode
5725
+ };
5726
+ }
5707
5727
  async function recordFailingResponseIncident(ctx, span, affectedNode, timestamp, statusCode, count, firstTimestamp) {
5708
5728
  const attrs = sanitizeAttributes(span.attributes);
5709
5729
  const first = firstTimestamp ?? timestamp;
@@ -6042,26 +6062,8 @@ async function handleSpan(ctx, span) {
6042
6062
  if (span.statusCode === 2) {
6043
6063
  stitchTrace(ctx.graph, sourceId, ts);
6044
6064
  if (ctx.writeErrorEventInline !== false) {
6045
- const locus = incidentLocus(span, ctx.graph, ctx.scanPath);
6046
- const attrs = withRecoveredCodeAttrs(sanitizeAttributes(span.attributes), locus);
6047
- const ev = {
6048
- id: `${span.traceId}:${span.spanId}`,
6049
- timestamp: ts,
6050
- service: span.service,
6051
- traceId: span.traceId,
6052
- spanId: span.spanId,
6053
- errorMessage: incidentMessage(span),
6054
- ...span.exception?.type ? { exceptionType: span.exception.type } : {},
6055
- ...span.exception?.stacktrace ? { exceptionStacktrace: span.exception.stacktrace } : {},
6056
- ...Object.keys(attrs).length > 0 ? { attributes: attrs } : {},
6057
- // Attribute to where the failure originated — the symbol / file / service
6058
- // the throwing span named (incidentAffectedNode / ADR-191, extended to
6059
- // recover the locus from the stacktrace when the span stamped no code.*
6060
- // attrs, ADR-216) — the same source-based attribution the durable
6061
- // receiver write uses, not the outbound edge target this span minted.
6062
- affectedNode: locus.affectedNode
6063
- };
6064
- await appendErrorEvent(ctx, ev);
6065
+ const ev = buildErrorEventForReceiver(span, ctx.graph, ctx.scanPath);
6066
+ if (ev) await appendErrorEvent(ctx, ev);
6065
6067
  }
6066
6068
  }
6067
6069
  if (span.statusCode !== 2) {