@neat.is/core 0.4.20-dev.20260620 → 0.4.20-dev.20260621

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
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  startDaemon
4
- } from "./chunk-ZV7GHZ2D.js";
4
+ } from "./chunk-IWGDXLXA.js";
5
5
  import {
6
6
  listProjects,
7
7
  registryPath
8
- } from "./chunk-Q5EDVWKZ.js";
8
+ } from "./chunk-RVOCG6UZ.js";
9
9
  import {
10
10
  BindAuthorityError,
11
11
  __require
package/dist/server.cjs CHANGED
@@ -2403,13 +2403,14 @@ var parentSpanCache = /* @__PURE__ */ new Map();
2403
2403
  function parentSpanKey(traceId, spanId) {
2404
2404
  return `${traceId}:${spanId}`;
2405
2405
  }
2406
- function cacheSpanService(span, now) {
2406
+ function cacheSpanService(span, now, callSite) {
2407
2407
  if (!span.traceId || !span.spanId) return;
2408
2408
  const key = parentSpanKey(span.traceId, span.spanId);
2409
2409
  parentSpanCache.delete(key);
2410
2410
  parentSpanCache.set(key, {
2411
2411
  service: span.service,
2412
2412
  env: span.env ?? "unknown",
2413
+ ...callSite ? { callSite } : {},
2413
2414
  expiresAt: now + PARENT_SPAN_CACHE_TTL_MS
2414
2415
  });
2415
2416
  while (parentSpanCache.size > PARENT_SPAN_CACHE_SIZE) {
@@ -2425,7 +2426,11 @@ function lookupParentSpan(traceId, parentSpanId, now) {
2425
2426
  parentSpanCache.delete(parentSpanKey(traceId, parentSpanId));
2426
2427
  return null;
2427
2428
  }
2428
- return { service: entry.service, env: entry.env };
2429
+ return {
2430
+ service: entry.service,
2431
+ env: entry.env,
2432
+ ...entry.callSite ? { callSite: entry.callSite } : {}
2433
+ };
2429
2434
  }
2430
2435
  function resolveServiceId(graph, host, env) {
2431
2436
  const envTagged = (0, import_types4.serviceId)(host, env);
@@ -2673,9 +2678,9 @@ async function handleSpan(ctx, span) {
2673
2678
  }
2674
2679
  const sourceId = ensureServiceNode(ctx.graph, span.service, env);
2675
2680
  const isError = span.statusCode === 2;
2676
- cacheSpanService(span, nowMs);
2677
2681
  const sourceServiceNode = ctx.graph.getNodeAttributes(sourceId);
2678
2682
  const callSite = callSiteFromSpan(span, sourceServiceNode, ctx.scanPath);
2683
+ cacheSpanService(span, nowMs, callSite);
2679
2684
  const observedSource = () => callSite ? ensureObservedFileNode(ctx.graph, span.service, sourceId, callSite) : sourceId;
2680
2685
  const callSiteEvidence = callSite ? { file: callSite.relPath, ...callSite.line !== void 0 ? { line: callSite.line } : {} } : void 0;
2681
2686
  let affectedNode = sourceId;
@@ -2732,13 +2737,19 @@ async function handleSpan(ctx, span) {
2732
2737
  const parent = lookupParentSpan(span.traceId, span.parentSpanId, nowMs);
2733
2738
  if (parent && parent.service !== span.service) {
2734
2739
  const parentId = ensureServiceNode(ctx.graph, parent.service, parent.env);
2740
+ const fallbackSource = parent.callSite ? ensureObservedFileNode(ctx.graph, parent.service, parentId, parent.callSite) : parentId;
2741
+ const fallbackEvidence = parent.callSite ? {
2742
+ file: parent.callSite.relPath,
2743
+ ...parent.callSite.line !== void 0 ? { line: parent.callSite.line } : {}
2744
+ } : void 0;
2735
2745
  upsertObservedEdge(
2736
2746
  ctx.graph,
2737
2747
  import_types4.EdgeType.CALLS,
2738
- parentId,
2748
+ fallbackSource,
2739
2749
  sourceId,
2740
2750
  ts,
2741
- isError
2751
+ isError,
2752
+ fallbackEvidence
2742
2753
  );
2743
2754
  }
2744
2755
  }