@inerrata-corporation/errata 2.0.2-dev.600 → 2.0.2-dev.610
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 +147 -18
- 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
|
|
19602
|
-
for (const t of matched)
|
|
19603
|
-
const coverage =
|
|
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,
|
|
20907
|
+
for (const [bucket, num3] of Object.entries(perContext)) {
|
|
20908
20908
|
counts[bucket] = {
|
|
20909
|
-
seen: seen[bucket] ??
|
|
20909
|
+
seen: seen[bucket] ?? num3.confirmed,
|
|
20910
20910
|
// denominator ≥ numerator
|
|
20911
|
-
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:
|
|
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:
|
|
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
|
|
23029
|
+
return num2(n.attrs["cloudConfidence"], num2(n.attrs["claimConfidence"], n.extractionConfidence));
|
|
22945
23030
|
}
|
|
22946
23031
|
function contributorsOf(n) {
|
|
22947
|
-
return Math.max(
|
|
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
|
|
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
|
-
|
|
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((
|
|
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
|
|
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
|
-
|
|
32633
|
+
num3 += len;
|
|
32549
32634
|
}
|
|
32550
|
-
LE_HEAP_STORE_U32((pnum >> 2) * 4,
|
|
32635
|
+
LE_HEAP_STORE_U32((pnum >> 2) * 4, num3);
|
|
32551
32636
|
return 0;
|
|
32552
32637
|
}, "_fd_write");
|
|
32553
32638
|
_fd_write.sig = "iippp";
|
|
@@ -52087,6 +52172,19 @@ var TIEBREAK = [
|
|
|
52087
52172
|
{ re: /same (issue|problem|pattern|root cause) as|instance of|an example of/i, type: "INSTANCE_OF" },
|
|
52088
52173
|
{ re: /depends on|requires|relies on/i, type: "DEPENDS_ON" }
|
|
52089
52174
|
];
|
|
52175
|
+
function packageName(description) {
|
|
52176
|
+
const at = description.lastIndexOf("@");
|
|
52177
|
+
return at > 0 ? description.slice(0, at) : description;
|
|
52178
|
+
}
|
|
52179
|
+
function fileImportsPackage(store, fileId, pkg) {
|
|
52180
|
+
for (const e of store.outEdges(fileId, ["IMPORTS"])) {
|
|
52181
|
+
const spec = store.getNode(e.to)?.description;
|
|
52182
|
+
if (!spec || spec.startsWith(".") || spec.startsWith("/")) continue;
|
|
52183
|
+
const specPkg = spec.startsWith("@") ? spec.split("/").slice(0, 2).join("/") : spec.split("/")[0];
|
|
52184
|
+
if (specPkg === pkg) return true;
|
|
52185
|
+
}
|
|
52186
|
+
return false;
|
|
52187
|
+
}
|
|
52090
52188
|
function tagEdgeCorroborated(targetAnchorIds, sessionTouchedNodeIds, independentReassert = false) {
|
|
52091
52189
|
if (independentReassert) return true;
|
|
52092
52190
|
for (const a of targetAnchorIds) if (sessionTouchedNodeIds.has(a)) return true;
|
|
@@ -52152,6 +52250,18 @@ function mintPriorEdge(store, source, target, sentence, touched, ts) {
|
|
|
52152
52250
|
if (anchorIds.size === 0 && (target.label === "Language" || target.label === "Package")) {
|
|
52153
52251
|
for (const e of store.inEdges(target.id, STACK_GROUNDING_EDGES)) anchorIds.add(e.from);
|
|
52154
52252
|
}
|
|
52253
|
+
if ((target.label === "Language" || target.label === "Package") && target.description) {
|
|
52254
|
+
const targetName = target.description;
|
|
52255
|
+
for (const tid of touched) {
|
|
52256
|
+
const tn = store.getNode(tid);
|
|
52257
|
+
if (tn?.label !== "File") continue;
|
|
52258
|
+
const grounded = target.label === "Language" ? String(tn.attrs["language"] ?? "").toLowerCase() === targetName.toLowerCase() : fileImportsPackage(store, tid, packageName(targetName));
|
|
52259
|
+
if (grounded) {
|
|
52260
|
+
anchorIds.add(tid);
|
|
52261
|
+
break;
|
|
52262
|
+
}
|
|
52263
|
+
}
|
|
52264
|
+
}
|
|
52155
52265
|
if (anchorIds.size === 0 && target.label === "Tool") anchorIds.add(target.id);
|
|
52156
52266
|
const corroborated = tagEdgeCorroborated(anchorIds, touched, false);
|
|
52157
52267
|
store.mergeEdge({
|
|
@@ -54559,7 +54669,7 @@ function startLoopLagMonitor(thresholdMs = 1e3) {
|
|
|
54559
54669
|
}
|
|
54560
54670
|
|
|
54561
54671
|
// src/engine.ts
|
|
54562
|
-
var DAEMON_VERSION = true ? "2.0.2-dev.
|
|
54672
|
+
var DAEMON_VERSION = true ? "2.0.2-dev.610" : "2.0.0-alpha.0";
|
|
54563
54673
|
var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
|
|
54564
54674
|
var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
|
|
54565
54675
|
var GIT_OP_MUTE_MS = 4e3;
|
|
@@ -55824,6 +55934,9 @@ function createWorkspaceEngine(opts) {
|
|
|
55824
55934
|
exposureShown,
|
|
55825
55935
|
exposureEvicted,
|
|
55826
55936
|
exposureUnshown,
|
|
55937
|
+
// The sum, so one liveness effectCounter sees an outcome regardless of
|
|
55938
|
+
// which cell it landed in (WM-join).
|
|
55939
|
+
exposureOutcomes: exposureShown + exposureEvicted + exposureUnshown,
|
|
55827
55940
|
touchedFileTurns,
|
|
55828
55941
|
touchedToolTurns,
|
|
55829
55942
|
// Seam diagnostic: sessions holding tool-run records at harvest time.
|
|
@@ -56101,6 +56214,16 @@ function createWorkspaceEngine(opts) {
|
|
|
56101
56214
|
if (report.revisitsCleared > 0 || report.fixCandidatesSettled > 0 || report.designResolved > 0) {
|
|
56102
56215
|
refreshContextNow();
|
|
56103
56216
|
}
|
|
56217
|
+
try {
|
|
56218
|
+
const t0 = Date.now();
|
|
56219
|
+
appendPassLedger(
|
|
56220
|
+
paths.configDir,
|
|
56221
|
+
"wm-calibration",
|
|
56222
|
+
Date.now() - t0,
|
|
56223
|
+
wmCalibrationCells(store)
|
|
56224
|
+
);
|
|
56225
|
+
} catch {
|
|
56226
|
+
}
|
|
56104
56227
|
livenessWatch.maybeRun();
|
|
56105
56228
|
return report;
|
|
56106
56229
|
},
|
|
@@ -57728,6 +57851,12 @@ async function startMultiDaemon(opts = {}) {
|
|
|
57728
57851
|
onHook: engine.webHooks.onHook,
|
|
57729
57852
|
onHookEvent: engine.webHooks.onHookEvent,
|
|
57730
57853
|
onShellEvent: engine.webHooks.onShellEvent,
|
|
57854
|
+
// The tool-run RECORD seam (SP-tool-ground). The single-engine path wired
|
|
57855
|
+
// this in #1172; this sibling builder never did, so on every multi
|
|
57856
|
+
// deployment (i.e. every real one) the webui logged "tool-run recorded"
|
|
57857
|
+
// and dropped the record on the floor — toolSessionsTracked read 0 across
|
|
57858
|
+
// 936 turns while the log showed records landing (VS-corroboration-rate).
|
|
57859
|
+
onToolsObserved: engine.webHooks.onToolsObserved,
|
|
57731
57860
|
onToolError: engine.webHooks.onToolError,
|
|
57732
57861
|
onDiagnostics: engine.webHooks.onDiagnostics,
|
|
57733
57862
|
onTurn: engine.webHooks.onTurn,
|