@inerrata-corporation/errata 2.0.17-dev.3407 → 2.0.17-dev.3416
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 +40 -5
- package/package.json +1 -1
package/errata.mjs
CHANGED
|
@@ -81593,7 +81593,7 @@ function createWatchBreaker(deps) {
|
|
|
81593
81593
|
}
|
|
81594
81594
|
|
|
81595
81595
|
// src/engine.ts
|
|
81596
|
-
var DAEMON_VERSION = true ? "2.0.17-dev.
|
|
81596
|
+
var DAEMON_VERSION = true ? "2.0.17-dev.3416" : "2.0.0-alpha.0";
|
|
81597
81597
|
var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
|
|
81598
81598
|
var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
|
|
81599
81599
|
var GIT_OP_MUTE_MS = 4e3;
|
|
@@ -86842,7 +86842,14 @@ function stage(profile, patch, now) {
|
|
|
86842
86842
|
}
|
|
86843
86843
|
};
|
|
86844
86844
|
}
|
|
86845
|
-
function
|
|
86845
|
+
function isEdgeContentBlock(err2) {
|
|
86846
|
+
return isIntermediaryRejection(err2) && err2 instanceof CloudError && err2.status !== 408 && err2.status !== 429;
|
|
86847
|
+
}
|
|
86848
|
+
function stageMs(value) {
|
|
86849
|
+
const ms = Number.parseInt(value, 10);
|
|
86850
|
+
return Number.isFinite(ms) ? ms : -1;
|
|
86851
|
+
}
|
|
86852
|
+
function unitTiming(postStarted, prepMs, receipt, nowMs = Date.now()) {
|
|
86846
86853
|
const s = (ms) => `${(ms / 1e3).toFixed(1)}s`;
|
|
86847
86854
|
const parts2 = [`local ${s(prepMs)}`];
|
|
86848
86855
|
const g = receipt.gate;
|
|
@@ -86850,10 +86857,13 @@ function unitTiming(postStarted, prepMs, receipt) {
|
|
|
86850
86857
|
if (receipt.timing?.modelMs !== void 0) parts2.push(`model ${s(receipt.timing.modelMs)}`);
|
|
86851
86858
|
if (receipt.timing?.orderWaitMs) parts2.push(`waited ${s(receipt.timing.orderWaitMs)} for the previous write`);
|
|
86852
86859
|
if (receipt.timing?.ingestMs !== void 0) {
|
|
86853
|
-
const top = Object.entries(receipt.timing.ingestStages ?? {}).slice(0, 4).map(([k, v]) => `${k} ${v}`);
|
|
86860
|
+
const top = Object.entries(receipt.timing.ingestStages ?? {}).sort((a, b) => stageMs(b[1]) - stageMs(a[1])).slice(0, 4).map(([k, v]) => `${k} ${v}`);
|
|
86854
86861
|
parts2.push(`ingest ${s(receipt.timing.ingestMs)}${top.length ? ` [${top.join(", ")}]` : ""}`);
|
|
86855
86862
|
}
|
|
86856
|
-
|
|
86863
|
+
if (receipt.usage && (receipt.usage.input_tokens || receipt.usage.output_tokens)) {
|
|
86864
|
+
parts2.push(`tokens ${receipt.usage.input_tokens}/${receipt.usage.output_tokens}`);
|
|
86865
|
+
}
|
|
86866
|
+
return ` in ${s(nowMs - postStarted + prepMs)} (${parts2.join(", ")})`;
|
|
86857
86867
|
}
|
|
86858
86868
|
function addCounts(a, b) {
|
|
86859
86869
|
const sum = (k) => (a[k] ?? 0) + (b[k] ?? 0);
|
|
@@ -86920,8 +86930,9 @@ async function walk10(root, input, client, opts, readBlob) {
|
|
|
86920
86930
|
const prepared = /* @__PURE__ */ new Map();
|
|
86921
86931
|
const launched = /* @__PURE__ */ new Map();
|
|
86922
86932
|
const cap = opts.maxUnits;
|
|
86933
|
+
const edgeParked = /* @__PURE__ */ new Set();
|
|
86923
86934
|
const predecessor = (k) => {
|
|
86924
|
-
for (let j = k - 1; j >= 0; j--) if (!units[j].skip) return units[j];
|
|
86935
|
+
for (let j = k - 1; j >= 0; j--) if (!units[j].skip && !edgeParked.has(j)) return units[j];
|
|
86925
86936
|
return void 0;
|
|
86926
86937
|
};
|
|
86927
86938
|
const prepare = (k) => {
|
|
@@ -87025,17 +87036,28 @@ async function walk10(root, input, client, opts, readBlob) {
|
|
|
87025
87036
|
let first = head2.settled;
|
|
87026
87037
|
let outcome = null;
|
|
87027
87038
|
let attempt = 0;
|
|
87039
|
+
let edgeBlocks = 0;
|
|
87040
|
+
let parkedAtEdge = false;
|
|
87028
87041
|
while (outcome === null) {
|
|
87029
87042
|
attempt += 1;
|
|
87030
87043
|
if (!first && body2.backfill && body2.backfill.anchorSeq === void 0 && anchor.seq !== void 0) {
|
|
87031
87044
|
body2.backfill = { ...body2.backfill, anchorSeq: anchor.seq };
|
|
87032
87045
|
}
|
|
87046
|
+
if (!first && body2.after) {
|
|
87047
|
+
const prev = predecessor(k);
|
|
87048
|
+
if (!prev) delete body2.after;
|
|
87049
|
+
else if (prev.sha !== body2.after.sha || prev.subIndex !== body2.after.subIndex) body2.after = { sha: prev.sha, subIndex: prev.subIndex };
|
|
87050
|
+
}
|
|
87033
87051
|
const settled = await (first ?? settle(Promise.resolve().then(() => post(projectId, body2))));
|
|
87034
87052
|
first = null;
|
|
87035
87053
|
if ("err" in settled) {
|
|
87036
87054
|
const err2 = settled.err;
|
|
87037
87055
|
const status = err2 instanceof CloudError ? err2.status : 0;
|
|
87038
87056
|
const elapsed = Math.round((Date.now() - started2) / 1e3);
|
|
87057
|
+
if (isEdgeContentBlock(err2) && ++edgeBlocks >= 2) {
|
|
87058
|
+
parkedAtEdge = true;
|
|
87059
|
+
break;
|
|
87060
|
+
}
|
|
87039
87061
|
if (Date.now() - started2 > RECOVERY_DEADLINE_MS) {
|
|
87040
87062
|
profile = stage(profile, { state: "paused", lastError: `unit ${label}: ${status || "connection"} after ${elapsed}s, giving up until the next run` }, now);
|
|
87041
87063
|
persist(profile);
|
|
@@ -87069,6 +87091,19 @@ async function walk10(root, input, client, opts, readBlob) {
|
|
|
87069
87091
|
}
|
|
87070
87092
|
outcome = res;
|
|
87071
87093
|
}
|
|
87094
|
+
if (parkedAtEdge || outcome === null) {
|
|
87095
|
+
edgeParked.add(k);
|
|
87096
|
+
const runId = `edge-blocked:${u.sha}/${u.subIndex}`;
|
|
87097
|
+
const gaps = [...profile.historyStage?.coverageGaps ?? []];
|
|
87098
|
+
const known = gaps.some((g) => g.runId === runId);
|
|
87099
|
+
counts = addCounts(counts, { commitsWalked: 1, deferredUnits: known ? 0 : 1 });
|
|
87100
|
+
if (!known) gaps.push({ sha: u.sha, subIndex: u.subIndex, runId, reason: "edge-blocked" });
|
|
87101
|
+
profile = stage(profile, { coverageGaps: gaps.slice(-1e3), unitsDone: doneSoFar, counts, ...lastInPosition ? { watermarkSha: positionSha } : {} }, now);
|
|
87102
|
+
persist(profile);
|
|
87103
|
+
processed += 1;
|
|
87104
|
+
log(`[errata] history ${label}: refused at the edge (HTML ${edgeBlocks}\xD7 on its text); coverage gap retained as ${runId}, walking on`);
|
|
87105
|
+
continue;
|
|
87106
|
+
}
|
|
87072
87107
|
await launchAhead(k);
|
|
87073
87108
|
switch (outcome.status) {
|
|
87074
87109
|
case "completed": {
|