@inerrata-corporation/errata 2.0.2-dev.361 → 2.0.2-dev.362

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 -9
  2. package/package.json +1 -1
package/errata.mjs CHANGED
@@ -26344,7 +26344,8 @@ function mergeDualBurst(local, cloud, opts = {}) {
26344
26344
  provenance: corroborated ? "corroborated" : "local",
26345
26345
  ...twin?.usageCount != null ? { usageCount: twin.usageCount } : {},
26346
26346
  ...twin?.rel ? { rel: twin.rel } : {},
26347
- why: l.components
26347
+ why: l.components,
26348
+ ...l.via ? { via: l.via } : {}
26348
26349
  });
26349
26350
  }
26350
26351
  let collectiveCount = 0;
@@ -26531,7 +26532,8 @@ function formatDualNodes(merged) {
26531
26532
  centrality: Number(n.why.centrality.toFixed(3)),
26532
26533
  trust: n.why.trust
26533
26534
  }
26534
- } : {}
26535
+ } : {},
26536
+ ...n.via ? { via: n.via } : {}
26535
26537
  }));
26536
26538
  }
26537
26539
  var BRIDGE_LABELS, CANONICAL_KNOWLEDGE_ID, UUID_ID;
@@ -28275,14 +28277,19 @@ function localBurst(store, seedId, opts = {}) {
28275
28277
  const seed = store.getNode(seedId);
28276
28278
  if (!seed) return [];
28277
28279
  const hopOf = /* @__PURE__ */ new Map([[seedId, 0]]);
28280
+ const viaOf = /* @__PURE__ */ new Map();
28278
28281
  let frontier = [seedId];
28279
28282
  for (let h = 1; h <= maxHops && hopOf.size < nodeCap; h++) {
28280
28283
  const next = [];
28281
28284
  for (const id of frontier) {
28282
- const neigh = [...store.outEdges(id).map((e) => e.to), ...store.inEdges(id).map((e) => e.from)];
28283
- for (const nb of neigh) {
28285
+ const neigh = [
28286
+ ...store.outEdges(id).map((e) => ({ nb: e.to, via: { edgeType: e.type, parentId: id, forward: true } })),
28287
+ ...store.inEdges(id).map((e) => ({ nb: e.from, via: { edgeType: e.type, parentId: id, forward: false } }))
28288
+ ];
28289
+ for (const { nb, via } of neigh) {
28284
28290
  if (!hopOf.has(nb)) {
28285
28291
  hopOf.set(nb, h);
28292
+ viaOf.set(nb, via);
28286
28293
  next.push(nb);
28287
28294
  if (hopOf.size >= nodeCap) break;
28288
28295
  }
@@ -28304,7 +28311,8 @@ function localBurst(store, seedId, opts = {}) {
28304
28311
  const now = store.currentIngestSeq();
28305
28312
  return nodes.map(({ node: node2, hops }) => {
28306
28313
  const r = scoreCandidate(node2, { ...ctxSeed, hops, decay: nodeFreshness(node2, now) }, weights);
28307
- return { id: node2.id, score: r.score, components: r.components, node: node2, hops };
28314
+ const via = viaOf.get(node2.id);
28315
+ return { id: node2.id, score: r.score, components: r.components, node: node2, hops, ...via ? { via } : {} };
28308
28316
  }).filter((r) => !gated || r.score > 0).sort((a, b) => b.score - a.score).slice(0, limit);
28309
28317
  }
28310
28318
  var init_relevance_rank = __esm({
@@ -38028,7 +38036,7 @@ var init_mcp = __esm({
38028
38036
  },
38029
38037
  {
38030
38038
  name: "errata.burst",
38031
- description: "Burst-grade local retrieval \u2014 the INTELLIGENT, seed-relative neighborhood (not a flat list). Given a SEED (`nodeId` or `qname`), expand its neighborhood and return the RELEVANT scored subset, ranked by burst-style relevance: semantic similarity to the seed \xD7 centrality \xD7 trust, hop-decayed; semantically-unrelated nodes are gated out. Prefer this over errata.neighbors when you want signal-ranked CONTEXT rather than raw edges. When the SEED is a package and the collective is reachable, results BLEND cross-project knowledge \u2014 each carries `provenance` (local | collective | corroborated) and `usageCount` (projects using it); `corroborated` means your graph and the collective agree (trust it most), `collective` is a cross-project prior to verify. Returns {seed, count, results:[{id,label,name,score,hops,provenance,usageCount?,why?}]}.",
38039
+ description: "Burst-grade local retrieval \u2014 the INTELLIGENT, seed-relative neighborhood (not a flat list). Given a SEED (`nodeId` or `qname`), expand its neighborhood and return the RELEVANT scored subset, ranked by burst-style relevance: semantic similarity to the seed \xD7 centrality \xD7 trust, hop-decayed; semantically-unrelated nodes are gated out. Prefer this over errata.neighbors when you want signal-ranked CONTEXT rather than raw edges. When the SEED is a package and the collective is reachable, results BLEND cross-project knowledge \u2014 each carries `provenance` (local | collective | corroborated) and `usageCount` (projects using it); `corroborated` means your graph and the collective agree (trust it most), `collective` is a cross-project prior to verify. Returns {seed, count, results:[{id,label,name,score,hops,provenance,usageCount?,why?,via?}]} \u2014 `via` is the TOPOLOGY: the edge that reached this result in the walk ({edgeType, parentId, forward}; forward: true \u21D2 parent \u2014edgeType\u2192 node), so you can tell 'FIXED_BY your seed' from 'two hops away via a shared package' and choose whether to dig down a causal chain or turn elsewhere.",
38032
38040
  inputSchema: {
38033
38041
  type: "object",
38034
38042
  properties: {
@@ -38072,7 +38080,8 @@ var init_mcp = __esm({
38072
38080
  node: { label: r.node.label, description: r.node.description },
38073
38081
  score: r.score,
38074
38082
  hops: r.hops ?? 0,
38075
- components: r.components
38083
+ components: r.components,
38084
+ ...r.via ? { via: r.via } : {}
38076
38085
  }));
38077
38086
  const seedNode = store.getNode(id);
38078
38087
  let collectiveStatus = "local-only";
@@ -38118,7 +38127,8 @@ var init_mcp = __esm({
38118
38127
  semantic: Number(r.components.semantic.toFixed(3)),
38119
38128
  centrality: Number(r.components.centrality.toFixed(3)),
38120
38129
  trust: r.components.trust
38121
- }
38130
+ },
38131
+ ...r.via ? { via: r.via } : {}
38122
38132
  }))
38123
38133
  };
38124
38134
  }
@@ -53264,7 +53274,7 @@ function startLoopLagMonitor(thresholdMs = 1e3) {
53264
53274
  }
53265
53275
 
53266
53276
  // src/engine.ts
53267
- var DAEMON_VERSION = true ? "2.0.2-dev.361" : "2.0.0-alpha.0";
53277
+ var DAEMON_VERSION = true ? "2.0.2-dev.362" : "2.0.0-alpha.0";
53268
53278
  var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
53269
53279
  var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
53270
53280
  var GIT_OP_MUTE_MS = 4e3;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inerrata-corporation/errata",
3
- "version": "2.0.2-dev.361",
3
+ "version": "2.0.2-dev.362",
4
4
  "description": "errata - local-first observation engine for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {