@inerrata-corporation/errata 2.0.3-dev.1793 → 2.0.3

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.
package/errata.mjs CHANGED
@@ -25280,8 +25280,8 @@ var init_config = __esm({
25280
25280
  "use strict";
25281
25281
  init_paths();
25282
25282
  LEGACY_CLOUD_URL = "https://inerrata-gateway.onrender.com";
25283
- DEFAULT_CLOUD_URL = true ? "https://dev.inerrata.dev" : DEV_CLOUD_URL;
25284
- DEFAULT_UPDATE_CHANNEL = false ? "latest" : "dev";
25283
+ DEFAULT_CLOUD_URL = true ? "https://inerrata.dev" : DEV_CLOUD_URL;
25284
+ DEFAULT_UPDATE_CHANNEL = true ? "latest" : "dev";
25285
25285
  }
25286
25286
  });
25287
25287
 
@@ -32238,8 +32238,7 @@ async function runIndexer(store, opts) {
32238
32238
  parentId = fid2;
32239
32239
  }
32240
32240
  const fid = fileNodeId(opts.workspaceId, f.relPath);
32241
- const skip = !f.provider ? "no-provider" : f.size > maxBytes ? "oversize" : void 0;
32242
- upsertFile(store, fid, f, opts.workspaceId, skip);
32241
+ upsertFile(store, fid, f, opts.workspaceId);
32243
32242
  report.nodesEmitted++;
32244
32243
  upsertEdge(store, parentId, "CONTAINS", fid, 1);
32245
32244
  report.edgesEmitted++;
@@ -32284,7 +32283,6 @@ async function runIndexer(store, opts) {
32284
32283
  symbols = f.provider.extractSymbols(source, f.absPath);
32285
32284
  } catch {
32286
32285
  report.filesSkipped++;
32287
- stampIndexOutcome(store, fileNodeId(opts.workspaceId, f.relPath), { indexSkipped: "parse-error" });
32288
32286
  continue;
32289
32287
  }
32290
32288
  reExports = scanReExports(source);
@@ -32295,9 +32293,6 @@ async function runIndexer(store, opts) {
32295
32293
  }
32296
32294
  symbolsByFile.set(f.relPath, symbols);
32297
32295
  if (reExports.length > 0) reExportsByFile.set(f.relPath, reExports);
32298
- if (symbols.length === 0) {
32299
- stampIndexOutcome(store, fileNodeId(opts.workspaceId, f.relPath), { symbolCount: 0 });
32300
- }
32301
32296
  report.filesParsed++;
32302
32297
  report.byLanguage[f.provider.id] = (report.byLanguage[f.provider.id] ?? 0) + 1;
32303
32298
  if (report.filesParsed % 250 === 0) perf(`parse @ ${report.filesParsed}/${files.length}`);
@@ -32797,7 +32792,7 @@ function gitListFiles(root, ignores, providers) {
32797
32792
  }
32798
32793
  return out2;
32799
32794
  }
32800
- function upsertFile(store, id, f, workspaceId2, skip) {
32795
+ function upsertFile(store, id, f, workspaceId2) {
32801
32796
  const now = nowTs();
32802
32797
  let contentHash;
32803
32798
  try {
@@ -32827,17 +32822,11 @@ function upsertFile(store, id, f, workspaceId2, skip) {
32827
32822
  size: f.size,
32828
32823
  language: f.language ?? null,
32829
32824
  workspaceId: workspaceId2,
32830
- ...contentHash ? { contentHash } : {},
32831
- ...skip ? { indexSkipped: skip } : {}
32825
+ ...contentHash ? { contentHash } : {}
32832
32826
  }
32833
32827
  };
32834
32828
  store.mergeNode(node2);
32835
32829
  }
32836
- function stampIndexOutcome(store, fileId, outcome) {
32837
- const fnode = store.getNode(fileId);
32838
- if (!fnode) return;
32839
- store.updateNode(fileId, { attrs: { ...fnode.attrs, ...outcome } });
32840
- }
32841
32830
  function upsertFolder(store, id, name2, workspaceId2, relPath) {
32842
32831
  const now = nowTs();
32843
32832
  const node2 = {
@@ -40261,8 +40250,7 @@ async function findStaleFiles(store, rootPath, workspaceId2) {
40261
40250
  } else {
40262
40251
  const edges = store.outEdges(fnode.id, ["DEFINES", "CONTAINS"]);
40263
40252
  if (edges.length === 0) {
40264
- const converged = fnode.attrs["symbolCount"] === 0 || typeof fnode.attrs["indexSkipped"] === "string";
40265
- if (!converged) stale.push(abs);
40253
+ stale.push(abs);
40266
40254
  } else {
40267
40255
  const targets = edges.map((e) => e.to);
40268
40256
  pending.push({ abs, targets });
@@ -57560,14 +57548,7 @@ var census = {
57560
57548
  since: Date.now(),
57561
57549
  breakerRecycles: 0,
57562
57550
  breakerQuarantined: [],
57563
- topOffender: null,
57564
- liveWatchers: 0
57565
- };
57566
- var noteWatcherOpened = () => {
57567
- census.liveWatchers = (census.liveWatchers ?? 0) + 1;
57568
- };
57569
- var noteWatcherClosed = () => {
57570
- census.liveWatchers = Math.max(0, (census.liveWatchers ?? 0) - 1);
57551
+ topOffender: null
57571
57552
  };
57572
57553
  var QUARANTINE_LIST_CAP = 8;
57573
57554
  var noteWatchDispatched = () => void census.dispatched++;
@@ -57586,33 +57567,19 @@ var noteWindowOffender = (path2, count, windowMs) => {
57586
57567
  function watchCensus() {
57587
57568
  return { ...census };
57588
57569
  }
57589
- var WATCH_STORM_RATE_PER_SEC = 20;
57590
- function ago(ms) {
57591
- const s = Math.max(0, Math.round(ms / 1e3));
57592
- if (s < 60) return `${s}s ago`;
57593
- const m = Math.round(s / 60);
57594
- if (m < 60) return `${m}m ago`;
57595
- return `${Math.floor(m / 60)}h ${m % 60}m ago`;
57596
- }
57597
- function watchCensusLine(c = watchCensus(), now = Date.now()) {
57570
+ function watchCensusLine(c = watchCensus()) {
57598
57571
  if (c.dispatched === 0 && c.emitted === 0) return null;
57599
- const elapsedSec = Math.max(1, (now - c.since) / 1e3);
57600
- const perMin = Math.round(c.dispatched / Math.max(1, elapsedSec / 60));
57572
+ const mins = Math.max(1, Math.round((Date.now() - c.since) / 6e4));
57573
+ const perMin = Math.round(c.dispatched / mins);
57601
57574
  let base = `${c.dispatched} OS event(s) \u2192 ${c.logged} logged (${perMin}/min, ${c.rejected} rejected here)`;
57602
57575
  if (c.breakerRecycles > 0 || c.breakerQuarantined.length > 0) {
57603
57576
  const q = c.breakerQuarantined.length > 0 ? `, ${c.breakerQuarantined.length} quarantined` : "";
57604
57577
  base += ` \xB7 breaker: ${c.breakerRecycles} recycled${q}`;
57605
57578
  }
57606
- const top = c.topOffender ? ` \u2014 top: ${c.topOffender.path} (${c.topOffender.count}/${Math.round(c.topOffender.windowMs / 1e3)}s, ${ago(now - c.topOffender.at)})` : "";
57607
- const cold = c.liveWatchers === 0;
57608
- if (cold) return `${base} \xB7 no live watcher (all workspaces cold; lifetime totals of retired engines)${top}`;
57609
- const noOutput = c.dispatched > 500 && c.dispatched / Math.max(c.logged, 1) > 1e4;
57610
- if (noOutput && c.dispatched / elapsedSec >= WATCH_STORM_RATE_PER_SEC) {
57579
+ if (c.dispatched > 500 && c.dispatched / Math.max(c.logged, 1) > 1e4) {
57580
+ const top = c.topOffender ? ` \u2014 top: ${c.topOffender.path} (${c.topOffender.count}/${Math.round(c.topOffender.windowMs / 1e3)}s)` : "";
57611
57581
  return `${base} \u26A0 watcher is doing work with NO output \u2014 a watch target likely contains an ignored tree${top}`;
57612
57582
  }
57613
- if (noOutput) {
57614
- return `${base} \xB7 no-output dispatch at a low rate = last-access echo of bulk reads (harmless)${top}`;
57615
- }
57616
57583
  return base;
57617
57584
  }
57618
57585
 
@@ -57783,7 +57750,7 @@ function createWatchBreaker(deps) {
57783
57750
  }
57784
57751
 
57785
57752
  // src/engine.ts
57786
- var DAEMON_VERSION = true ? "2.0.3-dev.1793" : "2.0.0-alpha.0";
57753
+ var DAEMON_VERSION = true ? "2.0.3" : "2.0.0-alpha.0";
57787
57754
  var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
57788
57755
  var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
57789
57756
  var GIT_OP_MUTE_MS = 4e3;
@@ -57928,7 +57895,6 @@ function createWorkspaceEngine(opts) {
57928
57895
  ignoreInitial: true,
57929
57896
  persistent: true
57930
57897
  });
57931
- noteWatcherOpened();
57932
57898
  watchBreaker = createWatchBreaker({
57933
57899
  unwatch: (p) => void watcher?.unwatch(p),
57934
57900
  readd: (p) => void watcher?.add(p),
@@ -59997,10 +59963,7 @@ B: ${b}`,
59997
59963
  if (stopGit) stopGit();
59998
59964
  if (passWorker) await passWorker.stop();
59999
59965
  if (watchBreaker) watchBreaker.stop();
60000
- if (watcher) {
60001
- await watcher.close();
60002
- noteWatcherClosed();
60003
- }
59966
+ if (watcher) await watcher.close();
60004
59967
  if (flushTimer) clearTimeout(flushTimer);
60005
59968
  for (const tmr of diagTimers.values()) clearTimeout(tmr);
60006
59969
  diagTimers.clear();
@@ -60591,7 +60554,6 @@ function buildInstanceIngest(store, profile, daemonVersion, ignorePatterns = [],
60591
60554
  };
60592
60555
  const nodes = [];
60593
60556
  const seen = /* @__PURE__ */ new Set();
60594
- const walked = /* @__PURE__ */ new Set();
60595
60557
  const shippedById = /* @__PURE__ */ new Map();
60596
60558
  const anchorSources = /* @__PURE__ */ new Set();
60597
60559
  const semanticEndpoints = /* @__PURE__ */ new Map();
@@ -60623,8 +60585,6 @@ function buildInstanceIngest(store, profile, daemonVersion, ignorePatterns = [],
60623
60585
  const population = label === "RootCause" && opts.sharedStore ? [...store.findNodesByLabel(label), ...opts.sharedStore.findNodesByLabel(label)] : store.findNodesByLabel(label);
60624
60586
  for (const n of population) {
60625
60587
  if (seen.has(n.id)) continue;
60626
- if (walked.has(n.id)) continue;
60627
- walked.add(n.id);
60628
60588
  composition.candidates++;
60629
60589
  if (n.attrs["source"] === "cloud") {
60630
60590
  composition.cloudSourced++;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inerrata-corporation/errata",
3
- "version": "2.0.3-dev.1793",
3
+ "version": "2.0.3",
4
4
  "description": "errata - local-first observation engine for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {
package/pass-worker.mjs CHANGED
@@ -16333,8 +16333,7 @@ async function runIndexer(store2, opts) {
16333
16333
  parentId = fid2;
16334
16334
  }
16335
16335
  const fid = fileNodeId(opts.workspaceId, f.relPath);
16336
- const skip = !f.provider ? "no-provider" : f.size > maxBytes ? "oversize" : void 0;
16337
- upsertFile(store2, fid, f, opts.workspaceId, skip);
16336
+ upsertFile(store2, fid, f, opts.workspaceId);
16338
16337
  report.nodesEmitted++;
16339
16338
  upsertEdge(store2, parentId, "CONTAINS", fid, 1);
16340
16339
  report.edgesEmitted++;
@@ -16379,7 +16378,6 @@ async function runIndexer(store2, opts) {
16379
16378
  symbols = f.provider.extractSymbols(source, f.absPath);
16380
16379
  } catch {
16381
16380
  report.filesSkipped++;
16382
- stampIndexOutcome(store2, fileNodeId(opts.workspaceId, f.relPath), { indexSkipped: "parse-error" });
16383
16381
  continue;
16384
16382
  }
16385
16383
  reExports = scanReExports(source);
@@ -16390,9 +16388,6 @@ async function runIndexer(store2, opts) {
16390
16388
  }
16391
16389
  symbolsByFile.set(f.relPath, symbols);
16392
16390
  if (reExports.length > 0) reExportsByFile.set(f.relPath, reExports);
16393
- if (symbols.length === 0) {
16394
- stampIndexOutcome(store2, fileNodeId(opts.workspaceId, f.relPath), { symbolCount: 0 });
16395
- }
16396
16391
  report.filesParsed++;
16397
16392
  report.byLanguage[f.provider.id] = (report.byLanguage[f.provider.id] ?? 0) + 1;
16398
16393
  if (report.filesParsed % 250 === 0) perf(`parse @ ${report.filesParsed}/${files.length}`);
@@ -16892,7 +16887,7 @@ function gitListFiles(root, ignores, providers) {
16892
16887
  }
16893
16888
  return out2;
16894
16889
  }
16895
- function upsertFile(store2, id, f, workspaceId, skip) {
16890
+ function upsertFile(store2, id, f, workspaceId) {
16896
16891
  const now = nowTs();
16897
16892
  let contentHash;
16898
16893
  try {
@@ -16922,17 +16917,11 @@ function upsertFile(store2, id, f, workspaceId, skip) {
16922
16917
  size: f.size,
16923
16918
  language: f.language ?? null,
16924
16919
  workspaceId,
16925
- ...contentHash ? { contentHash } : {},
16926
- ...skip ? { indexSkipped: skip } : {}
16920
+ ...contentHash ? { contentHash } : {}
16927
16921
  }
16928
16922
  };
16929
16923
  store2.mergeNode(node);
16930
16924
  }
16931
- function stampIndexOutcome(store2, fileId, outcome) {
16932
- const fnode = store2.getNode(fileId);
16933
- if (!fnode) return;
16934
- store2.updateNode(fileId, { attrs: { ...fnode.attrs, ...outcome } });
16935
- }
16936
16925
  function upsertFolder(store2, id, name2, workspaceId, relPath) {
16937
16926
  const now = nowTs();
16938
16927
  const node = {
@@ -27356,8 +27345,7 @@ async function findStaleFiles(store2, rootPath, workspaceId) {
27356
27345
  } else {
27357
27346
  const edges = store2.outEdges(fnode.id, ["DEFINES", "CONTAINS"]);
27358
27347
  if (edges.length === 0) {
27359
- const converged = fnode.attrs["symbolCount"] === 0 || typeof fnode.attrs["indexSkipped"] === "string";
27360
- if (!converged) stale.push(abs);
27348
+ stale.push(abs);
27361
27349
  } else {
27362
27350
  const targets = edges.map((e) => e.to);
27363
27351
  pending.push({ abs, targets });