@vitronai/themis 0.1.0-beta.0 → 0.1.0-beta.1

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,191 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/vitron-ai/themis/docs/schemas/generate-handoff.v1.json",
4
+ "title": "Themis Generate Handoff v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schema", "source", "filters", "gates", "summary", "artifacts", "hintFiles", "targets", "unresolved", "backlog", "nextActions", "prompt"],
8
+ "properties": {
9
+ "schema": {
10
+ "type": "string",
11
+ "const": "themis.generate.handoff.v1"
12
+ },
13
+ "source": {
14
+ "type": "object",
15
+ "additionalProperties": false,
16
+ "required": ["targetDir", "outputDir"],
17
+ "properties": {
18
+ "targetDir": { "type": "string" },
19
+ "outputDir": { "type": "string" }
20
+ }
21
+ },
22
+ "filters": {
23
+ "type": "object",
24
+ "additionalProperties": false,
25
+ "required": ["plan", "changed", "files", "scenario", "minConfidence", "matchSource", "matchExport", "include", "exclude"],
26
+ "properties": {
27
+ "plan": { "type": "boolean" },
28
+ "changed": { "type": "boolean" },
29
+ "files": {
30
+ "type": "array",
31
+ "items": { "type": "string" }
32
+ },
33
+ "scenario": { "type": ["string", "null"] },
34
+ "minConfidence": { "type": ["string", "null"] },
35
+ "matchSource": { "type": ["string", "null"] },
36
+ "matchExport": { "type": ["string", "null"] },
37
+ "include": { "type": ["string", "null"] },
38
+ "exclude": { "type": ["string", "null"] }
39
+ }
40
+ },
41
+ "gates": {
42
+ "type": "object",
43
+ "additionalProperties": false,
44
+ "required": ["strict", "failOnSkips", "failOnConflicts", "requireConfidence", "failed", "failures"],
45
+ "properties": {
46
+ "strict": { "type": "boolean" },
47
+ "failOnSkips": { "type": "boolean" },
48
+ "failOnConflicts": { "type": "boolean" },
49
+ "requireConfidence": { "type": ["string", "null"] },
50
+ "failed": { "type": "boolean" },
51
+ "failures": {
52
+ "type": "array",
53
+ "items": { "$ref": "#/$defs/gateFailure" }
54
+ }
55
+ }
56
+ },
57
+ "summary": {
58
+ "type": "object",
59
+ "additionalProperties": false,
60
+ "required": ["scanned", "generated", "created", "updated", "unchanged", "removed", "skipped", "conflicts"],
61
+ "properties": {
62
+ "scanned": { "type": "number" },
63
+ "generated": { "type": "number" },
64
+ "created": { "type": "number" },
65
+ "updated": { "type": "number" },
66
+ "unchanged": { "type": "number" },
67
+ "removed": { "type": "number" },
68
+ "skipped": { "type": "number" },
69
+ "conflicts": { "type": "number" }
70
+ }
71
+ },
72
+ "artifacts": {
73
+ "type": "object",
74
+ "additionalProperties": false,
75
+ "required": ["generateMap", "generateResult", "generateBacklog"],
76
+ "properties": {
77
+ "generateMap": { "type": "string" },
78
+ "generateResult": { "type": "string" },
79
+ "generateBacklog": { "type": "string" }
80
+ }
81
+ },
82
+ "hintFiles": {
83
+ "$ref": "#/$defs/hintFiles"
84
+ },
85
+ "targets": {
86
+ "type": "array",
87
+ "items": {
88
+ "type": "object",
89
+ "additionalProperties": false,
90
+ "required": ["action", "sourceFile", "testFile", "moduleKind", "confidence", "scenarios"],
91
+ "properties": {
92
+ "action": { "type": "string" },
93
+ "sourceFile": { "type": "string" },
94
+ "testFile": { "type": ["string", "null"] },
95
+ "moduleKind": { "type": "string" },
96
+ "confidence": { "type": "string" },
97
+ "scenarios": {
98
+ "type": "array",
99
+ "items": { "type": "string" }
100
+ }
101
+ }
102
+ }
103
+ },
104
+ "unresolved": {
105
+ "type": "array",
106
+ "items": { "$ref": "#/$defs/backlogItem" }
107
+ },
108
+ "backlog": { "$ref": "#/$defs/backlogSummary" },
109
+ "nextActions": {
110
+ "type": "array",
111
+ "items": { "type": "string" }
112
+ },
113
+ "prompt": {
114
+ "type": "string"
115
+ }
116
+ },
117
+ "$defs": {
118
+ "gateFailure": {
119
+ "type": "object",
120
+ "additionalProperties": false,
121
+ "required": ["code", "count", "message"],
122
+ "properties": {
123
+ "code": { "type": "string" },
124
+ "count": { "type": "number" },
125
+ "message": { "type": "string" }
126
+ }
127
+ },
128
+ "hintFiles": {
129
+ "type": "object",
130
+ "additionalProperties": false,
131
+ "required": ["created", "updated", "unchanged"],
132
+ "properties": {
133
+ "created": {
134
+ "type": "array",
135
+ "items": { "type": "string" }
136
+ },
137
+ "updated": {
138
+ "type": "array",
139
+ "items": { "type": "string" }
140
+ },
141
+ "unchanged": {
142
+ "type": "array",
143
+ "items": { "type": "string" }
144
+ }
145
+ }
146
+ },
147
+ "backlogSummary": {
148
+ "type": "object",
149
+ "additionalProperties": false,
150
+ "required": ["total", "errors", "warnings", "skipped", "conflicts", "confidence"],
151
+ "properties": {
152
+ "total": { "type": "number" },
153
+ "errors": { "type": "number" },
154
+ "warnings": { "type": "number" },
155
+ "skipped": { "type": "number" },
156
+ "conflicts": { "type": "number" },
157
+ "confidence": { "type": "number" }
158
+ }
159
+ },
160
+ "backlogItem": {
161
+ "type": "object",
162
+ "additionalProperties": false,
163
+ "required": [
164
+ "type",
165
+ "severity",
166
+ "sourceFile",
167
+ "testFile",
168
+ "moduleKind",
169
+ "confidence",
170
+ "stage",
171
+ "hintsFile",
172
+ "reason",
173
+ "suggestedAction",
174
+ "suggestedCommand"
175
+ ],
176
+ "properties": {
177
+ "type": { "type": "string" },
178
+ "severity": { "type": "string", "enum": ["warning", "error"] },
179
+ "sourceFile": { "type": "string" },
180
+ "testFile": { "type": ["string", "null"] },
181
+ "moduleKind": { "type": ["string", "null"] },
182
+ "confidence": { "type": ["string", "null"] },
183
+ "stage": { "type": ["string", "null"] },
184
+ "hintsFile": { "type": ["string", "null"] },
185
+ "reason": { "type": "string" },
186
+ "suggestedAction": { "type": "string" },
187
+ "suggestedCommand": { "type": ["string", "null"] }
188
+ }
189
+ }
190
+ }
191
+ }
@@ -0,0 +1,95 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/vitron-ai/themis/docs/schemas/generate-map.v1.json",
4
+ "title": "Themis Generate Map v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schema", "generatedAt", "targetDir", "outputDir", "entries"],
8
+ "properties": {
9
+ "schema": {
10
+ "type": "string",
11
+ "const": "themis.generate.map.v1"
12
+ },
13
+ "generatedAt": {
14
+ "type": "string"
15
+ },
16
+ "targetDir": {
17
+ "type": "string"
18
+ },
19
+ "outputDir": {
20
+ "type": "string"
21
+ },
22
+ "entries": {
23
+ "type": "array",
24
+ "items": {
25
+ "type": "object",
26
+ "additionalProperties": false,
27
+ "required": [
28
+ "sourceFile",
29
+ "sourceHash",
30
+ "testFile",
31
+ "moduleKind",
32
+ "confidence",
33
+ "exactExports",
34
+ "exportNames",
35
+ "hintsFile",
36
+ "scenarios"
37
+ ],
38
+ "properties": {
39
+ "sourceFile": {
40
+ "type": "string"
41
+ },
42
+ "sourceHash": {
43
+ "type": "string"
44
+ },
45
+ "testFile": {
46
+ "type": "string"
47
+ },
48
+ "moduleKind": {
49
+ "type": "string"
50
+ },
51
+ "confidence": {
52
+ "type": "string"
53
+ },
54
+ "exactExports": {
55
+ "type": "boolean"
56
+ },
57
+ "exportNames": {
58
+ "type": "array",
59
+ "items": {
60
+ "type": "string"
61
+ }
62
+ },
63
+ "hintsFile": {
64
+ "type": ["string", "null"]
65
+ },
66
+ "scenarios": {
67
+ "type": "array",
68
+ "items": {
69
+ "type": "object",
70
+ "additionalProperties": false,
71
+ "required": ["kind", "confidence", "exports", "caseCount"],
72
+ "properties": {
73
+ "kind": {
74
+ "type": "string"
75
+ },
76
+ "confidence": {
77
+ "type": "string"
78
+ },
79
+ "exports": {
80
+ "type": "array",
81
+ "items": {
82
+ "type": "string"
83
+ }
84
+ },
85
+ "caseCount": {
86
+ "type": "number"
87
+ }
88
+ }
89
+ }
90
+ }
91
+ }
92
+ }
93
+ }
94
+ }
95
+ }
@@ -0,0 +1,341 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/vitron-ai/themis/docs/schemas/generate-result.v1.json",
4
+ "title": "Themis Generate Result v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schema",
9
+ "mode",
10
+ "source",
11
+ "filters",
12
+ "gates",
13
+ "summary",
14
+ "scannedFiles",
15
+ "generatedFiles",
16
+ "removedFiles",
17
+ "skippedFiles",
18
+ "conflictFiles",
19
+ "hintFiles",
20
+ "entries",
21
+ "backlog",
22
+ "artifacts",
23
+ "promptReady",
24
+ "hints"
25
+ ],
26
+ "properties": {
27
+ "schema": {
28
+ "type": "string",
29
+ "const": "themis.generate.result.v1"
30
+ },
31
+ "mode": {
32
+ "type": "object",
33
+ "additionalProperties": false,
34
+ "required": ["review", "update", "clean", "changed", "plan", "writeHints"],
35
+ "properties": {
36
+ "review": { "type": "boolean" },
37
+ "update": { "type": "boolean" },
38
+ "clean": { "type": "boolean" },
39
+ "changed": { "type": "boolean" },
40
+ "plan": { "type": "boolean" },
41
+ "writeHints": { "type": "boolean" }
42
+ }
43
+ },
44
+ "source": {
45
+ "type": "object",
46
+ "additionalProperties": false,
47
+ "required": ["targetDir", "outputDir"],
48
+ "properties": {
49
+ "targetDir": { "type": "string" },
50
+ "outputDir": { "type": "string" }
51
+ }
52
+ },
53
+ "filters": {
54
+ "type": "object",
55
+ "additionalProperties": false,
56
+ "required": ["plan", "changed", "files", "scenario", "minConfidence", "matchSource", "matchExport", "include", "exclude"],
57
+ "properties": {
58
+ "plan": { "type": "boolean" },
59
+ "changed": { "type": "boolean" },
60
+ "files": {
61
+ "type": "array",
62
+ "items": { "type": "string" }
63
+ },
64
+ "scenario": { "type": ["string", "null"] },
65
+ "minConfidence": { "type": ["string", "null"] },
66
+ "matchSource": { "type": ["string", "null"] },
67
+ "matchExport": { "type": ["string", "null"] },
68
+ "include": { "type": ["string", "null"] },
69
+ "exclude": { "type": ["string", "null"] }
70
+ }
71
+ },
72
+ "gates": {
73
+ "type": "object",
74
+ "additionalProperties": false,
75
+ "required": ["strict", "failOnSkips", "failOnConflicts", "requireConfidence", "failed", "failures"],
76
+ "properties": {
77
+ "strict": { "type": "boolean" },
78
+ "failOnSkips": { "type": "boolean" },
79
+ "failOnConflicts": { "type": "boolean" },
80
+ "requireConfidence": { "type": ["string", "null"] },
81
+ "failed": { "type": "boolean" },
82
+ "failures": {
83
+ "type": "array",
84
+ "items": { "$ref": "#/$defs/gateFailure" }
85
+ }
86
+ }
87
+ },
88
+ "summary": {
89
+ "type": "object",
90
+ "additionalProperties": false,
91
+ "required": ["scanned", "generated", "created", "updated", "unchanged", "removed", "skipped", "conflicts"],
92
+ "properties": {
93
+ "scanned": { "type": "number" },
94
+ "generated": { "type": "number" },
95
+ "created": { "type": "number" },
96
+ "updated": { "type": "number" },
97
+ "unchanged": { "type": "number" },
98
+ "removed": { "type": "number" },
99
+ "skipped": { "type": "number" },
100
+ "conflicts": { "type": "number" }
101
+ }
102
+ },
103
+ "scannedFiles": {
104
+ "type": "array",
105
+ "items": { "type": "string" }
106
+ },
107
+ "generatedFiles": {
108
+ "type": "array",
109
+ "items": { "type": "string" }
110
+ },
111
+ "removedFiles": {
112
+ "type": "array",
113
+ "items": { "type": "string" }
114
+ },
115
+ "skippedFiles": {
116
+ "type": "array",
117
+ "items": {
118
+ "type": "object",
119
+ "additionalProperties": false,
120
+ "required": ["file", "reason", "stage"],
121
+ "properties": {
122
+ "file": { "type": "string" },
123
+ "reason": { "type": "string" },
124
+ "stage": { "type": "string" }
125
+ }
126
+ }
127
+ },
128
+ "conflictFiles": {
129
+ "type": "array",
130
+ "items": { "type": "string" }
131
+ },
132
+ "hintFiles": {
133
+ "$ref": "#/$defs/hintFiles"
134
+ },
135
+ "entries": {
136
+ "type": "array",
137
+ "items": { "$ref": "#/$defs/generateEntry" }
138
+ },
139
+ "backlog": {
140
+ "type": "object",
141
+ "additionalProperties": false,
142
+ "required": ["summary", "items"],
143
+ "properties": {
144
+ "summary": { "$ref": "#/$defs/backlogSummary" },
145
+ "items": {
146
+ "type": "array",
147
+ "items": { "$ref": "#/$defs/backlogItem" }
148
+ }
149
+ }
150
+ },
151
+ "artifacts": {
152
+ "type": "object",
153
+ "additionalProperties": false,
154
+ "required": ["generateMap", "helperFile", "generateResult", "generateHandoff", "generateBacklog"],
155
+ "properties": {
156
+ "generateMap": { "type": "string" },
157
+ "helperFile": { "type": "string" },
158
+ "generateResult": { "type": "string" },
159
+ "generateHandoff": { "type": "string" },
160
+ "generateBacklog": { "type": "string" }
161
+ }
162
+ },
163
+ "promptReady": {
164
+ "type": "object",
165
+ "additionalProperties": false,
166
+ "required": ["summary", "targets", "unresolved", "nextActions", "prompt"],
167
+ "properties": {
168
+ "summary": { "type": "string" },
169
+ "targets": {
170
+ "type": "array",
171
+ "items": { "$ref": "#/$defs/promptTarget" }
172
+ },
173
+ "unresolved": {
174
+ "type": "array",
175
+ "items": { "$ref": "#/$defs/backlogItem" }
176
+ },
177
+ "nextActions": {
178
+ "type": "array",
179
+ "items": { "type": "string" }
180
+ },
181
+ "prompt": { "type": "string" }
182
+ }
183
+ },
184
+ "hints": {
185
+ "type": "object",
186
+ "additionalProperties": false,
187
+ "required": ["runTests", "plan", "review", "updateOnly", "clean", "changed", "strict", "writeHints", "fileTarget"],
188
+ "properties": {
189
+ "runTests": { "type": "string" },
190
+ "plan": { "type": "string" },
191
+ "review": { "type": "string" },
192
+ "updateOnly": { "type": "string" },
193
+ "clean": { "type": "string" },
194
+ "changed": { "type": "string" },
195
+ "strict": { "type": "string" },
196
+ "writeHints": { "type": "string" },
197
+ "fileTarget": { "type": "string" }
198
+ }
199
+ }
200
+ },
201
+ "$defs": {
202
+ "gateFailure": {
203
+ "type": "object",
204
+ "additionalProperties": false,
205
+ "required": ["code", "count", "message"],
206
+ "properties": {
207
+ "code": { "type": "string" },
208
+ "count": { "type": "number" },
209
+ "message": { "type": "string" }
210
+ }
211
+ },
212
+ "generateEntry": {
213
+ "type": "object",
214
+ "additionalProperties": false,
215
+ "required": [
216
+ "action",
217
+ "sourceFile",
218
+ "testFile",
219
+ "moduleKind",
220
+ "confidence",
221
+ "exactExports",
222
+ "exportNames",
223
+ "hintsFile",
224
+ "sourceHash",
225
+ "scenarios",
226
+ "reason"
227
+ ],
228
+ "properties": {
229
+ "action": { "type": "string" },
230
+ "sourceFile": { "type": "string" },
231
+ "testFile": { "type": ["string", "null"] },
232
+ "moduleKind": { "type": "string" },
233
+ "confidence": { "type": "string" },
234
+ "exactExports": { "type": "boolean" },
235
+ "exportNames": {
236
+ "type": "array",
237
+ "items": { "type": "string" }
238
+ },
239
+ "hintsFile": { "type": ["string", "null"] },
240
+ "sourceHash": { "type": ["string", "null"] },
241
+ "scenarios": {
242
+ "type": "array",
243
+ "items": { "$ref": "#/$defs/scenarioSummary" }
244
+ },
245
+ "reason": { "type": ["string", "null"] }
246
+ }
247
+ },
248
+ "hintFiles": {
249
+ "type": "object",
250
+ "additionalProperties": false,
251
+ "required": ["created", "updated", "unchanged"],
252
+ "properties": {
253
+ "created": {
254
+ "type": "array",
255
+ "items": { "type": "string" }
256
+ },
257
+ "updated": {
258
+ "type": "array",
259
+ "items": { "type": "string" }
260
+ },
261
+ "unchanged": {
262
+ "type": "array",
263
+ "items": { "type": "string" }
264
+ }
265
+ }
266
+ },
267
+ "scenarioSummary": {
268
+ "type": "object",
269
+ "additionalProperties": false,
270
+ "required": ["kind", "confidence", "exports", "caseCount"],
271
+ "properties": {
272
+ "kind": { "type": "string" },
273
+ "confidence": { "type": "string" },
274
+ "exports": {
275
+ "type": "array",
276
+ "items": { "type": "string" }
277
+ },
278
+ "caseCount": { "type": "number" }
279
+ }
280
+ },
281
+ "backlogSummary": {
282
+ "type": "object",
283
+ "additionalProperties": false,
284
+ "required": ["total", "errors", "warnings", "skipped", "conflicts", "confidence"],
285
+ "properties": {
286
+ "total": { "type": "number" },
287
+ "errors": { "type": "number" },
288
+ "warnings": { "type": "number" },
289
+ "skipped": { "type": "number" },
290
+ "conflicts": { "type": "number" },
291
+ "confidence": { "type": "number" }
292
+ }
293
+ },
294
+ "backlogItem": {
295
+ "type": "object",
296
+ "additionalProperties": false,
297
+ "required": [
298
+ "type",
299
+ "severity",
300
+ "sourceFile",
301
+ "testFile",
302
+ "moduleKind",
303
+ "confidence",
304
+ "stage",
305
+ "hintsFile",
306
+ "reason",
307
+ "suggestedAction",
308
+ "suggestedCommand"
309
+ ],
310
+ "properties": {
311
+ "type": { "type": "string" },
312
+ "severity": { "type": "string", "enum": ["warning", "error"] },
313
+ "sourceFile": { "type": "string" },
314
+ "testFile": { "type": ["string", "null"] },
315
+ "moduleKind": { "type": ["string", "null"] },
316
+ "confidence": { "type": ["string", "null"] },
317
+ "stage": { "type": ["string", "null"] },
318
+ "hintsFile": { "type": ["string", "null"] },
319
+ "reason": { "type": "string" },
320
+ "suggestedAction": { "type": "string" },
321
+ "suggestedCommand": { "type": ["string", "null"] }
322
+ }
323
+ },
324
+ "promptTarget": {
325
+ "type": "object",
326
+ "additionalProperties": false,
327
+ "required": ["action", "sourceFile", "testFile", "moduleKind", "confidence", "scenarios"],
328
+ "properties": {
329
+ "action": { "type": "string" },
330
+ "sourceFile": { "type": "string" },
331
+ "testFile": { "type": ["string", "null"] },
332
+ "moduleKind": { "type": "string" },
333
+ "confidence": { "type": "string" },
334
+ "scenarios": {
335
+ "type": "array",
336
+ "items": { "type": "string" }
337
+ }
338
+ }
339
+ }
340
+ }
341
+ }
@@ -8,6 +8,7 @@ This is the intended shape of the editor UX:
8
8
  - a results sidebar driven by `.themis/*` artifacts
9
9
  - commands to run tests, rerun failures, refresh results, and open the HTML report
10
10
  - failure navigation that jumps from artifact data into the source file
11
+ - generated-review navigation for source files, generated tests, hint sidecars, and backlog items
11
12
 
12
13
  ## Current MVP Scope
13
14
 
@@ -16,7 +17,12 @@ The scaffold currently supports:
16
17
  - reading `.themis/last-run.json`
17
18
  - reading `.themis/failed-tests.json`
18
19
  - reading `.themis/run-diff.json`
20
+ - reading `.themis/generate-last.json`
21
+ - reading `.themis/generate-map.json`
22
+ - reading `.themis/generate-backlog.json`
19
23
  - opening `.themis/report.html` in a webview
24
+ - surfacing generated source/test/hint mappings in the sidebar
25
+ - surfacing unresolved generate backlog and gate state in the sidebar
20
26
  - refreshing when `.themis/*` files change
21
27
 
22
28
  The extension is intentionally thin. It shells out to Themis commands and treats the CLI plus artifacts as the canonical contract.
@@ -68,7 +68,7 @@ Themis keeps a lean JS runtime and ships first-party typings:
68
68
 
69
69
  Themis ships workflow features agents can use directly:
70
70
 
71
- - snapshots with `toMatchSnapshot()`
71
+ - direct contract assertions instead of snapshot-file churn
72
72
  - mocks and spies with `fn`, `spyOn`, and `mock`
73
73
  - `.themis/run-diff.json` and `.themis/run-history.json`
74
74
  - HTML verdict reports for human review