@inerrata-corporation/errata 2.0.2 → 2.0.3-dev.1791

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
@@ -25118,6 +25118,9 @@ var init_paths = __esm({
25118
25118
  // src/config.ts
25119
25119
  import { existsSync as existsSync6, readFileSync as readFileSync4, writeFileSync as writeFileSync5 } from "node:fs";
25120
25120
  import { randomUUID as randomUUID2 } from "node:crypto";
25121
+ function mcpUrlFor(cloudUrl) {
25122
+ return `${cloudUrl.replace(/\/+$/, "")}/mcp`;
25123
+ }
25121
25124
  function defaultConfig() {
25122
25125
  return {
25123
25126
  version: 1,
@@ -25137,7 +25140,7 @@ function defaultConfig() {
25137
25140
  opsNotices: false,
25138
25141
  onboardedAt: null,
25139
25142
  machineId: null,
25140
- updateChannel: "dev",
25143
+ updateChannel: DEFAULT_UPDATE_CHANNEL,
25141
25144
  activeAgent: null,
25142
25145
  installationProfiles: {},
25143
25146
  activeInstallationProfile: null
@@ -25271,13 +25274,14 @@ function clearActiveAgent(cfg = loadConfig()) {
25271
25274
  saveConfig(next);
25272
25275
  return next;
25273
25276
  }
25274
- var LEGACY_CLOUD_URL, DEFAULT_CLOUD_URL;
25277
+ var LEGACY_CLOUD_URL, DEFAULT_CLOUD_URL, DEFAULT_UPDATE_CHANNEL;
25275
25278
  var init_config = __esm({
25276
25279
  "src/config.ts"() {
25277
25280
  "use strict";
25278
25281
  init_paths();
25279
25282
  LEGACY_CLOUD_URL = "https://inerrata-gateway.onrender.com";
25280
- DEFAULT_CLOUD_URL = true ? "https://inerrata.dev" : DEV_CLOUD_URL;
25283
+ DEFAULT_CLOUD_URL = true ? "https://dev.inerrata.dev" : DEV_CLOUD_URL;
25284
+ DEFAULT_UPDATE_CHANNEL = false ? "latest" : "dev";
25281
25285
  }
25282
25286
  });
25283
25287
 
@@ -32234,7 +32238,8 @@ async function runIndexer(store, opts) {
32234
32238
  parentId = fid2;
32235
32239
  }
32236
32240
  const fid = fileNodeId(opts.workspaceId, f.relPath);
32237
- upsertFile(store, fid, f, opts.workspaceId);
32241
+ const skip = !f.provider ? "no-provider" : f.size > maxBytes ? "oversize" : void 0;
32242
+ upsertFile(store, fid, f, opts.workspaceId, skip);
32238
32243
  report.nodesEmitted++;
32239
32244
  upsertEdge(store, parentId, "CONTAINS", fid, 1);
32240
32245
  report.edgesEmitted++;
@@ -32279,6 +32284,7 @@ async function runIndexer(store, opts) {
32279
32284
  symbols = f.provider.extractSymbols(source, f.absPath);
32280
32285
  } catch {
32281
32286
  report.filesSkipped++;
32287
+ stampIndexOutcome(store, fileNodeId(opts.workspaceId, f.relPath), { indexSkipped: "parse-error" });
32282
32288
  continue;
32283
32289
  }
32284
32290
  reExports = scanReExports(source);
@@ -32289,6 +32295,9 @@ async function runIndexer(store, opts) {
32289
32295
  }
32290
32296
  symbolsByFile.set(f.relPath, symbols);
32291
32297
  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
+ }
32292
32301
  report.filesParsed++;
32293
32302
  report.byLanguage[f.provider.id] = (report.byLanguage[f.provider.id] ?? 0) + 1;
32294
32303
  if (report.filesParsed % 250 === 0) perf(`parse @ ${report.filesParsed}/${files.length}`);
@@ -32788,7 +32797,7 @@ function gitListFiles(root, ignores, providers) {
32788
32797
  }
32789
32798
  return out2;
32790
32799
  }
32791
- function upsertFile(store, id, f, workspaceId2) {
32800
+ function upsertFile(store, id, f, workspaceId2, skip) {
32792
32801
  const now = nowTs();
32793
32802
  let contentHash;
32794
32803
  try {
@@ -32818,11 +32827,17 @@ function upsertFile(store, id, f, workspaceId2) {
32818
32827
  size: f.size,
32819
32828
  language: f.language ?? null,
32820
32829
  workspaceId: workspaceId2,
32821
- ...contentHash ? { contentHash } : {}
32830
+ ...contentHash ? { contentHash } : {},
32831
+ ...skip ? { indexSkipped: skip } : {}
32822
32832
  }
32823
32833
  };
32824
32834
  store.mergeNode(node2);
32825
32835
  }
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
+ }
32826
32841
  function upsertFolder(store, id, name2, workspaceId2, relPath) {
32827
32842
  const now = nowTs();
32828
32843
  const node2 = {
@@ -40246,7 +40261,8 @@ async function findStaleFiles(store, rootPath, workspaceId2) {
40246
40261
  } else {
40247
40262
  const edges = store.outEdges(fnode.id, ["DEFINES", "CONTAINS"]);
40248
40263
  if (edges.length === 0) {
40249
- stale.push(abs);
40264
+ const converged = fnode.attrs["symbolCount"] === 0 || typeof fnode.attrs["indexSkipped"] === "string";
40265
+ if (!converged) stale.push(abs);
40250
40266
  } else {
40251
40267
  const targets = edges.map((e) => e.to);
40252
40268
  pending.push({ abs, targets });
@@ -57746,7 +57762,7 @@ function createWatchBreaker(deps) {
57746
57762
  }
57747
57763
 
57748
57764
  // src/engine.ts
57749
- var DAEMON_VERSION = true ? "2.0.2" : "2.0.0-alpha.0";
57765
+ var DAEMON_VERSION = true ? "2.0.3-dev.1791" : "2.0.0-alpha.0";
57750
57766
  var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
57751
57767
  var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
57752
57768
  var GIT_OP_MUTE_MS = 4e3;
@@ -65896,7 +65912,7 @@ async function installOpencodePlugin(port) {
65896
65912
  console.log(` (override: ERRATA_OPENCODE_SESSIONS_DIRS) and the daemon parses THAT \u2014`);
65897
65913
  console.log(` role-typed, attested. Works for headless \`opencode run\` too.`);
65898
65914
  console.log(` Cloud tools (search/contribute) are the MCP entry in opencode.json:`);
65899
- console.log(` { "mcp": { "inerrata": { "type": "remote", "url": "https://mcp.inerrata.dev/mcp", "headers": { "Authorization": "Bearer <errk_\u2026>" } } } }`);
65915
+ console.log(` { "mcp": { "inerrata": { "type": "remote", "url": "${mcpUrlFor(loadConfig().cloudUrl)}", "headers": { "Authorization": "Bearer <errk_\u2026>" } } } }`);
65900
65916
  }
65901
65917
  var ERRATA_TAG = "# errata-managed";
65902
65918
  function errataMcpInvocation() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inerrata-corporation/errata",
3
- "version": "2.0.2",
3
+ "version": "2.0.3-dev.1791",
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,7 +16333,8 @@ async function runIndexer(store2, opts) {
16333
16333
  parentId = fid2;
16334
16334
  }
16335
16335
  const fid = fileNodeId(opts.workspaceId, f.relPath);
16336
- upsertFile(store2, fid, f, opts.workspaceId);
16336
+ const skip = !f.provider ? "no-provider" : f.size > maxBytes ? "oversize" : void 0;
16337
+ upsertFile(store2, fid, f, opts.workspaceId, skip);
16337
16338
  report.nodesEmitted++;
16338
16339
  upsertEdge(store2, parentId, "CONTAINS", fid, 1);
16339
16340
  report.edgesEmitted++;
@@ -16378,6 +16379,7 @@ async function runIndexer(store2, opts) {
16378
16379
  symbols = f.provider.extractSymbols(source, f.absPath);
16379
16380
  } catch {
16380
16381
  report.filesSkipped++;
16382
+ stampIndexOutcome(store2, fileNodeId(opts.workspaceId, f.relPath), { indexSkipped: "parse-error" });
16381
16383
  continue;
16382
16384
  }
16383
16385
  reExports = scanReExports(source);
@@ -16388,6 +16390,9 @@ async function runIndexer(store2, opts) {
16388
16390
  }
16389
16391
  symbolsByFile.set(f.relPath, symbols);
16390
16392
  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
+ }
16391
16396
  report.filesParsed++;
16392
16397
  report.byLanguage[f.provider.id] = (report.byLanguage[f.provider.id] ?? 0) + 1;
16393
16398
  if (report.filesParsed % 250 === 0) perf(`parse @ ${report.filesParsed}/${files.length}`);
@@ -16887,7 +16892,7 @@ function gitListFiles(root, ignores, providers) {
16887
16892
  }
16888
16893
  return out2;
16889
16894
  }
16890
- function upsertFile(store2, id, f, workspaceId) {
16895
+ function upsertFile(store2, id, f, workspaceId, skip) {
16891
16896
  const now = nowTs();
16892
16897
  let contentHash;
16893
16898
  try {
@@ -16917,11 +16922,17 @@ function upsertFile(store2, id, f, workspaceId) {
16917
16922
  size: f.size,
16918
16923
  language: f.language ?? null,
16919
16924
  workspaceId,
16920
- ...contentHash ? { contentHash } : {}
16925
+ ...contentHash ? { contentHash } : {},
16926
+ ...skip ? { indexSkipped: skip } : {}
16921
16927
  }
16922
16928
  };
16923
16929
  store2.mergeNode(node);
16924
16930
  }
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
+ }
16925
16936
  function upsertFolder(store2, id, name2, workspaceId, relPath) {
16926
16937
  const now = nowTs();
16927
16938
  const node = {
@@ -27345,7 +27356,8 @@ async function findStaleFiles(store2, rootPath, workspaceId) {
27345
27356
  } else {
27346
27357
  const edges = store2.outEdges(fnode.id, ["DEFINES", "CONTAINS"]);
27347
27358
  if (edges.length === 0) {
27348
- stale.push(abs);
27359
+ const converged = fnode.attrs["symbolCount"] === 0 || typeof fnode.attrs["indexSkipped"] === "string";
27360
+ if (!converged) stale.push(abs);
27349
27361
  } else {
27350
27362
  const targets = edges.map((e) => e.to);
27351
27363
  pending.push({ abs, targets });