@neat.is/core 0.4.20-dev.20260619 → 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/cli.cjs CHANGED
@@ -1958,13 +1958,14 @@ var parentSpanCache = /* @__PURE__ */ new Map();
1958
1958
  function parentSpanKey(traceId, spanId) {
1959
1959
  return `${traceId}:${spanId}`;
1960
1960
  }
1961
- function cacheSpanService(span, now) {
1961
+ function cacheSpanService(span, now, callSite) {
1962
1962
  if (!span.traceId || !span.spanId) return;
1963
1963
  const key = parentSpanKey(span.traceId, span.spanId);
1964
1964
  parentSpanCache.delete(key);
1965
1965
  parentSpanCache.set(key, {
1966
1966
  service: span.service,
1967
1967
  env: span.env ?? "unknown",
1968
+ ...callSite ? { callSite } : {},
1968
1969
  expiresAt: now + PARENT_SPAN_CACHE_TTL_MS
1969
1970
  });
1970
1971
  while (parentSpanCache.size > PARENT_SPAN_CACHE_SIZE) {
@@ -1980,7 +1981,11 @@ function lookupParentSpan(traceId, parentSpanId, now) {
1980
1981
  parentSpanCache.delete(parentSpanKey(traceId, parentSpanId));
1981
1982
  return null;
1982
1983
  }
1983
- return { service: entry2.service, env: entry2.env };
1984
+ return {
1985
+ service: entry2.service,
1986
+ env: entry2.env,
1987
+ ...entry2.callSite ? { callSite: entry2.callSite } : {}
1988
+ };
1984
1989
  }
1985
1990
  function resolveServiceId(graph, host, env) {
1986
1991
  const envTagged = (0, import_types3.serviceId)(host, env);
@@ -2253,9 +2258,9 @@ async function handleSpan(ctx, span) {
2253
2258
  }
2254
2259
  const sourceId = ensureServiceNode(ctx.graph, span.service, env);
2255
2260
  const isError = span.statusCode === 2;
2256
- cacheSpanService(span, nowMs);
2257
2261
  const sourceServiceNode = ctx.graph.getNodeAttributes(sourceId);
2258
2262
  const callSite = callSiteFromSpan(span, sourceServiceNode, ctx.scanPath);
2263
+ cacheSpanService(span, nowMs, callSite);
2259
2264
  const observedSource = () => callSite ? ensureObservedFileNode(ctx.graph, span.service, sourceId, callSite) : sourceId;
2260
2265
  const callSiteEvidence = callSite ? { file: callSite.relPath, ...callSite.line !== void 0 ? { line: callSite.line } : {} } : void 0;
2261
2266
  let affectedNode = sourceId;
@@ -2312,13 +2317,19 @@ async function handleSpan(ctx, span) {
2312
2317
  const parent = lookupParentSpan(span.traceId, span.parentSpanId, nowMs);
2313
2318
  if (parent && parent.service !== span.service) {
2314
2319
  const parentId = ensureServiceNode(ctx.graph, parent.service, parent.env);
2320
+ const fallbackSource = parent.callSite ? ensureObservedFileNode(ctx.graph, parent.service, parentId, parent.callSite) : parentId;
2321
+ const fallbackEvidence = parent.callSite ? {
2322
+ file: parent.callSite.relPath,
2323
+ ...parent.callSite.line !== void 0 ? { line: parent.callSite.line } : {}
2324
+ } : void 0;
2315
2325
  upsertObservedEdge(
2316
2326
  ctx.graph,
2317
2327
  import_types3.EdgeType.CALLS,
2318
- parentId,
2328
+ fallbackSource,
2319
2329
  sourceId,
2320
2330
  ts,
2321
- isError
2331
+ isError,
2332
+ fallbackEvidence
2322
2333
  );
2323
2334
  }
2324
2335
  }
@@ -11256,7 +11267,10 @@ async function checkDaemonHealth(baseUrl) {
11256
11267
  }
11257
11268
  function snapshotForGraph(persisted) {
11258
11269
  return {
11259
- schemaVersion: 3,
11270
+ // Stamp the live schema version the daemon validates against on the
11271
+ // receiving `/snapshot` merge. Tracking the constant keeps the push
11272
+ // aligned with the current snapshot shape across schema migrations.
11273
+ schemaVersion: SCHEMA_VERSION,
11260
11274
  exportedAt: (/* @__PURE__ */ new Date()).toISOString(),
11261
11275
  graph: persisted.graph.export()
11262
11276
  };