@inerrata-corporation/errata 2.0.0-dev.86 → 2.0.0-dev.88
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 +7377 -6
- package/package.json +1 -1
- package/pass-worker.mjs +91 -2
package/package.json
CHANGED
package/pass-worker.mjs
CHANGED
|
@@ -24787,6 +24787,13 @@ function addDependency(store2, opts) {
|
|
|
24787
24787
|
store2.mergeEdge(edge);
|
|
24788
24788
|
return edge;
|
|
24789
24789
|
}
|
|
24790
|
+
function markRevisit(store2, node, reason, ts) {
|
|
24791
|
+
const fresh = store2.getNode(node.id) ?? node;
|
|
24792
|
+
store2.updateNode(node.id, {
|
|
24793
|
+
attrs: { ...fresh.attrs, revisit: true, revisitReason: reason, revisitSinceTs: ts },
|
|
24794
|
+
lastUpdatedAt: ts
|
|
24795
|
+
});
|
|
24796
|
+
}
|
|
24790
24797
|
function listNeedsRevisit(store2, asOf) {
|
|
24791
24798
|
return store2.nodesAsOf(asOf).filter((n) => n.attrs["revisit"] === true).map((n) => ({
|
|
24792
24799
|
id: n.id,
|
|
@@ -25190,6 +25197,15 @@ function priorsForFile(store2, relPath) {
|
|
|
25190
25197
|
openProblems.sort((a, b) => (b.lastUpdatedAt ?? 0) - (a.lastUpdatedAt ?? 0));
|
|
25191
25198
|
return { file: file2, openProblems, related: [...related.values()], solutionsByProblem };
|
|
25192
25199
|
}
|
|
25200
|
+
function recordAnchorHint(store2, problemId, relPath, provenance, ts) {
|
|
25201
|
+
const p = store2.getNode(problemId);
|
|
25202
|
+
if (!p || p.label !== "Problem") return false;
|
|
25203
|
+
if (p.attrs["anchorHint"]) return false;
|
|
25204
|
+
store2.updateNode(problemId, {
|
|
25205
|
+
attrs: { ...p.attrs, anchorHint: { path: relPath, provenance, ts } }
|
|
25206
|
+
});
|
|
25207
|
+
return true;
|
|
25208
|
+
}
|
|
25193
25209
|
function resolveDesignProblems(store2, t) {
|
|
25194
25210
|
let resolved = 0;
|
|
25195
25211
|
for (const p of store2.findNodesByLabel("Problem")) {
|
|
@@ -25233,6 +25249,69 @@ function resolveDesignProblems(store2, t) {
|
|
|
25233
25249
|
return resolved;
|
|
25234
25250
|
}
|
|
25235
25251
|
|
|
25252
|
+
// ../../packages/local-graph/src/anchor-backfill.ts
|
|
25253
|
+
var AUTO_MINT_PREFIX = "addressed by an edit to ";
|
|
25254
|
+
function isLegacyAnchor(attrs) {
|
|
25255
|
+
return attrs?.["captureTime"] === true && attrs["anchorProvenance"] === void 0;
|
|
25256
|
+
}
|
|
25257
|
+
function backfillLegacyAnchors(store2, ts) {
|
|
25258
|
+
const report = {
|
|
25259
|
+
demotedEdges: 0,
|
|
25260
|
+
demotedProblems: 0,
|
|
25261
|
+
labeledEdges: 0,
|
|
25262
|
+
suspects: []
|
|
25263
|
+
};
|
|
25264
|
+
for (const p of store2.findNodesByLabel("Problem")) {
|
|
25265
|
+
const legacy = store2.outEdges(p.id, ["ANCHORED_AT"]).filter((e) => isLegacyAnchor(e.attrs));
|
|
25266
|
+
if (legacy.length === 0) continue;
|
|
25267
|
+
const resolved = p.attrs["resolvedAt"] !== void 0;
|
|
25268
|
+
try {
|
|
25269
|
+
if (!resolved) {
|
|
25270
|
+
for (const e of legacy) {
|
|
25271
|
+
const file2 = store2.getNode(e.to);
|
|
25272
|
+
const path = String(file2?.attrs["relPath"] ?? file2?.description ?? "");
|
|
25273
|
+
if (path) recordAnchorHint(store2, p.id, path, "legacy", ts);
|
|
25274
|
+
store2.deleteEdge(e.id);
|
|
25275
|
+
report.demotedEdges++;
|
|
25276
|
+
}
|
|
25277
|
+
report.demotedProblems++;
|
|
25278
|
+
continue;
|
|
25279
|
+
}
|
|
25280
|
+
for (const e of legacy) {
|
|
25281
|
+
store2.mergeEdge({ ...e, attrs: { ...e.attrs, anchorProvenance: "legacy" }, lastSeenAt: ts });
|
|
25282
|
+
report.labeledEdges++;
|
|
25283
|
+
}
|
|
25284
|
+
for (const se of store2.outEdges(p.id, ["SOLVED_BY"])) {
|
|
25285
|
+
const sol = store2.getNode(se.to);
|
|
25286
|
+
if (!sol || !sol.description.startsWith(AUTO_MINT_PREFIX)) continue;
|
|
25287
|
+
const guessedAnchor = sol.description.slice(AUTO_MINT_PREFIX.length);
|
|
25288
|
+
store2.updateNode(sol.id, {
|
|
25289
|
+
attrs: { ...sol.attrs, provisional: true, resolutionSuspect: true },
|
|
25290
|
+
lastUpdatedAt: ts
|
|
25291
|
+
});
|
|
25292
|
+
markRevisit(
|
|
25293
|
+
store2,
|
|
25294
|
+
sol,
|
|
25295
|
+
`auto-closed off a pre-provenance anchor (guessed ${guessedAnchor}) \u2014 confirm the problem is really fixed, or reopen it`,
|
|
25296
|
+
ts
|
|
25297
|
+
);
|
|
25298
|
+
store2.updateNode(p.id, {
|
|
25299
|
+
attrs: { ...p.attrs, resolutionSuspect: true },
|
|
25300
|
+
lastUpdatedAt: ts
|
|
25301
|
+
});
|
|
25302
|
+
report.suspects.push({
|
|
25303
|
+
problemId: p.id,
|
|
25304
|
+
problem: p.description,
|
|
25305
|
+
solutionId: sol.id,
|
|
25306
|
+
guessedAnchor
|
|
25307
|
+
});
|
|
25308
|
+
}
|
|
25309
|
+
} catch {
|
|
25310
|
+
}
|
|
25311
|
+
}
|
|
25312
|
+
return report;
|
|
25313
|
+
}
|
|
25314
|
+
|
|
25236
25315
|
// ../../packages/local-graph/src/percolate.ts
|
|
25237
25316
|
init_src2();
|
|
25238
25317
|
|
|
@@ -25976,9 +26055,11 @@ function buildSnapshot(opts) {
|
|
|
25976
26055
|
};
|
|
25977
26056
|
const langNodes = opts.store.findNodesByLabel("Language");
|
|
25978
26057
|
const pkgNodes = opts.store.findNodesByLabel("Package");
|
|
26058
|
+
const toolNodes = opts.store.findNodesByLabel("Tool").sort((a, b) => (b.cumulativeHits ?? 0) - (a.cumulativeHits ?? 0)).slice(0, 5);
|
|
25979
26059
|
const profileContext = {
|
|
25980
26060
|
languages: opts.profile.languages.map((name2) => ({ name: name2, node: matchNode(langNodes, name2) })),
|
|
25981
|
-
packages: opts.profile.stack.map((name2) => ({ name: name2, node: matchNode(pkgNodes, pkgBase(name2)) }))
|
|
26061
|
+
packages: opts.profile.stack.map((name2) => ({ name: name2, node: matchNode(pkgNodes, pkgBase(name2)) })),
|
|
26062
|
+
tools: toolNodes.map((node) => ({ name: String(node.attrs["name"] ?? node.description), node }))
|
|
25982
26063
|
};
|
|
25983
26064
|
const causalNudge = recent.length >= 2 && recent.every(
|
|
25984
26065
|
(r) => opts.store.outEdges(r.node.id, ["CAUSED_BY"]).length === 0 && opts.store.inEdges(r.node.id, ["CAUSED_BY"]).length === 0
|
|
@@ -26234,6 +26315,14 @@ async function runReindex(p) {
|
|
|
26234
26315
|
return { ...r, identityEvaluations };
|
|
26235
26316
|
}
|
|
26236
26317
|
function runNightly() {
|
|
26318
|
+
let anchorsDemoted = 0;
|
|
26319
|
+
let resolutionsSuspect = 0;
|
|
26320
|
+
try {
|
|
26321
|
+
const a = backfillLegacyAnchors(store, Date.now());
|
|
26322
|
+
anchorsDemoted = a.demotedEdges;
|
|
26323
|
+
resolutionsSuspect = a.suspects.length;
|
|
26324
|
+
} catch {
|
|
26325
|
+
}
|
|
26237
26326
|
const report = runNightlyPipeline(store);
|
|
26238
26327
|
let merged = 0;
|
|
26239
26328
|
let clusters = 0;
|
|
@@ -26251,6 +26340,6 @@ function runNightly() {
|
|
|
26251
26340
|
backfillProblemContext(store, Date.now());
|
|
26252
26341
|
} catch {
|
|
26253
26342
|
}
|
|
26254
|
-
return { report, merged, clusters, localSkills: 0, skillsWritten: 0, skillsPruned: 0 };
|
|
26343
|
+
return { report, merged, clusters, localSkills: 0, skillsWritten: 0, skillsPruned: 0, anchorsDemoted, resolutionsSuspect };
|
|
26255
26344
|
}
|
|
26256
26345
|
port.postMessage({ ready: true });
|