@inerrata-corporation/errata 2.0.2-dev.344 → 2.0.2-dev.346
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 +51 -4
- package/package.json +1 -1
package/errata.mjs
CHANGED
|
@@ -20513,6 +20513,24 @@ function recordTriageObservation(l2, obs, ts) {
|
|
|
20513
20513
|
});
|
|
20514
20514
|
return { triageId, routeId };
|
|
20515
20515
|
}
|
|
20516
|
+
function recordCauseChainLink(l2, link, ts, attrs = {}) {
|
|
20517
|
+
if (link.fromId === link.toId) return false;
|
|
20518
|
+
let created = false;
|
|
20519
|
+
l2.transaction(() => {
|
|
20520
|
+
for (const [id, description] of [
|
|
20521
|
+
[link.fromId, link.fromDescription],
|
|
20522
|
+
[link.toId, link.toDescription]
|
|
20523
|
+
]) {
|
|
20524
|
+
if (!l2.getNode(id)) l2.mergeNode(semNode(id, "RootCause", description, ts, { ...attrs }));
|
|
20525
|
+
}
|
|
20526
|
+
const edgeId2 = `edge_cb_${link.fromId}_${link.toId}`;
|
|
20527
|
+
if (!l2.getEdge(edgeId2)) {
|
|
20528
|
+
l2.mergeEdge(semEdge(edgeId2, link.fromId, link.toId, "CAUSED_BY", ts, { witnessed: true, viaFold: true }));
|
|
20529
|
+
created = true;
|
|
20530
|
+
}
|
|
20531
|
+
});
|
|
20532
|
+
return created;
|
|
20533
|
+
}
|
|
20516
20534
|
function recordMisreadPrior(shared, problem, context, contributor, ts) {
|
|
20517
20535
|
if (problem.attrs["resolvedAs"] !== PROBLEM_RESOLUTION.FALSE_POSITIVE) return false;
|
|
20518
20536
|
if (Number(problem.attrs["corroborations"] ?? 0) < 1) return false;
|
|
@@ -21248,6 +21266,7 @@ __export(src_exports2, {
|
|
|
21248
21266
|
propagateVersionChange: () => propagateVersionChange,
|
|
21249
21267
|
rankToolsForHandles: () => rankToolsForHandles,
|
|
21250
21268
|
recordAnchorHint: () => recordAnchorHint,
|
|
21269
|
+
recordCauseChainLink: () => recordCauseChainLink,
|
|
21251
21270
|
recordClaim: () => recordClaim,
|
|
21252
21271
|
recordMisreadPrior: () => recordMisreadPrior,
|
|
21253
21272
|
recordTriageObservation: () => recordTriageObservation,
|
|
@@ -50811,10 +50830,18 @@ function parseInlineTags(text) {
|
|
|
50811
50830
|
sentence: sfield
|
|
50812
50831
|
});
|
|
50813
50832
|
if (f[1] === "!" && segs.length > 1) {
|
|
50833
|
+
let prevLink = null;
|
|
50814
50834
|
for (const seg of segs.slice(1)) {
|
|
50815
50835
|
const causeText = seg.replace(/\s+/g, " ").trim();
|
|
50816
50836
|
if (causeText.length >= CAUSE_TEXT_MIN) {
|
|
50817
|
-
out2.push({
|
|
50837
|
+
out2.push({
|
|
50838
|
+
kind: "triage",
|
|
50839
|
+
causeText,
|
|
50840
|
+
sentence: sfield,
|
|
50841
|
+
...prevLink ? { causeOf: prevLink } : {},
|
|
50842
|
+
...flagThread ? { threadId: flagThread } : {}
|
|
50843
|
+
});
|
|
50844
|
+
prevLink = causeText;
|
|
50818
50845
|
}
|
|
50819
50846
|
}
|
|
50820
50847
|
}
|
|
@@ -51024,7 +51051,7 @@ function harvestInlineTags(store, text, opts) {
|
|
|
51024
51051
|
const source = opts.sourceId ? store.getNode(opts.sourceId) : null;
|
|
51025
51052
|
const mintPriors = opts.mintPriors ?? true;
|
|
51026
51053
|
const touched = opts.sessionTouchedIds ?? /* @__PURE__ */ new Set();
|
|
51027
|
-
const plan = { priorEdges: 0, problems: [], fixes: [], triages: [], attempts: [], unresolvedFixes: [], transfers: [], solutionLinks: [], instances: [], patterns: [], domains: [], packages: [], components: [], refutes: [], corroborations: [] };
|
|
51054
|
+
const plan = { priorEdges: 0, problems: [], fixes: [], triages: [], causalLinks: [], attempts: [], unresolvedFixes: [], transfers: [], solutionLinks: [], instances: [], patterns: [], domains: [], packages: [], components: [], refutes: [], corroborations: [] };
|
|
51028
51055
|
const tags = parseInlineTags(text);
|
|
51029
51056
|
const symptomSeqs = tags.filter((t) => (t.kind === "problem" || t.kind === "todo") && t.statement).map((t) => ({ seq: t.seq ?? -1, statement: t.statement, threadId: t.threadId })).sort((a, b) => a.seq - b.seq);
|
|
51030
51057
|
const bindSymptom = (seq, threadId) => {
|
|
@@ -51093,7 +51120,16 @@ function harvestInlineTags(store, text, opts) {
|
|
|
51093
51120
|
if (node2) plan.triages.push({ causeId: node2.id, causeDescription: node2.description, ...bound });
|
|
51094
51121
|
} else if (tag.causeText) {
|
|
51095
51122
|
const causeId = `dcause_${digest({ statement: tag.causeText })}`.slice(0, 56);
|
|
51096
|
-
|
|
51123
|
+
if (tag.causeOf) {
|
|
51124
|
+
plan.causalLinks.push({
|
|
51125
|
+
fromId: `dcause_${digest({ statement: tag.causeOf })}`.slice(0, 56),
|
|
51126
|
+
fromDescription: tag.causeOf,
|
|
51127
|
+
toId: causeId,
|
|
51128
|
+
toDescription: tag.causeText
|
|
51129
|
+
});
|
|
51130
|
+
} else {
|
|
51131
|
+
plan.triages.push({ causeId, causeDescription: tag.causeText, ...bound });
|
|
51132
|
+
}
|
|
51097
51133
|
}
|
|
51098
51134
|
} else if (tag.kind === "transfer") {
|
|
51099
51135
|
const targetIds = [];
|
|
@@ -53200,7 +53236,7 @@ function startLoopLagMonitor(thresholdMs = 1e3) {
|
|
|
53200
53236
|
}
|
|
53201
53237
|
|
|
53202
53238
|
// src/engine.ts
|
|
53203
|
-
var DAEMON_VERSION = true ? "2.0.2-dev.
|
|
53239
|
+
var DAEMON_VERSION = true ? "2.0.2-dev.346" : "2.0.0-alpha.0";
|
|
53204
53240
|
var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
|
|
53205
53241
|
var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
|
|
53206
53242
|
var GIT_OP_MUTE_MS = 4e3;
|
|
@@ -54038,6 +54074,17 @@ function createWorkspaceEngine(opts) {
|
|
|
54038
54074
|
}
|
|
54039
54075
|
}
|
|
54040
54076
|
}
|
|
54077
|
+
if (opts.sharedStore) {
|
|
54078
|
+
for (const link of plan.causalLinks) {
|
|
54079
|
+
try {
|
|
54080
|
+
if (recordCauseChainLink(opts.sharedStore, link, t, { contributor: sessionId })) {
|
|
54081
|
+
triaged++;
|
|
54082
|
+
}
|
|
54083
|
+
} catch (err2) {
|
|
54084
|
+
console.warn("[errata] causal chain link failed:", err2);
|
|
54085
|
+
}
|
|
54086
|
+
}
|
|
54087
|
+
}
|
|
54041
54088
|
for (const at of plan.attempts) {
|
|
54042
54089
|
const pid = at.problemId ?? (at.threadId ? threads.get(at.threadId) : void 0) ?? (at.boundStatement ? designProblemId(at.boundStatement) : void 0);
|
|
54043
54090
|
const node2 = pid ? store.getNode(pid) : void 0;
|