@inerrata-corporation/errata 2.0.2-dev.79 → 2.0.2-dev.81

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.
@@ -16028,6 +16028,13 @@ var SqliteGraphStore = class {
16028
16028
  findByLabel: this.db.prepare(
16029
16029
  "SELECT * FROM nodes WHERE label = ? AND valid_to IS NULL"
16030
16030
  ),
16031
+ // Scalar count twin of findByLabel — same live-row semantics, no row
16032
+ // hydration. Exists because status surfaces (daemon `/` + `/health`) used
16033
+ // findNodesByLabel(...).length, materializing every row's attrs JSON and
16034
+ // embedding blob per request — seconds of synchronous loop-hold per poll.
16035
+ countByLabel: this.db.prepare(
16036
+ "SELECT COUNT(*) AS n FROM nodes WHERE label = ? AND valid_to IS NULL"
16037
+ ),
16031
16038
  // ALL versions of a label — incl frozen/closed (valid_to set). Used by the
16032
16039
  // clean-reindex purge so a true wipe removes history too, not just live rows.
16033
16040
  findByLabelAll: this.db.prepare("SELECT * FROM nodes WHERE label = ?"),
@@ -16281,6 +16288,13 @@ var SqliteGraphStore = class {
16281
16288
  const rows = this.stmts.findByLabel.all(label);
16282
16289
  return rows.map(rowToNode);
16283
16290
  }
16291
+ /** Live-row count for a label — `findNodesByLabel(label).length` without the
16292
+ * per-row hydration (attrs JSON + embedding blob). Status surfaces poll this
16293
+ * per project per request; the materializing form held the daemon's event
16294
+ * loop for seconds at scale. */
16295
+ countNodesByLabel(label) {
16296
+ return Number(this.stmts.countByLabel.get(label).n);
16297
+ }
16284
16298
  findAllVersionsByLabel(label) {
16285
16299
  const rows = this.stmts.findByLabelAll.all(label);
16286
16300
  return rows.map(rowToNode);
package/errata.mjs CHANGED
@@ -16674,6 +16674,13 @@ CREATE INDEX IF NOT EXISTS nodes_relpath ON nodes(json_extract(attrs_json, '$.re
16674
16674
  findByLabel: this.db.prepare(
16675
16675
  "SELECT * FROM nodes WHERE label = ? AND valid_to IS NULL"
16676
16676
  ),
16677
+ // Scalar count twin of findByLabel — same live-row semantics, no row
16678
+ // hydration. Exists because status surfaces (daemon `/` + `/health`) used
16679
+ // findNodesByLabel(...).length, materializing every row's attrs JSON and
16680
+ // embedding blob per request — seconds of synchronous loop-hold per poll.
16681
+ countByLabel: this.db.prepare(
16682
+ "SELECT COUNT(*) AS n FROM nodes WHERE label = ? AND valid_to IS NULL"
16683
+ ),
16677
16684
  // ALL versions of a label — incl frozen/closed (valid_to set). Used by the
16678
16685
  // clean-reindex purge so a true wipe removes history too, not just live rows.
16679
16686
  findByLabelAll: this.db.prepare("SELECT * FROM nodes WHERE label = ?"),
@@ -16927,6 +16934,13 @@ CREATE INDEX IF NOT EXISTS nodes_relpath ON nodes(json_extract(attrs_json, '$.re
16927
16934
  const rows = this.stmts.findByLabel.all(label);
16928
16935
  return rows.map(rowToNode);
16929
16936
  }
16937
+ /** Live-row count for a label — `findNodesByLabel(label).length` without the
16938
+ * per-row hydration (attrs JSON + embedding blob). Status surfaces poll this
16939
+ * per project per request; the materializing form held the daemon's event
16940
+ * loop for seconds at scale. */
16941
+ countNodesByLabel(label) {
16942
+ return Number(this.stmts.countByLabel.get(label).n);
16943
+ }
16930
16944
  findAllVersionsByLabel(label) {
16931
16945
  const rows = this.stmts.findByLabelAll.all(label);
16932
16946
  return rows.map(rowToNode);
@@ -51681,7 +51695,7 @@ function startLoopLagMonitor(thresholdMs = 1e3) {
51681
51695
  }
51682
51696
 
51683
51697
  // src/engine.ts
51684
- var DAEMON_VERSION = true ? "2.0.2-dev.79" : "2.0.0-alpha.0";
51698
+ var DAEMON_VERSION = true ? "2.0.2-dev.81" : "2.0.0-alpha.0";
51685
51699
  var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
51686
51700
  var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
51687
51701
  var GIT_OP_MUTE_MS = 4e3;
@@ -54213,8 +54227,10 @@ async function startMultiDaemon(opts = {}) {
54213
54227
  path: r.root,
54214
54228
  stack: r.entry.stack,
54215
54229
  nodes: r.engine.store.nodeCount(),
54216
- problems: r.engine.store.findNodesByLabel("Problem").length,
54217
- solutions: r.engine.store.findNodesByLabel("Solution").length,
54230
+ // COUNT(*) — the materializing findNodesByLabel(...).length form held
54231
+ // the event loop for seconds per poll once stores grew (HZ-index-hydrate).
54232
+ problems: r.engine.store.countNodesByLabel("Problem"),
54233
+ solutions: r.engine.store.countNodesByLabel("Solution"),
54218
54234
  endpoints: `/ws/${r.id}/`
54219
54235
  })),
54220
54236
  humanView: "run `errata report` \u2014 the dashboard was retired (GRAFT 4e)"
@@ -54270,8 +54286,9 @@ async function startMultiDaemon(opts = {}) {
54270
54286
  name: r.entry.name,
54271
54287
  path: r.root,
54272
54288
  nodes: r.engine.store.nodeCount(),
54273
- problems: r.engine.store.findNodesByLabel("Problem").length,
54274
- solutions: r.engine.store.findNodesByLabel("Solution").length,
54289
+ // COUNT(*) — same hydration hazard as `/` (HZ-index-hydrate).
54290
+ problems: r.engine.store.countNodesByLabel("Problem"),
54291
+ solutions: r.engine.store.countNodesByLabel("Solution"),
54275
54292
  stranded: strandedCount(r)
54276
54293
  }))
54277
54294
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inerrata-corporation/errata",
3
- "version": "2.0.2-dev.79",
3
+ "version": "2.0.2-dev.81",
4
4
  "description": "errata - local-first observation engine for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {
package/pass-worker.mjs CHANGED
@@ -24335,6 +24335,13 @@ var SqliteGraphStore = class {
24335
24335
  findByLabel: this.db.prepare(
24336
24336
  "SELECT * FROM nodes WHERE label = ? AND valid_to IS NULL"
24337
24337
  ),
24338
+ // Scalar count twin of findByLabel — same live-row semantics, no row
24339
+ // hydration. Exists because status surfaces (daemon `/` + `/health`) used
24340
+ // findNodesByLabel(...).length, materializing every row's attrs JSON and
24341
+ // embedding blob per request — seconds of synchronous loop-hold per poll.
24342
+ countByLabel: this.db.prepare(
24343
+ "SELECT COUNT(*) AS n FROM nodes WHERE label = ? AND valid_to IS NULL"
24344
+ ),
24338
24345
  // ALL versions of a label — incl frozen/closed (valid_to set). Used by the
24339
24346
  // clean-reindex purge so a true wipe removes history too, not just live rows.
24340
24347
  findByLabelAll: this.db.prepare("SELECT * FROM nodes WHERE label = ?"),
@@ -24588,6 +24595,13 @@ var SqliteGraphStore = class {
24588
24595
  const rows = this.stmts.findByLabel.all(label);
24589
24596
  return rows.map(rowToNode);
24590
24597
  }
24598
+ /** Live-row count for a label — `findNodesByLabel(label).length` without the
24599
+ * per-row hydration (attrs JSON + embedding blob). Status surfaces poll this
24600
+ * per project per request; the materializing form held the daemon's event
24601
+ * loop for seconds at scale. */
24602
+ countNodesByLabel(label) {
24603
+ return Number(this.stmts.countByLabel.get(label).n);
24604
+ }
24591
24605
  findAllVersionsByLabel(label) {
24592
24606
  const rows = this.stmts.findByLabelAll.all(label);
24593
24607
  return rows.map(rowToNode);