@vincemakes/kiso-evals 0.11.0 → 0.13.0

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.
@@ -13,7 +13,8 @@
13
13
  * trajectory contains a delivery claim with zero producer calls is NOT a
14
14
  * clean `completed` — the harness's delivery tracker must see the signal.
15
15
  */
16
- import { analyzeDelivery } from "@vincemakes/kiso-core";
16
+ // EC-1: analyzeDelivery moved out of kiso-core into this package.
17
+ import { analyzeDelivery } from "../governance/delivery.js";
17
18
  export const terminalLies = {
18
19
  name: "terminal-lies",
19
20
  incident: "uooki long-document turn: model claimed 'created the document artifact', canvas stayed empty, turn reported completed (document_create trap, 2026-07-31)",
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Delivery truth — "done" means the ledger says so, not the model (uooki
3
+ * done_guard, 30 incidents distilled).
4
+ *
5
+ * EC-1 (0.13.0): this module MOVED here from packages/core/src/governance/.
6
+ * The extraction criterion the round adopted is not "who has zero external
7
+ * callers" but "if this module left core, could the kernel still define its
8
+ * own execution-correctness semantics?" — and for a trajectory verdict the
9
+ * answer is plainly yes: delivery is an L7 EVAL concern, computed after the
10
+ * fact from events the loop already yielded. It had no consumer inside
11
+ * packages/core/src at all; its only real caller has always been the
12
+ * terminal-lies fixture next door. The kernel's own line budget (2,000 —
13
+ * the README's loudest promise) paid for the EC-1 scheduler by giving this
14
+ * module the home it always belonged in. Behavior is UNCHANGED: same
15
+ * verdict, same fields, byte for byte (the zero-behavior proof is
16
+ * packages/core/tests/m3.test.ts, which still exercises it).
17
+ *
18
+ * The kernel's terminal is honest but shallow: `completed` means "the loop
19
+ * ended on its own terms". Whether the turn DELIVERED what was asked is a
20
+ * harness-side verdict over the trajectory — this module computes it from
21
+ * the same events the loop yielded, so the verdict is replayable and the
22
+ * model's narration never participates in its own grading.
23
+ *
24
+ * Producers are named by the CALLER, in `DeliveryConfig.producers` — the
25
+ * hand-maintained set is the ONLY source of delivery truth. SC-1b removed
26
+ * `Tool.delivers`, the flag this note used to describe as the eventual
27
+ * replacement: it was declared on the contract and read by nothing, here
28
+ * or anywhere. Should a tool's own declaration ever supersede the caller's
29
+ * set, it enters as a new field with a wiring and a gate, never as a
30
+ * standing promise the code has not kept.
31
+ *
32
+ * The verdict counts producer calls that COMPLETED (non-error results).
33
+ * `claimedInText` is computed and REPORTED but does not enter `passed` —
34
+ * a caller that wants "claimed but not delivered" to fail combines the two
35
+ * itself (the evals fixture does). With `required: false`, text claiming
36
+ * delivery over zero producer calls passes here. The canonical lie —
37
+ * "generated-document" with zero producer calls and a clean completed
38
+ * terminal — is caught by that combination.
39
+ *
40
+ * In M3.5 the emission side (artifact URLs extracted from results) joins;
41
+ * today a completed producer IS the emission.
42
+ */
43
+ import type { Event } from "@vincemakes/kiso-core";
44
+ export interface DeliveryConfig {
45
+ /** Whether this turn was required to deliver at all. */
46
+ readonly required: boolean;
47
+ /** Tool names that produce a deliverable. */
48
+ readonly producers: ReadonlySet<string>;
49
+ }
50
+ export interface DeliveryVerdict {
51
+ readonly passed: boolean;
52
+ /** Producer calls the model actually made. */
53
+ readonly producerCalls: readonly string[];
54
+ /** Producer calls that completed (non-error result). */
55
+ readonly completedProducers: readonly string[];
56
+ /** The text claimed delivery (a claim is a lie only when unbacked). */
57
+ readonly claimedInText: boolean;
58
+ }
59
+ export declare function analyzeDelivery(events: readonly Event[], config: DeliveryConfig): DeliveryVerdict;
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Delivery truth — "done" means the ledger says so, not the model (uooki
3
+ * done_guard, 30 incidents distilled).
4
+ *
5
+ * EC-1 (0.13.0): this module MOVED here from packages/core/src/governance/.
6
+ * The extraction criterion the round adopted is not "who has zero external
7
+ * callers" but "if this module left core, could the kernel still define its
8
+ * own execution-correctness semantics?" — and for a trajectory verdict the
9
+ * answer is plainly yes: delivery is an L7 EVAL concern, computed after the
10
+ * fact from events the loop already yielded. It had no consumer inside
11
+ * packages/core/src at all; its only real caller has always been the
12
+ * terminal-lies fixture next door. The kernel's own line budget (2,000 —
13
+ * the README's loudest promise) paid for the EC-1 scheduler by giving this
14
+ * module the home it always belonged in. Behavior is UNCHANGED: same
15
+ * verdict, same fields, byte for byte (the zero-behavior proof is
16
+ * packages/core/tests/m3.test.ts, which still exercises it).
17
+ *
18
+ * The kernel's terminal is honest but shallow: `completed` means "the loop
19
+ * ended on its own terms". Whether the turn DELIVERED what was asked is a
20
+ * harness-side verdict over the trajectory — this module computes it from
21
+ * the same events the loop yielded, so the verdict is replayable and the
22
+ * model's narration never participates in its own grading.
23
+ *
24
+ * Producers are named by the CALLER, in `DeliveryConfig.producers` — the
25
+ * hand-maintained set is the ONLY source of delivery truth. SC-1b removed
26
+ * `Tool.delivers`, the flag this note used to describe as the eventual
27
+ * replacement: it was declared on the contract and read by nothing, here
28
+ * or anywhere. Should a tool's own declaration ever supersede the caller's
29
+ * set, it enters as a new field with a wiring and a gate, never as a
30
+ * standing promise the code has not kept.
31
+ *
32
+ * The verdict counts producer calls that COMPLETED (non-error results).
33
+ * `claimedInText` is computed and REPORTED but does not enter `passed` —
34
+ * a caller that wants "claimed but not delivered" to fail combines the two
35
+ * itself (the evals fixture does). With `required: false`, text claiming
36
+ * delivery over zero producer calls passes here. The canonical lie —
37
+ * "generated-document" with zero producer calls and a clean completed
38
+ * terminal — is caught by that combination.
39
+ *
40
+ * In M3.5 the emission side (artifact URLs extracted from results) joins;
41
+ * today a completed producer IS the emission.
42
+ */
43
+ const CLAIM_PATTERN = /created|completed|delivered|done/i;
44
+ export function analyzeDelivery(events, config) {
45
+ const producerCalls = [];
46
+ const completedProducers = [];
47
+ let claimedInText = false;
48
+ for (const ev of events) {
49
+ switch (ev.type) {
50
+ case "text_delta":
51
+ if (CLAIM_PATTERN.test(ev.text))
52
+ claimedInText = true;
53
+ break;
54
+ case "tool_call_end":
55
+ if (config.producers.has(ev.name))
56
+ producerCalls.push(ev.callId);
57
+ break;
58
+ case "tool_result":
59
+ if (producerCalls.includes(ev.callId) && !ev.isError) {
60
+ completedProducers.push(ev.callId);
61
+ }
62
+ break;
63
+ }
64
+ }
65
+ return {
66
+ passed: !config.required || completedProducers.length > 0,
67
+ producerCalls,
68
+ completedProducers,
69
+ claimedInText,
70
+ };
71
+ }
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from "./faux.js";
2
2
  export * from "./fixtures/index.js";
3
+ export * from "./governance/delivery.js";
package/dist/index.js CHANGED
@@ -1,2 +1,5 @@
1
1
  export * from "./faux.js";
2
2
  export * from "./fixtures/index.js";
3
+ // EC-1: delivery truth moved here from kiso-core (the extraction that paid
4
+ // for the kernel's Turn Commit scheduler) — see governance/delivery.ts.
5
+ export * from "./governance/delivery.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vincemakes/kiso-evals",
3
- "version": "0.11.0",
3
+ "version": "0.13.0",
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.11.0"
24
+ "@vincemakes/kiso-core": "0.13.0"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@anthropic-ai/sdk": "^0.115.0",
28
- "@vincemakes/kiso-provider-anthropic": "0.11.0",
29
- "@vincemakes/kiso-provider-openai": "0.11.0",
28
+ "@vincemakes/kiso-provider-anthropic": "0.13.0",
29
+ "@vincemakes/kiso-provider-openai": "0.13.0",
30
30
  "@types/node": "^26.1.2",
31
31
  "openai": "^7.3.0",
32
32
  "typescript": "^5.7.2",