@inerrata-corporation/errata 2.0.6-dev.2611 → 2.0.6-dev.2618

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 +14 -3
  2. package/package.json +1 -1
package/errata.mjs CHANGED
@@ -31078,13 +31078,18 @@ function bindCanonicalNeighbors(store, opts) {
31078
31078
  const problems = store.findNodesByLabel("Problem").filter((p) => p.embedding.length > 0 && live2(p));
31079
31079
  const patterns = store.findNodesByLabel("Pattern").filter((p) => p.embedding.length > 0);
31080
31080
  const candidates = [...problems, ...patterns];
31081
+ const since = opts.freshSince;
31082
+ const fresh = (n) => since === void 0 || n.createdAt > since || n.lastUpdatedAt > since;
31083
+ const freshCandidates = since === void 0 ? candidates : candidates.filter(fresh);
31081
31084
  let bound = 0;
31082
31085
  for (const p of problems) {
31086
+ const pool = fresh(p) ? candidates : freshCandidates;
31087
+ if (pool.length === 0) continue;
31083
31088
  const existing = new Set(
31084
31089
  store.outEdges(p.id, ["MATCHES", "INSTANCE_OF", "RELATES_TO"]).map((e) => e.to)
31085
31090
  );
31086
31091
  if (existing.size >= k) continue;
31087
- const ranked = candidates.filter(
31092
+ const ranked = pool.filter(
31088
31093
  (c) => c.id !== p.id && !existing.has(c.id) && c.embedding.length === p.embedding.length && (c.attrs["embeddingVersion"] ?? "") === (p.attrs["embeddingVersion"] ?? "")
31089
31094
  ).map((c) => ({ c, s: cosine(p.embedding, c.embedding) })).filter((x) => x.s >= CANONICAL_BIND_MIN && x.s < NEMORI_DEDUP_COSINE).sort((a, b) => b.s - a.s);
31090
31095
  const picked = [];
@@ -78421,7 +78426,7 @@ function createWatchBreaker(deps) {
78421
78426
  }
78422
78427
 
78423
78428
  // src/engine.ts
78424
- var DAEMON_VERSION = true ? "2.0.6-dev.2611" : "2.0.0-alpha.0";
78429
+ var DAEMON_VERSION = true ? "2.0.6-dev.2618" : "2.0.0-alpha.0";
78425
78430
  var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
78426
78431
  var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
78427
78432
  var GIT_OP_MUTE_MS = 4e3;
@@ -80567,7 +80572,13 @@ B: ${b}`,
80567
80572
  }
80568
80573
  await yieldLoop();
80569
80574
  if (sem.embedded > 0) {
80570
- const cb = bindCanonicalNeighbors(store, { ts: Date.now() });
80575
+ const bindStart = Date.now();
80576
+ const bindWmRaw = store.getMeta?.("canon_bind_at") ?? null;
80577
+ const cb = bindCanonicalNeighbors(store, {
80578
+ ts: bindStart,
80579
+ ...bindWmRaw !== null ? { freshSince: Number(bindWmRaw) || 0 } : {}
80580
+ });
80581
+ store.setMeta?.("canon_bind_at", String(bindStart));
80571
80582
  if (cb.bound > 0) {
80572
80583
  console.log(`[errata] canonical-bind: +${cb.bound} machine-proposed link(s) across ${cb.scanned} problem(s)`);
80573
80584
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inerrata-corporation/errata",
3
- "version": "2.0.6-dev.2611",
3
+ "version": "2.0.6-dev.2618",
4
4
  "description": "errata - local-first observation engine for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {