Skip to content

Commit 203c38f

Browse files
committed
bugfix: remove _comment field from benchmark.json and enforce schema exclusivity
Remove the undocumented _comment field from SkillTestRunner output and add test assertion to enforce field exclusivity, preventing similar schema violations in the future.
1 parent 592b30e commit 203c38f

6 files changed

Lines changed: 16 additions & 5 deletions

File tree

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
{"status": "open"}
1+
{
2+
"status" : "closed",
3+
"resolution" : "implemented",
4+
"target_branch" : "v2.1"
5+
}

client/src/main/java/io/github/cowwoc/cat/hooks/skills/SkillTestRunner.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,6 @@ public void persistArtifacts(String[] args, PrintStream out) throws IOException
528528
Path benchmarkJsonPath = benchmarkDir.resolve("benchmark.json");
529529
JsonMapper mapper = scope.getJsonMapper();
530530
ObjectNode root = mapper.createObjectNode();
531-
root.put("_comment", "Auto-generated snapshot of the last benchmark run. Not a config file.");
532531
root.put("session_id", sessionId);
533532
root.put("phase", phase);
534533
root.put("timestamp", timestamp);

client/src/test/java/io/github/cowwoc/cat/hooks/test/SkillTestRunnerTest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
import java.nio.charset.StandardCharsets;
1818
import java.nio.file.Files;
1919
import java.nio.file.Path;
20+
import java.util.ArrayList;
21+
import java.util.Collections;
22+
import java.util.List;
2023

2124
import static io.github.cowwoc.requirements13.java.DefaultJavaValidators.requireThat;
2225

@@ -951,6 +954,12 @@ public void persistArtifactsWritesBenchmarkJson() throws IOException
951954
requireThat(root.path("skill").path("path").asString(), "skill.path").isEqualTo("skill.md");
952955
requireThat(root.path("skill").path("sha256").asString(""), "skill.sha256").isNotBlank();
953956
requireThat(root.path("test_cases").path("sha256").asString(""), "test_cases.sha256").isNotBlank();
957+
958+
// Assert exclusivity: no undocumented fields
959+
List<String> fieldNames = new ArrayList<>(root.propertyNames());
960+
Collections.sort(fieldNames);
961+
List<String> expectedFieldNames = List.of("phase", "session_id", "skill", "test_cases", "timestamp");
962+
requireThat(fieldNames, "fieldNames").isEqualTo(expectedFieldNames);
954963
}
955964
finally
956965
{

plugin/concepts/skill-benchmarking.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ Skill benchmarking produces quantitative evidence about whether a skill improves
1414
benchmark run executes the same test cases in two configurations — `with-skill` (skill active) and
1515
`without-skill` (skill inactive) — grades the outputs against defined assertions, and aggregates
1616
pass rates, timing, and token counts. The result is a benchmark JSON that supports A/B comparison
17-
and pattern analysis.
17+
and pattern analysis. The `benchmark.json` snapshot stored under each skill's `benchmark/` directory
18+
is auto-generated by `SkillTestRunner`; do not edit it manually.
1819

1920
The full loop: write test cases -> spawn parallel runs -> grade outputs -> aggregate -> analyze ->
2021
review with user -> improve skill -> repeat.

plugin/skills/get-output-agent/benchmark/benchmark.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"_comment" : "Auto-generated snapshot of the last benchmark run. Not a config file.",
32
"session_id" : "9ae46230-f04d-4c75-9a98-ae196923503e",
43
"phase" : "sprt",
54
"timestamp" : "2026-03-21T16:38:00Z",

plugin/skills/status-agent/benchmark/benchmark.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"_comment": "Auto-generated snapshot of the last benchmark run. Not a config file.",
32
"session_id": "754d0e28-baa5-48ce-92c8-d96f578ffb93",
43
"phase": "post-hardening",
54
"timestamp": "2026-03-16T21:16:53Z",

0 commit comments

Comments
 (0)