@inerrata-corporation/errata 2.0.2-dev.483 → 2.0.2-dev.497

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
@@ -17660,13 +17660,46 @@ function addDependency(store, opts) {
17660
17660
  store.mergeEdge(edge2);
17661
17661
  return edge2;
17662
17662
  }
17663
- function markRevisit(store, node2, reason, ts) {
17663
+ function markRevisit(store, node2, reason, ts, answeredWhen) {
17664
17664
  const fresh = store.getNode(node2.id) ?? node2;
17665
17665
  store.updateNode(node2.id, {
17666
- attrs: { ...fresh.attrs, revisit: true, revisitReason: reason, revisitSinceTs: ts },
17666
+ attrs: {
17667
+ ...fresh.attrs,
17668
+ revisit: true,
17669
+ revisitReason: reason,
17670
+ revisitSinceTs: ts,
17671
+ ...answeredWhen ? { revisitAnsweredWhen: answeredWhen } : {}
17672
+ },
17667
17673
  lastUpdatedAt: ts
17668
17674
  });
17669
17675
  }
17676
+ function conditionOf(node2) {
17677
+ const explicit = node2.attrs["revisitAnsweredWhen"];
17678
+ if (explicit === "parentProblemOpen") return explicit;
17679
+ if (String(node2.attrs["revisitReason"] ?? "").startsWith(LEGACY_AUTO_CLOSE_ASK)) {
17680
+ return "parentProblemOpen";
17681
+ }
17682
+ return void 0;
17683
+ }
17684
+ function clearAnsweredRevisits(store, ts) {
17685
+ const report = { cleared: 0, standing: 0 };
17686
+ for (const node2 of store.findNodesByLabel("Solution")) {
17687
+ if (node2.attrs["revisit"] !== true) continue;
17688
+ if (conditionOf(node2) !== "parentProblemOpen") {
17689
+ report.standing++;
17690
+ continue;
17691
+ }
17692
+ const parents = store.inEdges(node2.id, ["SOLVED_BY"]).map((e) => store.getNode(e.from)).filter((n) => n !== null);
17693
+ const answered = parents.every((p) => p.attrs["resolvedAt"] == null);
17694
+ if (!answered) {
17695
+ report.standing++;
17696
+ continue;
17697
+ }
17698
+ clearRevisit(store, node2.id, ts);
17699
+ report.cleared++;
17700
+ }
17701
+ return report;
17702
+ }
17670
17703
  function clearRevisit(store, nodeId, ts) {
17671
17704
  const n = store.getNode(nodeId);
17672
17705
  if (!n) return;
@@ -17739,10 +17772,12 @@ function propagateFactChange(store, opts) {
17739
17772
  cascade(store, seeds, visited, flagged, opts.ts);
17740
17773
  return flagged;
17741
17774
  }
17775
+ var LEGACY_AUTO_CLOSE_ASK;
17742
17776
  var init_justification = __esm({
17743
17777
  "../../packages/local-graph/src/justification.ts"() {
17744
17778
  "use strict";
17745
17779
  init_src();
17780
+ LEGACY_AUTO_CLOSE_ASK = "auto-closed off a pre-provenance anchor";
17746
17781
  }
17747
17782
  });
17748
17783
 
@@ -19560,7 +19595,11 @@ function backfillLegacyAnchors(store, ts) {
19560
19595
  store,
19561
19596
  sol,
19562
19597
  `auto-closed off a pre-provenance anchor (guessed ${guessedAnchor}) \u2014 confirm the problem is really fixed, or reopen it`,
19563
- ts
19598
+ ts,
19599
+ // "or reopen it" is half the ask, and the nightly reopen takes that
19600
+ // branch — so record what would answer this, or the flag can never be
19601
+ // lowered and the band fills with settled questions.
19602
+ "parentProblemOpen"
19564
19603
  );
19565
19604
  store.updateNode(p.id, {
19566
19605
  attrs: { ...p.attrs, resolutionSuspect: true },
@@ -21711,6 +21750,7 @@ __export(src_exports2, {
21711
21750
  canonicalizePatternText: () => canonicalizePatternText,
21712
21751
  causalChain: () => causalChain,
21713
21752
  claimId: () => claimId,
21753
+ clearAnsweredRevisits: () => clearAnsweredRevisits,
21714
21754
  clearRevisit: () => clearRevisit,
21715
21755
  communityInductionRequests: () => communityInductionRequests,
21716
21756
  communitySeeds: () => communitySeeds,
@@ -28434,6 +28474,7 @@ function runNightlyPipeline(store) {
28434
28474
  });
28435
28475
  const motifs = promoteMotifs(store, started2);
28436
28476
  reopenAutoClosedProblems(store, started2);
28477
+ const revisits = clearAnsweredRevisits(store, started2);
28437
28478
  const designResolved = markFixCandidates(store, started2);
28438
28479
  const cry = crystallize(store, { ts: started2 });
28439
28480
  return {
@@ -28449,6 +28490,7 @@ function runNightlyPipeline(store) {
28449
28490
  // skills are cloud-induced now (see above)
28450
28491
  skillsRefreshed: 0,
28451
28492
  designResolved,
28493
+ revisitsCleared: revisits.cleared,
28452
28494
  claimsEvaluated: cry.evaluated,
28453
28495
  claimsDerived: cry.derived.length,
28454
28496
  durationMs: Date.now() - started2
@@ -53704,7 +53746,7 @@ function startLoopLagMonitor(thresholdMs = 1e3) {
53704
53746
  }
53705
53747
 
53706
53748
  // src/engine.ts
53707
- var DAEMON_VERSION = true ? "2.0.2-dev.483" : "2.0.0-alpha.0";
53749
+ var DAEMON_VERSION = true ? "2.0.2-dev.497" : "2.0.0-alpha.0";
53708
53750
  var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
53709
53751
  var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
53710
53752
  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.483",
3
+ "version": "2.0.2-dev.497",
4
4
  "description": "errata - local-first observation engine for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {
package/pass-worker.mjs CHANGED
@@ -25007,13 +25007,56 @@ function addDependency(store2, opts) {
25007
25007
  store2.mergeEdge(edge);
25008
25008
  return edge;
25009
25009
  }
25010
- function markRevisit(store2, node, reason, ts) {
25010
+ function markRevisit(store2, node, reason, ts, answeredWhen) {
25011
25011
  const fresh = store2.getNode(node.id) ?? node;
25012
25012
  store2.updateNode(node.id, {
25013
- attrs: { ...fresh.attrs, revisit: true, revisitReason: reason, revisitSinceTs: ts },
25013
+ attrs: {
25014
+ ...fresh.attrs,
25015
+ revisit: true,
25016
+ revisitReason: reason,
25017
+ revisitSinceTs: ts,
25018
+ ...answeredWhen ? { revisitAnsweredWhen: answeredWhen } : {}
25019
+ },
25014
25020
  lastUpdatedAt: ts
25015
25021
  });
25016
25022
  }
25023
+ var LEGACY_AUTO_CLOSE_ASK = "auto-closed off a pre-provenance anchor";
25024
+ function conditionOf(node) {
25025
+ const explicit = node.attrs["revisitAnsweredWhen"];
25026
+ if (explicit === "parentProblemOpen") return explicit;
25027
+ if (String(node.attrs["revisitReason"] ?? "").startsWith(LEGACY_AUTO_CLOSE_ASK)) {
25028
+ return "parentProblemOpen";
25029
+ }
25030
+ return void 0;
25031
+ }
25032
+ function clearAnsweredRevisits(store2, ts) {
25033
+ const report = { cleared: 0, standing: 0 };
25034
+ for (const node of store2.findNodesByLabel("Solution")) {
25035
+ if (node.attrs["revisit"] !== true) continue;
25036
+ if (conditionOf(node) !== "parentProblemOpen") {
25037
+ report.standing++;
25038
+ continue;
25039
+ }
25040
+ const parents = store2.inEdges(node.id, ["SOLVED_BY"]).map((e) => store2.getNode(e.from)).filter((n) => n !== null);
25041
+ const answered = parents.every((p) => p.attrs["resolvedAt"] == null);
25042
+ if (!answered) {
25043
+ report.standing++;
25044
+ continue;
25045
+ }
25046
+ clearRevisit(store2, node.id, ts);
25047
+ report.cleared++;
25048
+ }
25049
+ return report;
25050
+ }
25051
+ function clearRevisit(store2, nodeId, ts) {
25052
+ const n = store2.getNode(nodeId);
25053
+ if (!n) return;
25054
+ const attrs = { ...n.attrs };
25055
+ delete attrs["revisit"];
25056
+ delete attrs["revisitReason"];
25057
+ delete attrs["revisitSinceTs"];
25058
+ store2.updateNode(nodeId, { attrs, lastUpdatedAt: ts });
25059
+ }
25017
25060
  function listNeedsRevisit(store2, asOf) {
25018
25061
  return store2.nodesAsOf(asOf).filter((n) => n.attrs["revisit"] === true).map((n) => ({
25019
25062
  id: n.id,
@@ -25716,7 +25759,11 @@ function backfillLegacyAnchors(store2, ts) {
25716
25759
  store2,
25717
25760
  sol,
25718
25761
  `auto-closed off a pre-provenance anchor (guessed ${guessedAnchor}) \u2014 confirm the problem is really fixed, or reopen it`,
25719
- ts
25762
+ ts,
25763
+ // "or reopen it" is half the ask, and the nightly reopen takes that
25764
+ // branch — so record what would answer this, or the flag can never be
25765
+ // lowered and the band fills with settled questions.
25766
+ "parentProblemOpen"
25720
25767
  );
25721
25768
  store2.updateNode(p.id, {
25722
25769
  attrs: { ...p.attrs, resolutionSuspect: true },
@@ -26299,6 +26346,7 @@ function runNightlyPipeline(store2) {
26299
26346
  });
26300
26347
  const motifs = promoteMotifs(store2, started);
26301
26348
  reopenAutoClosedProblems(store2, started);
26349
+ const revisits = clearAnsweredRevisits(store2, started);
26302
26350
  const designResolved = markFixCandidates(store2, started);
26303
26351
  const cry = crystallize(store2, { ts: started });
26304
26352
  return {
@@ -26314,6 +26362,7 @@ function runNightlyPipeline(store2) {
26314
26362
  // skills are cloud-induced now (see above)
26315
26363
  skillsRefreshed: 0,
26316
26364
  designResolved,
26365
+ revisitsCleared: revisits.cleared,
26317
26366
  claimsEvaluated: cry.evaluated,
26318
26367
  claimsDerived: cry.derived.length,
26319
26368
  durationMs: Date.now() - started