@inerrata-corporation/errata 2.0.2-dev.560 → 2.0.2-dev.588

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
@@ -54367,7 +54367,8 @@ function createLivenessWatch(deps) {
54367
54367
  });
54368
54368
  }
54369
54369
  const rows = evaluateMechanisms(deps.store, invocations);
54370
- const bad = rows.filter((r) => hasStarvedMechanism([r]));
54370
+ const workspaceActive = invocations.has("capture") || invocations.has("render");
54371
+ const bad = workspaceActive ? rows.filter((r) => hasStarvedMechanism([r])) : [];
54371
54372
  appendPassLedger(deps.configDir, "liveness-watch", Date.now() - started2, {
54372
54373
  mechanisms: rows.length,
54373
54374
  alarms: bad.length
@@ -54419,7 +54420,7 @@ function startLoopLagMonitor(thresholdMs = 1e3) {
54419
54420
  }
54420
54421
 
54421
54422
  // src/engine.ts
54422
- var DAEMON_VERSION = true ? "2.0.2-dev.560" : "2.0.0-alpha.0";
54423
+ var DAEMON_VERSION = true ? "2.0.2-dev.588" : "2.0.0-alpha.0";
54423
54424
  var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
54424
54425
  var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
54425
54426
  var GIT_OP_MUTE_MS = 4e3;
@@ -56490,6 +56491,9 @@ import { join as join30 } from "node:path";
56490
56491
  var HEAD_BYTES = 8 * 1024;
56491
56492
  var INDEX_TTL_MS = 10 * 60 * 1e3;
56492
56493
  var MIN_SYMBOL_LEN = 4;
56494
+ function isNameShapedSymbol(name2) {
56495
+ return /[A-Z0-9_$]/.test(name2);
56496
+ }
56493
56497
  var NAMED_IMPORT_RE = /import\s+(?:type\s+)?(.+?)\s+from\s+['"]([^'"]+)['"]/g;
56494
56498
  var REQUIRE_RE = /(?:const|let|var)\s+(.+?)\s*=\s*require\(\s*['"]([^'"]+)['"]\s*\)/g;
56495
56499
  function isBareExternal(spec, internalNames) {
@@ -56569,7 +56573,7 @@ function publicSymbolIndex(store, workspaceRoot, deps = {}) {
56569
56573
  for (const m of head2.matchAll(re)) {
56570
56574
  if (!isBareExternal(m[2], internal)) continue;
56571
56575
  for (const name2 of bindingNames(m[1])) {
56572
- if (name2.length >= MIN_SYMBOL_LEN) symbols.add(name2);
56576
+ if (name2.length >= MIN_SYMBOL_LEN && isNameShapedSymbol(name2)) symbols.add(name2);
56573
56577
  }
56574
56578
  }
56575
56579
  }
@@ -56591,8 +56595,23 @@ function preservedSymbolsFor(description, index) {
56591
56595
  }
56592
56596
  return out2;
56593
56597
  }
56598
+ function internalSymbolsFor(description, lexiconHas, publicIndex) {
56599
+ const out2 = [];
56600
+ const seen = /* @__PURE__ */ new Set();
56601
+ for (const m of description.matchAll(/[A-Za-z_$][\w$]{2,}(?:\.[A-Za-z_$][\w$]+)*/g)) {
56602
+ const tok = m[0];
56603
+ if (seen.has(tok)) continue;
56604
+ seen.add(tok);
56605
+ if (!lexiconHas(tok)) continue;
56606
+ if (publicIndex?.symbols.has(tok)) continue;
56607
+ out2.push(tok);
56608
+ if (out2.length >= PRESERVED_SYMBOLS_CAP) break;
56609
+ }
56610
+ return out2;
56611
+ }
56594
56612
 
56595
56613
  // src/instance-ingest.ts
56614
+ init_generalize_graph();
56596
56615
  var INSTANCE_LABELS = ["Problem", "Solution", "RootCause"];
56597
56616
  var INSTANCE_EDGES = ["CAUSED_BY", "SOLVED_BY"];
56598
56617
  var ANCHOR_EDGES = ["OCCURS_IN", "DEPENDS_ON", "PERTAIN_TO", "CONCERNS"];
@@ -56662,18 +56681,22 @@ function buildInstanceIngest(store, profile, daemonVersion, ignorePatterns = [],
56662
56681
  return key ? { originSession: key } : {};
56663
56682
  };
56664
56683
  const symbolIndex = opts.workspaceRoot ? publicSymbolIndex(store, opts.workspaceRoot) : null;
56684
+ const ownLexicon = buildSymbolLexicon(store);
56665
56685
  const shareable = (n) => {
56666
56686
  const preserved = symbolIndex ? preservedSymbolsFor(n.description, symbolIndex) : [];
56687
+ const shippedText = generalize(n.description, { level }).text;
56688
+ const internal = internalSymbolsFor(shippedText, (t) => ownLexicon.has(t), symbolIndex);
56667
56689
  return {
56668
56690
  ...n,
56669
- description: generalize(n.description, { level }).text,
56691
+ description: shippedText,
56670
56692
  embedding: [],
56671
56693
  ...originSessionOf(n),
56672
56694
  attrs: {
56673
56695
  scope: stripCodebaseScope(n.attrs["scope"]),
56674
56696
  ...n.attrs["kind"] ? { kind: n.attrs["kind"] } : {},
56675
56697
  ...n.attrs["resolvedAs"] ? { resolvedAs: n.attrs["resolvedAs"] } : {},
56676
- ...preserved.length > 0 ? { preservedSymbols: preserved } : {}
56698
+ ...preserved.length > 0 ? { preservedSymbols: preserved } : {},
56699
+ ...internal.length > 0 ? { internalSymbols: internal } : {}
56677
56700
  }
56678
56701
  };
56679
56702
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inerrata-corporation/errata",
3
- "version": "2.0.2-dev.560",
3
+ "version": "2.0.2-dev.588",
4
4
  "description": "errata - local-first observation engine for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {