@inerrata-corporation/errata 2.0.2-dev.600 → 2.0.2-dev.606

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.
Files changed (2) hide show
  1. package/errata.mjs +116 -18
  2. package/package.json +1 -1
package/errata.mjs CHANGED
@@ -19598,9 +19598,9 @@ function searchByIntent(store, intent, opts) {
19598
19598
  if (denom === 0) return [];
19599
19599
  const hits = [];
19600
19600
  for (const { node: node2, matched } of candidates) {
19601
- let num2 = 0;
19602
- for (const t of matched) num2 += idf(t);
19603
- const coverage = num2 / denom;
19601
+ let num3 = 0;
19602
+ for (const t of matched) num3 += idf(t);
19603
+ const coverage = num3 / denom;
19604
19604
  if (coverage < minCoverage) continue;
19605
19605
  hits.push({ node: node2, coverage, matched });
19606
19606
  }
@@ -20904,18 +20904,18 @@ function triageOf(l2, q, mathOpts) {
20904
20904
  for (const e of l2.outEdges(triageId, [...ROUTE_EDGE_TYPES])) {
20905
20905
  const perContext = e.attrs["perContext"] ?? {};
20906
20906
  const counts = {};
20907
- for (const [bucket, num2] of Object.entries(perContext)) {
20907
+ for (const [bucket, num3] of Object.entries(perContext)) {
20908
20908
  counts[bucket] = {
20909
- seen: seen[bucket] ?? num2.confirmed,
20909
+ seen: seen[bucket] ?? num3.confirmed,
20910
20910
  // denominator ≥ numerator
20911
- confirmed: num2.confirmed,
20911
+ confirmed: num3.confirmed,
20912
20912
  // Cloud-merged routes carry a distinct-uploader count; local routes count
20913
20913
  // their session contributors.
20914
- independent: num2.independent ?? num2.contributors?.length ?? 0,
20914
+ independent: num3.independent ?? num3.contributors?.length ?? 0,
20915
20915
  // Discounted-in-trust-ramp subset (T3-weighting): the cloud-authoritative
20916
20916
  // corpus count when present, else the local inferred-only contributor count
20917
20917
  // (ambient-paired diagnoses whose binding the daemon guessed).
20918
- inferredIndependent: num2.inferredIndependent ?? num2.inferredContributors?.length ?? 0
20918
+ inferredIndependent: num3.inferredIndependent ?? num3.inferredContributors?.length ?? 0
20919
20919
  };
20920
20920
  }
20921
20921
  const post = triagePosterior(counts, buckets, mathOpts);
@@ -22060,6 +22060,37 @@ var init_mechanism_liveness = __esm({
22060
22060
  effectCounter: "corroboratedEdges",
22061
22061
  note: "expected STARVED until VS-corroboration-rate lands \u2014 the channel is genuinely starved"
22062
22062
  },
22063
+ {
22064
+ id: "wm-reinforce-exposure",
22065
+ what: "labels each paraphrase re-derivation with the prior's exposure (shown/evicted/unshown)",
22066
+ // The producer runs inside capture's fold path (reinforceSameAnchorProblem),
22067
+ // but capture cannot count it without threading the fold verdict up through
22068
+ // ingestDesignProblem — so the WM-JOIN reading is the observable: the
22069
+ // wm-calibration pass reads the stamped counters as levels every tick.
22070
+ pass: "wm-calibration",
22071
+ // Conditional stamp, rare by design (a paraphrase fold is a few-per-day
22072
+ // event) — the bar is "the field is written at all", the revisit-sweep
22073
+ // precedent. Zero everywhere = the outcome site never fired, which was
22074
+ // this store's measured state on 2026-08-09, day one of WM-labels.
22075
+ fed: { labels: ["Problem"], attr: "lastReinforceExposure", minFraction: 0 },
22076
+ // A LEVEL, not an increment: nonzero once any node ever carried an outcome.
22077
+ effectCounter: "reinforcedNodes",
22078
+ note: "levels ride the wm-calibration row; expect no-effect until outcome data accrues"
22079
+ },
22080
+ {
22081
+ id: "wm-leaned-exposure",
22082
+ what: "classifies a leaned-cite's exposure at outcome time (the display-confounded cell)",
22083
+ // CAPTURE parses the cite and classifies against the render stamps — the
22084
+ // gate's input is `lastShownAtSeq`, the render ledger's seq stamp.
22085
+ pass: "capture",
22086
+ fed: {
22087
+ labels: ["Problem", "Solution", "RootCause", "Pattern"],
22088
+ attr: "lastShownAtSeq",
22089
+ minFraction: 5e-3
22090
+ },
22091
+ effectCounter: "exposureOutcomes",
22092
+ note: "0 with live render stamps = no lean-cites parsed, not a broken classifier"
22093
+ },
22063
22094
  {
22064
22095
  id: "liveness-watch",
22065
22096
  what: "the daemon-side schedule of this very verdict \u2014 alarms when a mechanism stops working",
@@ -22084,6 +22115,57 @@ var init_mechanism_liveness = __esm({
22084
22115
  }
22085
22116
  });
22086
22117
 
22118
+ // ../../packages/local-graph/src/wm-calibration.ts
22119
+ function wmCalibrationCells(store) {
22120
+ const cells = {
22121
+ shownNodes: 0,
22122
+ shownImpressions: 0,
22123
+ evictedNodes: 0,
22124
+ evictedImpressions: 0,
22125
+ reinforceShown: 0,
22126
+ reinforceEvicted: 0,
22127
+ reinforceUnshown: 0,
22128
+ reinforcedNodes: 0
22129
+ };
22130
+ for (const label of WM_CALIBRATION_LABELS) {
22131
+ for (const n of store.findNodesByLabel(label)) {
22132
+ const shown = num(n.attrs["shownCount"]);
22133
+ const evicted = num(n.attrs["evictedCount"]);
22134
+ if (shown > 0) {
22135
+ cells.shownNodes++;
22136
+ cells.shownImpressions += shown;
22137
+ }
22138
+ if (evicted > 0) {
22139
+ cells.evictedNodes++;
22140
+ cells.evictedImpressions += evicted;
22141
+ }
22142
+ const rs = num(n.attrs["reinforceShownCount"]);
22143
+ const re = num(n.attrs["reinforceEvictedCount"]);
22144
+ const ru = num(n.attrs["reinforceUnshownCount"]);
22145
+ cells.reinforceShown += rs;
22146
+ cells.reinforceEvicted += re;
22147
+ cells.reinforceUnshown += ru;
22148
+ if (rs + re + ru > 0) cells.reinforcedNodes++;
22149
+ }
22150
+ }
22151
+ return cells;
22152
+ }
22153
+ var WM_CALIBRATION_LABELS, num;
22154
+ var init_wm_calibration = __esm({
22155
+ "../../packages/local-graph/src/wm-calibration.ts"() {
22156
+ "use strict";
22157
+ WM_CALIBRATION_LABELS = [
22158
+ "Problem",
22159
+ "Solution",
22160
+ "RootCause",
22161
+ "Pattern",
22162
+ "Technique",
22163
+ "AntiPattern"
22164
+ ];
22165
+ num = (v) => typeof v === "number" && Number.isFinite(v) ? v : 0;
22166
+ }
22167
+ });
22168
+
22087
22169
  // ../../packages/local-graph/src/index.ts
22088
22170
  var src_exports2 = {};
22089
22171
  __export(src_exports2, {
@@ -22107,6 +22189,7 @@ __export(src_exports2, {
22107
22189
  STALL_MIN_RUNS: () => STALL_MIN_RUNS,
22108
22190
  STALL_MIN_SPAN_MS: () => STALL_MIN_SPAN_MS,
22109
22191
  SqliteGraphStore: () => SqliteGraphStore,
22192
+ WM_CALIBRATION_LABELS: () => WM_CALIBRATION_LABELS,
22110
22193
  addDependency: () => addDependency,
22111
22194
  aggregateClaimConfidence: () => aggregateClaimConfidence,
22112
22195
  anchorProblemToDiff: () => anchorProblemToDiff,
@@ -22218,7 +22301,8 @@ __export(src_exports2, {
22218
22301
  toolNodeId: () => toolNodeId,
22219
22302
  toolPriorsFor: () => toolPriorsFor,
22220
22303
  triageOf: () => triageOf,
22221
- walk: () => walk
22304
+ walk: () => walk,
22305
+ wmCalibrationCells: () => wmCalibrationCells
22222
22306
  });
22223
22307
  var init_src5 = __esm({
22224
22308
  "../../packages/local-graph/src/index.ts"() {
@@ -22243,6 +22327,7 @@ var init_src5 = __esm({
22243
22327
  init_tools();
22244
22328
  init_principle_sync();
22245
22329
  init_mechanism_liveness();
22330
+ init_wm_calibration();
22246
22331
  }
22247
22332
  });
22248
22333
 
@@ -22941,10 +23026,10 @@ function pathsFor(node2) {
22941
23026
  return globs.length > 0 ? globs : ["**/*"];
22942
23027
  }
22943
23028
  function confidenceOf(n) {
22944
- return num(n.attrs["cloudConfidence"], num(n.attrs["claimConfidence"], n.extractionConfidence));
23029
+ return num2(n.attrs["cloudConfidence"], num2(n.attrs["claimConfidence"], n.extractionConfidence));
22945
23030
  }
22946
23031
  function contributorsOf(n) {
22947
- return Math.max(num(n.attrs["cloudContributors"], 0), num(n.attrs["contributorCount"], 1));
23032
+ return Math.max(num2(n.attrs["cloudContributors"], 0), num2(n.attrs["contributorCount"], 1));
22948
23033
  }
22949
23034
  function slugFor(n) {
22950
23035
  const kebab = n.description.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 40);
@@ -22975,12 +23060,12 @@ _Collective principle \xB7 confidence ${conf.toFixed(2)} \xB7 ${contrib} contrib
22975
23060
  };
22976
23061
  });
22977
23062
  }
22978
- var num, LANG_GLOBS;
23063
+ var num2, LANG_GLOBS;
22979
23064
  var init_select_durable_memory = __esm({
22980
23065
  "../../packages/context-writer/src/select-durable-memory.ts"() {
22981
23066
  "use strict";
22982
23067
  init_src2();
22983
- num = (v, d = 0) => typeof v === "number" && Number.isFinite(v) ? v : d;
23068
+ num2 = (v, d = 0) => typeof v === "number" && Number.isFinite(v) ? v : d;
22984
23069
  LANG_GLOBS = {
22985
23070
  typescript: ["**/*.ts", "**/*.tsx"],
22986
23071
  javascript: ["**/*.js", "**/*.jsx"],
@@ -32519,7 +32604,7 @@ async function Module2(moduleArg = {}) {
32519
32604
  _fd_close.sig = "ii";
32520
32605
  var INT53_MAX = 9007199254740992;
32521
32606
  var INT53_MIN = -9007199254740992;
32522
- var bigintToI53Checked = /* @__PURE__ */ __name((num2) => num2 < INT53_MIN || num2 > INT53_MAX ? NaN : Number(num2), "bigintToI53Checked");
32607
+ var bigintToI53Checked = /* @__PURE__ */ __name((num3) => num3 < INT53_MIN || num3 > INT53_MAX ? NaN : Number(num3), "bigintToI53Checked");
32523
32608
  function _fd_seek(fd, offset, whence, newOffset) {
32524
32609
  offset = bigintToI53Checked(offset);
32525
32610
  return 70;
@@ -32537,7 +32622,7 @@ async function Module2(moduleArg = {}) {
32537
32622
  }
32538
32623
  }, "printChar");
32539
32624
  var _fd_write = /* @__PURE__ */ __name((fd, iov, iovcnt, pnum) => {
32540
- var num2 = 0;
32625
+ var num3 = 0;
32541
32626
  for (var i2 = 0; i2 < iovcnt; i2++) {
32542
32627
  var ptr = LE_HEAP_LOAD_U32((iov >> 2) * 4);
32543
32628
  var len = LE_HEAP_LOAD_U32((iov + 4 >> 2) * 4);
@@ -32545,9 +32630,9 @@ async function Module2(moduleArg = {}) {
32545
32630
  for (var j = 0; j < len; j++) {
32546
32631
  printChar(fd, HEAPU8[ptr + j]);
32547
32632
  }
32548
- num2 += len;
32633
+ num3 += len;
32549
32634
  }
32550
- LE_HEAP_STORE_U32((pnum >> 2) * 4, num2);
32635
+ LE_HEAP_STORE_U32((pnum >> 2) * 4, num3);
32551
32636
  return 0;
32552
32637
  }, "_fd_write");
32553
32638
  _fd_write.sig = "iippp";
@@ -54559,7 +54644,7 @@ function startLoopLagMonitor(thresholdMs = 1e3) {
54559
54644
  }
54560
54645
 
54561
54646
  // src/engine.ts
54562
- var DAEMON_VERSION = true ? "2.0.2-dev.600" : "2.0.0-alpha.0";
54647
+ var DAEMON_VERSION = true ? "2.0.2-dev.606" : "2.0.0-alpha.0";
54563
54648
  var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
54564
54649
  var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
54565
54650
  var GIT_OP_MUTE_MS = 4e3;
@@ -55824,6 +55909,9 @@ function createWorkspaceEngine(opts) {
55824
55909
  exposureShown,
55825
55910
  exposureEvicted,
55826
55911
  exposureUnshown,
55912
+ // The sum, so one liveness effectCounter sees an outcome regardless of
55913
+ // which cell it landed in (WM-join).
55914
+ exposureOutcomes: exposureShown + exposureEvicted + exposureUnshown,
55827
55915
  touchedFileTurns,
55828
55916
  touchedToolTurns,
55829
55917
  // Seam diagnostic: sessions holding tool-run records at harvest time.
@@ -56101,6 +56189,16 @@ function createWorkspaceEngine(opts) {
56101
56189
  if (report.revisitsCleared > 0 || report.fixCandidatesSettled > 0 || report.designResolved > 0) {
56102
56190
  refreshContextNow();
56103
56191
  }
56192
+ try {
56193
+ const t0 = Date.now();
56194
+ appendPassLedger(
56195
+ paths.configDir,
56196
+ "wm-calibration",
56197
+ Date.now() - t0,
56198
+ wmCalibrationCells(store)
56199
+ );
56200
+ } catch {
56201
+ }
56104
56202
  livenessWatch.maybeRun();
56105
56203
  return report;
56106
56204
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inerrata-corporation/errata",
3
- "version": "2.0.2-dev.600",
3
+ "version": "2.0.2-dev.606",
4
4
  "description": "errata - local-first observation engine for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {