@inerrata-corporation/errata 2.0.2-dev.500 → 2.0.2-dev.503

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
@@ -19300,7 +19300,8 @@ function markFixCandidates(store, t) {
19300
19300
  if (e.attrs?.["mention"] === true) continue;
19301
19301
  if (e.attrs?.["anchorProvenance"] === "legacy") continue;
19302
19302
  const sym = store.getNode(e.to);
19303
- if (sym && sym.lastUpdatedAt > since) {
19303
+ const changedAt = sym?.label === "File" ? Number(sym.attrs["contentChangedAt"] ?? 0) : sym?.lastUpdatedAt ?? 0;
19304
+ if (sym && changedAt > since) {
19304
19305
  edited = true;
19305
19306
  symName = sym.description;
19306
19307
  symRelPath = sym.attrs["relPath"] ?? void 0;
@@ -19335,9 +19336,11 @@ function markFixCandidates(store, t) {
19335
19336
  return resolved;
19336
19337
  }
19337
19338
  function clearSettledFixCandidates(store, t) {
19338
- const report = { answered: 0, ignored: 0, standing: 0 };
19339
+ const report = { answered: 0, ignored: 0, unsubstantiated: 0, standing: 0 };
19339
19340
  for (const p of store.findNodesByLabel("Problem")) {
19340
19341
  if (p.attrs["fixCandidateAt"] === void 0) continue;
19342
+ const fileAnchors = store.outEdges(p.id, ["ANCHORED_AT"]).filter((e) => e.attrs?.["mention"] !== true && e.attrs?.["anchorProvenance"] !== "legacy").map((e) => store.getNode(e.to)).filter((n) => n !== null && n.label === "File");
19343
+ const unsubstantiated = fileAnchors.length > 0 && fileAnchors.every((f) => f.attrs["contentChangedAt"] === void 0);
19341
19344
  const answered = p.attrs["resolvedAt"] != null || store.outEdges(p.id, ["SOLVED_BY"]).some((e) => {
19342
19345
  const s = store.getNode(e.to);
19343
19346
  return s !== null && !String(s.description ?? "").startsWith(AUTO_MINT_PREFIX);
@@ -19347,7 +19350,7 @@ function clearSettledFixCandidates(store, t) {
19347
19350
  );
19348
19351
  const shownSinceAsk = Number(p.attrs["shownCount"] ?? 0) - base;
19349
19352
  const ignored = shownSinceAsk >= FIX_CANDIDATE_ASK_LIMIT;
19350
- if (!answered && !ignored) {
19353
+ if (!answered && !ignored && !unsubstantiated) {
19351
19354
  report.standing++;
19352
19355
  continue;
19353
19356
  }
@@ -19358,7 +19361,8 @@ function clearSettledFixCandidates(store, t) {
19358
19361
  attrs["fixCandidateClearedAt"] = t;
19359
19362
  store.updateNode(p.id, { attrs, lastUpdatedAt: t });
19360
19363
  if (answered) report.answered++;
19361
- else report.ignored++;
19364
+ else if (ignored) report.ignored++;
19365
+ else report.unsubstantiated++;
19362
19366
  }
19363
19367
  return report;
19364
19368
  }
@@ -28529,7 +28533,7 @@ function runNightlyPipeline(store) {
28529
28533
  skillsRefreshed: 0,
28530
28534
  designResolved,
28531
28535
  revisitsCleared: revisits.cleared,
28532
- fixCandidatesSettled: fixCandidates.answered + fixCandidates.ignored,
28536
+ fixCandidatesSettled: fixCandidates.answered + fixCandidates.ignored + fixCandidates.unsubstantiated,
28533
28537
  claimsEvaluated: cry.evaluated,
28534
28538
  claimsDerived: cry.derived.length,
28535
28539
  durationMs: Date.now() - started2
@@ -29725,7 +29729,15 @@ async function incrementalReindex(store, rootPath, workspaceId2, changedAbsPaths
29725
29729
  const h = fileHashes.get(rel);
29726
29730
  if (!h) continue;
29727
29731
  const fnode = store.getNode(fileNodeId(workspaceId2, rel));
29728
- if (fnode) store.updateNode(fnode.id, { attrs: { ...fnode.attrs, contentHash: h } });
29732
+ if (!fnode) continue;
29733
+ const contentMoved = fnode.attrs["contentHash"] !== h;
29734
+ store.updateNode(fnode.id, {
29735
+ attrs: {
29736
+ ...fnode.attrs,
29737
+ contentHash: h,
29738
+ ...contentMoved ? { contentChangedAt: t } : {}
29739
+ }
29740
+ });
29729
29741
  }
29730
29742
  return {
29731
29743
  filesReindexed: changedRelPaths.size,
@@ -53785,7 +53797,7 @@ function startLoopLagMonitor(thresholdMs = 1e3) {
53785
53797
  }
53786
53798
 
53787
53799
  // src/engine.ts
53788
- var DAEMON_VERSION = true ? "2.0.2-dev.500" : "2.0.0-alpha.0";
53800
+ var DAEMON_VERSION = true ? "2.0.2-dev.503" : "2.0.0-alpha.0";
53789
53801
  var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
53790
53802
  var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
53791
53803
  var GIT_OP_MUTE_MS = 4e3;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inerrata-corporation/errata",
3
- "version": "2.0.2-dev.500",
3
+ "version": "2.0.2-dev.503",
4
4
  "description": "errata - local-first observation engine for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {
package/pass-worker.mjs CHANGED
@@ -16139,7 +16139,15 @@ async function incrementalReindex(store2, rootPath, workspaceId, changedAbsPaths
16139
16139
  const h = fileHashes.get(rel);
16140
16140
  if (!h) continue;
16141
16141
  const fnode = store2.getNode(fileNodeId(workspaceId, rel));
16142
- if (fnode) store2.updateNode(fnode.id, { attrs: { ...fnode.attrs, contentHash: h } });
16142
+ if (!fnode) continue;
16143
+ const contentMoved = fnode.attrs["contentHash"] !== h;
16144
+ store2.updateNode(fnode.id, {
16145
+ attrs: {
16146
+ ...fnode.attrs,
16147
+ contentHash: h,
16148
+ ...contentMoved ? { contentChangedAt: t } : {}
16149
+ }
16150
+ });
16143
16151
  }
16144
16152
  return {
16145
16153
  filesReindexed: changedRelPaths.size,
@@ -25584,7 +25592,8 @@ function markFixCandidates(store2, t) {
25584
25592
  if (e.attrs?.["mention"] === true) continue;
25585
25593
  if (e.attrs?.["anchorProvenance"] === "legacy") continue;
25586
25594
  const sym = store2.getNode(e.to);
25587
- if (sym && sym.lastUpdatedAt > since) {
25595
+ const changedAt = sym?.label === "File" ? Number(sym.attrs["contentChangedAt"] ?? 0) : sym?.lastUpdatedAt ?? 0;
25596
+ if (sym && changedAt > since) {
25588
25597
  edited = true;
25589
25598
  symName = sym.description;
25590
25599
  symRelPath = sym.attrs["relPath"] ?? void 0;
@@ -25620,9 +25629,11 @@ function markFixCandidates(store2, t) {
25620
25629
  }
25621
25630
  var FIX_CANDIDATE_ASK_LIMIT = 5;
25622
25631
  function clearSettledFixCandidates(store2, t) {
25623
- const report = { answered: 0, ignored: 0, standing: 0 };
25632
+ const report = { answered: 0, ignored: 0, unsubstantiated: 0, standing: 0 };
25624
25633
  for (const p of store2.findNodesByLabel("Problem")) {
25625
25634
  if (p.attrs["fixCandidateAt"] === void 0) continue;
25635
+ const fileAnchors = store2.outEdges(p.id, ["ANCHORED_AT"]).filter((e) => e.attrs?.["mention"] !== true && e.attrs?.["anchorProvenance"] !== "legacy").map((e) => store2.getNode(e.to)).filter((n) => n !== null && n.label === "File");
25636
+ const unsubstantiated = fileAnchors.length > 0 && fileAnchors.every((f) => f.attrs["contentChangedAt"] === void 0);
25626
25637
  const answered = p.attrs["resolvedAt"] != null || store2.outEdges(p.id, ["SOLVED_BY"]).some((e) => {
25627
25638
  const s = store2.getNode(e.to);
25628
25639
  return s !== null && !String(s.description ?? "").startsWith(AUTO_MINT_PREFIX);
@@ -25632,7 +25643,7 @@ function clearSettledFixCandidates(store2, t) {
25632
25643
  );
25633
25644
  const shownSinceAsk = Number(p.attrs["shownCount"] ?? 0) - base;
25634
25645
  const ignored = shownSinceAsk >= FIX_CANDIDATE_ASK_LIMIT;
25635
- if (!answered && !ignored) {
25646
+ if (!answered && !ignored && !unsubstantiated) {
25636
25647
  report.standing++;
25637
25648
  continue;
25638
25649
  }
@@ -25643,7 +25654,8 @@ function clearSettledFixCandidates(store2, t) {
25643
25654
  attrs["fixCandidateClearedAt"] = t;
25644
25655
  store2.updateNode(p.id, { attrs, lastUpdatedAt: t });
25645
25656
  if (answered) report.answered++;
25646
- else report.ignored++;
25657
+ else if (ignored) report.ignored++;
25658
+ else report.unsubstantiated++;
25647
25659
  }
25648
25660
  return report;
25649
25661
  }
@@ -26399,7 +26411,7 @@ function runNightlyPipeline(store2) {
26399
26411
  skillsRefreshed: 0,
26400
26412
  designResolved,
26401
26413
  revisitsCleared: revisits.cleared,
26402
- fixCandidatesSettled: fixCandidates.answered + fixCandidates.ignored,
26414
+ fixCandidatesSettled: fixCandidates.answered + fixCandidates.ignored + fixCandidates.unsubstantiated,
26403
26415
  claimsEvaluated: cry.evaluated,
26404
26416
  claimsDerived: cry.derived.length,
26405
26417
  durationMs: Date.now() - started