@gaunt-sloth/batch 2.0.0-alpha.19 → 2.0.0-alpha.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.
Files changed (39) hide show
  1. package/README.md +140 -0
  2. package/dist/bin.d.ts +13 -0
  3. package/dist/bin.js +28 -0
  4. package/dist/bin.js.map +1 -0
  5. package/dist/deterministicChecks.d.ts +39 -7
  6. package/dist/deterministicChecks.js +120 -11
  7. package/dist/deterministicChecks.js.map +1 -1
  8. package/dist/evalOutput.d.ts +17 -4
  9. package/dist/evalOutput.js +40 -5
  10. package/dist/evalOutput.js.map +1 -1
  11. package/dist/evalRunner.d.ts +68 -15
  12. package/dist/evalRunner.js +309 -55
  13. package/dist/evalRunner.js.map +1 -1
  14. package/dist/evalSuite.d.ts +32 -11
  15. package/dist/evalSuite.js +487 -42
  16. package/dist/evalSuite.js.map +1 -1
  17. package/dist/evalTypes.d.ts +187 -15
  18. package/dist/index.d.ts +5 -1
  19. package/dist/index.js +6 -0
  20. package/dist/index.js.map +1 -1
  21. package/dist/pipelineCli.d.ts +102 -0
  22. package/dist/pipelineCli.js +348 -0
  23. package/dist/pipelineCli.js.map +1 -0
  24. package/dist/reporters/drive.d.ts +14 -0
  25. package/dist/reporters/drive.js +49 -0
  26. package/dist/reporters/drive.js.map +1 -0
  27. package/dist/reporters/registry.d.ts +11 -0
  28. package/dist/reporters/registry.js +26 -0
  29. package/dist/reporters/registry.js.map +1 -0
  30. package/dist/reporters/reporterTypes.d.ts +36 -0
  31. package/dist/reporters/reporterTypes.js +2 -0
  32. package/dist/reporters/reporterTypes.js.map +1 -0
  33. package/dist/reporters/textReporter.d.ts +10 -0
  34. package/dist/reporters/textReporter.js +50 -0
  35. package/dist/reporters/textReporter.js.map +1 -0
  36. package/dist/toolChecks.d.ts +21 -0
  37. package/dist/toolChecks.js +38 -0
  38. package/dist/toolChecks.js.map +1 -0
  39. package/package.json +6 -3
@@ -0,0 +1,38 @@
1
+ import { toolNameMatchesPattern } from '@gaunt-sloth/core/utils/toolMatching.js';
2
+ /**
3
+ * BATCH-10 tool-trace assertions — grade a case against the tool *names* it actually invoked
4
+ * (`cellResult.tools`), rather than grepping the answer text. This "kills the false-positive class
5
+ * structurally": an MCP-only case can prove the server was called instead of a substring that a
6
+ * hallucinated answer could also contain.
7
+ *
8
+ * Kept separate from `runDeterministicChecks` (which reads the *answer*) on purpose — these read the
9
+ * tool trace — so neither signature is muddied. Patterns reuse GS2-61's `toolNameMatchesPattern`
10
+ * (`@gaunt-sloth/core`), the same glob/exact matcher `allowedTools` uses, so `mcp__unimarket__*`
11
+ * behaves identically here.
12
+ *
13
+ * - `mustCall` — for **each** pattern, at least one called tool must match it, else
14
+ * `did not call "<pattern>"`.
15
+ * - `mustNotCall` — **no** called tool may match any forbidden pattern; each offending tool is
16
+ * reported once as `called forbidden tool "<tool>" (matched "<pattern>")`.
17
+ *
18
+ * BATCH-12: grades one {@link EvalExpectation} block's tool-trace assertions (a flat case's single
19
+ * block or a matrix case's identity-scoped block) — same field names, same behavior as before.
20
+ */
21
+ export function runToolCallChecks(tools, expectation) {
22
+ const failures = [];
23
+ for (const pattern of expectation.mustCall) {
24
+ if (!tools.some((tool) => toolNameMatchesPattern(tool, pattern))) {
25
+ failures.push(`did not call "${pattern}"`);
26
+ }
27
+ }
28
+ // De-duplicate: a tool called N times (traces realistically repeat names) is one violation, not
29
+ // N identical failure lines. `Set` preserves first-seen order.
30
+ for (const tool of new Set(tools)) {
31
+ const matched = expectation.mustNotCall.find((pattern) => toolNameMatchesPattern(tool, pattern));
32
+ if (matched !== undefined) {
33
+ failures.push(`called forbidden tool "${tool}" (matched "${matched}")`);
34
+ }
35
+ }
36
+ return failures;
37
+ }
38
+ //# sourceMappingURL=toolChecks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolChecks.js","sourceRoot":"","sources":["../src/toolChecks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAIjF;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,iBAAiB,CAC/B,KAAe,EACf,WAA8D;IAE9D,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,KAAK,MAAM,OAAO,IAAI,WAAW,CAAC,QAAQ,EAAE,CAAC;QAC3C,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,sBAAsB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;YACjE,QAAQ,CAAC,IAAI,CAAC,iBAAiB,OAAO,GAAG,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC;IAED,gGAAgG;IAChG,+DAA+D;IAC/D,KAAK,MAAM,IAAI,IAAI,IAAI,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;QAClC,MAAM,OAAO,GAAG,WAAW,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CACvD,sBAAsB,CAAC,IAAI,EAAE,OAAO,CAAC,CACtC,CAAC;QACF,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1B,QAAQ,CAAC,IAAI,CAAC,0BAA0B,IAAI,eAAe,OAAO,IAAI,CAAC,CAAC;QAC1E,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gaunt-sloth/batch",
3
- "version": "2.0.0-alpha.19",
3
+ "version": "2.0.0-alpha.21",
4
4
  "description": "Batch matrix runtime for Gaunt Sloth (BATCH-1): run a prompt-executable over a matrix of models and/or content-bound inputs",
5
5
  "license": "MIT",
6
6
  "author": "Andrew Kondratev",
@@ -23,6 +23,9 @@
23
23
  "type": "module",
24
24
  "main": "dist/index.js",
25
25
  "types": "dist/index.d.ts",
26
+ "bin": {
27
+ "gth-batch": "dist/bin.js"
28
+ },
26
29
  "exports": {
27
30
  ".": "./dist/index.js",
28
31
  "./*.js": "./dist/*.js"
@@ -34,8 +37,8 @@
34
37
  "@langchain/core": "^1.2.3",
35
38
  "yaml": "^2.9.0",
36
39
  "zod": "^4.4.3",
37
- "@gaunt-sloth/agent": "2.0.0-alpha.19",
38
- "@gaunt-sloth/core": "2.0.0-alpha.19"
40
+ "@gaunt-sloth/agent": "2.0.0-alpha.21",
41
+ "@gaunt-sloth/core": "2.0.0-alpha.21"
39
42
  },
40
43
  "files": [
41
44
  "./dist/*"