@inerrata-corporation/errata 2.0.2-dev.249 → 2.0.2-dev.260

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 +28 -5
  2. package/package.json +1 -1
package/errata.mjs CHANGED
@@ -18509,14 +18509,19 @@ function mintCitedPackageNode(store, ref, ts) {
18509
18509
  function mintComponentNode(store, name2, ts) {
18510
18510
  const display = name2.replace(/\s+/g, " ").trim();
18511
18511
  const slug2 = display.toLowerCase();
18512
- if (!store.getNode(slug2)) {
18512
+ const canonicalId = genericCanonicalId("comp", { type: "Component", description: display });
18513
+ const existing = store.getNode(slug2);
18514
+ if (!existing) {
18513
18515
  store.mergeNode(
18514
18516
  buildNode(slug2, "Component", display, ts, {
18515
18517
  name: display,
18516
18518
  source: "convo",
18517
- provisional: true
18519
+ provisional: true,
18520
+ canonicalId
18518
18521
  })
18519
18522
  );
18523
+ } else if (typeof existing.attrs["canonicalId"] !== "string") {
18524
+ store.updateNode(slug2, { attrs: { ...existing.attrs, canonicalId }, lastUpdatedAt: ts });
18520
18525
  }
18521
18526
  return slug2;
18522
18527
  }
@@ -26754,7 +26759,7 @@ function bindCanonicalNeighbors(store, opts) {
26754
26759
  picked.push(cand);
26755
26760
  }
26756
26761
  for (const { c, s } of picked) {
26757
- const type = c.label === "Pattern" ? "INSTANCE_OF" : "MATCHES";
26762
+ const type = c.label === "Pattern" ? "INSTANCE_OF" : "RELATES_TO";
26758
26763
  store.mergeEdge({
26759
26764
  id: `edge_${digest({ from: p.id, type, to: c.id, k: "canonBind" })}`.slice(0, 24),
26760
26765
  from: p.id,
@@ -52659,7 +52664,7 @@ function startLoopLagMonitor(thresholdMs = 1e3) {
52659
52664
  }
52660
52665
 
52661
52666
  // src/engine.ts
52662
- var DAEMON_VERSION = true ? "2.0.2-dev.249" : "2.0.0-alpha.0";
52667
+ var DAEMON_VERSION = true ? "2.0.2-dev.260" : "2.0.0-alpha.0";
52663
52668
  var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
52664
52669
  var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
52665
52670
  var GIT_OP_MUTE_MS = 4e3;
@@ -54531,6 +54536,14 @@ function contributedWireId(n) {
54531
54536
  const cloudId = n.attrs["cloudNodeId"];
54532
54537
  return isMembraneSaltedId(cloudId) ? cloudId : n.id;
54533
54538
  }
54539
+ var WIRE_CANONICAL_ID_MIN = 6;
54540
+ function unshippableReason(n) {
54541
+ const canonical = typeof n.attrs?.["canonicalId"] === "string" ? n.attrs["canonicalId"] : n.id;
54542
+ if (canonical.length < WIRE_CANONICAL_ID_MIN) {
54543
+ return `canonicalId "${canonical}" is ${canonical.length} chars; the door requires >= ${WIRE_CANONICAL_ID_MIN}`;
54544
+ }
54545
+ return null;
54546
+ }
54534
54547
  function wireContextId(n) {
54535
54548
  if (n.label === "Language" && n.attrs["source"] !== "cloud") {
54536
54549
  const name2 = String(n.attrs["name"] ?? "").trim() || n.description.trim() || n.id.replace(/^lang:/, "");
@@ -54553,7 +54566,7 @@ function shareableContext(n, wireId) {
54553
54566
  name: n.attrs["name"],
54554
54567
  ecosystem: n.attrs["ecosystem"],
54555
54568
  resolved: n.attrs["resolved"]
54556
- } : n.label === "Domain" ? { name: n.description, canonicalId: n.attrs["canonicalId"] } : { name: n.attrs["name"] };
54569
+ } : n.label === "Domain" ? { name: n.description, canonicalId: n.attrs["canonicalId"] } : n.label === "Component" ? { name: n.attrs["name"], canonicalId: n.attrs["canonicalId"] } : { name: n.attrs["name"] };
54557
54570
  return {
54558
54571
  ...n,
54559
54572
  id: wireId,
@@ -54614,6 +54627,11 @@ function buildInstanceIngest(store, profile, daemonVersion, ignorePatterns = [],
54614
54627
  if (!problemShippable) continue;
54615
54628
  }
54616
54629
  if (!noveltyAgainst(n, ref, noveltyOpts).ready) continue;
54630
+ const reject = unshippableReason(n);
54631
+ if (reject) {
54632
+ console.warn(`[errata] skipping unshippable node ${n.id} (${n.label}): ${reject}`);
54633
+ continue;
54634
+ }
54617
54635
  ref.push(n);
54618
54636
  const wireNode = shareable(n);
54619
54637
  nodes.push(wireNode);
@@ -54663,6 +54681,11 @@ function buildInstanceIngest(store, profile, daemonVersion, ignorePatterns = [],
54663
54681
  anchorDigests[sourceId] = dg;
54664
54682
  const wireFrom = seen.has(sourceId) || !sourceNode ? sourceId : contributedWireId(sourceNode);
54665
54683
  for (const { e, t, wireId } of targets) {
54684
+ const reject = unshippableReason({ id: wireId, label: t.label, attrs: t.attrs });
54685
+ if (reject) {
54686
+ console.warn(`[errata] skipping unshippable anchor ${wireId} (${t.label}): ${reject}`);
54687
+ continue;
54688
+ }
54666
54689
  anchorEdges.push({ ...e, from: wireFrom, to: wireId, attrs: {} });
54667
54690
  if (t.attrs["source"] === "cloud" || contextSeen.has(wireId)) continue;
54668
54691
  contextSeen.add(wireId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inerrata-corporation/errata",
3
- "version": "2.0.2-dev.249",
3
+ "version": "2.0.2-dev.260",
4
4
  "description": "errata - local-first observation engine for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {