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.
Files changed (2) hide show
  1. package/dist/judge.js +10 -4
  2. 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
- const line = eventLine(event, rawIDs.has(event.id) ? budgetChars : HISTORY_CLIP);
47
- if (used + line.length > budgetChars * HISTORY_SHARE)
48
- break;
49
- used += line.length;
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fidelis",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Harness-agnostic AI agent auditor core: checklist compiler, judge pipeline and session state machine.",
5
5
  "type": "module",
6
6
  "license": "MIT",