You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sha256), `test_cases` (path + sha256) — but NO model field at all.
24
+
25
+
3.**Rules test-results.json** (`plugin/skills/*/test/test-results.json` and
26
+
`plugin/tests/rules/*/test-results.json`): Contains `sprt.session_id` and `sprt.test_cases[]` with SPRT
27
+
data — but NO model field at all.
28
+
29
+
4.**Model extraction**: `InstructionTestRunner.extractModel()` reads the `model:` field from SKILL.md
30
+
frontmatter and returns short names (`"haiku"`, `"sonnet"`, `"opus"`). Falls back to `"haiku"` if absent.
31
+
32
+
5.**No staleness detection**: No existing logic compares stored model against current model to detect stale
33
+
cached results.
34
+
35
+
### Approach: Model ID Resolution
36
+
37
+
Short model names from SKILL.md frontmatter must be resolved to fully-qualified model IDs. Create a
38
+
`ModelIdResolver` utility class in Java that maps short names to their fully-qualified equivalents:
39
+
-`haiku` → `claude-haiku-4-5-20251001`
40
+
-`sonnet` → `claude-sonnet-4-6`
41
+
-`opus` → `claude-opus-4-6`
42
+
43
+
This mapping is maintained as a static map in Java, easily updated when model versions change.
44
+
45
+
## Risk Assessment
46
+
47
+
-**Risk Level:** MEDIUM
48
+
-**Concerns:** Existing cached results.json files will have short model names; changing to fully-qualified
49
+
IDs means all existing cached results become stale (model mismatch). This is the desired behavior — it
50
+
forces re-validation after model changes.
51
+
-**Mitigation:** The migration is intentional. Existing results with short names will naturally trigger
52
+
re-validation when compared against the new fully-qualified format.
53
+
54
+
## Files to Modify
55
+
56
+
-`client/src/main/java/io/github/cowwoc/cat/hooks/skills/ModelIdResolver.java` — NEW: model name resolution utility
57
+
-`client/src/main/java/io/github/cowwoc/cat/hooks/skills/InstructionTestRunner.java` — update `extractModel()` to return fully-qualified IDs; update `persistArtifacts()` to write model_id; update `mergeResults()` and `init-sprt` to handle model staleness
58
+
-`client/src/test/java/io/github/cowwoc/cat/hooks/test/ModelIdResolverTest.java` — NEW: tests for model resolution
59
+
-`client/src/test/java/io/github/cowwoc/cat/hooks/test/InstructionTestRunnerModelIdTest.java` — NEW: tests for model ID in results
60
+
-`plugin/concepts/skill-test-results.md` — update schema documentation to include model_id field and staleness semantics
61
+
62
+
## Jobs
63
+
64
+
### Job 1
65
+
66
+
- Create `ModelIdResolver.java` in `client/src/main/java/io/github/cowwoc/cat/hooks/skills/`:
67
+
- A final class with a static method `resolve(String shortName)` that maps short model names to fully-qualified model IDs
- Update `InstructionTestRunner.extractModel()` method to resolve the short model name to a fully-qualified model ID by calling `ModelIdResolver.resolve()` on the value read from SKILL.md frontmatter
- Add `model_id` field to the top-level fields table (fully-qualified model identifier, e.g., `claude-haiku-4-5-20251001`)
104
+
- Document the `model` field as the short name from SKILL.md frontmatter (for human reference)
105
+
- Add a "Staleness Detection" section explaining that when `model_id` in cached results differs from the current model's fully-qualified ID, all cached SPRT results are invalidated
106
+
- Update the example JSON to include a `model_id` field
107
+
- Files: `plugin/concepts/skill-test-results.md`
108
+
109
+
- Update index.json to status: closed, progress: 100%
0 commit comments