@inerrata-corporation/errata 2.0.2-dev.981 → 2.0.2-dev.982

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 +16 -6
  2. package/package.json +1 -1
package/errata.mjs CHANGED
@@ -39774,6 +39774,13 @@ function rankTier(node2) {
39774
39774
  if (isTestNode(node2)) return 1;
39775
39775
  return 0;
39776
39776
  }
39777
+ function edgeTier(store, farId) {
39778
+ const n = store.getNode(farId);
39779
+ return n ? rankTier(n) : 0;
39780
+ }
39781
+ function byTier(store, items, farId) {
39782
+ return items.map((item, i2) => ({ item, i: i2, tier: edgeTier(store, farId(item)) })).sort((a, b) => a.tier - b.tier || a.i - b.i).map((x) => x.item);
39783
+ }
39777
39784
  function searchGraph(store, query, limit) {
39778
39785
  const q = query.trim();
39779
39786
  const terms = q.split(/\s+/).filter((t) => t.length >= 2);
@@ -39913,14 +39920,17 @@ function similarNodes(store, seed, limit) {
39913
39920
  id: c.id,
39914
39921
  label: c.label,
39915
39922
  name: c.description,
39916
- score: cosine3(seed.embedding, c.embedding)
39923
+ score: cosine3(seed.embedding, c.embedding),
39924
+ // Carried, not returned — the tier orders the list without leaking an
39925
+ // internal ranking field into the tool's response shape.
39926
+ tier: rankTier(c)
39917
39927
  }));
39918
- scored.sort((a, b) => b.score - a.score);
39928
+ scored.sort((a, b) => a.tier - b.tier || b.score - a.score);
39919
39929
  return {
39920
39930
  found: true,
39921
39931
  seedId: seed.id,
39922
39932
  seedLabel: seed.label,
39923
- hits: scored.slice(0, limit)
39933
+ hits: scored.slice(0, limit).map(({ tier: _tier, ...hit }) => hit)
39924
39934
  };
39925
39935
  }
39926
39936
  function cosine3(a, b) {
@@ -40336,7 +40346,7 @@ var init_mcp = __esm({
40336
40346
  const p = e.attrs?.provenance;
40337
40347
  return p ? { provenance: p } : {};
40338
40348
  };
40339
- const out2 = store.outEdges(id).slice(0, limit).map((e) => {
40349
+ const out2 = byTier(store, store.outEdges(id), (e) => e.to).slice(0, limit).map((e) => {
40340
40350
  const t = store.getNode(e.to);
40341
40351
  return {
40342
40352
  type: e.type,
@@ -40344,7 +40354,7 @@ var init_mcp = __esm({
40344
40354
  to: t ? { id: t.id, label: t.label, name: t.description } : { id: e.to }
40345
40355
  };
40346
40356
  });
40347
- const incoming = store.inEdges(id).slice(0, limit).map((e) => {
40357
+ const incoming = byTier(store, store.inEdges(id), (e) => e.from).slice(0, limit).map((e) => {
40348
40358
  const f = store.getNode(e.from);
40349
40359
  return {
40350
40360
  type: e.type,
@@ -56329,7 +56339,7 @@ function createLivenessWatch(deps) {
56329
56339
  }
56330
56340
 
56331
56341
  // src/engine.ts
56332
- var DAEMON_VERSION = true ? "2.0.2-dev.981" : "2.0.0-alpha.0";
56342
+ var DAEMON_VERSION = true ? "2.0.2-dev.982" : "2.0.0-alpha.0";
56333
56343
  var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
56334
56344
  var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
56335
56345
  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.981",
3
+ "version": "2.0.2-dev.982",
4
4
  "description": "errata - local-first observation engine for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {