@inerrata-corporation/errata 2.0.1-dev.52 → 2.0.1-dev.57

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.
Files changed (2) hide show
  1. package/errata.mjs +19 -5
  2. package/package.json +1 -1
package/errata.mjs CHANGED
@@ -21871,6 +21871,7 @@ var init_client = __esm({
21871
21871
  }
21872
21872
  const merged = { runId, nodes: [], edges: [] };
21873
21873
  let pendingEdges = [...batch.edges];
21874
+ const echoedCloudId = /* @__PURE__ */ new Map();
21874
21875
  for (const nodeChunk of chunkArray(batch.nodes, INGEST_NODE_CHUNK)) {
21875
21876
  const ids = new Set(nodeChunk.map((n) => n.id));
21876
21877
  const inChunk = pendingEdges.filter((e) => ids.has(e.from) && ids.has(e.to)).slice(0, MAX_EDGES_PER_PAYLOAD);
@@ -21881,12 +21882,20 @@ var init_client = __esm({
21881
21882
  const r = await this.ingestWire(toWirePayload({ ...batch, nodes: nodeChunk, edges: inChunk }, randomUUID()));
21882
21883
  merged.nodes.push(...r.nodes);
21883
21884
  merged.edges.push(...r.edges);
21885
+ for (const rn of r.nodes) {
21886
+ if (rn.nodeId && rn.nodeId !== rn.canonicalId) echoedCloudId.set(rn.canonicalId, rn.nodeId);
21887
+ }
21884
21888
  if (r.patternReconciliation) {
21885
21889
  merged.patternReconciliation = { ...merged.patternReconciliation, ...r.patternReconciliation };
21886
21890
  }
21887
21891
  }
21888
21892
  for (const edgeChunk of chunkArray(pendingEdges, MAX_EDGES_PER_PAYLOAD)) {
21889
- const r = await this.ingestWire(toWirePayload({ ...batch, nodes: [], edges: edgeChunk }, randomUUID()));
21893
+ const rewritten = edgeChunk.map((e) => ({
21894
+ ...e,
21895
+ from: echoedCloudId.get(e.from) ?? e.from,
21896
+ to: echoedCloudId.get(e.to) ?? e.to
21897
+ }));
21898
+ const r = await this.ingestWire(toWirePayload({ ...batch, nodes: [], edges: rewritten }, randomUUID()));
21890
21899
  merged.edges.push(...r.edges);
21891
21900
  }
21892
21901
  return { ...summarizeIngestResult(merged), result: merged };
@@ -51655,7 +51664,7 @@ function startLoopLagMonitor(thresholdMs = 1e3) {
51655
51664
  }
51656
51665
 
51657
51666
  // src/engine.ts
51658
- var DAEMON_VERSION = true ? "2.0.1-dev.52" : "2.0.0-alpha.0";
51667
+ var DAEMON_VERSION = true ? "2.0.1-dev.57" : "2.0.0-alpha.0";
51659
51668
  var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
51660
51669
  var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
51661
51670
  var GIT_OP_MUTE_MS = 4e3;
@@ -53435,10 +53444,13 @@ function buildInstanceIngest(store, profile, daemonVersion, ignorePatterns = [],
53435
53444
  }
53436
53445
  if (targets.length === 0) continue;
53437
53446
  const dg = digest(targets.map(({ e, wireId }) => `${e.type}>${wireId}`).sort());
53438
- if (store.getNode(sourceId)?.attrs["anchorsContributedDigest"] === dg) continue;
53447
+ const sourceNode = store.getNode(sourceId);
53448
+ if (sourceNode?.attrs["anchorsContributedDigest"] === dg) continue;
53439
53449
  anchorDigests[sourceId] = dg;
53450
+ const skippedCloudId = !seen.has(sourceId) ? sourceNode?.attrs["cloudNodeId"] : void 0;
53451
+ const wireFrom = typeof skippedCloudId === "string" && skippedCloudId.length > 0 ? skippedCloudId : sourceId;
53440
53452
  for (const { e, t, wireId } of targets) {
53441
- anchorEdges.push({ ...e, to: wireId, attrs: {} });
53453
+ anchorEdges.push({ ...e, from: wireFrom, to: wireId, attrs: {} });
53442
53454
  if (t.attrs["source"] === "cloud" || contextSeen.has(wireId)) continue;
53443
53455
  contextSeen.add(wireId);
53444
53456
  contextNodes.push(shareableContext(t, wireId));
@@ -53450,6 +53462,8 @@ function buildInstanceIngest(store, profile, daemonVersion, ignorePatterns = [],
53450
53462
  for (const sourceId of anchorSources) {
53451
53463
  const source = store.getNode(sourceId);
53452
53464
  if (!source) continue;
53465
+ const skippedCloudId = !seen.has(sourceId) ? source.attrs["cloudNodeId"] : void 0;
53466
+ const wireFrom = typeof skippedCloudId === "string" && skippedCloudId.length > 0 ? skippedCloudId : sourceId;
53453
53467
  for (const e of store.outEdges(sourceId, ["ANCHORED_AT"])) {
53454
53468
  const target = store.getNode(e.to);
53455
53469
  if (!target) continue;
@@ -53484,7 +53498,7 @@ function buildInstanceIngest(store, profile, daemonVersion, ignorePatterns = [],
53484
53498
  stability: "unstable"
53485
53499
  });
53486
53500
  }
53487
- anchorEdges.push({ ...e, to: symId, attrs: {} });
53501
+ anchorEdges.push({ ...e, from: wireFrom, to: symId, attrs: {} });
53488
53502
  }
53489
53503
  }
53490
53504
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inerrata-corporation/errata",
3
- "version": "2.0.1-dev.52",
3
+ "version": "2.0.1-dev.57",
4
4
  "description": "errata - local-first observation engine for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {