@vincemakes/kiso-evals 0.1.19 → 0.1.21
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.
|
@@ -9,9 +9,14 @@
|
|
|
9
9
|
* to the same revision key and overwriting the original. The fix was one
|
|
10
10
|
* line of idempotence: a marked message is never archived again.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
12
|
+
* ADR-0044 merged the classic auto-compaction into the microcompact
|
|
13
|
+
* boundary. The incident's lesson is now STRUCTURAL: a boundary is a
|
|
14
|
+
* persisted fact, so the projection derives the same cleared view from
|
|
15
|
+
* the same events, byte for byte — "re-running compaction" is a pure
|
|
16
|
+
* re-derivation that can never re-archive, overwrite, or grow. The
|
|
17
|
+
* fixture pins that idempotence: replaying the log is identical, and the
|
|
18
|
+
* cleared results carry exactly the ONE placeholder, never a grown
|
|
19
|
+
* re-cleared copy.
|
|
15
20
|
*/
|
|
16
21
|
import type { Fixture } from "./types.js";
|
|
17
22
|
export declare const compactionRegrowth: Fixture;
|
|
@@ -9,11 +9,16 @@
|
|
|
9
9
|
* to the same revision key and overwriting the original. The fix was one
|
|
10
10
|
* line of idempotence: a marked message is never archived again.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
12
|
+
* ADR-0044 merged the classic auto-compaction into the microcompact
|
|
13
|
+
* boundary. The incident's lesson is now STRUCTURAL: a boundary is a
|
|
14
|
+
* persisted fact, so the projection derives the same cleared view from
|
|
15
|
+
* the same events, byte for byte — "re-running compaction" is a pure
|
|
16
|
+
* re-derivation that can never re-archive, overwrite, or grow. The
|
|
17
|
+
* fixture pins that idempotence: replaying the log is identical, and the
|
|
18
|
+
* cleared results carry exactly the ONE placeholder, never a grown
|
|
19
|
+
* re-cleared copy.
|
|
15
20
|
*/
|
|
16
|
-
import {
|
|
21
|
+
import { projectMessages } from "@vincemakes/kiso-core";
|
|
17
22
|
export const compactionRegrowth = {
|
|
18
23
|
name: "compaction-regrowth",
|
|
19
24
|
incident: "uooki video pipeline: 579 store_calls vs 44 expected at 50 turns — re-archiving cleared markers overwrote originals (2026)",
|
|
@@ -27,18 +32,37 @@ export const compactionRegrowth = {
|
|
|
27
32
|
],
|
|
28
33
|
},
|
|
29
34
|
],
|
|
30
|
-
staticCheck: (
|
|
35
|
+
staticCheck: () => {
|
|
31
36
|
const violations = [];
|
|
32
|
-
//
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
37
|
+
// A compacted log: two read results, a boundary clearing the first.
|
|
38
|
+
const ev = (seq, e) => ({ seq, ...e });
|
|
39
|
+
const log = [
|
|
40
|
+
ev(0, { type: "user_input", content: "start" }),
|
|
41
|
+
ev(1, { type: "tool_call_end", callId: "c1", name: "read_file", input: { path: "a.ts" } }),
|
|
42
|
+
ev(2, { type: "tool_result", callId: "c1", content: "x".repeat(100), isError: false }),
|
|
43
|
+
ev(3, { type: "user_input", content: "again" }),
|
|
44
|
+
ev(4, { type: "tool_call_end", callId: "c2", name: "read_file", input: { path: "b.ts" } }),
|
|
45
|
+
ev(5, { type: "tool_result", callId: "c2", content: "y".repeat(100), isError: false }),
|
|
46
|
+
ev(6, { type: "microcompacted", beforeSeq: 2 }),
|
|
47
|
+
];
|
|
48
|
+
const first = projectMessages(log);
|
|
49
|
+
// Idempotence: replaying the same events derives the SAME
|
|
50
|
+
// projection — nothing grows, nothing is re-archived (the regrowth
|
|
51
|
+
// incident's fix, now structural).
|
|
52
|
+
if (JSON.stringify(first) !== JSON.stringify(projectMessages(log))) {
|
|
53
|
+
violations.push("projection is not byte-stable across replay");
|
|
36
54
|
}
|
|
37
|
-
|
|
38
|
-
|
|
55
|
+
// The boundary cleared exactly the ONE eligible result (seq ≤ 2,
|
|
56
|
+
// a whitelisted tool): the second result is untouched — never a
|
|
57
|
+
// grown re-cleared copy of the first.
|
|
58
|
+
const tools = first.filter((m) => m.role === "tool");
|
|
59
|
+
const cleared = tools.filter((m) => String(m.content).includes("cleared"));
|
|
60
|
+
const kept = tools.filter((m) => !String(m.content).includes("cleared"));
|
|
61
|
+
if (cleared.length !== 1) {
|
|
62
|
+
violations.push("expected exactly one cleared result after the boundary");
|
|
39
63
|
}
|
|
40
|
-
if (
|
|
41
|
-
violations.push("
|
|
64
|
+
if (kept.length !== 1) {
|
|
65
|
+
violations.push("the second result must stay untouched");
|
|
42
66
|
}
|
|
43
67
|
return violations;
|
|
44
68
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vincemakes/kiso-evals",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.21",
|
|
4
4
|
"description": "kiso evals — the faux provider, the incident fixture library, and the cross-provider contract tests.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
"test": "vitest run"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@vincemakes/kiso-core": "0.1.
|
|
24
|
+
"@vincemakes/kiso-core": "0.1.21"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@anthropic-ai/sdk": "^0.115.0",
|
|
28
|
-
"@vincemakes/kiso-provider-anthropic": "0.1.
|
|
29
|
-
"@vincemakes/kiso-provider-openai": "0.1.
|
|
28
|
+
"@vincemakes/kiso-provider-anthropic": "0.1.21",
|
|
29
|
+
"@vincemakes/kiso-provider-openai": "0.1.21",
|
|
30
30
|
"@types/node": "^26.1.2",
|
|
31
31
|
"openai": "^7.3.0",
|
|
32
32
|
"typescript": "^5.7.2",
|