fidelis 0.1.1 → 0.1.2
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/dist/judge.js +10 -4
- package/package.json +1 -1
package/dist/judge.js
CHANGED
|
@@ -42,11 +42,17 @@ export function digest(evidence, prior, budgetChars, rawIDs = new Set(), preambl
|
|
|
42
42
|
const history = evidence.history ?? [];
|
|
43
43
|
const historyLines = [];
|
|
44
44
|
let used = 0;
|
|
45
|
+
let full = false;
|
|
45
46
|
for (const event of [...history].reverse()) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
used
|
|
47
|
+
// A restored span always goes in: the recheck is only valid if the judge really sees it. Over budget fails below.
|
|
48
|
+
const restored = rawIDs.has(event.id);
|
|
49
|
+
const line = eventLine(event, restored ? budgetChars : HISTORY_CLIP);
|
|
50
|
+
if (!restored && (full || used + line.length > budgetChars * HISTORY_SHARE)) {
|
|
51
|
+
full = true;
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
if (!restored)
|
|
55
|
+
used += line.length;
|
|
50
56
|
historyLines.unshift(line);
|
|
51
57
|
}
|
|
52
58
|
const omitted = history.length - historyLines.length;
|