@inerrata-corporation/errata 2.0.22-dev.4180 → 2.0.22-dev.4277

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.
@@ -17052,7 +17052,7 @@ function installHistoryAttrSlim(db) {
17052
17052
  }
17053
17053
 
17054
17054
  // ../../packages/local-graph/src/text-index.ts
17055
- var TEXT_INDEX_KEY = "text-index-trigram-1";
17055
+ var TEXT_INDEX_KEY = "text-index-trigram-2";
17056
17056
  var TEXT_INDEX_MIN_TERM = 3;
17057
17057
  function installTextIndex(db) {
17058
17058
  if (db.prepare("SELECT value FROM store_meta WHERE key = ?").get(TEXT_INDEX_KEY)) return;
@@ -17065,17 +17065,23 @@ function installTextIndex(db) {
17065
17065
  db.transaction(() => {
17066
17066
  db.exec(`CREATE VIRTUAL TABLE IF NOT EXISTS nodes_text
17067
17067
  USING fts5(description, content='nodes', content_rowid='rowid', tokenize='trigram')`);
17068
+ db.exec(`DROP TRIGGER IF EXISTS nodes_text_update_out; DROP TRIGGER IF EXISTS nodes_text_update_in;
17069
+ DROP TRIGGER IF EXISTS nodes_text_update`);
17068
17070
  db.exec(`CREATE TRIGGER IF NOT EXISTS nodes_text_insert AFTER INSERT ON nodes WHEN NEW.valid_to IS NULL
17069
17071
  BEGIN INSERT INTO nodes_text(rowid, description) VALUES (NEW.rowid, NEW.description); END;`);
17070
- db.exec(`CREATE TRIGGER IF NOT EXISTS nodes_text_update_out AFTER UPDATE OF description, valid_to ON nodes
17071
- WHEN OLD.valid_to IS NULL
17072
- BEGIN INSERT INTO nodes_text(nodes_text, rowid, description) VALUES ('delete', OLD.rowid, OLD.description); END;`);
17073
- db.exec(`CREATE TRIGGER IF NOT EXISTS nodes_text_update_in AFTER UPDATE OF description, valid_to ON nodes
17074
- WHEN NEW.valid_to IS NULL
17075
- BEGIN INSERT INTO nodes_text(rowid, description) VALUES (NEW.rowid, NEW.description); END;`);
17072
+ db.exec(`CREATE TRIGGER nodes_text_update AFTER UPDATE OF description, valid_to ON nodes
17073
+ WHEN OLD.description IS NOT NEW.description OR OLD.valid_to IS NOT NEW.valid_to
17074
+ BEGIN
17075
+ INSERT INTO nodes_text(nodes_text, rowid, description)
17076
+ SELECT 'delete', OLD.rowid, OLD.description WHERE OLD.valid_to IS NULL;
17077
+ INSERT INTO nodes_text(rowid, description)
17078
+ SELECT NEW.rowid, NEW.description WHERE NEW.valid_to IS NULL;
17079
+ END;`);
17076
17080
  db.exec(`CREATE TRIGGER IF NOT EXISTS nodes_text_delete AFTER DELETE ON nodes WHEN OLD.valid_to IS NULL
17077
17081
  BEGIN INSERT INTO nodes_text(nodes_text, rowid, description) VALUES ('delete', OLD.rowid, OLD.description); END;`);
17082
+ db.exec(`INSERT INTO nodes_text(nodes_text) VALUES ('delete-all')`);
17078
17083
  db.exec(`INSERT INTO nodes_text(rowid, description) SELECT rowid, description FROM nodes WHERE valid_to IS NULL`);
17084
+ db.prepare("INSERT OR REPLACE INTO store_meta(key,value) VALUES (?,?)").run("text-index-trigram-1", "installed");
17079
17085
  db.prepare("INSERT INTO store_meta(key,value) VALUES (?,?)").run(TEXT_INDEX_KEY, "installed");
17080
17086
  });
17081
17087
  }
@@ -21020,7 +21026,9 @@ function buildInstanceIngest(store, profile, daemonVersion, ignorePatterns = [],
21020
21026
  sidecarNoSummary: 0,
21021
21027
  fileRefsSubstituted: 0,
21022
21028
  fileRefLexiconMisses: 0,
21023
- collapsedEdges: 0
21029
+ collapsedEdges: 0,
21030
+ edgesHeldParked: 0,
21031
+ edgesHeldDropped: 0
21024
21032
  };
21025
21033
  const sharedCauses = /* @__PURE__ */ new Map();
21026
21034
  const causalQueue = store.findNodeFieldsByLabel("Problem", ["source", "resolvedAs"]).filter((r) => r.attrs["source"] !== "cloud" && r.attrs["resolvedAs"] !== PROBLEM_RESOLUTION.FALSE_POSITIVE).map((r) => r.id).filter((id) => ignorePatterns.length === 0 || !ignored(store.getNode(id)?.description ?? ""));
@@ -21331,6 +21339,30 @@ function buildInstanceIngest(store, profile, daemonVersion, ignorePatterns = [],
21331
21339
  if (count > 0) symbolSummaries = sidecar;
21332
21340
  }
21333
21341
  edges.push(...anchorEdges);
21342
+ if (opts.edgeHolds && Object.keys(opts.edgeHolds).length > 0) {
21343
+ const holds = opts.edgeHolds;
21344
+ const shipsHere = (wireId) => (endpointSources[wireId] ?? [wireId]).some((localId) => shippedById.has(localId));
21345
+ const kept = [];
21346
+ for (const e of edges) {
21347
+ const hold = holds[e.id];
21348
+ if (!hold || hold === "held" && (shipsHere(e.from) || shipsHere(e.to))) {
21349
+ kept.push(e);
21350
+ continue;
21351
+ }
21352
+ if (hold === "held") {
21353
+ composition.edgesHeldParked++;
21354
+ for (const localId of endpointSources[e.from] ?? [e.from]) {
21355
+ delete anchorDigests[localId];
21356
+ delete semanticEdgeDigests[localId];
21357
+ delete projectAnchorDigests[localId];
21358
+ }
21359
+ } else {
21360
+ composition.edgesHeldDropped++;
21361
+ }
21362
+ }
21363
+ edges.length = 0;
21364
+ edges.push(...kept);
21365
+ }
21334
21366
  const bindingEndpoints = /* @__PURE__ */ new Set();
21335
21367
  for (const e of edges) {
21336
21368
  if (e.type === "CAUSED_BY" || e.type === "SOLVED_BY") {
@@ -21412,7 +21444,8 @@ function buildDrainInstances(store, sharedStore, input) {
21412
21444
  ...lexicon ? { lexicon } : {},
21413
21445
  ...fileLexicon ? { fileLexicon } : {},
21414
21446
  ...input.project ? { project: input.project } : {},
21415
- ...input.quarantinedSessions?.length ? { quarantinedSessions: input.quarantinedSessions } : {}
21447
+ ...input.quarantinedSessions?.length ? { quarantinedSessions: input.quarantinedSessions } : {},
21448
+ ...input.edgeHolds ? { edgeHolds: input.edgeHolds } : {}
21416
21449
  });
21417
21450
  return {
21418
21451
  batch,