@skill-harness/core 0.8.0 → 0.10.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.
@@ -0,0 +1,133 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://skill-harness.dev/schemas/results-v2.schema.json",
4
+ "title": "skill-harness results v2",
5
+ "type": "object",
6
+ "required": ["schema", "skill", "harness", "model", "judge", "timestamp", "label", "mode", "effective_grade", "scenarios"],
7
+ "properties": {
8
+ "schema": { "const": 2 },
9
+ "harness_version": { "type": "string" },
10
+ "harness_cli_version": { "type": "string" },
11
+ "delivery_canary": { "enum": ["pass", "skipped"] },
12
+ "skill": { "type": "string" },
13
+ "harness": { "type": "string" },
14
+ "model": { "type": "string" },
15
+ "judge": {
16
+ "type": "object",
17
+ "required": ["provider", "model"],
18
+ "properties": { "provider": { "type": "string" }, "model": { "type": "string" } }
19
+ },
20
+ "timestamp": { "type": "string" },
21
+ "label": { "type": ["string", "null"] },
22
+ "mode": { "enum": ["red", "green", "force"] },
23
+ "partial": { "type": "boolean" },
24
+ "source_hashes": { "type": "object", "additionalProperties": { "type": "string" } },
25
+ "effective_grade": { "$ref": "#/$defs/grade" },
26
+ "scenarios": { "type": "array", "items": { "$ref": "#/$defs/scenario" } }
27
+ },
28
+ "$defs": {
29
+ "verdict": { "enum": ["PASS", "FAIL", "ERROR", "JUDGE-AMBIGUOUS"] },
30
+ "grade": {
31
+ "type": "object",
32
+ "required": ["passed", "total", "pct", "letter", "ship", "note"],
33
+ "properties": {
34
+ "passed": { "type": "integer" }, "total": { "type": "integer" }, "pct": { "type": "number" },
35
+ "letter": { "type": "string" }, "ship": { "type": "boolean" }, "note": { "type": "string" }
36
+ }
37
+ },
38
+ "metrics": {
39
+ "type": "object",
40
+ "required": ["wall_time_ms", "judge_calls", "judge_rejudge_calls", "subject_metrics_reps", "total_reps"],
41
+ "properties": {
42
+ "wall_time_ms": { "type": "number", "minimum": 0 },
43
+ "judge_calls": { "type": "integer", "minimum": 0 },
44
+ "judge_rejudge_calls": { "type": "integer", "minimum": 0 },
45
+ "subject_metrics_reps": { "type": "integer", "minimum": 0 },
46
+ "total_reps": { "type": "integer", "minimum": 1 },
47
+ "input_tokens": { "type": "integer", "minimum": 0 },
48
+ "output_tokens": { "type": "integer", "minimum": 0 },
49
+ "cache_read_tokens": { "type": "integer", "minimum": 0 },
50
+ "cache_write_tokens": { "type": "integer", "minimum": 0 },
51
+ "subject_cost_usd": { "type": "number", "minimum": 0 },
52
+ "tool_calls": { "type": "integer", "minimum": 0 },
53
+ "delegated_children": { "type": "integer", "minimum": 0 },
54
+ "max_concurrency": { "type": "integer", "minimum": 0 }
55
+ }
56
+ },
57
+ "scenario": {
58
+ "type": "object",
59
+ "required": ["id", "judge_verdict", "judge_reason", "suspect", "override", "note"],
60
+ "properties": {
61
+ "id": { "type": "string" },
62
+ "judge_verdict": { "$ref": "#/$defs/verdict" },
63
+ "judge_reason": { "type": "string" },
64
+ "suspect": { "type": "boolean" },
65
+ "override": { "oneOf": [{ "const": null }, { "enum": ["PASS", "FAIL"] }] },
66
+ "note": { "type": "string" },
67
+ "reps": { "type": "integer", "minimum": 1 },
68
+ "passes": { "type": "integer", "minimum": 0 },
69
+ "clean": { "type": "integer", "minimum": 0 },
70
+ "flakiness": { "type": "number", "minimum": 0, "maximum": 1 },
71
+ "pass_threshold": { "type": "number", "minimum": 0, "maximum": 1 },
72
+ "metrics": { "$ref": "#/$defs/metrics" },
73
+ "objective": {
74
+ "type": "object",
75
+ "additionalProperties": false,
76
+ "required": ["status", "assertions"],
77
+ "properties": {
78
+ "status": { "enum": ["PASS", "FAIL", "ERROR"] },
79
+ "trace_version": { "type": "integer" },
80
+ "trace_sha256": { "type": "string" },
81
+ "trajectory_version": { "const": "1.0" },
82
+ "events_sha256": { "type": "string" },
83
+ "rep_events_sha256": { "type": "array", "items": { "type": "string", "pattern": "^[a-fA-F0-9]{64}$" } },
84
+ "rep_trace_sha256": { "type": "array", "items": { "type": "string", "pattern": "^[a-fA-F0-9]{64}$" } },
85
+ "assertions": {
86
+ "type": "array",
87
+ "items": {
88
+ "type": "object",
89
+ "additionalProperties": false,
90
+ "required": ["kind", "status", "detail"],
91
+ "properties": {
92
+ "kind": { "type": "string", "minLength": 1 },
93
+ "status": { "enum": ["PASS", "FAIL", "ERROR"] },
94
+ "detail": { "type": "string" }
95
+ }
96
+ }
97
+ }
98
+ }
99
+ },
100
+ "adjudication": {
101
+ "type": "object",
102
+ "additionalProperties": false,
103
+ "required": ["state", "trigger", "judgments"],
104
+ "properties": {
105
+ "state": { "enum": ["confirmed", "tie_broken", "unresolved"] },
106
+ "trigger": { "enum": ["ambiguous", "contradictory", "non_unanimous", "ship_deciding"] },
107
+ "verdict": { "enum": ["PASS", "FAIL"] },
108
+ "judgments": {
109
+ "type": "array",
110
+ "items": {
111
+ "type": "object",
112
+ "additionalProperties": false,
113
+ "required": ["ordinal", "judge", "verdict", "reason", "suspect"],
114
+ "properties": {
115
+ "ordinal": { "type": "integer", "minimum": 1, "maximum": 3 },
116
+ "judge": {
117
+ "type": "object",
118
+ "additionalProperties": false,
119
+ "required": ["provider", "model"],
120
+ "properties": { "provider": { "type": "string" }, "model": { "type": "string" } }
121
+ },
122
+ "verdict": { "$ref": "#/$defs/verdict" },
123
+ "reason": { "type": "string" },
124
+ "suspect": { "type": "boolean" }
125
+ }
126
+ }
127
+ }
128
+ }
129
+ }
130
+ }
131
+ }
132
+ }
133
+ }
@@ -0,0 +1,217 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://skill-harness.dev/schemas/specification-v1.schema.json",
4
+ "title": "skill-harness specification v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["skill", "judge_persona", "ship_bar", "scenarios"],
8
+ "properties": {
9
+ "schema": { "const": 1 },
10
+ "skill": { "type": "string", "minLength": 1 },
11
+ "judge_persona": { "type": "string", "minLength": 1 },
12
+ "ship_bar": {
13
+ "type": "object",
14
+ "additionalProperties": false,
15
+ "required": ["total", "min_pass"],
16
+ "properties": {
17
+ "total": { "type": "integer", "minimum": 1 },
18
+ "min_pass": { "type": "integer", "minimum": 1 },
19
+ "no_critical_fail": { "type": "boolean" }
20
+ }
21
+ },
22
+ "critical": { "type": "array", "items": { "type": "string" }, "uniqueItems": true },
23
+ "adjudication": { "type": "object" },
24
+ "scenarios": { "type": "array", "items": { "$ref": "#/$defs/scenario" } }
25
+ },
26
+ "$defs": {
27
+ "stringList": { "type": "array", "items": { "type": "string", "minLength": 1 }, "minItems": 1, "uniqueItems": true },
28
+ "predicate": {
29
+ "oneOf": [
30
+ { "type": ["string", "number", "boolean"] },
31
+ {
32
+ "type": "object",
33
+ "additionalProperties": false,
34
+ "properties": {
35
+ "equals": {},
36
+ "contains": { "type": "string" },
37
+ "starts_with": { "type": "string" },
38
+ "ends_with": { "type": "string" },
39
+ "matches": { "type": "string" },
40
+ "exists": { "type": "boolean" },
41
+ "any": { "$ref": "#/$defs/predicate" }
42
+ },
43
+ "minProperties": 1
44
+ }
45
+ ]
46
+ },
47
+ "count": {
48
+ "type": "object",
49
+ "additionalProperties": false,
50
+ "properties": {
51
+ "min": { "type": "integer", "minimum": 0 },
52
+ "max": { "type": "integer", "minimum": 0 }
53
+ }
54
+ },
55
+ "selector": {
56
+ "type": "object",
57
+ "additionalProperties": false,
58
+ "required": ["event"],
59
+ "properties": {
60
+ "event": { "type": "string", "minLength": 1 },
61
+ "where": { "type": "object", "additionalProperties": { "$ref": "#/$defs/predicate" } },
62
+ "select": { "enum": ["first", "last", "all"] }
63
+ }
64
+ },
65
+ "requiredSelector": {
66
+ "type": "object",
67
+ "additionalProperties": false,
68
+ "required": ["event"],
69
+ "properties": {
70
+ "event": { "type": "string", "minLength": 1 },
71
+ "where": { "type": "object", "additionalProperties": { "$ref": "#/$defs/predicate" } },
72
+ "select": { "enum": ["first", "last", "all"] },
73
+ "count": { "$ref": "#/$defs/count" }
74
+ }
75
+ },
76
+ "correlation": {
77
+ "type": "object",
78
+ "additionalProperties": false,
79
+ "required": ["left", "right"],
80
+ "properties": {
81
+ "left": { "$ref": "#/$defs/selector" },
82
+ "right": { "$ref": "#/$defs/selector" },
83
+ "same": { "$ref": "#/$defs/stringList" },
84
+ "different": { "$ref": "#/$defs/stringList" },
85
+ "order": { "enum": ["before", "after"] }
86
+ },
87
+ "anyOf": [{ "required": ["same"] }, { "required": ["different"] }, { "required": ["order"] }]
88
+ },
89
+ "freshness": {
90
+ "type": "object",
91
+ "additionalProperties": false,
92
+ "required": ["subject", "after"],
93
+ "properties": {
94
+ "subject": { "$ref": "#/$defs/selector" },
95
+ "after": { "type": "array", "items": { "$ref": "#/$defs/selector" }, "minItems": 1 },
96
+ "same": { "$ref": "#/$defs/stringList" }
97
+ }
98
+ },
99
+ "unique": {
100
+ "type": "object",
101
+ "additionalProperties": false,
102
+ "required": ["events", "fields"],
103
+ "properties": {
104
+ "events": { "$ref": "#/$defs/selector" },
105
+ "fields": { "$ref": "#/$defs/stringList" }
106
+ }
107
+ },
108
+ "forbidAfter": {
109
+ "type": "object",
110
+ "additionalProperties": false,
111
+ "required": ["anchor", "forbidden"],
112
+ "properties": {
113
+ "anchor": { "$ref": "#/$defs/selector" },
114
+ "forbidden": { "type": "array", "items": { "$ref": "#/$defs/selector" }, "minItems": 1 },
115
+ "same": { "$ref": "#/$defs/stringList" },
116
+ "anchor_optional": { "type": "boolean" }
117
+ }
118
+ },
119
+ "approvalAssertion": {
120
+ "type": "object",
121
+ "additionalProperties": false,
122
+ "required": ["grant", "use"],
123
+ "properties": {
124
+ "grant": { "$ref": "#/$defs/selector" },
125
+ "use": { "$ref": "#/$defs/selector" },
126
+ "same": { "$ref": "#/$defs/stringList" },
127
+ "scopes": { "$ref": "#/$defs/stringList" },
128
+ "sources": { "$ref": "#/$defs/stringList" },
129
+ "unexpired": { "type": "boolean" },
130
+ "max_uses": { "type": "integer", "minimum": 1 }
131
+ }
132
+ },
133
+ "coverageAssertion": {
134
+ "type": "object",
135
+ "additionalProperties": false,
136
+ "required": ["requirements"],
137
+ "properties": {
138
+ "requirements": { "$ref": "#/$defs/stringList" },
139
+ "events": { "$ref": "#/$defs/selector" }
140
+ }
141
+ },
142
+ "trajectory": {
143
+ "type": "object",
144
+ "additionalProperties": false,
145
+ "required": ["version"],
146
+ "properties": {
147
+ "version": { "const": "1.0" },
148
+ "require": { "type": "array", "items": { "$ref": "#/$defs/requiredSelector" }, "minItems": 1 },
149
+ "forbid": { "type": "array", "items": { "$ref": "#/$defs/selector" }, "minItems": 1 },
150
+ "ordered": { "type": "array", "items": { "type": "array", "items": { "$ref": "#/$defs/selector" }, "minItems": 1 }, "minItems": 1 },
151
+ "correlate": { "type": "array", "items": { "$ref": "#/$defs/correlation" }, "minItems": 1 },
152
+ "freshness": { "type": "array", "items": { "$ref": "#/$defs/freshness" }, "minItems": 1 },
153
+ "unique": { "type": "array", "items": { "$ref": "#/$defs/unique" }, "minItems": 1 },
154
+ "forbid_after": { "type": "array", "items": { "$ref": "#/$defs/forbidAfter" }, "minItems": 1 },
155
+ "approvals": { "type": "array", "items": { "$ref": "#/$defs/approvalAssertion" }, "minItems": 1 },
156
+ "coverage": { "type": "array", "items": { "$ref": "#/$defs/coverageAssertion" }, "minItems": 1 }
157
+ },
158
+ "minProperties": 2
159
+ },
160
+ "scenario": {
161
+ "type": "object",
162
+ "additionalProperties": false,
163
+ "required": ["id", "title", "turns", "checklist"],
164
+ "properties": {
165
+ "id": { "type": "string", "minLength": 1 },
166
+ "title": { "type": "string", "minLength": 1 },
167
+ "critical": { "type": "boolean" },
168
+ "mode": { "enum": ["inline", "seeded"] },
169
+ "fixture": { "type": "string" },
170
+ "turns": { "type": "array", "items": { "type": "string" }, "minItems": 1 },
171
+ "checklist": { "type": "array", "items": { "type": "string" }, "minItems": 1 },
172
+ "covers": { "type": "array", "items": { "type": "string" } },
173
+ "reps": { "type": "integer", "minimum": 1 },
174
+ "pass_threshold": { "type": "number", "minimum": 0, "maximum": 1 },
175
+ "system_prompt_file": { "type": "string" },
176
+ "env": {
177
+ "type": "object",
178
+ "additionalProperties": false,
179
+ "properties": {
180
+ "workspace": {},
181
+ "remote": { "type": "boolean" },
182
+ "extensions": { "type": "array", "items": { "type": "string" } },
183
+ "event_sources": {
184
+ "type": "array",
185
+ "items": {
186
+ "type": "object",
187
+ "additionalProperties": false,
188
+ "required": ["adapter", "path"],
189
+ "properties": {
190
+ "adapter": { "enum": ["normalized-v1", "principal-assurance-v1", "pi-daddy-v1"] },
191
+ "path": {
192
+ "type": "string",
193
+ "minLength": 1,
194
+ "pattern": "^(?!/)(?![A-Za-z]:[\\\\/])(?!.*\\\\)(?!.*//)(?!.*(?:^|/)\\.\\.?(?:/|$)).+$"
195
+ },
196
+ "required": { "type": "boolean" }
197
+ }
198
+ }
199
+ }
200
+ }
201
+ },
202
+ "assert": {
203
+ "type": "object",
204
+ "additionalProperties": false,
205
+ "properties": {
206
+ "vitest": { "type": "boolean" },
207
+ "diff_contains": { "type": "array", "items": { "type": "string", "minLength": 1 } },
208
+ "diff_excludes": { "type": "array", "items": { "type": "string", "minLength": 1 } },
209
+ "post_test": { "type": "string" },
210
+ "trace": { "type": "object" },
211
+ "trajectory": { "$ref": "#/$defs/trajectory" }
212
+ }
213
+ }
214
+ }
215
+ }
216
+ }
217
+ }
@@ -0,0 +1,61 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://skill-harness.dev/schemas/trajectory-event-v1.schema.json",
4
+ "title": "skill-harness normalized trajectory event v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["event_version", "seq", "type", "source"],
8
+ "properties": {
9
+ "event_version": { "const": "1.0" },
10
+ "seq": { "type": "integer", "minimum": 1 },
11
+ "type": { "type": "string", "minLength": 1 },
12
+ "source": { "type": "string", "minLength": 1 },
13
+ "at": { "type": "string", "format": "date-time" },
14
+ "run_id": { "$ref": "#/$defs/id" },
15
+ "task_id": { "$ref": "#/$defs/id" },
16
+ "workspace_id": { "$ref": "#/$defs/id" },
17
+ "context_id": { "$ref": "#/$defs/id" },
18
+ "finding_id": { "$ref": "#/$defs/id" },
19
+ "parent_id": { "$ref": "#/$defs/id" },
20
+ "child_id": { "$ref": "#/$defs/id" },
21
+ "phase": { "type": "string", "minLength": 1 },
22
+ "tool": { "type": "string", "minLength": 1 },
23
+ "capability": { "type": "string", "minLength": 1 },
24
+ "requested_capabilities": { "type": "array", "items": { "type": "string", "minLength": 1 }, "uniqueItems": true },
25
+ "effective_capabilities": { "type": "array", "items": { "type": "string", "minLength": 1 }, "uniqueItems": true },
26
+ "refusal_code": { "type": "string", "pattern": "^[A-Z][A-Z0-9_]*$" },
27
+ "exit_code": { "type": "integer" },
28
+ "digests": {
29
+ "type": "object",
30
+ "properties": {
31
+ "plan": { "$ref": "#/$defs/sha256" },
32
+ "task": { "$ref": "#/$defs/sha256" },
33
+ "definition": { "$ref": "#/$defs/sha256" },
34
+ "head": { "$ref": "#/$defs/gitSha" },
35
+ "tree": { "$ref": "#/$defs/gitSha" }
36
+ },
37
+ "additionalProperties": { "type": "string" }
38
+ },
39
+ "approval": {
40
+ "type": "object",
41
+ "additionalProperties": false,
42
+ "properties": {
43
+ "id": { "$ref": "#/$defs/id" },
44
+ "capability": { "type": "string", "minLength": 1 },
45
+ "subject": { "type": "string", "minLength": 1 },
46
+ "source": { "type": "string", "minLength": 1 },
47
+ "scope": { "type": "string", "minLength": 1 },
48
+ "approved_at": { "type": "string", "format": "date-time" },
49
+ "expires_at": { "type": "string", "format": "date-time" },
50
+ "used_at": { "type": "string", "format": "date-time" }
51
+ }
52
+ },
53
+ "requirements": { "type": "array", "items": { "type": "string", "minLength": 1 }, "uniqueItems": true },
54
+ "attributes": { "type": "object" }
55
+ },
56
+ "$defs": {
57
+ "id": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$" },
58
+ "sha256": { "type": "string", "pattern": "^[a-fA-F0-9]{64}$" },
59
+ "gitSha": { "type": "string", "pattern": "^(?:[a-fA-F0-9]{40}|[a-fA-F0-9]{64})$" }
60
+ }
61
+ }