@uinaf/skillcheck 1.7.4 → 1.7.6

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.
@@ -1,6 +1,35 @@
1
1
  import { spawn } from "node:child_process";
2
2
  import path from "node:path";
3
3
  //#region src/grok-provider.ts
4
+ function record(value) {
5
+ return typeof value === "object" && value !== null && !Array.isArray(value);
6
+ }
7
+ function nonnegativeNumber(value) {
8
+ return typeof value === "number" && Number.isFinite(value) && value >= 0;
9
+ }
10
+ function isGrokEvent(value) {
11
+ if (!record(value) || typeof value.type !== "string") return false;
12
+ if (value.type === "text") return typeof value.data === "string";
13
+ if (value.type === "tool_call" && value.toolName === "read_file") {
14
+ if (typeof value.toolCallId !== "string") return false;
15
+ const input = value.rawInput;
16
+ if (input === void 0 || input === null) return true;
17
+ return record(input) && (input.target_file === void 0 || typeof input.target_file === "string") && (input.path === void 0 || typeof input.path === "string");
18
+ }
19
+ if (value.type === "tool_call_update") return typeof value.toolCallId === "string" && (value.status === void 0 || value.status === null || typeof value.status === "string");
20
+ if (value.type !== "end") return true;
21
+ if (typeof value.stopReason !== "string") return false;
22
+ if (value.usage !== void 0) {
23
+ if (!record(value.usage)) return false;
24
+ for (const key of [
25
+ "input_tokens",
26
+ "output_tokens",
27
+ "total_tokens",
28
+ "cache_read_input_tokens"
29
+ ]) if (value.usage[key] !== void 0 && !nonnegativeNumber(value.usage[key])) return false;
30
+ }
31
+ return value.total_cost_usd === void 0 || nonnegativeNumber(value.total_cost_usd);
32
+ }
4
33
  const OUTPUT_CAP = 1e6;
5
34
  function within(root, file) {
6
35
  const rel = path.relative(root, file);
@@ -67,11 +96,15 @@ var GrokProvider = class {
67
96
  stop("grok emitted invalid streaming JSON");
68
97
  return;
69
98
  }
99
+ if (!isGrokEvent(event)) {
100
+ stop("grok emitted an invalid streaming event");
101
+ return;
102
+ }
70
103
  if (event.type === "text" && typeof event.data === "string") {
71
104
  output += event.data;
72
105
  if (output.length > OUTPUT_CAP) stop("grok output exceeded limit");
73
106
  } else if (event.type === "tool_call" && event.toolName === "read_file") {
74
- const target = event.rawInput?.target_file;
107
+ const target = event.rawInput?.target_file ?? event.rawInput?.path;
75
108
  if (event.toolCallId && typeof target === "string") {
76
109
  const resolved = path.resolve(workdir, target);
77
110
  if (within(workdir, resolved)) reads.set(event.toolCallId, resolved);
package/dist/scenario.js CHANGED
@@ -210,7 +210,11 @@ function materialize(s, runDir, harness, control = false) {
210
210
  const from = fs.realpathSync(path.join(skillsRoot, name));
211
211
  fs.cpSync(from, path.join(workdir, root, "skills", name), {
212
212
  recursive: true,
213
- filter: (src) => src !== path.join(from, "evals")
213
+ filter: (src) => {
214
+ if (src === path.join(from, "evals")) return false;
215
+ if (fs.lstatSync(src).isSymbolicLink()) throw new Error(`skill contains a symbolic link: ${src}`);
216
+ return true;
217
+ }
214
218
  });
215
219
  }
216
220
  for (const root of roots) {
package/docs/scenarios.md CHANGED
@@ -137,7 +137,9 @@ time. It stays outside the root so the agent cannot reach the skill's source,
137
137
  its evals, or the repository's own agent guidance. The skill under test is installed where the harness discovers skills:
138
138
  `.claude/skills/<skill>/`, plus `.agents/skills/<skill>/` on codex, or
139
139
  `.grok/skills/<skill>/` on Grok, with its `evals/` directory excluded, so
140
- criteria never leak into the agent's context. Sibling skills under the same root that the skill links to (inline, angle-bracket, or reference links, followed transitively; a symlink out of the root is skipped) are installed beside it
140
+ criteria never leak into the agent's context. Symbolic links inside an installed
141
+ skill are rejected: a copied link could expose excluded evals or let the agent
142
+ change the source tree. Sibling skills under the same root that the skill links to (inline, angle-bracket, or reference links, followed transitively; a symlink out of the root is skipped) are installed beside it
141
143
  the same way, so links such as `../other/SKILL.md` resolve as they do when a
142
144
  plugin installs the set; a control run installs none of them.
143
145
 
package/docs/usage.md CHANGED
@@ -154,7 +154,10 @@ workdir with the skill under `.grok/skills/`. It uses native streaming events
154
154
  to count a completed read of that skill's `SKILL.md` as `skill-used` evidence.
155
155
  Grok must be logged in locally or have its supported credentials configured.
156
156
  The run disables subagents and grants edit permission in the workdir; web
157
- search stays on. `--agent` selects a Grok model ID.
157
+ search stays on. `--agent` selects a Grok model ID. Malformed fields consumed by
158
+ the provider are reported as run errors. Progress-only tool updates and pending read inputs are
159
+ ignored. Skill-read evidence requires a file path on the initial tool call
160
+ (`path` or `target_file`) and a completed update.
158
161
 
159
162
  `--judge` takes either a bare Claude model (graded through the Anthropic
160
163
  selection in [auth](#auth)) or a provider-qualified promptfoo id, passed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uinaf/skillcheck",
3
- "version": "1.7.4",
3
+ "version": "1.7.6",
4
4
  "description": "Lint and eval harness for agent skills",
5
5
  "homepage": "https://github.com/uinaf/skillcheck#readme",
6
6
  "bugs": {
@@ -34,15 +34,15 @@
34
34
  },
35
35
  "devDependencies": {
36
36
  "@anthropic-ai/claude-agent-sdk": "^0.3.281",
37
- "@openai/codex-sdk": "^0.157.0",
37
+ "@openai/codex-sdk": "^0.160.0",
38
38
  "@types/node": "^26.6.2",
39
- "promptfoo": "^0.123.1",
39
+ "promptfoo": "^0.124.0",
40
40
  "vite": "catalog:",
41
41
  "vite-plus": "catalog:"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "@anthropic-ai/claude-agent-sdk": "^0.3.281",
45
- "@openai/codex-sdk": "^0.156.1 || ^0.157.0",
45
+ "@openai/codex-sdk": "^0.156.1 || ^0.157.0 || ^0.160.0",
46
46
  "promptfoo": "^0.123.1"
47
47
  },
48
48
  "peerDependenciesMeta": {
@@ -66,5 +66,5 @@
66
66
  "engines": {
67
67
  "node": ">=24"
68
68
  },
69
- "packageManager": "pnpm@12.7.0"
69
+ "packageManager": "pnpm@12.10.1"
70
70
  }