@inerrata-corporation/errata 2.0.22-dev.4624 → 2.0.22-dev.4629

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.
@@ -17895,6 +17895,10 @@ CREATE INDEX IF NOT EXISTS edges_live ON edges(valid_to);
17895
17895
  -- of matching and sorting every live edge (the hourly liveness check: 163 MB \u2192
17896
17896
  -- 69 MB). Named by recentEdgeAttrCoverage; the planner keeps edges_live otherwise.
17897
17897
  CREATE INDEX IF NOT EXISTS edges_live_created ON edges(created_at) WHERE valid_to IS NULL;
17898
+ -- Live prior-tag edges by recency: the liveness corroboration check reads the
17899
+ -- newest 100 of ~300, and walking all live edges newest-first to find them read
17900
+ -- 69 MB. Its predicate is the one recentEdgeAttrCoverage uses for that marker.
17901
+ CREATE INDEX IF NOT EXISTS edges_live_prior_tag ON edges(created_at) WHERE valid_to IS NULL AND json_extract(attrs_json, '$.priorTag') = 1;
17898
17902
  -- Expression index on the per-node relPath (stored in attrs_json) so the
17899
17903
  -- incremental reindex can fetch just the changed files' symbols instead of
17900
17904
  -- scanning every versioned node. Partial: only live rows are ever queried.
@@ -17985,6 +17989,7 @@ function rowToEdge(r) {
17985
17989
  }
17986
17990
  var FINGERPRINT_INDEXED_LABELS = ["Problem", "Vulnerability", "Solution", "RootCause"];
17987
17991
  var NODE_LABELS_CHUNK = 256;
17992
+ var PRIOR_TAG_MARKER = '"priorTag":true';
17988
17993
  var SqliteGraphStore = class {
17989
17994
  db;
17990
17995
  // Typed edge lookups build their SQL from the number of types asked for, and
@@ -19046,7 +19051,22 @@ var SqliteGraphStore = class {
19046
19051
  ).get(...edgeTypes, label, cloudOnly ? 1 : 0);
19047
19052
  return { count: Number(r.count), total: Number(r.total) };
19048
19053
  }
19054
+ liveEdgeTargets(edgeTypes) {
19055
+ if (edgeTypes.length === 0) return [];
19056
+ const rows = this.db.prepare(`SELECT DISTINCT to_id FROM edges INDEXED BY edges_type WHERE type IN (${edgeTypes.map(() => "?").join(",")}) AND valid_to IS NULL`).all(...edgeTypes);
19057
+ return rows.map((r) => r.to_id);
19058
+ }
19049
19059
  recentEdgeAttrCoverage(marker, attr, limit) {
19060
+ if (marker === PRIOR_TAG_MARKER) {
19061
+ const r2 = this.db.prepare(
19062
+ `SELECT COUNT(*) AS total,
19063
+ COALESCE(SUM(CASE WHEN json_extract(attrs_json, '$.' || ?) = 1 THEN 1 ELSE 0 END), 0) AS count
19064
+ FROM (SELECT attrs_json FROM edges INDEXED BY edges_live_prior_tag
19065
+ WHERE valid_to IS NULL AND json_extract(attrs_json, '$.priorTag') = 1
19066
+ ORDER BY created_at DESC LIMIT ?)`
19067
+ ).get(attr, limit);
19068
+ return { count: Number(r2.count), total: Number(r2.total) };
19069
+ }
19050
19070
  const r = this.db.prepare(
19051
19071
  `SELECT COUNT(*) AS total,
19052
19072
  COALESCE(SUM(CASE WHEN json_extract(attrs_json, '$.' || ?) = 1 THEN 1 ELSE 0 END), 0) AS count
package/errata.mjs CHANGED
@@ -20628,7 +20628,7 @@ function rowToEdge(r) {
20628
20628
  function openGraphStore(opts) {
20629
20629
  return new SqliteGraphStore(opts);
20630
20630
  }
20631
- var PAGE_RANK_SCALE_KEY, TEXT_SEARCH_COLUMNS, LOCAL_RULE_OVERRIDES, SCHEMA_VERSION, SESSION_REPAIR_KEY, SESSION_EVIDENCE_PREDICATE, SCHEMA_SQL, TEMPORAL_INDEX_SQL, FINGERPRINT_INDEXED_LABELS, NODE_LABELS_CHUNK, SqliteGraphStore;
20631
+ var PAGE_RANK_SCALE_KEY, TEXT_SEARCH_COLUMNS, LOCAL_RULE_OVERRIDES, SCHEMA_VERSION, SESSION_REPAIR_KEY, SESSION_EVIDENCE_PREDICATE, SCHEMA_SQL, TEMPORAL_INDEX_SQL, FINGERPRINT_INDEXED_LABELS, NODE_LABELS_CHUNK, PRIOR_TAG_MARKER, SqliteGraphStore;
20632
20632
  var init_store = __esm({
20633
20633
  "../../packages/local-graph/src/store.ts"() {
20634
20634
  "use strict";
@@ -20804,6 +20804,10 @@ CREATE INDEX IF NOT EXISTS edges_live ON edges(valid_to);
20804
20804
  -- of matching and sorting every live edge (the hourly liveness check: 163 MB \u2192
20805
20805
  -- 69 MB). Named by recentEdgeAttrCoverage; the planner keeps edges_live otherwise.
20806
20806
  CREATE INDEX IF NOT EXISTS edges_live_created ON edges(created_at) WHERE valid_to IS NULL;
20807
+ -- Live prior-tag edges by recency: the liveness corroboration check reads the
20808
+ -- newest 100 of ~300, and walking all live edges newest-first to find them read
20809
+ -- 69 MB. Its predicate is the one recentEdgeAttrCoverage uses for that marker.
20810
+ CREATE INDEX IF NOT EXISTS edges_live_prior_tag ON edges(created_at) WHERE valid_to IS NULL AND json_extract(attrs_json, '$.priorTag') = 1;
20807
20811
  -- Expression index on the per-node relPath (stored in attrs_json) so the
20808
20812
  -- incremental reindex can fetch just the changed files' symbols instead of
20809
20813
  -- scanning every versioned node. Partial: only live rows are ever queried.
@@ -20837,6 +20841,7 @@ CREATE INDEX IF NOT EXISTS nodes_revisit_true ON nodes(valid_from) WHERE json_ty
20837
20841
  `;
20838
20842
  FINGERPRINT_INDEXED_LABELS = ["Problem", "Vulnerability", "Solution", "RootCause"];
20839
20843
  NODE_LABELS_CHUNK = 256;
20844
+ PRIOR_TAG_MARKER = '"priorTag":true';
20840
20845
  SqliteGraphStore = class {
20841
20846
  db;
20842
20847
  // Typed edge lookups build their SQL from the number of types asked for, and
@@ -21898,7 +21903,22 @@ CREATE INDEX IF NOT EXISTS nodes_revisit_true ON nodes(valid_from) WHERE json_ty
21898
21903
  ).get(...edgeTypes, label, cloudOnly ? 1 : 0);
21899
21904
  return { count: Number(r.count), total: Number(r.total) };
21900
21905
  }
21906
+ liveEdgeTargets(edgeTypes) {
21907
+ if (edgeTypes.length === 0) return [];
21908
+ const rows = this.db.prepare(`SELECT DISTINCT to_id FROM edges INDEXED BY edges_type WHERE type IN (${edgeTypes.map(() => "?").join(",")}) AND valid_to IS NULL`).all(...edgeTypes);
21909
+ return rows.map((r) => r.to_id);
21910
+ }
21901
21911
  recentEdgeAttrCoverage(marker, attr, limit) {
21912
+ if (marker === PRIOR_TAG_MARKER) {
21913
+ const r2 = this.db.prepare(
21914
+ `SELECT COUNT(*) AS total,
21915
+ COALESCE(SUM(CASE WHEN json_extract(attrs_json, '$.' || ?) = 1 THEN 1 ELSE 0 END), 0) AS count
21916
+ FROM (SELECT attrs_json FROM edges INDEXED BY edges_live_prior_tag
21917
+ WHERE valid_to IS NULL AND json_extract(attrs_json, '$.priorTag') = 1
21918
+ ORDER BY created_at DESC LIMIT ?)`
21919
+ ).get(attr, limit);
21920
+ return { count: Number(r2.count), total: Number(r2.total) };
21921
+ }
21902
21922
  const r = this.db.prepare(
21903
21923
  `SELECT COUNT(*) AS total,
21904
21924
  COALESCE(SUM(CASE WHEN json_extract(attrs_json, '$.' || ?) = 1 THEN 1 ELSE 0 END), 0) AS count
@@ -26846,6 +26866,13 @@ var init_principle_sync = __esm({
26846
26866
 
26847
26867
  // ../../packages/local-graph/src/mechanism-liveness.ts
26848
26868
  function evaluateFed(store, d, stamps) {
26869
+ const incomingRows = d.fedIncoming && store.liveEdgeTargets ? stamps?.(d.fedIncoming.label, "source") : void 0;
26870
+ if (d.fedIncoming && incomingRows) {
26871
+ const targets = new Set(store.liveEdgeTargets(d.fedIncoming.edgeTypes));
26872
+ const rows = d.fedIncoming.cloudOnly ? incomingRows.filter((r) => r.cloud) : incomingRows;
26873
+ const count2 = rows.filter((r) => targets.has(r.id)).length;
26874
+ return { count: count2, total: rows.length, fraction: rows.length === 0 ? 0 : count2 / rows.length };
26875
+ }
26849
26876
  if (d.fedIncoming) {
26850
26877
  const { count: count2, total } = store.incomingEdgeCoverage?.(
26851
26878
  d.fedIncoming.label,
@@ -26890,6 +26917,7 @@ function evaluateMechanisms(store, invocations = /* @__PURE__ */ new Map(), mech
26890
26917
  };
26891
26918
  const wanted = /* @__PURE__ */ new Map();
26892
26919
  for (const d of mechanisms) for (const l of d.fed?.labels ?? []) wanted.set(l, (wanted.get(l) ?? /* @__PURE__ */ new Set()).add(d.fed.attr));
26920
+ for (const d of mechanisms) if (d.fedIncoming) wanted.set(d.fedIncoming.label, (wanted.get(d.fedIncoming.label) ?? /* @__PURE__ */ new Set()).add("source"));
26893
26921
  const byLabel = /* @__PURE__ */ new Map();
26894
26922
  const stamps = store.findNodeStampsByLabelAttrs ? (label, attr) => {
26895
26923
  if (!byLabel.has(label)) byLabel.set(label, store.findNodeStampsByLabelAttrs(label, [...wanted.get(label) ?? [attr]]));
@@ -86817,7 +86845,7 @@ function createWatchBreaker(deps) {
86817
86845
  }
86818
86846
 
86819
86847
  // src/engine.ts
86820
- var DAEMON_VERSION = true ? "2.0.22-dev.4624" : "2.0.0-alpha.0";
86848
+ var DAEMON_VERSION = true ? "2.0.22-dev.4629" : "2.0.0-alpha.0";
86821
86849
  var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
86822
86850
  var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
86823
86851
  var GIT_OP_MUTE_MS = 4e3;
@@ -16292,6 +16292,10 @@ CREATE INDEX IF NOT EXISTS edges_live ON edges(valid_to);
16292
16292
  -- of matching and sorting every live edge (the hourly liveness check: 163 MB \u2192
16293
16293
  -- 69 MB). Named by recentEdgeAttrCoverage; the planner keeps edges_live otherwise.
16294
16294
  CREATE INDEX IF NOT EXISTS edges_live_created ON edges(created_at) WHERE valid_to IS NULL;
16295
+ -- Live prior-tag edges by recency: the liveness corroboration check reads the
16296
+ -- newest 100 of ~300, and walking all live edges newest-first to find them read
16297
+ -- 69 MB. Its predicate is the one recentEdgeAttrCoverage uses for that marker.
16298
+ CREATE INDEX IF NOT EXISTS edges_live_prior_tag ON edges(created_at) WHERE valid_to IS NULL AND json_extract(attrs_json, '$.priorTag') = 1;
16295
16299
  -- Expression index on the per-node relPath (stored in attrs_json) so the
16296
16300
  -- incremental reindex can fetch just the changed files' symbols instead of
16297
16301
  -- scanning every versioned node. Partial: only live rows are ever queried.
@@ -16382,6 +16386,7 @@ function rowToEdge(r) {
16382
16386
  }
16383
16387
  var FINGERPRINT_INDEXED_LABELS = ["Problem", "Vulnerability", "Solution", "RootCause"];
16384
16388
  var NODE_LABELS_CHUNK = 256;
16389
+ var PRIOR_TAG_MARKER = '"priorTag":true';
16385
16390
  var SqliteGraphStore = class {
16386
16391
  db;
16387
16392
  // Typed edge lookups build their SQL from the number of types asked for, and
@@ -17443,7 +17448,22 @@ var SqliteGraphStore = class {
17443
17448
  ).get(...edgeTypes, label, cloudOnly ? 1 : 0);
17444
17449
  return { count: Number(r.count), total: Number(r.total) };
17445
17450
  }
17451
+ liveEdgeTargets(edgeTypes) {
17452
+ if (edgeTypes.length === 0) return [];
17453
+ const rows = this.db.prepare(`SELECT DISTINCT to_id FROM edges INDEXED BY edges_type WHERE type IN (${edgeTypes.map(() => "?").join(",")}) AND valid_to IS NULL`).all(...edgeTypes);
17454
+ return rows.map((r) => r.to_id);
17455
+ }
17446
17456
  recentEdgeAttrCoverage(marker, attr, limit) {
17457
+ if (marker === PRIOR_TAG_MARKER) {
17458
+ const r2 = this.db.prepare(
17459
+ `SELECT COUNT(*) AS total,
17460
+ COALESCE(SUM(CASE WHEN json_extract(attrs_json, '$.' || ?) = 1 THEN 1 ELSE 0 END), 0) AS count
17461
+ FROM (SELECT attrs_json FROM edges INDEXED BY edges_live_prior_tag
17462
+ WHERE valid_to IS NULL AND json_extract(attrs_json, '$.priorTag') = 1
17463
+ ORDER BY created_at DESC LIMIT ?)`
17464
+ ).get(attr, limit);
17465
+ return { count: Number(r2.count), total: Number(r2.total) };
17466
+ }
17447
17467
  const r = this.db.prepare(
17448
17468
  `SELECT COUNT(*) AS total,
17449
17469
  COALESCE(SUM(CASE WHEN json_extract(attrs_json, '$.' || ?) = 1 THEN 1 ELSE 0 END), 0) AS count
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inerrata-corporation/errata",
3
- "version": "2.0.22-dev.4624",
3
+ "version": "2.0.22-dev.4629",
4
4
  "description": "errata - local-first observation engine for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {
package/pass-worker.mjs CHANGED
@@ -27160,6 +27160,10 @@ CREATE INDEX IF NOT EXISTS edges_live ON edges(valid_to);
27160
27160
  -- of matching and sorting every live edge (the hourly liveness check: 163 MB \u2192
27161
27161
  -- 69 MB). Named by recentEdgeAttrCoverage; the planner keeps edges_live otherwise.
27162
27162
  CREATE INDEX IF NOT EXISTS edges_live_created ON edges(created_at) WHERE valid_to IS NULL;
27163
+ -- Live prior-tag edges by recency: the liveness corroboration check reads the
27164
+ -- newest 100 of ~300, and walking all live edges newest-first to find them read
27165
+ -- 69 MB. Its predicate is the one recentEdgeAttrCoverage uses for that marker.
27166
+ CREATE INDEX IF NOT EXISTS edges_live_prior_tag ON edges(created_at) WHERE valid_to IS NULL AND json_extract(attrs_json, '$.priorTag') = 1;
27163
27167
  -- Expression index on the per-node relPath (stored in attrs_json) so the
27164
27168
  -- incremental reindex can fetch just the changed files' symbols instead of
27165
27169
  -- scanning every versioned node. Partial: only live rows are ever queried.
@@ -27250,6 +27254,7 @@ function rowToEdge(r) {
27250
27254
  }
27251
27255
  var FINGERPRINT_INDEXED_LABELS = ["Problem", "Vulnerability", "Solution", "RootCause"];
27252
27256
  var NODE_LABELS_CHUNK = 256;
27257
+ var PRIOR_TAG_MARKER = '"priorTag":true';
27253
27258
  var SqliteGraphStore = class {
27254
27259
  db;
27255
27260
  // Typed edge lookups build their SQL from the number of types asked for, and
@@ -28311,7 +28316,22 @@ var SqliteGraphStore = class {
28311
28316
  ).get(...edgeTypes, label, cloudOnly ? 1 : 0);
28312
28317
  return { count: Number(r.count), total: Number(r.total) };
28313
28318
  }
28319
+ liveEdgeTargets(edgeTypes) {
28320
+ if (edgeTypes.length === 0) return [];
28321
+ const rows = this.db.prepare(`SELECT DISTINCT to_id FROM edges INDEXED BY edges_type WHERE type IN (${edgeTypes.map(() => "?").join(",")}) AND valid_to IS NULL`).all(...edgeTypes);
28322
+ return rows.map((r) => r.to_id);
28323
+ }
28314
28324
  recentEdgeAttrCoverage(marker, attr, limit) {
28325
+ if (marker === PRIOR_TAG_MARKER) {
28326
+ const r2 = this.db.prepare(
28327
+ `SELECT COUNT(*) AS total,
28328
+ COALESCE(SUM(CASE WHEN json_extract(attrs_json, '$.' || ?) = 1 THEN 1 ELSE 0 END), 0) AS count
28329
+ FROM (SELECT attrs_json FROM edges INDEXED BY edges_live_prior_tag
28330
+ WHERE valid_to IS NULL AND json_extract(attrs_json, '$.priorTag') = 1
28331
+ ORDER BY created_at DESC LIMIT ?)`
28332
+ ).get(attr, limit);
28333
+ return { count: Number(r2.count), total: Number(r2.total) };
28334
+ }
28315
28335
  const r = this.db.prepare(
28316
28336
  `SELECT COUNT(*) AS total,
28317
28337
  COALESCE(SUM(CASE WHEN json_extract(attrs_json, '$.' || ?) = 1 THEN 1 ELSE 0 END), 0) AS count
@@ -30164,6 +30184,13 @@ var COLUMN_INPUTS = {
30164
30184
  __createdAtSeq: (n) => n.createdAtSeq !== void 0 && n.createdAtSeq !== null
30165
30185
  };
30166
30186
  function evaluateFed(store2, d, stamps) {
30187
+ const incomingRows = d.fedIncoming && store2.liveEdgeTargets ? stamps?.(d.fedIncoming.label, "source") : void 0;
30188
+ if (d.fedIncoming && incomingRows) {
30189
+ const targets = new Set(store2.liveEdgeTargets(d.fedIncoming.edgeTypes));
30190
+ const rows = d.fedIncoming.cloudOnly ? incomingRows.filter((r) => r.cloud) : incomingRows;
30191
+ const count2 = rows.filter((r) => targets.has(r.id)).length;
30192
+ return { count: count2, total: rows.length, fraction: rows.length === 0 ? 0 : count2 / rows.length };
30193
+ }
30167
30194
  if (d.fedIncoming) {
30168
30195
  const { count: count2, total } = store2.incomingEdgeCoverage?.(
30169
30196
  d.fedIncoming.label,
@@ -30208,6 +30235,7 @@ function evaluateMechanisms(store2, invocations = /* @__PURE__ */ new Map(), mec
30208
30235
  };
30209
30236
  const wanted = /* @__PURE__ */ new Map();
30210
30237
  for (const d of mechanisms) for (const l of d.fed?.labels ?? []) wanted.set(l, (wanted.get(l) ?? /* @__PURE__ */ new Set()).add(d.fed.attr));
30238
+ for (const d of mechanisms) if (d.fedIncoming) wanted.set(d.fedIncoming.label, (wanted.get(d.fedIncoming.label) ?? /* @__PURE__ */ new Set()).add("source"));
30211
30239
  const byLabel = /* @__PURE__ */ new Map();
30212
30240
  const stamps = store2.findNodeStampsByLabelAttrs ? (label, attr) => {
30213
30241
  if (!byLabel.has(label)) byLabel.set(label, store2.findNodeStampsByLabelAttrs(label, [...wanted.get(label) ?? [attr]]));
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "errata-context",
3
- "version": "2.0.22-dev.4624",
3
+ "version": "2.0.22-dev.4629",
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
- 2f2ed72ed3ac78912e2f6d5afbfd43bb55b67b91e397c9c559d045d0b93f1bde .codex-plugin/plugin.json
1
+ 6116713b2c7fa083cb68622899bbfe5c62167d3c1b8d6d62ec2c81e4cc391baa .codex-plugin/plugin.json
2
2
  a7bebae9fb01c838d6c75fc784129e28be571233fa66ff5ee8039b574f35ccf7 assets/icon.png
3
3
  fc38b64e4df1e0b72c35764bef6c4c05430d97c9009ad0ecc8a9e75b4deab232 configure-local.mjs
4
4
  73dc6028b3b070257c7c31f252d11e55a9e096f4aed0f187f10cb21716e1e6d7 dist/client.js