@inerrata-corporation/errata 2.0.0-dev.93 → 2.0.0-dev.95
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 +42 -16
- package/package.json +1 -1
package/errata.mjs
CHANGED
|
@@ -25573,6 +25573,11 @@ var init_dual_burst = __esm({
|
|
|
25573
25573
|
function isHardBridge(n) {
|
|
25574
25574
|
return n.label === "Package" || n.label === "Language" || n.label === "Claim" && Number(n.attrs["abstractionLevel"] ?? 0) >= 2;
|
|
25575
25575
|
}
|
|
25576
|
+
function isQuotaError(err2) {
|
|
25577
|
+
const status = err2?.status;
|
|
25578
|
+
const msg = err2 instanceof Error ? err2.message : String(err2);
|
|
25579
|
+
return status === 403 && /quota/i.test(msg);
|
|
25580
|
+
}
|
|
25576
25581
|
async function dualAugment(opts) {
|
|
25577
25582
|
const { store, cloud, localHits, seedNode, queryText, limit } = opts;
|
|
25578
25583
|
const cloudHits = [];
|
|
@@ -25613,6 +25618,10 @@ async function dualAugment(opts) {
|
|
|
25613
25618
|
try {
|
|
25614
25619
|
await Promise.all(calls);
|
|
25615
25620
|
} catch (err2) {
|
|
25621
|
+
if (isQuotaError(err2)) {
|
|
25622
|
+
console.warn("[errata] dualAugment: collective read QUOTA EXCEEDED \u2014 the collective is up; this key hit its cap. Bump the tier or wait for the window to reset.");
|
|
25623
|
+
return { status: "quota" };
|
|
25624
|
+
}
|
|
25616
25625
|
console.error("[errata] dualAugment: collective bridge call failed \u2014", err2 instanceof Error ? err2.message : err2);
|
|
25617
25626
|
return { status: "offline" };
|
|
25618
25627
|
}
|
|
@@ -25624,6 +25633,16 @@ async function dualAugment(opts) {
|
|
|
25624
25633
|
seedUsageCount
|
|
25625
25634
|
};
|
|
25626
25635
|
}
|
|
25636
|
+
function federationHint(status) {
|
|
25637
|
+
switch (status) {
|
|
25638
|
+
case "quota":
|
|
25639
|
+
return "collective read quota exceeded \u2014 the network is up but this key hit its cap; raise the tier or wait for the window to reset";
|
|
25640
|
+
case "offline":
|
|
25641
|
+
return "collective unreachable \u2014 staying local-only (offline / timeout)";
|
|
25642
|
+
default:
|
|
25643
|
+
return void 0;
|
|
25644
|
+
}
|
|
25645
|
+
}
|
|
25627
25646
|
function formatDualNodes(merged) {
|
|
25628
25647
|
return merged.nodes.map((n) => ({
|
|
25629
25648
|
id: n.id,
|
|
@@ -36836,6 +36855,7 @@ var init_mcp = __esm({
|
|
|
36836
36855
|
query,
|
|
36837
36856
|
collectiveReachable: dual.status === "empty",
|
|
36838
36857
|
collectiveStatus: dual.status,
|
|
36858
|
+
...federationHint(dual.status) ? { collectiveHint: federationHint(dual.status) } : {},
|
|
36839
36859
|
count: hits.length,
|
|
36840
36860
|
results: hits
|
|
36841
36861
|
};
|
|
@@ -37016,6 +37036,7 @@ var init_mcp = __esm({
|
|
|
37016
37036
|
// reached-but-empty counts as reachable; offline/no-portal/local-only do not.
|
|
37017
37037
|
collectiveReachable: collectiveStatus === "empty",
|
|
37018
37038
|
collectiveStatus,
|
|
37039
|
+
...federationHint(collectiveStatus) ? { collectiveHint: federationHint(collectiveStatus) } : {},
|
|
37019
37040
|
count: ranked.length,
|
|
37020
37041
|
results: ranked.map((r) => ({
|
|
37021
37042
|
id: r.id,
|
|
@@ -37528,7 +37549,12 @@ var init_mcp = __esm({
|
|
|
37528
37549
|
results: formatDualNodes(dual.merged)
|
|
37529
37550
|
};
|
|
37530
37551
|
}
|
|
37531
|
-
return {
|
|
37552
|
+
return {
|
|
37553
|
+
...local,
|
|
37554
|
+
collectiveReachable: dual.status === "empty",
|
|
37555
|
+
collectiveStatus: dual.status,
|
|
37556
|
+
...federationHint(dual.status) ? { collectiveHint: federationHint(dual.status) } : {}
|
|
37557
|
+
};
|
|
37532
37558
|
}
|
|
37533
37559
|
return local;
|
|
37534
37560
|
}
|
|
@@ -51438,7 +51464,7 @@ function startLoopLagMonitor(thresholdMs = 1e3) {
|
|
|
51438
51464
|
}
|
|
51439
51465
|
|
|
51440
51466
|
// src/engine.ts
|
|
51441
|
-
var DAEMON_VERSION = true ? "2.0.0-dev.
|
|
51467
|
+
var DAEMON_VERSION = true ? "2.0.0-dev.95" : "2.0.0-alpha.0";
|
|
51442
51468
|
var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
|
|
51443
51469
|
var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
|
|
51444
51470
|
var GIT_OP_MUTE_MS = 4e3;
|
|
@@ -53126,8 +53152,8 @@ function noveltyAgainst(node2, neighbors, opts = {}) {
|
|
|
53126
53152
|
// src/instance-ingest.ts
|
|
53127
53153
|
var INSTANCE_LABELS = ["Problem", "Solution", "RootCause"];
|
|
53128
53154
|
var INSTANCE_EDGES = ["CAUSED_BY", "SOLVED_BY"];
|
|
53129
|
-
var ANCHOR_EDGES = ["OCCURS_IN", "DEPENDS_ON"];
|
|
53130
|
-
var ANCHOR_TARGET_LABELS = ["Language", "Package"];
|
|
53155
|
+
var ANCHOR_EDGES = ["OCCURS_IN", "DEPENDS_ON", "PERTAIN_TO"];
|
|
53156
|
+
var ANCHOR_TARGET_LABELS = ["Language", "Package", "Domain"];
|
|
53131
53157
|
function stripCodebaseScope(scope) {
|
|
53132
53158
|
const s = { ...scope ?? {} };
|
|
53133
53159
|
delete s["codebase"];
|
|
@@ -53138,21 +53164,20 @@ function wireContextId(n) {
|
|
|
53138
53164
|
const name2 = String(n.attrs["name"] ?? "").trim() || n.description.trim() || n.id.replace(/^lang:/, "");
|
|
53139
53165
|
return languageCanonicalId(name2);
|
|
53140
53166
|
}
|
|
53167
|
+
if (n.label === "Domain" && n.attrs["source"] !== "cloud") {
|
|
53168
|
+
return String(n.attrs["canonicalId"] ?? n.id);
|
|
53169
|
+
}
|
|
53141
53170
|
return n.id;
|
|
53142
53171
|
}
|
|
53143
53172
|
function shareableContext(n, wireId) {
|
|
53144
|
-
|
|
53145
|
-
|
|
53146
|
-
|
|
53147
|
-
|
|
53148
|
-
|
|
53149
|
-
|
|
53150
|
-
|
|
53151
|
-
|
|
53152
|
-
ecosystem: n.attrs["ecosystem"],
|
|
53153
|
-
resolved: n.attrs["resolved"]
|
|
53154
|
-
} : { name: n.attrs["name"] }
|
|
53155
|
-
};
|
|
53173
|
+
const attrs = n.label === "Package" ? {
|
|
53174
|
+
purl: n.attrs["purl"],
|
|
53175
|
+
name: n.attrs["name"],
|
|
53176
|
+
version: n.attrs["version"],
|
|
53177
|
+
ecosystem: n.attrs["ecosystem"],
|
|
53178
|
+
resolved: n.attrs["resolved"]
|
|
53179
|
+
} : n.label === "Domain" ? { name: n.description, canonicalId: n.attrs["canonicalId"] } : { name: n.attrs["name"] };
|
|
53180
|
+
return { ...n, id: wireId, embedding: [], attrs };
|
|
53156
53181
|
}
|
|
53157
53182
|
function buildInstanceIngest(store, profile, daemonVersion, ignorePatterns = [], opts = {}) {
|
|
53158
53183
|
const level = opts.level ?? 1;
|
|
@@ -53208,6 +53233,7 @@ function buildInstanceIngest(store, profile, daemonVersion, ignorePatterns = [],
|
|
|
53208
53233
|
if (!t || !ANCHOR_TARGET_LABELS.includes(t.label)) continue;
|
|
53209
53234
|
if (e.type === "OCCURS_IN" && t.label !== "Language") continue;
|
|
53210
53235
|
if (e.type === "DEPENDS_ON" && t.label !== "Package") continue;
|
|
53236
|
+
if (e.type === "PERTAIN_TO" && t.label !== "Domain") continue;
|
|
53211
53237
|
if (t.label === "Package" && opts.includePackages !== true) continue;
|
|
53212
53238
|
if (ignored(t.description) || ignored(String(t.attrs["name"] ?? ""))) continue;
|
|
53213
53239
|
targets.push({ e, t, wireId: wireContextId(t) });
|