@inerrata-corporation/errata 2.0.20 → 2.0.21-dev.3716

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/install.ps1 CHANGED
@@ -43,7 +43,7 @@ $LegacyDir = Join-Path $env:LOCALAPPDATA "errata"
43
43
  $LegacyMjs = Join-Path $LegacyDir "errata.mjs"
44
44
  if (Test-Path $LegacyMjs) {
45
45
  Write-Host "migrating off the legacy %LOCALAPPDATA%\errata bundle install..."
46
- foreach ($f in @("errata.mjs", "errata.cmd", "pass-worker.mjs", "consolidate-worker.mjs", "resources")) {
46
+ foreach ($f in @("errata.mjs", "errata.cmd", "pass-worker.mjs", "consolidate-worker.mjs", "generalize-worker.mjs", "resources")) {
47
47
  $p = Join-Path $LegacyDir $f
48
48
  if (Test-Path $p) { Remove-Item -Path $p -Recurse -Force -ErrorAction SilentlyContinue }
49
49
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inerrata-corporation/errata",
3
- "version": "2.0.20",
3
+ "version": "2.0.21-dev.3716",
4
4
  "description": "errata - local-first observation engine for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {
@@ -10,6 +10,7 @@
10
10
  "errata.mjs",
11
11
  "pass-worker.mjs",
12
12
  "consolidate-worker.mjs",
13
+ "generalize-worker.mjs",
13
14
  "resources",
14
15
  "install.ps1",
15
16
  "uninstall.ps1",
package/pass-worker.mjs CHANGED
@@ -25581,6 +25581,11 @@ CREATE INDEX IF NOT EXISTS nodes_live_description ON nodes(description, label) W
25581
25581
  -- Problems by the file their anchor hint names: the harvest upgrades hints for
25582
25582
  -- every edited file of every turn, and a scan parses every Problem's attrs.
25583
25583
  CREATE INDEX IF NOT EXISTS nodes_anchor_hint_path ON nodes(json_extract(attrs_json, '$.anchorHint.path')) WHERE valid_to IS NULL;
25584
+ -- Nodes still waiting on a root-cause ask. The MCP server checks this on EVERY
25585
+ -- tool response (the enrichment piggyback), so it must not parse every
25586
+ -- Solution's and Problem's attrs per call. Not partial: the Problem pull reads
25587
+ -- closed versions too.
25588
+ CREATE INDEX IF NOT EXISTS nodes_enrichment_pending ON nodes(json_extract(attrs_json, '$.enrichmentPending'));
25584
25589
  `;
25585
25590
  function encodeEmbedding(emb) {
25586
25591
  if (!emb || emb.length === 0) return null;
@@ -26238,7 +26243,10 @@ var SqliteGraphStore = class {
26238
26243
  }));
26239
26244
  }
26240
26245
  findAllVersionsByLabel(label, attribute) {
26241
- const rows = attribute ? this.db.prepare("SELECT * FROM nodes WHERE label = ? AND json_extract(attrs_json, ?) = ?").all(label, `$.${attribute.path}`, attribute.value) : this.stmts.findByLabelAll.all(label);
26246
+ if (attribute && !/^[A-Za-z0-9_]+(\.[A-Za-z0-9_]+)*$/.test(attribute.path)) {
26247
+ throw new Error(`invalid attr path: ${attribute.path}`);
26248
+ }
26249
+ const rows = attribute ? this.db.prepare(`SELECT * FROM nodes WHERE json_extract(attrs_json, '$.${attribute.path}') = ? AND label = ?`).all(attribute.value, label) : this.stmts.findByLabelAll.all(label);
26242
26250
  return rows.map(rowToNode);
26243
26251
  }
26244
26252
  searchNodes(opts) {
@@ -26263,6 +26271,21 @@ var SqliteGraphStore = class {
26263
26271
  const rows = this.db.prepare(sql).all(params);
26264
26272
  return rows.map(rowToNode);
26265
26273
  }
26274
+ searchDescriptionTerms(terms, limit) {
26275
+ if (terms.length === 0) return [];
26276
+ const score2 = terms.map(() => "(description LIKE ?)").join(" + ");
26277
+ const rows = this.db.prepare(
26278
+ `SELECT n.*, h.m AS matched
26279
+ FROM (SELECT rowid AS rid, ${score2} AS m
26280
+ FROM nodes INDEXED BY nodes_live_description
26281
+ WHERE valid_to IS NULL) h
26282
+ JOIN nodes n ON n.rowid = h.rid
26283
+ WHERE h.m > 0
26284
+ ORDER BY h.m DESC, n.page_rank DESC, n.last_updated_at DESC
26285
+ LIMIT ?`
26286
+ ).all(...terms.map((t) => `%${t}%`), Math.max(1, limit));
26287
+ return rows.map((r) => ({ node: rowToNode(r), matched: Number(r.matched) }));
26288
+ }
26266
26289
  typedEdgeStmt(sql) {
26267
26290
  let stmt = this.typedEdgeStmts.get(sql);
26268
26291
  if (!stmt) {
@@ -27197,7 +27220,11 @@ function priorsForFile(store2, relPath) {
27197
27220
  const resolvedProblems = [];
27198
27221
  const seenProblem = /* @__PURE__ */ new Set();
27199
27222
  const related = /* @__PURE__ */ new Map();
27200
- for (const e of store2.inEdges(file2.id, ["ANCHORED_AT"])) {
27223
+ const anchorEdges = [
27224
+ ...store2.inEdges(file2.id, ["ANCHORED_AT"]),
27225
+ ...store2.outEdges(file2.id, ["DEFINES"]).flatMap((d) => store2.inEdges(d.to, ["ANCHORED_AT"]))
27226
+ ];
27227
+ for (const e of anchorEdges) {
27201
27228
  const n = store2.getNode(e.from);
27202
27229
  if (!n) continue;
27203
27230
  if (n.label === "Problem" || n.label === "Vulnerability") {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "errata-context",
3
- "version": "2.0.20",
3
+ "version": "2.0.21-dev.3716",
4
4
  "description": "A minimal 3D view of loaded Errata priors and recent graph bursts.",
5
5
  "author": {
6
6
  "name": "inErrata"
@@ -1,4 +1,4 @@
1
- 744dc08096909009474181104263c674b562dce6f396894816c3d2e3684bbc15 .codex-plugin/plugin.json
1
+ da2a059b614c25491075da85eaf5f31609a9b467573b8dc378237c618d1fe1a4 .codex-plugin/plugin.json
2
2
  a7bebae9fb01c838d6c75fc784129e28be571233fa66ff5ee8039b574f35ccf7 assets/icon.png
3
3
  fc38b64e4df1e0b72c35764bef6c4c05430d97c9009ad0ecc8a9e75b4deab232 configure-local.mjs
4
4
  73dc6028b3b070257c7c31f252d11e55a9e096f4aed0f187f10cb21716e1e6d7 dist/client.js