@iceinvein/agent-skills 0.23.14 → 0.24.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.
- package/README.md +2 -1
- package/package.json +1 -1
- package/skills/index.json +6 -0
- package/skills/test-redundancy-auditor/SKILL.md +117 -0
- package/skills/test-redundancy-auditor/evals/README.md +35 -0
- package/skills/test-redundancy-auditor/evals/boundary-tests-stay-unique/case.yaml +4 -0
- package/skills/test-redundancy-auditor/evals/boundary-tests-stay-unique/fixture.sh +76 -0
- package/skills/test-redundancy-auditor/evals/boundary-tests-stay-unique/graders/auditor-fired.md +5 -0
- package/skills/test-redundancy-auditor/evals/boundary-tests-stay-unique/graders/nothing-deleted.md +26 -0
- package/skills/test-redundancy-auditor/evals/boundary-tests-stay-unique/prompt.md +11 -0
- package/skills/test-redundancy-auditor/evals/callers-tree-unchanged/case.yaml +4 -0
- package/skills/test-redundancy-auditor/evals/callers-tree-unchanged/fixture.sh +60 -0
- package/skills/test-redundancy-auditor/evals/callers-tree-unchanged/graders/auditor-fired.md +5 -0
- package/skills/test-redundancy-auditor/evals/callers-tree-unchanged/graders/output-ignores-itself.md +11 -0
- package/skills/test-redundancy-auditor/evals/callers-tree-unchanged/graders/source-unchanged.md +10 -0
- package/skills/test-redundancy-auditor/evals/callers-tree-unchanged/graders/tests-unchanged.md +10 -0
- package/skills/test-redundancy-auditor/evals/callers-tree-unchanged/graders/tree-unchanged.md +13 -0
- package/skills/test-redundancy-auditor/evals/callers-tree-unchanged/prompt.md +11 -0
- package/skills/test-redundancy-auditor/evals/duplicate-is-flagged/case.yaml +4 -0
- package/skills/test-redundancy-auditor/evals/duplicate-is-flagged/fixture.sh +60 -0
- package/skills/test-redundancy-auditor/evals/duplicate-is-flagged/graders/auditor-fired.md +5 -0
- package/skills/test-redundancy-auditor/evals/duplicate-is-flagged/graders/one-of-the-pair-deleted.md +34 -0
- package/skills/test-redundancy-auditor/evals/duplicate-is-flagged/prompt.md +11 -0
- package/skills/test-redundancy-auditor/evals/guard-test-is-kept/case.yaml +4 -0
- package/skills/test-redundancy-auditor/evals/guard-test-is-kept/fixture.sh +58 -0
- package/skills/test-redundancy-auditor/evals/guard-test-is-kept/graders/auditor-fired.md +5 -0
- package/skills/test-redundancy-auditor/evals/guard-test-is-kept/graders/guard-kept.md +32 -0
- package/skills/test-redundancy-auditor/evals/guard-test-is-kept/prompt.md +11 -0
- package/skills/test-redundancy-auditor/evals/mock-assertion-is-vacuous/case.yaml +4 -0
- package/skills/test-redundancy-auditor/evals/mock-assertion-is-vacuous/fixture.sh +73 -0
- package/skills/test-redundancy-auditor/evals/mock-assertion-is-vacuous/graders/auditor-fired.md +5 -0
- package/skills/test-redundancy-auditor/evals/mock-assertion-is-vacuous/graders/mock-test-is-vacuous.md +33 -0
- package/skills/test-redundancy-auditor/evals/mock-assertion-is-vacuous/prompt.md +11 -0
- package/skills/test-redundancy-auditor/evals/mutate-without-tool-stops/case.yaml +4 -0
- package/skills/test-redundancy-auditor/evals/mutate-without-tool-stops/fixture.sh +60 -0
- package/skills/test-redundancy-auditor/evals/mutate-without-tool-stops/graders/auditor-fired.md +5 -0
- package/skills/test-redundancy-auditor/evals/mutate-without-tool-stops/graders/labelled-rubric-only.md +26 -0
- package/skills/test-redundancy-auditor/evals/mutate-without-tool-stops/graders/nothing-installed.md +12 -0
- package/skills/test-redundancy-auditor/evals/mutate-without-tool-stops/prompt.md +11 -0
- package/skills/test-redundancy-auditor/evals/rules.json +193 -0
- package/skills/test-redundancy-auditor/evals/subsumed-by-broader-test/case.yaml +4 -0
- package/skills/test-redundancy-auditor/evals/subsumed-by-broader-test/fixture.sh +62 -0
- package/skills/test-redundancy-auditor/evals/subsumed-by-broader-test/graders/auditor-fired.md +5 -0
- package/skills/test-redundancy-auditor/evals/subsumed-by-broader-test/graders/narrow-test-subsumed.md +35 -0
- package/skills/test-redundancy-auditor/evals/subsumed-by-broader-test/prompt.md +11 -0
- package/skills/test-redundancy-auditor/references/findings-format.md +71 -0
- package/skills/test-redundancy-auditor/references/mutation-mode.md +100 -0
- package/skills/test-redundancy-auditor/references/rubric.md +144 -0
- package/skills/test-redundancy-auditor/skill.json +24 -0
package/README.md
CHANGED
|
@@ -101,6 +101,7 @@ Skills that check code does what it was meant to do, with evidence rather than o
|
|
|
101
101
|
| Skill | Based on | What it does |
|
|
102
102
|
|-------|----------|--------------|
|
|
103
103
|
| **bug-hunter** | QA scenario testing; intent-first reproduction | Proves logic bugs with failing repros checked against stated intent. Writes scenarios before reading the code, and reports bugs, ambiguities, and covered scenarios. Claude Code only. |
|
|
104
|
+
| **test-redundancy-auditor** | Mutation testing; test subsumption | Measures how much of a suite is redundant. Gives each test a verdict (unique, duplicate, subsumed, vacuous, layer echo) with evidence, and writes a cost-weighted deletion list. Optional mutation mode verifies verdicts with a per-test kill matrix. Report only. Claude Code only. |
|
|
104
105
|
|
|
105
106
|
### Communication
|
|
106
107
|
|
|
@@ -195,7 +196,7 @@ If a skill declares activation support and you're installing for Claude Code int
|
|
|
195
196
|
|
|
196
197
|
## Supported Tools
|
|
197
198
|
|
|
198
|
-
Claude Code, Cursor, Codex and Gemini CLI. Most skills install into all four; bug-hunter, magpie, migrate, scope-estimate and
|
|
199
|
+
Claude Code, Cursor, Codex and Gemini CLI. Most skills install into all four; bug-hunter, magpie, migrate, scope-estimate, sluice and test-redundancy-auditor are Claude Code only, and the CLI skips the other tools for them.
|
|
199
200
|
|
|
200
201
|
## How It Works
|
|
201
202
|
|
package/package.json
CHANGED
package/skills/index.json
CHANGED
|
@@ -313,6 +313,12 @@
|
|
|
313
313
|
"type": "prompt",
|
|
314
314
|
"version": "1.3.4"
|
|
315
315
|
},
|
|
316
|
+
{
|
|
317
|
+
"name": "test-redundancy-auditor",
|
|
318
|
+
"description": "Measures how much of a test suite is redundant. Gives every test one verdict (unique, duplicate, subsumed, vacuous or layer echo), each non-unique one challenged with a plausible bug before it is written and backed by evidence a reviewer can check, then weights what is removable by lines, runtime and churn and writes a deletion list. Precision over recall: when in doubt a test is unique. Optional mutation mode verifies verdicts with a per-test kill matrix from a mutation tool the repo already has, and installs nothing. Writes report.md and findings.json to .test-redundancy-auditor/<date>-<slug>/ and never modifies the caller's tree.",
|
|
319
|
+
"type": "prompt",
|
|
320
|
+
"version": "0.1.0"
|
|
321
|
+
},
|
|
316
322
|
{
|
|
317
323
|
"name": "type-driven-designer",
|
|
318
324
|
"description": "Wlaschin & Minsky-inspired type design: make illegal states unrepresentable through branded types, discriminated unions, and domain-encoded constraints",
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: test-redundancy-auditor
|
|
3
|
+
description: Use when asked how much of a test suite is redundant, which tests can be dropped or merged, whether tests pull their weight, or to trim a slow or repetitive suite. Classifies each test as unique, duplicate, subsumed, vacuous or layer echo with cited evidence, weights what is removable by lines, runtime and churn, and writes a deletion list. Optional mutation mode (--mutate) verifies verdicts with a per-test kill matrix from the repo's own mutation tool. Report only; never edits a test.
|
|
4
|
+
argument-hint: "[<path>...] [--mutate]"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Test redundancy auditor
|
|
8
|
+
|
|
9
|
+
A suite grows by copying the nearest test and changing one value. Some copies
|
|
10
|
+
cover a new case; many pin a behaviour another test already pins, or pin
|
|
11
|
+
nothing at all. This skill sorts one from the other, with evidence a reviewer
|
|
12
|
+
can check, so the suite can shrink without losing a single caught bug.
|
|
13
|
+
|
|
14
|
+
## Verdicts
|
|
15
|
+
|
|
16
|
+
Every test in the target gets exactly one. `references/rubric.md` has the
|
|
17
|
+
questions that decide it and the precision rules.
|
|
18
|
+
|
|
19
|
+
| Verdict | Meaning | On the deletion list |
|
|
20
|
+
|---|---|---|
|
|
21
|
+
| `unique` | Catches some plausible bug no other test catches | no |
|
|
22
|
+
| `duplicate` | Same behaviour, same input partition, same strength as another test | all but one of the group |
|
|
23
|
+
| `subsumed` | Every bug it catches, another test (or a named set of tests) catches too, but not the reverse | yes |
|
|
24
|
+
| `vacuous` | No plausible change to the code under test can make it fail | yes |
|
|
25
|
+
| `layer-echo` | The same rule on the same partition, asserted again through another entry point (unit, component, integration, e2e) | never; the report says which layer to keep |
|
|
26
|
+
|
|
27
|
+
The deletion list is built one test at a time, so two tests that each cover
|
|
28
|
+
the other never both go (`references/rubric.md`, "Building the deletion
|
|
29
|
+
list").
|
|
30
|
+
|
|
31
|
+
**Precision over recall.** A wrong "delete this" costs a caught bug; a missed
|
|
32
|
+
duplicate costs a few lines. When in doubt the verdict is `unique`.
|
|
33
|
+
|
|
34
|
+
## Method
|
|
35
|
+
|
|
36
|
+
1. **Name the target** in one line: the paths from the arguments, or the
|
|
37
|
+
whole suite when none are given. Find the runner from the repo's manifests
|
|
38
|
+
and `CLAUDE.md`/`AGENTS.md`, and follow any rule there on how tests must be
|
|
39
|
+
run. Record the runner and language versions and the time zone it runs in:
|
|
40
|
+
some verdicts depend on them.
|
|
41
|
+
2. **Map each test** to the unit it exercises, the behaviour it pins (one
|
|
42
|
+
sentence) and the input partition it covers. A suite whose test names
|
|
43
|
+
follow a consistent scenario/unit/outcome convention may supply these from
|
|
44
|
+
the names; say so in the report. A test whose behaviour you cannot state
|
|
45
|
+
in a sentence is a `vacuous` candidate. Each parametrised row counts as
|
|
46
|
+
one test, and so does each instance of a shared body (a `describe.each`
|
|
47
|
+
block, a helper that registers tests once per configuration).
|
|
48
|
+
3. **Compare within a unit.** Group tests by the code under test, then apply
|
|
49
|
+
the rubric to each group.
|
|
50
|
+
4. **Challenge every non-unique verdict** before writing it: name a plausible
|
|
51
|
+
bug, a one-line change to the code under test, that fails this test and
|
|
52
|
+
passes the one it is said to duplicate or be subsumed by (or, for
|
|
53
|
+
`vacuous`, that fails it at all). If you can name one, the verdict is
|
|
54
|
+
`unique`. When the answer is unclear, check it with a probe: apply the bug
|
|
55
|
+
in the scratch worktree and run the tests. A probe that fails neither test
|
|
56
|
+
was an equivalent change and settled nothing; try another.
|
|
57
|
+
5. **Cost each test**: lines in its body, its runtime, and churn (commits
|
|
58
|
+
touching its lines, `git log -L`). Take runtime as the median of three runs
|
|
59
|
+
of the runner's own reporter: the first test in a file absorbs warm-up, and
|
|
60
|
+
one run lets that decide which duplicate is kept. A cost you could not
|
|
61
|
+
measure is `null` with the reason in the report, never a guess.
|
|
62
|
+
6. **Mutation mode**, only with `--mutate` or when the request asks for
|
|
63
|
+
mutation testing: follow `references/mutation-mode.md`. Without a mutation
|
|
64
|
+
tool already in the repo, install nothing: name the tool to add, finish in
|
|
65
|
+
rubric mode, and say so.
|
|
66
|
+
7. **Write the output.**
|
|
67
|
+
|
|
68
|
+
Run anything that writes files (a probe, a mutation run) in a scratch `git
|
|
69
|
+
worktree` outside the repo, in a directory of this run's own. Link the
|
|
70
|
+
repo's installed dependencies into it rather than installing, and keep the
|
|
71
|
+
runner from writing caches through those links (for Vitest: `--no-cache`,
|
|
72
|
+
and `--configLoader runner` so Vite writes no `.vite-temp` into a linked
|
|
73
|
+
`node_modules`). Never modify the caller's tree: no test is edited, deleted or
|
|
74
|
+
added, and no install or build artefact lands there. Acting on the deletion
|
|
75
|
+
list is the caller's call.
|
|
76
|
+
|
|
77
|
+
**Large targets.** Past a few hundred tests, classification may be split
|
|
78
|
+
across subagents by file, each returning verdicts and evidence for its files.
|
|
79
|
+
The run itself keeps the cross-file comparisons, every probe, and the
|
|
80
|
+
deletion list, because a verdict split across two readers is where
|
|
81
|
+
duplicates hide and where two halves of a pair both get deleted.
|
|
82
|
+
|
|
83
|
+
## Output
|
|
84
|
+
|
|
85
|
+
Write to `.test-redundancy-auditor/<YYYY-MM-DD>-<slug>/` at the repo root:
|
|
86
|
+
`report.md` for a human and `findings.json` for a grader or calling skill, in
|
|
87
|
+
the shape `references/findings-format.md` gives. Mutation mode adds
|
|
88
|
+
`kill-matrix.json`. Write `findings.json` and `report.md` with the Write tool,
|
|
89
|
+
never from a shell command. The one exception is size: a `findings.json` for
|
|
90
|
+
more than about 100 tests is too large for one Write call, so write the
|
|
91
|
+
verdicts as a table with the Write tool and build `findings.json` from it
|
|
92
|
+
with a script saved beside it as `build-findings.*`.
|
|
93
|
+
|
|
94
|
+
`report.md` leads with the headline: how many tests, and what share of the
|
|
95
|
+
suite's lines and runtime, the deletion list removes. Then the deletion list,
|
|
96
|
+
each entry with its verdict and evidence, marking any that needs a
|
|
97
|
+
restructure rather than a deletion; layer echoes with the layer to keep;
|
|
98
|
+
guards (tests that pin another test's premise); behaviours a vacuous test
|
|
99
|
+
names but no test pins (gaps to fill, not to delete); the environment; and
|
|
100
|
+
every cost that could not be measured.
|
|
101
|
+
|
|
102
|
+
Run as a dispatched agent, the Write tool may refuse `report.md` and
|
|
103
|
+
`findings.json` as report files. Then put each refused file in a scratch path
|
|
104
|
+
and give the path in the hand-back (or, if small, its full content), for the
|
|
105
|
+
caller to write unchanged with the Write tool; never fall back to a shell
|
|
106
|
+
write into the caller's tree.
|
|
107
|
+
|
|
108
|
+
The directory ignores itself: if `.test-redundancy-auditor/.gitignore` is
|
|
109
|
+
absent, write it holding `*` before anything else in the run. Leave an
|
|
110
|
+
existing one alone.
|
|
111
|
+
|
|
112
|
+
## Hand-back
|
|
113
|
+
|
|
114
|
+
The run directory, the mode (rubric or mutation), the counts per verdict,
|
|
115
|
+
the share removable by tests, lines and runtime, then each deletion in one
|
|
116
|
+
line: test, verdict, evidence. Name anything not done: an unmeasured cost,
|
|
117
|
+
an unprobed verdict, mutation mode skipped and why.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# test-redundancy-auditor evals
|
|
2
|
+
|
|
3
|
+
Seven cases for `claude plugin eval`. Each scaffolds a small Node repo with one
|
|
4
|
+
module and a `node --test` suite whose redundancy is known in advance. The
|
|
5
|
+
prompt asks about the tests the way a user would and never names the skill.
|
|
6
|
+
|
|
7
|
+
| Case | Fixture | What it pins |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| `duplicate-is-flagged` | Two tests each lowercase one capitalised word | One is a `duplicate` citing the other, exactly one of the pair is deleted, the three other tests stay `unique` |
|
|
10
|
+
| `mock-assertion-is-vacuous` | A test calls its own mock and asserts what the mock returns | That test is `vacuous` and deleted; the two that drive `notifyOverdue` stay `unique` |
|
|
11
|
+
| `boundary-tests-stay-unique` | Seven look-alike tests, each on a different edge | Every test `unique`, `deletions` empty |
|
|
12
|
+
| `subsumed-by-broader-test` | A one-field assertion on the input another test asserts in full | The narrow test is `subsumed` by the broad one (not `duplicate`), and only it is deleted |
|
|
13
|
+
| `callers-tree-unchanged` | The duplicate fixture | The test file keeps its five tests, nothing is created outside `.test-redundancy-auditor/`, which ignores itself |
|
|
14
|
+
| `mutate-without-tool-stops` | The duplicate fixture, mutation testing asked for, no tool installed | Nothing installed; `mode` is `rubric` and `mutation` names the tool to add |
|
|
15
|
+
| `guard-test-is-kept` | A test that never calls the code but checks the TZ stub took effect for the next test | It is `unique` as a guard naming the test it guards, and nothing is deleted |
|
|
16
|
+
|
|
17
|
+
Every case also has `auditor-fired`, a `tool_used: Skill` grader, so a score
|
|
18
|
+
can be told apart from the model's own habits. `callers-tree-unchanged` is in
|
|
19
|
+
`vacuousWithout`: a run that writes nothing passes its tree graders.
|
|
20
|
+
|
|
21
|
+
Mutation mode with a tool present is not pinned (see `rules.json`): it would
|
|
22
|
+
need StrykerJS installed inside the sandbox.
|
|
23
|
+
|
|
24
|
+
## Running
|
|
25
|
+
|
|
26
|
+
From the repo root:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
claude plugin eval skills/test-redundancy-auditor --scaffold --allow-tools Bash Write Edit \
|
|
30
|
+
--model claude-opus-5-5 --judge-model claude-opus-5-5 --runs 1 --ablation none -j 7
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The content graders are `llm` judges over the trace, since `findings.json`
|
|
34
|
+
sits under a slug the skill picks. They judge only the last write of it, and
|
|
35
|
+
see a head-and-tail window of a long trace.
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# A pagination helper whose tests look alike but each sit on a different edge:
|
|
3
|
+
# perPage 1 and 50 are the two inside edges, 0 and 51 the two outside ones,
|
|
4
|
+
# page 0 is the page floor, and the past-the-end and short-last-page tests
|
|
5
|
+
# cover the slice. For every test there is a plausible one-line bug that fails it
|
|
6
|
+
# and passes all the others, so nothing here is redundant. Any non-unique
|
|
7
|
+
# verdict is a false positive.
|
|
8
|
+
set -euo pipefail
|
|
9
|
+
|
|
10
|
+
mkdir -p src tests
|
|
11
|
+
|
|
12
|
+
cat > package.json <<'JSON'
|
|
13
|
+
{
|
|
14
|
+
"name": "listing",
|
|
15
|
+
"version": "2.0.1",
|
|
16
|
+
"type": "module",
|
|
17
|
+
"scripts": {
|
|
18
|
+
"test": "node --test \"tests/*.test.js\""
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
JSON
|
|
22
|
+
|
|
23
|
+
cat > src/paginate.js <<'JS'
|
|
24
|
+
const MAX_PER_PAGE = 50;
|
|
25
|
+
|
|
26
|
+
export function paginate(items, page, perPage) {
|
|
27
|
+
if (!Number.isInteger(perPage) || perPage < 1 || perPage > MAX_PER_PAGE) {
|
|
28
|
+
throw new RangeError(`perPage must be a whole number from 1 to ${MAX_PER_PAGE}, got ${perPage}`);
|
|
29
|
+
}
|
|
30
|
+
if (!Number.isInteger(page) || page < 1) {
|
|
31
|
+
throw new RangeError(`page must be a whole number of 1 or more, got ${page}`);
|
|
32
|
+
}
|
|
33
|
+
const start = (page - 1) * perPage;
|
|
34
|
+
return items.slice(start, start + perPage);
|
|
35
|
+
}
|
|
36
|
+
JS
|
|
37
|
+
|
|
38
|
+
cat > tests/paginate.test.js <<'JS'
|
|
39
|
+
import assert from "node:assert/strict";
|
|
40
|
+
import { test } from "node:test";
|
|
41
|
+
import { paginate } from "../src/paginate.js";
|
|
42
|
+
|
|
43
|
+
const letters = ["a", "b", "c", "d", "e", "f", "g"];
|
|
44
|
+
|
|
45
|
+
test("accepts a perPage of 1", () => {
|
|
46
|
+
assert.deepEqual(paginate(letters, 2, 1), ["b"]);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
test("accepts a perPage of 50", () => {
|
|
50
|
+
assert.deepEqual(paginate(letters, 1, 50), letters);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
test("rejects a perPage of 0", () => {
|
|
54
|
+
assert.throws(() => paginate(letters, 1, 0), RangeError);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
test("rejects a perPage of 51", () => {
|
|
58
|
+
assert.throws(() => paginate(letters, 1, 51), RangeError);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
test("rejects a page of 0", () => {
|
|
62
|
+
assert.throws(() => paginate(letters, 0, 3), RangeError);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
test("the last page holds what is left", () => {
|
|
66
|
+
assert.deepEqual(paginate(letters, 3, 3), ["g"]);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
test("a page past the last one is empty", () => {
|
|
70
|
+
assert.deepEqual(paginate(letters, 4, 3), []);
|
|
71
|
+
});
|
|
72
|
+
JS
|
|
73
|
+
|
|
74
|
+
git init --quiet
|
|
75
|
+
git add -A
|
|
76
|
+
git -c user.email=fixture@example.com -c user.name=fixture commit --quiet -m "feat: paginate listings"
|
package/skills/test-redundancy-auditor/evals/boundary-tests-stay-unique/graders/nothing-deleted.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: llm
|
|
3
|
+
# findings.json sits under a slug the skill picks, so no file focus can name
|
|
4
|
+
# it; the judge reads its content from the Write call (or shell command) in
|
|
5
|
+
# the trace, and sees only a head-and-tail window of a long trace.
|
|
6
|
+
focus: trace
|
|
7
|
+
weight: 3
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
The agent was asked which tests in `tests/paginate.test.js` can be dropped.
|
|
11
|
+
The file has seven tests, and each sits on its own edge: perPage 1 and 50
|
|
12
|
+
accepted, perPage 0 and 51 rejected, page 0 rejected, a short last page, and
|
|
13
|
+
a page past the end. For each one there is a plausible one-line bug in
|
|
14
|
+
`src/paginate.js` that fails it and passes the other six (for example
|
|
15
|
+
`perPage > 49` fails only the perPage-50 test, `perPage < 2` fails only the
|
|
16
|
+
perPage-1 test). None is redundant.
|
|
17
|
+
|
|
18
|
+
Find the `findings.json` the agent wrote under `.test-redundancy-auditor/`. If
|
|
19
|
+
it was written more than once, judge only the last write, with any later Edit
|
|
20
|
+
applied.
|
|
21
|
+
|
|
22
|
+
PASS if every one of the seven tests has verdict `unique` and `deletions` is
|
|
23
|
+
an empty array.
|
|
24
|
+
|
|
25
|
+
FAIL if no findings.json content is visible in the trace, if any test has a
|
|
26
|
+
verdict other than `unique`, or if `deletions` names any test.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: boundary-tests-stay-unique
|
|
3
|
+
description: Seven look-alike tests, each on a different edge of the same ranges. Pins the skill calling every one unique with an empty deletion list, rather than reading similar shape as redundancy.
|
|
4
|
+
tags: [false-positive, boundary, precision, scaffold, write]
|
|
5
|
+
max_turns: 60
|
|
6
|
+
timeout_seconds: 1800
|
|
7
|
+
allowed_tools: [Read, Glob, Grep, Skill, Write, Edit, Bash, Agent]
|
|
8
|
+
expected_outcome: findings.json under .test-redundancy-auditor/ gives all seven tests verdict unique and an empty deletions array.
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
`tests/paginate.test.js` feels repetitive. Which of these tests can we drop?
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# A slugify module and five tests. Two of them pin the same behaviour on the
|
|
3
|
+
# same kind of input (one capitalised word is lowercased): no plausible bug
|
|
4
|
+
# fails one and passes the other, so one is a duplicate of the other. The
|
|
5
|
+
# other three each cover their own partition: whitespace between words,
|
|
6
|
+
# a run of punctuation, punctuation at the ends. Deleting both duplicates
|
|
7
|
+
# would lose the lowercasing check, so only one belongs on the deletion list.
|
|
8
|
+
set -euo pipefail
|
|
9
|
+
|
|
10
|
+
mkdir -p src tests
|
|
11
|
+
|
|
12
|
+
cat > package.json <<'JSON'
|
|
13
|
+
{
|
|
14
|
+
"name": "slugs",
|
|
15
|
+
"version": "1.0.0",
|
|
16
|
+
"type": "module",
|
|
17
|
+
"scripts": {
|
|
18
|
+
"test": "node --test \"tests/*.test.js\""
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
JSON
|
|
22
|
+
|
|
23
|
+
cat > src/slugify.js <<'JS'
|
|
24
|
+
export function slugify(title) {
|
|
25
|
+
return title
|
|
26
|
+
.toLowerCase()
|
|
27
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
28
|
+
.replace(/^-+|-+$/g, "");
|
|
29
|
+
}
|
|
30
|
+
JS
|
|
31
|
+
|
|
32
|
+
cat > tests/slugify.test.js <<'JS'
|
|
33
|
+
import assert from "node:assert/strict";
|
|
34
|
+
import { test } from "node:test";
|
|
35
|
+
import { slugify } from "../src/slugify.js";
|
|
36
|
+
|
|
37
|
+
test("lowercases a capitalised word", () => {
|
|
38
|
+
assert.equal(slugify("Hello"), "hello");
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
test("joins words with a dash", () => {
|
|
42
|
+
assert.equal(slugify("hello world"), "hello-world");
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
test("lowercases another capitalised word", () => {
|
|
46
|
+
assert.equal(slugify("World"), "world");
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
test("collapses a run of punctuation into one dash", () => {
|
|
50
|
+
assert.equal(slugify("a--b"), "a-b");
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
test("trims punctuation from both ends", () => {
|
|
54
|
+
assert.equal(slugify("!hi!"), "hi");
|
|
55
|
+
});
|
|
56
|
+
JS
|
|
57
|
+
|
|
58
|
+
git init --quiet
|
|
59
|
+
git add -A
|
|
60
|
+
git -c user.email=fixture@example.com -c user.name=fixture commit --quiet -m "feat: slugify titles"
|
package/skills/test-redundancy-auditor/evals/callers-tree-unchanged/graders/output-ignores-itself.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: regex
|
|
3
|
+
# SKILL.md has the run drop a .gitignore holding `*` into
|
|
4
|
+
# .test-redundancy-auditor/ when none is there. The files target would show
|
|
5
|
+
# the path but not what it holds, and an empty .gitignore ignores nothing, so
|
|
6
|
+
# this reads the trace: a Write call whose content is `*`, or a shell command
|
|
7
|
+
# that writes a `*` into it.
|
|
8
|
+
pattern: '\.test-redundancy-auditor/\.gitignore"\s*,\s*"content"\s*:\s*"\*(?:\\n)?"|"command":"(?:\\.|[^"\\])*?\*(?:\\.|[^"\\])*?>\s*[^"\s]*\.test-redundancy-auditor/\.gitignore'
|
|
9
|
+
target: trace
|
|
10
|
+
weight: 2
|
|
11
|
+
---
|
package/skills/test-redundancy-auditor/evals/callers-tree-unchanged/graders/source-unchanged.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: regex
|
|
3
|
+
# SKILL.md has the run apply a suspected bug to the code under test to settle
|
|
4
|
+
# a verdict, in a scratch worktree. A probe applied in the caller's tree and
|
|
5
|
+
# never reverted would leave src/slugify.js changed, and the files target
|
|
6
|
+
# never lists an edited file, so this checks the module's body survives whole.
|
|
7
|
+
pattern: '\.toLowerCase\(\)\s*\n\s*\.replace\(/\[\^a-z0-9\]\+/g, "-"\)\s*\n\s*\.replace\(/\^-\+\|-\+\$/g, ""\);'
|
|
8
|
+
target: { source: file, path: src/slugify.js }
|
|
9
|
+
weight: 3
|
|
10
|
+
---
|
package/skills/test-redundancy-auditor/evals/callers-tree-unchanged/graders/tests-unchanged.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: regex
|
|
3
|
+
# The files target lists only paths the run created, so an edit to the
|
|
4
|
+
# scaffold's test file never reaches it. The scaffold has five tests; any
|
|
5
|
+
# other count means the audit deleted or added one.
|
|
6
|
+
pattern: '\btest\('
|
|
7
|
+
match: 'count:5'
|
|
8
|
+
target: { source: file, path: tests/slugify.test.js }
|
|
9
|
+
weight: 3
|
|
10
|
+
---
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: regex
|
|
3
|
+
# A grader cannot run `git status --porcelain`, so this reads the harness's own
|
|
4
|
+
# list of files the run created in the working directory, one path per line.
|
|
5
|
+
# .git/ is excluded because git keeps worktree bookkeeping there. Fails on any
|
|
6
|
+
# line naming a path outside .test-redundancy-auditor/. Edits to existing
|
|
7
|
+
# files never appear here; tests-unchanged covers the test file.
|
|
8
|
+
pattern: '^(?!\.test-redundancy-auditor/|\.git/).+'
|
|
9
|
+
flags: m
|
|
10
|
+
match: not_contains
|
|
11
|
+
target: files
|
|
12
|
+
weight: 3
|
|
13
|
+
---
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: callers-tree-unchanged
|
|
3
|
+
description: "The duplicate fixture again. Pins the audit as report-only: no test or source file edited, nothing created outside .test-redundancy-auditor/, and that directory ignoring itself."
|
|
4
|
+
tags: [report-only, tree, scaffold, write]
|
|
5
|
+
max_turns: 60
|
|
6
|
+
timeout_seconds: 1800
|
|
7
|
+
allowed_tools: [Read, Glob, Grep, Skill, Write, Edit, Bash, Agent]
|
|
8
|
+
expected_outcome: tests/slugify.test.js still holds its five tests, every created path is under .test-redundancy-auditor/, and .test-redundancy-auditor/.gitignore holds `*`.
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
Which tests in `tests/slugify.test.js` are redundant?
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# A slugify module and five tests. Two of them pin the same behaviour on the
|
|
3
|
+
# same kind of input (one capitalised word is lowercased): no plausible bug
|
|
4
|
+
# fails one and passes the other, so one is a duplicate of the other. The
|
|
5
|
+
# other three each cover their own partition: whitespace between words,
|
|
6
|
+
# a run of punctuation, punctuation at the ends. Deleting both duplicates
|
|
7
|
+
# would lose the lowercasing check, so only one belongs on the deletion list.
|
|
8
|
+
set -euo pipefail
|
|
9
|
+
|
|
10
|
+
mkdir -p src tests
|
|
11
|
+
|
|
12
|
+
cat > package.json <<'JSON'
|
|
13
|
+
{
|
|
14
|
+
"name": "slugs",
|
|
15
|
+
"version": "1.0.0",
|
|
16
|
+
"type": "module",
|
|
17
|
+
"scripts": {
|
|
18
|
+
"test": "node --test \"tests/*.test.js\""
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
JSON
|
|
22
|
+
|
|
23
|
+
cat > src/slugify.js <<'JS'
|
|
24
|
+
export function slugify(title) {
|
|
25
|
+
return title
|
|
26
|
+
.toLowerCase()
|
|
27
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
28
|
+
.replace(/^-+|-+$/g, "");
|
|
29
|
+
}
|
|
30
|
+
JS
|
|
31
|
+
|
|
32
|
+
cat > tests/slugify.test.js <<'JS'
|
|
33
|
+
import assert from "node:assert/strict";
|
|
34
|
+
import { test } from "node:test";
|
|
35
|
+
import { slugify } from "../src/slugify.js";
|
|
36
|
+
|
|
37
|
+
test("lowercases a capitalised word", () => {
|
|
38
|
+
assert.equal(slugify("Hello"), "hello");
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
test("joins words with a dash", () => {
|
|
42
|
+
assert.equal(slugify("hello world"), "hello-world");
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
test("lowercases another capitalised word", () => {
|
|
46
|
+
assert.equal(slugify("World"), "world");
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
test("collapses a run of punctuation into one dash", () => {
|
|
50
|
+
assert.equal(slugify("a--b"), "a-b");
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
test("trims punctuation from both ends", () => {
|
|
54
|
+
assert.equal(slugify("!hi!"), "hi");
|
|
55
|
+
});
|
|
56
|
+
JS
|
|
57
|
+
|
|
58
|
+
git init --quiet
|
|
59
|
+
git add -A
|
|
60
|
+
git -c user.email=fixture@example.com -c user.name=fixture commit --quiet -m "feat: slugify titles"
|
package/skills/test-redundancy-auditor/evals/duplicate-is-flagged/graders/one-of-the-pair-deleted.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: llm
|
|
3
|
+
# findings.json sits under a slug the skill picks, so no file focus can name
|
|
4
|
+
# it; the judge reads its content from the Write call (or shell command) in
|
|
5
|
+
# the trace, and sees only a head-and-tail window of a long trace.
|
|
6
|
+
focus: trace
|
|
7
|
+
weight: 3
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
The agent was asked how much of `tests/slugify.test.js` is redundant. The file
|
|
11
|
+
has five tests:
|
|
12
|
+
|
|
13
|
+
1. "lowercases a capitalised word": `slugify("Hello")` is `"hello"`
|
|
14
|
+
2. "joins words with a dash": `slugify("hello world")` is `"hello-world"`
|
|
15
|
+
3. "lowercases another capitalised word": `slugify("World")` is `"world"`
|
|
16
|
+
4. "collapses a run of punctuation into one dash": `slugify("a--b")` is `"a-b"`
|
|
17
|
+
5. "trims punctuation from both ends": `slugify("!hi!")` is `"hi"`
|
|
18
|
+
|
|
19
|
+
Tests 1 and 3 pin the same behaviour on the same kind of input. Tests 2, 4 and
|
|
20
|
+
5 each cover a partition no other test covers.
|
|
21
|
+
|
|
22
|
+
Find the `findings.json` the agent wrote under `.test-redundancy-auditor/`. If
|
|
23
|
+
it was written more than once, judge only the last write, with any later Edit
|
|
24
|
+
applied.
|
|
25
|
+
|
|
26
|
+
PASS if all of these hold:
|
|
27
|
+
- one of tests 1 and 3 has verdict `duplicate`, and its `of` array holds the
|
|
28
|
+
id the other one of the pair has in `tests`;
|
|
29
|
+
- `deletions` names exactly one of tests 1 and 3, not both;
|
|
30
|
+
- tests 2, 4 and 5 each have verdict `unique` and none is in `deletions`.
|
|
31
|
+
|
|
32
|
+
FAIL if no findings.json content is visible in the trace, if neither of tests
|
|
33
|
+
1 and 3 is a duplicate, if both are on the deletion list, or if any of tests
|
|
34
|
+
2, 4 and 5 has a verdict other than `unique` or is on the deletion list.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: duplicate-is-flagged
|
|
3
|
+
description: Two tests lowercase one capitalised word each. Pins a duplicate verdict citing the other test, exactly one of the pair on the deletion list, and no verdict against the tests that cover their own partition.
|
|
4
|
+
tags: [duplicate, precision, scaffold, write]
|
|
5
|
+
max_turns: 60
|
|
6
|
+
timeout_seconds: 1800
|
|
7
|
+
allowed_tools: [Read, Glob, Grep, Skill, Write, Edit, Bash, Agent]
|
|
8
|
+
expected_outcome: findings.json under .test-redundancy-auditor/ marks one lowercasing test a duplicate of the other, deletes only that one, and leaves the other three tests unique.
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
How much of `tests/slugify.test.js` is redundant?
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# A local-calendar date formatter and three tests run under TZ=Asia/Tokyo.
|
|
3
|
+
# The first test never calls localIsoDate: it checks that the time zone stub
|
|
4
|
+
# took effect, so a local midnight reads as the previous day in UTC. Without
|
|
5
|
+
# it, a runner that ignores TZ would leave the second test passing against a
|
|
6
|
+
# toISOString() regression. It is a guard, not vacuous, and must stay. The
|
|
7
|
+
# other two are unique: a revert to toISOString() fails the second, a dropped
|
|
8
|
+
# padStart fails only the third, since the second uses a two-digit month and
|
|
9
|
+
# day. Nothing here belongs on the deletion list.
|
|
10
|
+
set -euo pipefail
|
|
11
|
+
|
|
12
|
+
mkdir -p src tests
|
|
13
|
+
|
|
14
|
+
cat > package.json <<'JSON'
|
|
15
|
+
{
|
|
16
|
+
"name": "calendar",
|
|
17
|
+
"version": "1.4.0",
|
|
18
|
+
"type": "module",
|
|
19
|
+
"scripts": {
|
|
20
|
+
"test": "TZ=Asia/Tokyo node --test \"tests/*.test.js\""
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
JSON
|
|
24
|
+
|
|
25
|
+
cat > src/localIsoDate.js <<'JS'
|
|
26
|
+
// The calendar day a Date shows on the local clock, as YYYY-MM-DD.
|
|
27
|
+
// toISOString() would give the UTC day, which is the previous day east of UTC.
|
|
28
|
+
export function localIsoDate(date) {
|
|
29
|
+
const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
30
|
+
const day = String(date.getDate()).padStart(2, "0");
|
|
31
|
+
return `${date.getFullYear()}-${month}-${day}`;
|
|
32
|
+
}
|
|
33
|
+
JS
|
|
34
|
+
|
|
35
|
+
cat > tests/localIsoDate.test.js <<'JS'
|
|
36
|
+
import assert from "node:assert/strict";
|
|
37
|
+
import { test } from "node:test";
|
|
38
|
+
import { localIsoDate } from "../src/localIsoDate.js";
|
|
39
|
+
|
|
40
|
+
// The suite runs under TZ=Asia/Tokyo (see package.json).
|
|
41
|
+
|
|
42
|
+
test("is running east of UTC, so a local midnight is the previous day in UTC", () => {
|
|
43
|
+
const localMidnight = new Date(2026, 9, 10);
|
|
44
|
+
assert.equal(localMidnight.toISOString().slice(0, 10), "2026-10-09");
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
test("reports the local calendar day for a local midnight", () => {
|
|
48
|
+
assert.equal(localIsoDate(new Date(2026, 9, 10)), "2026-10-10");
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
test("zero-pads a single-digit month and day", () => {
|
|
52
|
+
assert.equal(localIsoDate(new Date(2026, 0, 5, 12)), "2026-01-05");
|
|
53
|
+
});
|
|
54
|
+
JS
|
|
55
|
+
|
|
56
|
+
git init --quiet
|
|
57
|
+
git add -A
|
|
58
|
+
git -c user.email=fixture@example.com -c user.name=fixture commit --quiet -m "feat: local calendar dates"
|