@cursor/july 0.1.24 → 0.1.25
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/bin/agent-serve.js +0 -0
- package/dist/channels/github/instrument.d.ts +20 -0
- package/dist/channels/github/instrument.d.ts.map +1 -0
- package/dist/docs/404.html +1 -1
- package/dist/docs/ab.html +2 -2
- package/dist/docs/assets/{app.CvSGaAxk.js → app.DYcC9FY-.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.BQTzJjR_.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.J1jJbCvs.js → VPLocalSearchBox.o4N_knTV.js} +1 -1
- package/dist/docs/assets/chunks/{theme.C7vfzr7h.js → theme.DQ-njyo0.js} +2 -2
- package/dist/docs/building-with-agents.html +2 -2
- package/dist/docs/concepts.html +2 -2
- package/dist/docs/deployment.html +2 -2
- package/dist/docs/evals.html +2 -2
- package/dist/docs/example-agents/approval-buddy.html +2 -2
- package/dist/docs/example-agents/benny.html +2 -2
- package/dist/docs/example-agents/bugbot.html +2 -2
- package/dist/docs/example-agents/codebase-wiki.html +2 -2
- package/dist/docs/example-agents/codeowners-review.html +2 -2
- package/dist/docs/example-agents/concierge.html +2 -2
- package/dist/docs/example-agents/fsd.html +2 -2
- package/dist/docs/example-agents/index.html +2 -2
- package/dist/docs/example-agents/knowledge-base.html +2 -2
- package/dist/docs/example-agents/oncall.html +2 -2
- package/dist/docs/example-agents/security-reviewer.html +2 -2
- package/dist/docs/example-agents/slack-agent.html +2 -2
- package/dist/docs/example-agents/weather-agent.html +2 -2
- package/dist/docs/guides/agent-to-agent.html +2 -2
- package/dist/docs/guides/cloud-runtime.html +2 -2
- package/dist/docs/guides/github.html +2 -2
- package/dist/docs/guides/human-in-the-loop.html +2 -2
- package/dist/docs/guides/mcp-oauth.html +2 -2
- package/dist/docs/guides/slack.html +2 -2
- package/dist/docs/guides/webhooks.html +2 -2
- package/dist/docs/hillclimbing.html +2 -2
- package/dist/docs/index.html +2 -2
- package/dist/docs/quickstart.html +2 -2
- package/dist/docs/reference/agent-config.html +2 -2
- package/dist/docs/reference/channels.html +2 -2
- package/dist/docs/reference/cli.html +2 -2
- package/dist/docs/reference/connections.html +2 -2
- package/dist/docs/reference/hooks.html +2 -2
- package/dist/docs/reference/http-api.html +2 -2
- package/dist/docs/reference/instructions.html +2 -2
- package/dist/docs/reference/playground.html +2 -2
- package/dist/docs/reference/project-layout.html +2 -2
- package/dist/docs/reference/prompt.html +2 -2
- package/dist/docs/reference/schedules.html +2 -2
- package/dist/docs/reference/sessions.html +2 -2
- package/dist/docs/reference/skills.html +2 -2
- package/dist/docs/reference/subagents.html +2 -2
- package/dist/docs/reference/tools.html +2 -2
- package/dist/docs/scaffolding-agents.html +2 -2
- package/dist/docs/storage.html +2 -2
- package/dist/docs/troubleshooting.html +2 -2
- package/dist/internal/json-dir-store.d.ts +32 -0
- package/dist/internal/json-dir-store.d.ts.map +1 -0
- package/dist/internal/json-dir-store.js +100 -0
- package/dist/playground/assets/index-CjOQ4hN9.css +1 -0
- package/dist/playground/assets/{index-DTG9OsPV.js → index-DqXdAFGa.js} +41 -41
- package/dist/playground/index.html +2 -2
- package/package.json +31 -24
- package/src/artifacts.ts +78 -0
- package/src/bin/agent-serve.version.test.ts +64 -0
- package/src/channels/github/api.test.ts +64 -0
- package/src/channels/github/auth.test.ts +105 -0
- package/src/channels/github/cursor-account.test.ts +204 -0
- package/src/channels/github/forward.test.ts +457 -0
- package/src/channels/github/github.test.ts +943 -0
- package/src/channels/github/replay.test.ts +179 -0
- package/src/channels/slack/api.post-message.test.ts +148 -0
- package/src/channels/slack/approvals.test.ts +328 -0
- package/src/channels/slack/block-actions.test.ts +452 -0
- package/src/channels/slack/bot-mentions.test.ts +267 -0
- package/src/channels/slack/channel-watch.test.ts +363 -0
- package/src/channels/slack/cursor-account.test.ts +253 -0
- package/src/channels/slack/defaults.final-post.test.ts +182 -0
- package/src/channels/slack/dispatch.test.ts +795 -0
- package/src/channels/slack/eval-directive.test.ts +273 -0
- package/src/channels/slack/message-body.test.ts +54 -0
- package/src/channels/slack/nudge-store.test.ts +143 -0
- package/src/channels/slack/slack.test.ts +391 -0
- package/src/channels/slack/stop.test.ts +23 -0
- package/src/channels/slack/thread-context.test.ts +202 -0
- package/src/evals/assertions.test.ts +617 -0
- package/src/evals/assertions.ts +37 -1
- package/src/evals/expect.test.ts +144 -0
- package/src/evals/judge.test.ts +181 -0
- package/src/evals/loaders.test.ts +132 -0
- package/src/evals/matchers.test.ts +95 -0
- package/src/evals/reporters.test.ts +303 -0
- package/src/evals/run-facts.test.ts +259 -0
- package/src/evals.ts +1 -0
- package/src/index.ts +1 -0
- package/src/internal/ab-snapshot.test.ts +325 -0
- package/src/internal/approval-gate.test.ts +49 -0
- package/src/internal/approvals.integration.test.ts +383 -0
- package/src/internal/artifacts-store.test.ts +283 -0
- package/src/internal/artifacts-store.ts +290 -0
- package/src/internal/authored-loaders.test.ts +31 -0
- package/src/internal/builtin-tools/artifacts.test.ts +247 -0
- package/src/internal/builtin-tools/artifacts.ts +74 -0
- package/src/internal/builtin-tools/index.ts +21 -0
- package/src/internal/builtin-tools/reminders.test.ts +201 -0
- package/src/internal/channel-route-schema.test.ts +294 -0
- package/src/internal/chat-attach.test.ts +262 -0
- package/src/internal/cli-deploy.test.ts +1991 -0
- package/src/internal/cli-docs.test.ts +161 -0
- package/src/internal/cli-mcp.test.ts +789 -0
- package/src/internal/cli-skills.test.ts +133 -0
- package/src/internal/cli-slack.test.ts +1654 -0
- package/src/internal/cli-slack.ts +13 -4
- package/src/internal/cloud-merge.test.ts +74 -0
- package/src/internal/cron.test.ts +22 -0
- package/src/internal/cursor/account-mcp.test.ts +807 -0
- package/src/internal/cursor/backend-client.test.ts +591 -0
- package/src/internal/cursor/credentials.test.ts +351 -0
- package/src/internal/cursor/github-credentials.test.ts +136 -0
- package/src/internal/cursor-account-mcp-auth.test.ts +310 -0
- package/src/internal/cursor-account.integration.test.ts +441 -0
- package/src/internal/cursor-event-relay.test.ts +746 -0
- package/src/internal/cursor-github-credentials.integration.test.ts +271 -0
- package/src/internal/cursor-slack-relay.test.ts +525 -0
- package/src/internal/deploy-source.test.ts +111 -0
- package/src/internal/discovery.artifact-tool.test.ts +136 -0
- package/src/internal/discovery.artifacts.test.ts +119 -0
- package/src/internal/discovery.builtin-tools.test.ts +94 -0
- package/src/internal/discovery.concurrency.test.ts +60 -0
- package/src/internal/discovery.cursor-account.test.ts +133 -0
- package/src/internal/discovery.cwd.test.ts +83 -0
- package/src/internal/discovery.hosting.test.ts +80 -0
- package/src/internal/discovery.identity.test.ts +44 -0
- package/src/internal/discovery.ts +102 -1
- package/src/internal/distribution.ts +1 -0
- package/src/internal/docs-site.test.ts +66 -0
- package/src/internal/duration.test.ts +29 -0
- package/src/internal/eval-judge-model.test.ts +187 -0
- package/src/internal/eval-run-store.cancel.test.ts +142 -0
- package/src/internal/eval-run-store.storage.test.ts +211 -0
- package/src/internal/eval-runner.http.test.ts +403 -0
- package/src/internal/eval-runner.run.test.ts +928 -0
- package/src/internal/evals-client.test.ts +307 -0
- package/src/internal/event-mapper.test.ts +243 -0
- package/src/internal/github-fanout.test.ts +213 -0
- package/src/internal/handleAgentServeTrigger.test.ts +185 -0
- package/src/internal/host-kv.test.ts +82 -0
- package/src/internal/host-platforms.test.ts +126 -0
- package/src/internal/http-channel.test.ts +402 -0
- package/src/internal/init-project.test.ts +270 -0
- package/src/internal/install-cursor-skills.test.ts +262 -0
- package/src/internal/local-env.test.ts +120 -0
- package/src/internal/log-ring.test.ts +31 -0
- package/src/internal/logs-client.test.ts +350 -0
- package/src/internal/mcp-endpoint.test.ts +436 -0
- package/src/internal/mcp-host.test.ts +298 -0
- package/src/internal/mcp-oauth.test.ts +148 -0
- package/src/internal/net.test.ts +17 -0
- package/src/internal/peer-connections.test.ts +128 -0
- package/src/internal/peer-mcp.integration.test.ts +289 -0
- package/src/internal/playground/toolchain.test.ts +53 -0
- package/src/internal/playground-cli.test.ts +187 -0
- package/src/internal/playground-proxy.test.ts +376 -0
- package/src/internal/prompt-context.integration.test.ts +232 -0
- package/src/internal/prompt-context.test.ts +127 -0
- package/src/internal/reminder-runner.test.ts +390 -0
- package/src/internal/reminder-store.test.ts +53 -0
- package/src/internal/request-headers.test.ts +27 -0
- package/src/internal/resolve-prod-target.test.ts +787 -0
- package/src/internal/resolved-connections.test.ts +295 -0
- package/src/internal/router.test.ts +57 -0
- package/src/internal/sdk-runner.test.ts +290 -0
- package/src/internal/server.artifacts.test.ts +303 -0
- package/src/internal/server.ts +43 -0
- package/src/internal/session-engine.artifacts.test.ts +243 -0
- package/src/internal/session-engine.coalesce.test.ts +169 -0
- package/src/internal/session-engine.concurrency.test.ts +250 -0
- package/src/internal/session-engine.host-oauth-mcp.test.ts +110 -0
- package/src/internal/session-engine.interrupt.test.ts +577 -0
- package/src/internal/session-engine.storage.test.ts +547 -0
- package/src/internal/session-engine.ts +125 -0
- package/src/internal/session-urls.test.ts +28 -0
- package/src/internal/sessions-client.test.ts +518 -0
- package/src/internal/storage-coordinator.test.ts +517 -0
- package/src/internal/storage-coordinator.ts +62 -0
- package/src/internal/tool-call.test.ts +458 -0
- package/src/internal/tool-result.test.ts +52 -0
- package/src/internal/trajectory.approvals.test.ts +83 -0
- package/src/internal/trajectory.subagents.test.ts +198 -0
- package/src/internal/turn-governor.test.ts +137 -0
- package/src/internal/update-check.test.ts +485 -0
- package/src/internal/workspace.test.ts +207 -0
- package/src/storage-backends/cursor-hosted.test.ts +121 -0
- package/src/storage.ts +6 -0
- package/src/types.ts +134 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.CL2Y0Zmh.js +0 -1
- package/dist/playground/assets/index-CidizGZv.css +0 -1
|
@@ -0,0 +1,617 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import type { SessionEvent } from "../types.js";
|
|
3
|
+
import {
|
|
4
|
+
computeVerdict,
|
|
5
|
+
createAssertions,
|
|
6
|
+
EvalAssertionRecorder,
|
|
7
|
+
EvalRequireFailure,
|
|
8
|
+
verdictFailsRun,
|
|
9
|
+
} from "./assertions.js";
|
|
10
|
+
import { equals, includes, similarity } from "./expect.js";
|
|
11
|
+
|
|
12
|
+
let sequence = 0;
|
|
13
|
+
|
|
14
|
+
function event(type: string, data: unknown, turnId = "turn_1"): SessionEvent {
|
|
15
|
+
sequence++;
|
|
16
|
+
return {
|
|
17
|
+
sessionId: "ses_1",
|
|
18
|
+
seq: sequence,
|
|
19
|
+
at: new Date(sequence * 1000).toISOString(),
|
|
20
|
+
turnId,
|
|
21
|
+
type,
|
|
22
|
+
data,
|
|
23
|
+
} as unknown as SessionEvent;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function weatherRun(): SessionEvent[] {
|
|
27
|
+
return [
|
|
28
|
+
event("message.received", { text: "weather in NYC?" }),
|
|
29
|
+
event("actions.requested", {
|
|
30
|
+
calls: [{ callId: "c1", toolName: "get_weather", args: { city: "NYC" } }],
|
|
31
|
+
}),
|
|
32
|
+
event("action.result", {
|
|
33
|
+
callId: "c1",
|
|
34
|
+
toolName: "get_weather",
|
|
35
|
+
output: { tempF: 72 },
|
|
36
|
+
isError: false,
|
|
37
|
+
}),
|
|
38
|
+
event("message.completed", { text: "Sunny, 72F", finishReason: "stop" }),
|
|
39
|
+
event("turn.completed", {}),
|
|
40
|
+
event("session.waiting", {}),
|
|
41
|
+
];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function setup(events: SessionEvent[] = weatherRun()) {
|
|
45
|
+
const recorder = new EvalAssertionRecorder();
|
|
46
|
+
const t = createAssertions({ recorder, events: () => events });
|
|
47
|
+
return { recorder, t };
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
describe("severity handles", () => {
|
|
51
|
+
it("records gates by default and keeps the wire shape compact", () => {
|
|
52
|
+
const { recorder, t } = setup();
|
|
53
|
+
t.succeeded();
|
|
54
|
+
const [result] = recorder.results();
|
|
55
|
+
expect(result).toMatchObject({ name: "succeeded", passed: true });
|
|
56
|
+
// `gate` is the default everywhere, so it is omitted rather than repeated.
|
|
57
|
+
expect(result?.severity).toBeUndefined();
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it("demotes a gate to a tracked soft assertion", () => {
|
|
61
|
+
const { recorder, t } = setup();
|
|
62
|
+
t.calledTool("nope").soft();
|
|
63
|
+
const [result] = recorder.results();
|
|
64
|
+
expect(result?.severity).toBe("soft");
|
|
65
|
+
// The miss is still recorded honestly; being soft only means it does not
|
|
66
|
+
// decide the verdict, so the CLI shows `~` and the eval still passes.
|
|
67
|
+
expect(result?.passed).toBe(false);
|
|
68
|
+
expect(computeVerdict(recorder.results())).toBe("passed");
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it("keeps a tracked score from failing the verdict when it has no bar", () => {
|
|
72
|
+
const { recorder, t } = setup();
|
|
73
|
+
t.check("Rainy", similarity("Sunny, 72F"));
|
|
74
|
+
expect(recorder.results()[0]?.passed).toBe(true);
|
|
75
|
+
expect(recorder.results()[0]?.score).toBeLessThan(0.5);
|
|
76
|
+
expect(computeVerdict(recorder.results())).toBe("passed");
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it("scores an eval when a soft threshold is missed", () => {
|
|
80
|
+
const { recorder, t } = setup();
|
|
81
|
+
t.check("Rainy", similarity("Sunny, 72F")).atLeast(0.9);
|
|
82
|
+
const [result] = recorder.results();
|
|
83
|
+
expect(result?.severity).toBe("soft");
|
|
84
|
+
expect(result?.threshold).toBe(0.9);
|
|
85
|
+
expect(result?.passed).toBe(false);
|
|
86
|
+
expect(computeVerdict(recorder.results())).toBe("scored");
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
it("passes a soft assertion that clears its bar", () => {
|
|
90
|
+
const { recorder, t } = setup();
|
|
91
|
+
t.check("Sunny, 72F", similarity("Sunny, 72F")).atLeast(0.9);
|
|
92
|
+
expect(recorder.results()[0]?.passed).toBe(true);
|
|
93
|
+
expect(computeVerdict(recorder.results())).toBe("passed");
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it("promotes a score to a hard gate with .gate(threshold)", () => {
|
|
97
|
+
const { recorder, t } = setup();
|
|
98
|
+
t.check("Rainy", similarity("Sunny, 72F")).gate(0.9);
|
|
99
|
+
expect(recorder.results()[0]?.severity).toBeUndefined();
|
|
100
|
+
expect(computeVerdict(recorder.results())).toBe("failed");
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it("converts a boolean assertion to a score when given a threshold", () => {
|
|
104
|
+
const { recorder, t } = setup();
|
|
105
|
+
t.calledTool("get_weather").gate(1);
|
|
106
|
+
expect(recorder.results()[0]?.passed).toBe(true);
|
|
107
|
+
const second = setup();
|
|
108
|
+
second.t.calledTool("missing").gate(1);
|
|
109
|
+
expect(second.recorder.results()[0]?.passed).toBe(false);
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
it("re-reads severity on the last call, so chains are order-independent", () => {
|
|
113
|
+
const { recorder, t } = setup();
|
|
114
|
+
t.check("Rainy", similarity("Sunny")).atLeast(0.9).soft();
|
|
115
|
+
// `.soft()` with no threshold keeps the 0.9 bar set by `.atLeast`.
|
|
116
|
+
expect(recorder.results()[0]?.threshold).toBe(0.9);
|
|
117
|
+
expect(computeVerdict(recorder.results())).toBe("scored");
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
describe("computeVerdict / verdictFailsRun", () => {
|
|
122
|
+
it("prefers a failed gate over a missed soft bar", () => {
|
|
123
|
+
expect(
|
|
124
|
+
computeVerdict([
|
|
125
|
+
{ name: "a", passed: false },
|
|
126
|
+
{ name: "b", passed: false, severity: "soft", threshold: 0.5 },
|
|
127
|
+
])
|
|
128
|
+
).toBe("failed");
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
it("treats an assertion with no severity as a gate", () => {
|
|
132
|
+
expect(computeVerdict([{ name: "legacy", passed: false }])).toBe("failed");
|
|
133
|
+
expect(computeVerdict([{ name: "legacy", passed: true }])).toBe("passed");
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
it("only fails the run on scored under --strict", () => {
|
|
137
|
+
expect(verdictFailsRun("scored", false)).toBe(false);
|
|
138
|
+
expect(verdictFailsRun("scored", true)).toBe(true);
|
|
139
|
+
expect(verdictFailsRun("failed", false)).toBe(true);
|
|
140
|
+
expect(verdictFailsRun("skipped", true)).toBe(false);
|
|
141
|
+
expect(verdictFailsRun("passed", true)).toBe(false);
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
describe("run-level assertions", () => {
|
|
146
|
+
it("succeeded passes a healthy run left open for the next message", () => {
|
|
147
|
+
const { recorder, t } = setup();
|
|
148
|
+
t.succeeded();
|
|
149
|
+
expect(recorder.results()[0]?.passed).toBe(true);
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
it("succeeded fails a run parked on an unanswered approval", () => {
|
|
153
|
+
const { recorder, t } = setup([
|
|
154
|
+
event("message.received", { text: "deploy" }),
|
|
155
|
+
event("actions.requested", {
|
|
156
|
+
calls: [{ callId: "c1", toolName: "deploy", args: {} }],
|
|
157
|
+
}),
|
|
158
|
+
event("action.approval_requested", { callId: "c1", toolName: "deploy" }),
|
|
159
|
+
event("session.waiting", {}),
|
|
160
|
+
]);
|
|
161
|
+
t.succeeded();
|
|
162
|
+
t.parked();
|
|
163
|
+
const [succeeded, parked] = recorder.results();
|
|
164
|
+
expect(succeeded?.passed).toBe(false);
|
|
165
|
+
expect(succeeded?.detail).toMatch(/unanswered approval/);
|
|
166
|
+
expect(parked?.passed).toBe(true);
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
it("calledTool defaults to request-based matching for compatibility", () => {
|
|
170
|
+
// A pending call still counts as "the agent used this tool".
|
|
171
|
+
const { recorder, t } = setup([
|
|
172
|
+
event("actions.requested", {
|
|
173
|
+
calls: [{ callId: "c1", toolName: "slow", args: {} }],
|
|
174
|
+
}),
|
|
175
|
+
event("turn.completed", {}),
|
|
176
|
+
]);
|
|
177
|
+
t.calledTool("slow");
|
|
178
|
+
t.calledTool("slow", { status: "completed" });
|
|
179
|
+
const [anyState, completed] = recorder.results();
|
|
180
|
+
expect(anyState?.passed).toBe(true);
|
|
181
|
+
expect(completed?.passed).toBe(false);
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
it("infers the parameter type of an inline matcher predicate", () => {
|
|
185
|
+
const { recorder, t } = setup();
|
|
186
|
+
// No annotation on `value`: the matcher union deliberately keeps its
|
|
187
|
+
// function member so this compiles under noImplicitAny.
|
|
188
|
+
t.calledTool("get_weather", {
|
|
189
|
+
input: (value) => (value as { city: string }).city === "NYC",
|
|
190
|
+
});
|
|
191
|
+
t.calledTool("get_weather", { count: (count) => count >= 1 });
|
|
192
|
+
// Nested inside an object literal, which is where a matcher predicate most
|
|
193
|
+
// often lands (`{ input: { field: predicate } }`).
|
|
194
|
+
t.calledTool("get_weather", {
|
|
195
|
+
input: { city: (value) => String(value).startsWith("NY") },
|
|
196
|
+
});
|
|
197
|
+
expect(recorder.results().map((r) => r.passed)).toEqual([true, true, true]);
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
it("narrows calledTool with input, output, and count matchers", () => {
|
|
201
|
+
const { recorder, t } = setup();
|
|
202
|
+
t.calledTool("get_weather", { input: { city: "NYC" }, count: 1 });
|
|
203
|
+
t.calledTool("get_weather", { output: { tempF: 72 } });
|
|
204
|
+
t.calledTool("get_weather", { input: { city: /^NY/ } });
|
|
205
|
+
t.calledTool("get_weather", { count: 2 });
|
|
206
|
+
const results = recorder.results();
|
|
207
|
+
expect(results.map((r) => r.passed)).toEqual([true, true, true, false]);
|
|
208
|
+
expect(results[0]?.name).toBe(
|
|
209
|
+
'calledTool(get_weather, {input={"city":"NYC"}, count=1})'
|
|
210
|
+
);
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
it("taggedArtifact matches artifact.tagged events by kind and predicate", () => {
|
|
214
|
+
const { recorder, t } = setup([
|
|
215
|
+
...weatherRun(),
|
|
216
|
+
event("artifact.tagged", {
|
|
217
|
+
id: "art_1",
|
|
218
|
+
kind: "reviewed-pr",
|
|
219
|
+
key: "pr-1",
|
|
220
|
+
title: "PR #1",
|
|
221
|
+
data: { url: "https://github.com/org/repo/pull/1" },
|
|
222
|
+
source: "model",
|
|
223
|
+
}),
|
|
224
|
+
]);
|
|
225
|
+
t.taggedArtifact();
|
|
226
|
+
t.taggedArtifact("reviewed-pr");
|
|
227
|
+
t.taggedArtifact("report");
|
|
228
|
+
t.taggedArtifact("reviewed-pr", (record) => record.source === "model");
|
|
229
|
+
t.taggedArtifact("reviewed-pr", (record) => record.key === "other");
|
|
230
|
+
const results = recorder.results();
|
|
231
|
+
expect(results.map((r) => r.passed)).toEqual([
|
|
232
|
+
true,
|
|
233
|
+
true,
|
|
234
|
+
false,
|
|
235
|
+
true,
|
|
236
|
+
false,
|
|
237
|
+
]);
|
|
238
|
+
expect(results[1]?.name).toBe("taggedArtifact(reviewed-pr)");
|
|
239
|
+
expect(results[2]?.detail).toBe("tagged kinds: [reviewed-pr]");
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
it("taggedArtifact fails when nothing was tagged", () => {
|
|
243
|
+
const { recorder, t } = setup();
|
|
244
|
+
t.taggedArtifact();
|
|
245
|
+
const [result] = recorder.results();
|
|
246
|
+
expect(result?.passed).toBe(false);
|
|
247
|
+
expect(result?.detail).toBe("tagged kinds: []");
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
it("notCalledTool matches any lifecycle state", () => {
|
|
251
|
+
const { recorder, t } = setup();
|
|
252
|
+
t.notCalledTool("echo");
|
|
253
|
+
t.notCalledTool("get_weather");
|
|
254
|
+
expect(recorder.results().map((r) => r.passed)).toEqual([true, false]);
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
it("messageIncludes reads the joined assistant text", () => {
|
|
258
|
+
const { recorder, t } = setup([
|
|
259
|
+
event("message.completed", {
|
|
260
|
+
text: "part one",
|
|
261
|
+
finishReason: "tool_call",
|
|
262
|
+
}),
|
|
263
|
+
event("message.completed", { text: "part two", finishReason: "stop" }),
|
|
264
|
+
event("turn.completed", {}),
|
|
265
|
+
]);
|
|
266
|
+
t.messageIncludes("part one");
|
|
267
|
+
t.messageIncludes(/part two/);
|
|
268
|
+
t.messageIncludes("part three");
|
|
269
|
+
expect(recorder.results().map((r) => r.passed)).toEqual([
|
|
270
|
+
true,
|
|
271
|
+
true,
|
|
272
|
+
false,
|
|
273
|
+
]);
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
it("toolOrder allows unrelated calls between the required ones", () => {
|
|
277
|
+
const { recorder, t } = setup([
|
|
278
|
+
event("actions.requested", {
|
|
279
|
+
calls: [
|
|
280
|
+
{ callId: "a", toolName: "prepare", args: {} },
|
|
281
|
+
{ callId: "b", toolName: "unrelated", args: {} },
|
|
282
|
+
{ callId: "c", toolName: "finalize", args: {} },
|
|
283
|
+
],
|
|
284
|
+
}),
|
|
285
|
+
event("turn.completed", {}),
|
|
286
|
+
]);
|
|
287
|
+
t.toolOrder(["prepare", "finalize"]);
|
|
288
|
+
t.toolOrder(["finalize", "prepare"]);
|
|
289
|
+
const [forward, backward] = recorder.results();
|
|
290
|
+
expect(forward?.passed).toBe(true);
|
|
291
|
+
expect(backward?.passed).toBe(false);
|
|
292
|
+
expect(backward?.detail).toMatch(/missing prepare after position/);
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
it("usedNoTools, maxToolCalls, and noFailedActions read the whole run", () => {
|
|
296
|
+
const { recorder, t } = setup([
|
|
297
|
+
event("actions.requested", {
|
|
298
|
+
calls: [
|
|
299
|
+
{ callId: "a", toolName: "one", args: {} },
|
|
300
|
+
{ callId: "b", toolName: "two", args: {} },
|
|
301
|
+
],
|
|
302
|
+
}),
|
|
303
|
+
event("action.result", {
|
|
304
|
+
callId: "b",
|
|
305
|
+
toolName: "two",
|
|
306
|
+
output: "boom",
|
|
307
|
+
isError: true,
|
|
308
|
+
}),
|
|
309
|
+
event("turn.completed", {}),
|
|
310
|
+
]);
|
|
311
|
+
t.usedNoTools();
|
|
312
|
+
t.maxToolCalls(2);
|
|
313
|
+
t.maxToolCalls(1);
|
|
314
|
+
t.noFailedActions();
|
|
315
|
+
expect(recorder.results().map((r) => r.passed)).toEqual([
|
|
316
|
+
false,
|
|
317
|
+
true,
|
|
318
|
+
false,
|
|
319
|
+
false,
|
|
320
|
+
]);
|
|
321
|
+
expect(recorder.results()[3]?.detail).toBe("two");
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
it("calledSubagent matches identity, output, and status", () => {
|
|
325
|
+
const { recorder, t } = setup([
|
|
326
|
+
event("actions.requested", {
|
|
327
|
+
calls: [{ callId: "t1", toolName: "task", args: {} }],
|
|
328
|
+
}),
|
|
329
|
+
event("subagent.called", { callId: "t1", name: "research" }),
|
|
330
|
+
event("subagent.completed", { callId: "t1", name: "research" }),
|
|
331
|
+
event("action.result", {
|
|
332
|
+
callId: "t1",
|
|
333
|
+
toolName: "task",
|
|
334
|
+
output: "72F in NYC",
|
|
335
|
+
isError: false,
|
|
336
|
+
}),
|
|
337
|
+
event("turn.completed", {}),
|
|
338
|
+
]);
|
|
339
|
+
t.calledSubagent("research", { output: /72F/, status: "completed" });
|
|
340
|
+
t.calledSubagent("research", { count: 2 });
|
|
341
|
+
t.calledSubagent("other");
|
|
342
|
+
expect(recorder.results().map((r) => r.passed)).toEqual([
|
|
343
|
+
true,
|
|
344
|
+
false,
|
|
345
|
+
false,
|
|
346
|
+
]);
|
|
347
|
+
});
|
|
348
|
+
|
|
349
|
+
it("loadedSkill matches any tool call that opened the skill file", () => {
|
|
350
|
+
const { recorder, t } = setup([
|
|
351
|
+
event("actions.requested", {
|
|
352
|
+
calls: [
|
|
353
|
+
{
|
|
354
|
+
callId: "c1",
|
|
355
|
+
toolName: "read_file",
|
|
356
|
+
args: { path: ".cursor/skills/alert-investigation/SKILL.md" },
|
|
357
|
+
},
|
|
358
|
+
],
|
|
359
|
+
}),
|
|
360
|
+
event("turn.completed", {}),
|
|
361
|
+
]);
|
|
362
|
+
t.loadedSkill("alert-investigation");
|
|
363
|
+
t.loadedSkill("other-skill");
|
|
364
|
+
expect(recorder.results().map((r) => r.passed)).toEqual([true, false]);
|
|
365
|
+
});
|
|
366
|
+
});
|
|
367
|
+
|
|
368
|
+
describe("event assertions", () => {
|
|
369
|
+
it("matches presence, absence, data, and count", () => {
|
|
370
|
+
const { recorder, t } = setup();
|
|
371
|
+
t.event("turn.completed");
|
|
372
|
+
t.event("message.completed", { data: { text: /Sunny/ } });
|
|
373
|
+
t.event("message.completed", { count: 2 });
|
|
374
|
+
t.notEvent("turn.failed");
|
|
375
|
+
t.notEvent("turn.completed");
|
|
376
|
+
expect(recorder.results().map((r) => r.passed)).toEqual([
|
|
377
|
+
true,
|
|
378
|
+
true,
|
|
379
|
+
false,
|
|
380
|
+
true,
|
|
381
|
+
false,
|
|
382
|
+
]);
|
|
383
|
+
});
|
|
384
|
+
|
|
385
|
+
it("eventOrder requires matching groups in stream order", () => {
|
|
386
|
+
const { recorder, t } = setup();
|
|
387
|
+
t.eventOrder([
|
|
388
|
+
{ type: "actions.requested" },
|
|
389
|
+
{ type: "action.result" },
|
|
390
|
+
{ type: "turn.completed" },
|
|
391
|
+
]);
|
|
392
|
+
t.eventOrder([{ type: "turn.completed" }, { type: "actions.requested" }]);
|
|
393
|
+
expect(recorder.results().map((r) => r.passed)).toEqual([true, false]);
|
|
394
|
+
});
|
|
395
|
+
|
|
396
|
+
it("eventOrder honors a numeric count per group", () => {
|
|
397
|
+
const { recorder, t } = setup([
|
|
398
|
+
event("subagent.called", { callId: "a", name: "r" }),
|
|
399
|
+
event("subagent.called", { callId: "b", name: "r" }),
|
|
400
|
+
event("turn.completed", {}),
|
|
401
|
+
]);
|
|
402
|
+
t.eventOrder([
|
|
403
|
+
{ type: "subagent.called", count: 2 },
|
|
404
|
+
{ type: "turn.completed" },
|
|
405
|
+
]);
|
|
406
|
+
t.eventOrder([
|
|
407
|
+
{ type: "subagent.called", count: 3 },
|
|
408
|
+
{ type: "turn.completed" },
|
|
409
|
+
]);
|
|
410
|
+
expect(recorder.results().map((r) => r.passed)).toEqual([true, false]);
|
|
411
|
+
});
|
|
412
|
+
|
|
413
|
+
it("eventsSatisfy records a predicate throw as a failure detail", () => {
|
|
414
|
+
const { recorder, t } = setup();
|
|
415
|
+
t.eventsSatisfy("has a reply", (events) =>
|
|
416
|
+
events.some((e) => e.type === "message.completed")
|
|
417
|
+
);
|
|
418
|
+
t.eventsSatisfy("throws", () => {
|
|
419
|
+
throw new Error("bad predicate");
|
|
420
|
+
});
|
|
421
|
+
const results = recorder.results();
|
|
422
|
+
expect(results[0]?.passed).toBe(true);
|
|
423
|
+
expect(results[1]).toMatchObject({
|
|
424
|
+
passed: false,
|
|
425
|
+
detail: "bad predicate",
|
|
426
|
+
});
|
|
427
|
+
});
|
|
428
|
+
});
|
|
429
|
+
|
|
430
|
+
describe("require* lookups", () => {
|
|
431
|
+
it("requireToolCall returns the matching call", () => {
|
|
432
|
+
const { recorder, t } = setup();
|
|
433
|
+
const call = t.requireToolCall("get_weather");
|
|
434
|
+
expect(call.output).toEqual({ tempF: 72 });
|
|
435
|
+
expect(recorder.results()[0]?.passed).toBe(true);
|
|
436
|
+
});
|
|
437
|
+
|
|
438
|
+
it("requireToolCall records a gate and stops the body when nothing matches", () => {
|
|
439
|
+
const { recorder, t } = setup();
|
|
440
|
+
expect(() => t.requireToolCall("missing")).toThrow(EvalRequireFailure);
|
|
441
|
+
expect(recorder.results()[0]).toMatchObject({
|
|
442
|
+
name: "requireToolCall(missing)",
|
|
443
|
+
passed: false,
|
|
444
|
+
});
|
|
445
|
+
});
|
|
446
|
+
|
|
447
|
+
it("requireInputRequest demands exactly one pending approval", () => {
|
|
448
|
+
const { recorder, t } = setup([
|
|
449
|
+
event("actions.requested", {
|
|
450
|
+
calls: [{ callId: "c1", toolName: "deploy", args: { env: "prod" } }],
|
|
451
|
+
}),
|
|
452
|
+
event("action.approval_requested", {
|
|
453
|
+
callId: "c1",
|
|
454
|
+
toolName: "deploy",
|
|
455
|
+
args: { env: "prod" },
|
|
456
|
+
}),
|
|
457
|
+
event("session.waiting", {}),
|
|
458
|
+
]);
|
|
459
|
+
const request = t.requireInputRequest({ toolName: "deploy" });
|
|
460
|
+
expect(request.args).toEqual({ env: "prod" });
|
|
461
|
+
expect(() => t.requireInputRequest({ toolName: "other" })).toThrow(
|
|
462
|
+
EvalRequireFailure
|
|
463
|
+
);
|
|
464
|
+
expect(recorder.results()[1]?.detail).toMatch(/found 0/);
|
|
465
|
+
});
|
|
466
|
+
});
|
|
467
|
+
|
|
468
|
+
describe("turn scoping", () => {
|
|
469
|
+
it("prefixes turn assertions and narrows them to that turn's events", () => {
|
|
470
|
+
const recorder = new EvalAssertionRecorder();
|
|
471
|
+
const firstTurn = [
|
|
472
|
+
event("actions.requested", {
|
|
473
|
+
calls: [{ callId: "c1", toolName: "search", args: {} }],
|
|
474
|
+
}),
|
|
475
|
+
event("message.completed", { text: "draft", finishReason: "stop" }),
|
|
476
|
+
event("turn.completed", {}),
|
|
477
|
+
];
|
|
478
|
+
const secondTurn = [
|
|
479
|
+
event("actions.requested", {
|
|
480
|
+
calls: [{ callId: "c2", toolName: "send_email", args: {} }],
|
|
481
|
+
}),
|
|
482
|
+
event(
|
|
483
|
+
"message.completed",
|
|
484
|
+
{ text: "sent", finishReason: "stop" },
|
|
485
|
+
"turn_2"
|
|
486
|
+
),
|
|
487
|
+
event("turn.completed", {}, "turn_2"),
|
|
488
|
+
];
|
|
489
|
+
const turnOne = createAssertions({
|
|
490
|
+
recorder,
|
|
491
|
+
events: () => firstTurn,
|
|
492
|
+
scope: "turn[1]",
|
|
493
|
+
});
|
|
494
|
+
const run = createAssertions({
|
|
495
|
+
recorder,
|
|
496
|
+
events: () => [...firstTurn, ...secondTurn],
|
|
497
|
+
});
|
|
498
|
+
|
|
499
|
+
turnOne.calledTool("search");
|
|
500
|
+
turnOne.notCalledTool("send_email");
|
|
501
|
+
run.calledTool("send_email");
|
|
502
|
+
|
|
503
|
+
const results = recorder.results();
|
|
504
|
+
expect(results.map((r) => r.name)).toEqual([
|
|
505
|
+
"turn[1].calledTool(search)",
|
|
506
|
+
"turn[1].notCalledTool(send_email)",
|
|
507
|
+
"calledTool(send_email)",
|
|
508
|
+
]);
|
|
509
|
+
expect(results.map((r) => r.passed)).toEqual([true, true, true]);
|
|
510
|
+
expect(results[0]?.scope).toBe("turn[1]");
|
|
511
|
+
expect(results[2]?.scope).toBeUndefined();
|
|
512
|
+
});
|
|
513
|
+
});
|
|
514
|
+
|
|
515
|
+
describe("score", () => {
|
|
516
|
+
it("records a tracked score that does not gate until given a bar", () => {
|
|
517
|
+
const { recorder, t } = setup();
|
|
518
|
+
t.score("recall", 0.4);
|
|
519
|
+
expect(recorder.results()[0]).toMatchObject({
|
|
520
|
+
name: "score(recall)",
|
|
521
|
+
severity: "soft",
|
|
522
|
+
score: 0.4,
|
|
523
|
+
passed: true,
|
|
524
|
+
});
|
|
525
|
+
expect(computeVerdict(recorder.results())).toBe("passed");
|
|
526
|
+
});
|
|
527
|
+
|
|
528
|
+
it("marks the eval scored once the score misses its bar", () => {
|
|
529
|
+
const { recorder, t } = setup();
|
|
530
|
+
t.score("recall", 0.4).atLeast(0.6);
|
|
531
|
+
expect(recorder.results()[0]?.passed).toBe(false);
|
|
532
|
+
expect(computeVerdict(recorder.results())).toBe("scored");
|
|
533
|
+
});
|
|
534
|
+
|
|
535
|
+
it("can be promoted to a hard gate", () => {
|
|
536
|
+
const { recorder, t } = setup();
|
|
537
|
+
t.score("recall", 0.4).gate(0.6);
|
|
538
|
+
expect(computeVerdict(recorder.results())).toBe("failed");
|
|
539
|
+
});
|
|
540
|
+
|
|
541
|
+
it("fails loudly on a non-finite score rather than reporting NaN", () => {
|
|
542
|
+
const { recorder, t } = setup();
|
|
543
|
+
t.score("recall", Number.NaN);
|
|
544
|
+
expect(recorder.results()[0]).toMatchObject({
|
|
545
|
+
passed: false,
|
|
546
|
+
score: undefined,
|
|
547
|
+
detail: "score is not a finite number: NaN",
|
|
548
|
+
});
|
|
549
|
+
});
|
|
550
|
+
});
|
|
551
|
+
|
|
552
|
+
describe("check", () => {
|
|
553
|
+
it("keeps the historical assertion name so output stays stable", () => {
|
|
554
|
+
const { recorder, t } = setup();
|
|
555
|
+
t.check("Sunny, 72F", includes("Sunny"));
|
|
556
|
+
t.check(72, equals(72));
|
|
557
|
+
expect(recorder.results().map((r) => r.name)).toEqual([
|
|
558
|
+
"check(includes)",
|
|
559
|
+
"check(equals)",
|
|
560
|
+
]);
|
|
561
|
+
});
|
|
562
|
+
});
|
|
563
|
+
|
|
564
|
+
describe("recordAsync", () => {
|
|
565
|
+
it("fills the slot in when the async score settles", async () => {
|
|
566
|
+
const recorder = new EvalAssertionRecorder();
|
|
567
|
+
recorder
|
|
568
|
+
.recordAsync(
|
|
569
|
+
{ name: "judge.closedQA(x)", passed: true, severity: "soft" },
|
|
570
|
+
Promise.resolve({ passed: true, score: 0.4, detail: "N (0.40)" })
|
|
571
|
+
)
|
|
572
|
+
.atLeast(0.6);
|
|
573
|
+
await recorder.waitForPending();
|
|
574
|
+
expect(recorder.results()[0]).toMatchObject({
|
|
575
|
+
severity: "soft",
|
|
576
|
+
score: 0.4,
|
|
577
|
+
threshold: 0.6,
|
|
578
|
+
passed: false,
|
|
579
|
+
detail: "N (0.40)",
|
|
580
|
+
});
|
|
581
|
+
expect(computeVerdict(recorder.results())).toBe("scored");
|
|
582
|
+
});
|
|
583
|
+
|
|
584
|
+
it("turns a rejected score into a failed gate with the error message", async () => {
|
|
585
|
+
const recorder = new EvalAssertionRecorder();
|
|
586
|
+
recorder
|
|
587
|
+
.recordAsync(
|
|
588
|
+
{ name: "judge.factuality(x)", passed: true, severity: "soft" },
|
|
589
|
+
Promise.reject(new Error("judge reply had no choice"))
|
|
590
|
+
)
|
|
591
|
+
.atLeast(0.7);
|
|
592
|
+
await recorder.waitForPending();
|
|
593
|
+
expect(recorder.results()[0]).toMatchObject({
|
|
594
|
+
passed: false,
|
|
595
|
+
detail: "judge reply had no choice",
|
|
596
|
+
});
|
|
597
|
+
// Grading errors must not hide behind soft severity.
|
|
598
|
+
expect(recorder.results()[0]?.severity).toBeUndefined();
|
|
599
|
+
expect(computeVerdict(recorder.results())).toBe("failed");
|
|
600
|
+
});
|
|
601
|
+
|
|
602
|
+
it("waits for judges started while an earlier judge was settling", async () => {
|
|
603
|
+
const recorder = new EvalAssertionRecorder();
|
|
604
|
+
recorder.recordAsync(
|
|
605
|
+
{ name: "first", passed: true, severity: "soft" },
|
|
606
|
+
Promise.resolve({}).then(() => {
|
|
607
|
+
recorder.recordAsync(
|
|
608
|
+
{ name: "second", passed: true, severity: "soft" },
|
|
609
|
+
Promise.resolve({ score: 1 })
|
|
610
|
+
);
|
|
611
|
+
return { score: 1 };
|
|
612
|
+
})
|
|
613
|
+
);
|
|
614
|
+
await recorder.waitForPending();
|
|
615
|
+
expect(recorder.results().map((r) => r.score)).toEqual([1, 1]);
|
|
616
|
+
});
|
|
617
|
+
});
|
package/src/evals/assertions.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* by `t.send(...)`, which narrows the events under inspection to that turn.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import type { SessionEvent } from "../types.js";
|
|
18
|
+
import type { SessionEvent, SessionEventPayload } from "../types.js";
|
|
19
19
|
import type { Expectation } from "./expect.js";
|
|
20
20
|
import { evaluateExpectation, expectationSeverity } from "./expect.js";
|
|
21
21
|
import type {
|
|
@@ -37,6 +37,12 @@ import { deriveRunFacts } from "./run-facts.js";
|
|
|
37
37
|
/** Hard gates fail the eval; soft assertions are tracked scores. */
|
|
38
38
|
export type EvalAssertionSeverity = "gate" | "soft";
|
|
39
39
|
|
|
40
|
+
/** One `artifact.tagged` payload, as seen by `t.taggedArtifact(...)`. */
|
|
41
|
+
export type EvalTaggedArtifactFact = Extract<
|
|
42
|
+
SessionEventPayload,
|
|
43
|
+
{ type: "artifact.tagged" }
|
|
44
|
+
>["data"];
|
|
45
|
+
|
|
40
46
|
/**
|
|
41
47
|
* Overall grade for one eval case.
|
|
42
48
|
*
|
|
@@ -314,6 +320,14 @@ export interface EvalAssertions {
|
|
|
314
320
|
name: string,
|
|
315
321
|
matcher?: EvalSubagentMatcher
|
|
316
322
|
): EvalAssertionHandle;
|
|
323
|
+
/**
|
|
324
|
+
* Gate: at least one artifact was tagged (`ctx.artifacts.tag` or the
|
|
325
|
+
* `tag_artifact` built-in), optionally of `kind` and matching `predicate`.
|
|
326
|
+
*/
|
|
327
|
+
taggedArtifact(
|
|
328
|
+
kind?: string,
|
|
329
|
+
predicate?: (record: EvalTaggedArtifactFact) => boolean
|
|
330
|
+
): EvalAssertionHandle;
|
|
317
331
|
/** Gate: at least one matching event of `type` occurred. */
|
|
318
332
|
event(type: string, matcher?: EvalEventMatcher): EvalAssertionHandle;
|
|
319
333
|
/** Gate: no matching event of `type` occurred. */
|
|
@@ -567,6 +581,28 @@ export function createAssertions(
|
|
|
567
581
|
});
|
|
568
582
|
},
|
|
569
583
|
|
|
584
|
+
taggedArtifact(
|
|
585
|
+
kind?: string,
|
|
586
|
+
predicate?: (record: EvalTaggedArtifactFact) => boolean
|
|
587
|
+
) {
|
|
588
|
+
const tagged = events().flatMap((event) =>
|
|
589
|
+
event.type === "artifact.tagged" ? [event.data] : []
|
|
590
|
+
);
|
|
591
|
+
const matched = tagged.filter(
|
|
592
|
+
(record) =>
|
|
593
|
+
(kind === undefined || record.kind === kind) &&
|
|
594
|
+
(predicate === undefined || predicate(record) === true)
|
|
595
|
+
);
|
|
596
|
+
return record({
|
|
597
|
+
name: `taggedArtifact(${kind ?? ""})`,
|
|
598
|
+
passed: matched.length > 0,
|
|
599
|
+
detail:
|
|
600
|
+
matched.length > 0
|
|
601
|
+
? undefined
|
|
602
|
+
: `tagged kinds: [${tagged.map((r) => r.kind).join(", ")}]`,
|
|
603
|
+
});
|
|
604
|
+
},
|
|
605
|
+
|
|
570
606
|
event(type: string, matcher?: EvalEventMatcher) {
|
|
571
607
|
const matched = matchingEvents(type, matcher);
|
|
572
608
|
const passed = matchCount(matched.length, matcher?.count);
|