@skathio/somi 1.2.0 → 2.0.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/.claude/settings.json +8 -8
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.copilot-extension/extension.json +1 -1
- package/.copilot-extension/marketplace.json +1 -1
- package/README.md +5 -0
- package/VERSION +1 -1
- package/commands/code-loop.md +12 -12
- package/commands/plan-loop.md +9 -9
- package/commands/pr.md +1 -1
- package/commands/release-readiness.md +3 -3
- package/commands/review-panel.md +1 -1
- package/commands/review.md +3 -3
- package/commands/ship-loop.md +2 -2
- package/commands/somi.md +1 -1
- package/commands/upgrade.md +1 -1
- package/hooks/hooks.json +8 -8
- package/hooks/lib/common.mjs +328 -0
- package/hooks/post-tool/audit-log.mjs +93 -0
- package/hooks/post-tool/lint-changed-files.mjs +212 -0
- package/hooks/pre-tool/block-dangerous-bash.mjs +382 -0
- package/hooks/pre-tool/block-secret-writes.mjs +96 -0
- package/hooks/pre-tool/gate-dep-install.mjs +229 -0
- package/hooks/pre-tool/guard-protected-paths.mjs +157 -0
- package/hooks/session-start/detect-repo-instructions.mjs +264 -0
- package/hooks/user-prompt-submit/inject-workflow-context.mjs +432 -0
- package/package.json +2 -2
- package/scripts/somi-check.mjs +243 -0
- package/scripts/somi-findings.mjs +307 -0
- package/scripts/somi-loop.mjs +354 -0
- package/scripts/validate.sh +21 -16
- package/skills/clean-code/SKILL.md +1 -1
- package/tests/hooks/cases/audit-log.json +21 -0
- package/tests/hooks/cases/block-dangerous-bash.json +90 -2
- package/tests/hooks/cases/block-secret-writes.json +1 -1
- package/tests/hooks/cases/detect-repo-instructions.json +84 -0
- package/tests/hooks/cases/gate-dep-install.json +6 -1
- package/tests/hooks/cases/guard-protected-paths.json +1 -1
- package/tests/hooks/cases/inject-workflow-context.json +126 -0
- package/tests/hooks/cases/lint-changed-files.json +120 -0
- package/tests/hooks/run.sh +280 -15
- package/tests/scripts/goldens/somi-findings.json +336 -0
- package/tests/scripts/goldens/somi-loop.json +168 -0
- package/tests/scripts/run.sh +251 -30
- package/hooks/lib/common.sh +0 -133
- package/hooks/post-tool/audit-log.sh +0 -40
- package/hooks/post-tool/lint-changed-files.sh +0 -80
- package/hooks/pre-tool/block-dangerous-bash.sh +0 -171
- package/hooks/pre-tool/block-secret-writes.sh +0 -83
- package/hooks/pre-tool/gate-dep-install.sh +0 -113
- package/hooks/pre-tool/guard-protected-paths.sh +0 -89
- package/hooks/session-start/detect-repo-instructions.sh +0 -73
- package/hooks/user-prompt-submit/inject-workflow-context.sh +0 -143
- package/scripts/somi-check.sh +0 -135
- package/scripts/somi-findings.sh +0 -173
- package/scripts/somi-loop.sh +0 -225
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"script": "somi-findings.sh",
|
|
4
|
+
"name": "record: first sighting is new (F-1)",
|
|
5
|
+
"argv": [
|
|
6
|
+
"record",
|
|
7
|
+
"--slug",
|
|
8
|
+
"gf",
|
|
9
|
+
"--review",
|
|
10
|
+
"r1.md",
|
|
11
|
+
"--run",
|
|
12
|
+
"RUN1",
|
|
13
|
+
"--pass",
|
|
14
|
+
"1"
|
|
15
|
+
],
|
|
16
|
+
"stdin": "[{\"file\":\"src/a.txt\",\"symbol\":\"HandleWebhook\",\"title\":\"Missing rate limit on retry path\",\"severity\":\"Major\",\"confidence\":\"High\"}]",
|
|
17
|
+
"exit": 0,
|
|
18
|
+
"stdout": "{\"id\":\"F-1\",\"state\":\"new\",\"recurring_consecutive\":false,\"recurring_cross_run\":false}",
|
|
19
|
+
"stderr": ""
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"script": "somi-findings.sh",
|
|
23
|
+
"name": "record: consecutive-pass recurrence (exit 5)",
|
|
24
|
+
"argv": [
|
|
25
|
+
"record",
|
|
26
|
+
"--slug",
|
|
27
|
+
"gf",
|
|
28
|
+
"--review",
|
|
29
|
+
"r2.md",
|
|
30
|
+
"--run",
|
|
31
|
+
"RUN1",
|
|
32
|
+
"--pass",
|
|
33
|
+
"2"
|
|
34
|
+
],
|
|
35
|
+
"stdin": "[{\"file\":\"src/a.txt\",\"symbol\":\"handlewebhook\",\"title\":\"missing rate limit on retry path\",\"severity\":\"Major\"}]",
|
|
36
|
+
"exit": 5,
|
|
37
|
+
"stdout": "{\"id\":\"F-1\",\"state\":\"known\",\"recurring_consecutive\":true,\"recurring_cross_run\":false}",
|
|
38
|
+
"stderr": ""
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"script": "somi-findings.sh",
|
|
42
|
+
"name": "record: cross-run recurrence (exit 0, not consecutive)",
|
|
43
|
+
"argv": [
|
|
44
|
+
"record",
|
|
45
|
+
"--slug",
|
|
46
|
+
"gf",
|
|
47
|
+
"--review",
|
|
48
|
+
"r3.md",
|
|
49
|
+
"--run",
|
|
50
|
+
"RUN2",
|
|
51
|
+
"--pass",
|
|
52
|
+
"1"
|
|
53
|
+
],
|
|
54
|
+
"stdin": "[{\"file\":\"src/a.txt\",\"symbol\":\"HandleWebhook\",\"title\":\"Missing rate limit on retry path\",\"severity\":\"Major\",\"confidence\":\"High\"}]",
|
|
55
|
+
"exit": 0,
|
|
56
|
+
"stdout": "{\"id\":\"F-1\",\"state\":\"known\",\"recurring_consecutive\":false,\"recurring_cross_run\":true}",
|
|
57
|
+
"stderr": ""
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"script": "somi-findings.sh",
|
|
61
|
+
"name": "resolve: F-1 fixed",
|
|
62
|
+
"argv": [
|
|
63
|
+
"resolve",
|
|
64
|
+
"--slug",
|
|
65
|
+
"gf",
|
|
66
|
+
"--id",
|
|
67
|
+
"F-1",
|
|
68
|
+
"--status",
|
|
69
|
+
"fixed",
|
|
70
|
+
"--by",
|
|
71
|
+
"r4.md"
|
|
72
|
+
],
|
|
73
|
+
"exit": 0,
|
|
74
|
+
"stdout": "{\"id\":\"F-1\",\"status\":\"fixed\",\"resolved_by\":\"r4.md\"}",
|
|
75
|
+
"stderr": ""
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"script": "somi-findings.sh",
|
|
79
|
+
"name": "open: empty after resolve",
|
|
80
|
+
"argv": [
|
|
81
|
+
"open",
|
|
82
|
+
"--slug",
|
|
83
|
+
"gf"
|
|
84
|
+
],
|
|
85
|
+
"exit": 0,
|
|
86
|
+
"stdout": "[]",
|
|
87
|
+
"stderr": ""
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"script": "somi-findings.sh",
|
|
91
|
+
"name": "record: resolved locus re-reported becomes new (F-2)",
|
|
92
|
+
"argv": [
|
|
93
|
+
"record",
|
|
94
|
+
"--slug",
|
|
95
|
+
"gf",
|
|
96
|
+
"--review",
|
|
97
|
+
"r5.md",
|
|
98
|
+
"--run",
|
|
99
|
+
"RUN3",
|
|
100
|
+
"--pass",
|
|
101
|
+
"1"
|
|
102
|
+
],
|
|
103
|
+
"stdin": "[{\"file\":\"src/a.txt\",\"symbol\":\"HandleWebhook\",\"title\":\"Missing rate limit on retry path\",\"severity\":\"Major\",\"confidence\":\"High\"}]",
|
|
104
|
+
"exit": 0,
|
|
105
|
+
"stdout": "{\"id\":\"F-2\",\"state\":\"new\",\"recurring_consecutive\":false,\"recurring_cross_run\":false}",
|
|
106
|
+
"stderr": ""
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"script": "somi-findings.sh",
|
|
110
|
+
"name": "reopen: F-1 back to open",
|
|
111
|
+
"argv": [
|
|
112
|
+
"reopen",
|
|
113
|
+
"--slug",
|
|
114
|
+
"gf",
|
|
115
|
+
"--id",
|
|
116
|
+
"F-1",
|
|
117
|
+
"--by",
|
|
118
|
+
"r6.md"
|
|
119
|
+
],
|
|
120
|
+
"exit": 0,
|
|
121
|
+
"stdout": "{\"id\":\"F-1\",\"status\":\"open\"}",
|
|
122
|
+
"stderr": ""
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"script": "somi-findings.sh",
|
|
126
|
+
"name": "get: F-1 (reopened)",
|
|
127
|
+
"argv": [
|
|
128
|
+
"get",
|
|
129
|
+
"--slug",
|
|
130
|
+
"gf",
|
|
131
|
+
"--id",
|
|
132
|
+
"F-1"
|
|
133
|
+
],
|
|
134
|
+
"exit": 0,
|
|
135
|
+
"stdout": "{\n \"id\": \"F-1\",\n \"key\": \"src/a.txt|handlewebhook|missing rate limit on retry path\",\n \"locus\": {\n \"file\": \"src/a.txt\",\n \"symbol\": \"HandleWebhook\"\n },\n \"title\": \"Missing rate limit on retry path\",\n \"severity\": \"Major\",\n \"confidence\": \"High\",\n \"status\": \"open\",\n \"introduced_by\": \"r1.md\",\n \"resolved_by\": null,\n \"seen\": [\n {\n \"review\": \"r1.md\",\n \"run\": \"RUN1\",\n \"pass\": 1,\n \"date\": \"<DATE>\"\n },\n {\n \"review\": \"r2.md\",\n \"run\": \"RUN1\",\n \"pass\": 2,\n \"date\": \"<DATE>\"\n },\n {\n \"review\": \"r3.md\",\n \"run\": \"RUN2\",\n \"pass\": 1,\n \"date\": \"<DATE>\"\n }\n ],\n \"reopened_by\": \"r6.md\"\n}",
|
|
136
|
+
"stderr": ""
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"script": "somi-findings.sh",
|
|
140
|
+
"name": "get: F-2",
|
|
141
|
+
"argv": [
|
|
142
|
+
"get",
|
|
143
|
+
"--slug",
|
|
144
|
+
"gf",
|
|
145
|
+
"--id",
|
|
146
|
+
"F-2"
|
|
147
|
+
],
|
|
148
|
+
"exit": 0,
|
|
149
|
+
"stdout": "{\n \"id\": \"F-2\",\n \"key\": \"src/a.txt|handlewebhook|missing rate limit on retry path\",\n \"locus\": {\n \"file\": \"src/a.txt\",\n \"symbol\": \"HandleWebhook\"\n },\n \"title\": \"Missing rate limit on retry path\",\n \"severity\": \"Major\",\n \"confidence\": \"High\",\n \"status\": \"open\",\n \"introduced_by\": \"r5.md\",\n \"resolved_by\": null,\n \"seen\": [\n {\n \"review\": \"r5.md\",\n \"run\": \"RUN3\",\n \"pass\": 1,\n \"date\": \"<DATE>\"\n }\n ]\n}",
|
|
150
|
+
"stderr": ""
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"script": "somi-findings.sh",
|
|
154
|
+
"name": "normalize_title: empty title (dies 64, never reaches normalize_title) — record",
|
|
155
|
+
"argv": [
|
|
156
|
+
"record",
|
|
157
|
+
"--slug",
|
|
158
|
+
"edge-empty",
|
|
159
|
+
"--review",
|
|
160
|
+
"r.md",
|
|
161
|
+
"--run",
|
|
162
|
+
"R1",
|
|
163
|
+
"--pass",
|
|
164
|
+
"1"
|
|
165
|
+
],
|
|
166
|
+
"stdin": "[{\"file\":\"src/a.txt\",\"title\":\"\"}]",
|
|
167
|
+
"exit": 64,
|
|
168
|
+
"stdout": "",
|
|
169
|
+
"stderr": "somi-findings: finding 0 needs at least {file, title}"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"script": "somi-findings.sh",
|
|
173
|
+
"name": "normalize_title: single word — record",
|
|
174
|
+
"argv": [
|
|
175
|
+
"record",
|
|
176
|
+
"--slug",
|
|
177
|
+
"edge-single",
|
|
178
|
+
"--review",
|
|
179
|
+
"r.md",
|
|
180
|
+
"--run",
|
|
181
|
+
"R1",
|
|
182
|
+
"--pass",
|
|
183
|
+
"1"
|
|
184
|
+
],
|
|
185
|
+
"stdin": "[{\"file\":\"src/a.txt\",\"title\":\"Bug\"}]",
|
|
186
|
+
"exit": 0,
|
|
187
|
+
"stdout": "{\"id\":\"F-1\",\"state\":\"new\",\"recurring_consecutive\":false,\"recurring_cross_run\":false}",
|
|
188
|
+
"stderr": ""
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"script": "somi-findings.sh",
|
|
192
|
+
"name": "normalize_title: single word — get (exposes key)",
|
|
193
|
+
"argv": [
|
|
194
|
+
"get",
|
|
195
|
+
"--slug",
|
|
196
|
+
"edge-single",
|
|
197
|
+
"--id",
|
|
198
|
+
"F-1"
|
|
199
|
+
],
|
|
200
|
+
"exit": 0,
|
|
201
|
+
"stdout": "{\n \"id\": \"F-1\",\n \"key\": \"src/a.txt||bug\",\n \"locus\": {\n \"file\": \"src/a.txt\",\n \"symbol\": \"\"\n },\n \"title\": \"Bug\",\n \"severity\": \"Minor\",\n \"confidence\": \"Medium\",\n \"status\": \"open\",\n \"introduced_by\": \"r.md\",\n \"resolved_by\": null,\n \"seen\": [\n {\n \"review\": \"r.md\",\n \"run\": \"R1\",\n \"pass\": 1,\n \"date\": \"<DATE>\"\n }\n ]\n}",
|
|
202
|
+
"stderr": ""
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"script": "somi-findings.sh",
|
|
206
|
+
"name": "normalize_title: >8 words truncates — record",
|
|
207
|
+
"argv": [
|
|
208
|
+
"record",
|
|
209
|
+
"--slug",
|
|
210
|
+
"edge-many",
|
|
211
|
+
"--review",
|
|
212
|
+
"r.md",
|
|
213
|
+
"--run",
|
|
214
|
+
"R1",
|
|
215
|
+
"--pass",
|
|
216
|
+
"1"
|
|
217
|
+
],
|
|
218
|
+
"stdin": "[{\"file\":\"src/a.txt\",\"title\":\"one two three four five six seven eight nine ten\"}]",
|
|
219
|
+
"exit": 0,
|
|
220
|
+
"stdout": "{\"id\":\"F-1\",\"state\":\"new\",\"recurring_consecutive\":false,\"recurring_cross_run\":false}",
|
|
221
|
+
"stderr": ""
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"script": "somi-findings.sh",
|
|
225
|
+
"name": "normalize_title: >8 words truncates — get (exposes key)",
|
|
226
|
+
"argv": [
|
|
227
|
+
"get",
|
|
228
|
+
"--slug",
|
|
229
|
+
"edge-many",
|
|
230
|
+
"--id",
|
|
231
|
+
"F-1"
|
|
232
|
+
],
|
|
233
|
+
"exit": 0,
|
|
234
|
+
"stdout": "{\n \"id\": \"F-1\",\n \"key\": \"src/a.txt||one two three four five six seven eight\",\n \"locus\": {\n \"file\": \"src/a.txt\",\n \"symbol\": \"\"\n },\n \"title\": \"one two three four five six seven eight nine ten\",\n \"severity\": \"Minor\",\n \"confidence\": \"Medium\",\n \"status\": \"open\",\n \"introduced_by\": \"r.md\",\n \"resolved_by\": null,\n \"seen\": [\n {\n \"review\": \"r.md\",\n \"run\": \"R1\",\n \"pass\": 1,\n \"date\": \"<DATE>\"\n }\n ]\n}",
|
|
235
|
+
"stderr": ""
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
"script": "somi-findings.sh",
|
|
239
|
+
"name": "normalize_title: leading/trailing whitespace — record",
|
|
240
|
+
"argv": [
|
|
241
|
+
"record",
|
|
242
|
+
"--slug",
|
|
243
|
+
"edge-ws",
|
|
244
|
+
"--review",
|
|
245
|
+
"r.md",
|
|
246
|
+
"--run",
|
|
247
|
+
"R1",
|
|
248
|
+
"--pass",
|
|
249
|
+
"1"
|
|
250
|
+
],
|
|
251
|
+
"stdin": "[{\"file\":\"src/a.txt\",\"title\":\" Missing rate limit \"}]",
|
|
252
|
+
"exit": 0,
|
|
253
|
+
"stdout": "{\"id\":\"F-1\",\"state\":\"new\",\"recurring_consecutive\":false,\"recurring_cross_run\":false}",
|
|
254
|
+
"stderr": ""
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"script": "somi-findings.sh",
|
|
258
|
+
"name": "normalize_title: leading/trailing whitespace — get (exposes key)",
|
|
259
|
+
"argv": [
|
|
260
|
+
"get",
|
|
261
|
+
"--slug",
|
|
262
|
+
"edge-ws",
|
|
263
|
+
"--id",
|
|
264
|
+
"F-1"
|
|
265
|
+
],
|
|
266
|
+
"exit": 0,
|
|
267
|
+
"stdout": "{\n \"id\": \"F-1\",\n \"key\": \"src/a.txt||missing rate limit\",\n \"locus\": {\n \"file\": \"src/a.txt\",\n \"symbol\": \"\"\n },\n \"title\": \" Missing rate limit \",\n \"severity\": \"Minor\",\n \"confidence\": \"Medium\",\n \"status\": \"open\",\n \"introduced_by\": \"r.md\",\n \"resolved_by\": null,\n \"seen\": [\n {\n \"review\": \"r.md\",\n \"run\": \"R1\",\n \"pass\": 1,\n \"date\": \"<DATE>\"\n }\n ]\n}",
|
|
268
|
+
"stderr": ""
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
"script": "somi-findings.sh",
|
|
272
|
+
"name": "normalize_title: multiple internal spaces — record",
|
|
273
|
+
"argv": [
|
|
274
|
+
"record",
|
|
275
|
+
"--slug",
|
|
276
|
+
"edge-multispace",
|
|
277
|
+
"--review",
|
|
278
|
+
"r.md",
|
|
279
|
+
"--run",
|
|
280
|
+
"R1",
|
|
281
|
+
"--pass",
|
|
282
|
+
"1"
|
|
283
|
+
],
|
|
284
|
+
"stdin": "[{\"file\":\"src/a.txt\",\"title\":\"Missing rate limit\"}]",
|
|
285
|
+
"exit": 0,
|
|
286
|
+
"stdout": "{\"id\":\"F-1\",\"state\":\"new\",\"recurring_consecutive\":false,\"recurring_cross_run\":false}",
|
|
287
|
+
"stderr": ""
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
"script": "somi-findings.sh",
|
|
291
|
+
"name": "normalize_title: multiple internal spaces — get (exposes key)",
|
|
292
|
+
"argv": [
|
|
293
|
+
"get",
|
|
294
|
+
"--slug",
|
|
295
|
+
"edge-multispace",
|
|
296
|
+
"--id",
|
|
297
|
+
"F-1"
|
|
298
|
+
],
|
|
299
|
+
"exit": 0,
|
|
300
|
+
"stdout": "{\n \"id\": \"F-1\",\n \"key\": \"src/a.txt||missing rate limit\",\n \"locus\": {\n \"file\": \"src/a.txt\",\n \"symbol\": \"\"\n },\n \"title\": \"Missing rate limit\",\n \"severity\": \"Minor\",\n \"confidence\": \"Medium\",\n \"status\": \"open\",\n \"introduced_by\": \"r.md\",\n \"resolved_by\": null,\n \"seen\": [\n {\n \"review\": \"r.md\",\n \"run\": \"R1\",\n \"pass\": 1,\n \"date\": \"<DATE>\"\n }\n ]\n}",
|
|
301
|
+
"stderr": ""
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
"script": "somi-findings.sh",
|
|
305
|
+
"name": "normalize_title: punctuation stripped — record",
|
|
306
|
+
"argv": [
|
|
307
|
+
"record",
|
|
308
|
+
"--slug",
|
|
309
|
+
"edge-punct",
|
|
310
|
+
"--review",
|
|
311
|
+
"r.md",
|
|
312
|
+
"--run",
|
|
313
|
+
"R1",
|
|
314
|
+
"--pass",
|
|
315
|
+
"1"
|
|
316
|
+
],
|
|
317
|
+
"stdin": "[{\"file\":\"src/a.txt\",\"title\":\"Missing rate-limit! (on retry) path?\"}]",
|
|
318
|
+
"exit": 0,
|
|
319
|
+
"stdout": "{\"id\":\"F-1\",\"state\":\"new\",\"recurring_consecutive\":false,\"recurring_cross_run\":false}",
|
|
320
|
+
"stderr": ""
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
"script": "somi-findings.sh",
|
|
324
|
+
"name": "normalize_title: punctuation stripped — get (exposes key)",
|
|
325
|
+
"argv": [
|
|
326
|
+
"get",
|
|
327
|
+
"--slug",
|
|
328
|
+
"edge-punct",
|
|
329
|
+
"--id",
|
|
330
|
+
"F-1"
|
|
331
|
+
],
|
|
332
|
+
"exit": 0,
|
|
333
|
+
"stdout": "{\n \"id\": \"F-1\",\n \"key\": \"src/a.txt||missing rate limit on retry path\",\n \"locus\": {\n \"file\": \"src/a.txt\",\n \"symbol\": \"\"\n },\n \"title\": \"Missing rate-limit! (on retry) path?\",\n \"severity\": \"Minor\",\n \"confidence\": \"Medium\",\n \"status\": \"open\",\n \"introduced_by\": \"r.md\",\n \"resolved_by\": null,\n \"seen\": [\n {\n \"review\": \"r.md\",\n \"run\": \"R1\",\n \"pass\": 1,\n \"date\": \"<DATE>\"\n }\n ]\n}",
|
|
334
|
+
"stderr": ""
|
|
335
|
+
}
|
|
336
|
+
]
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"script": "somi-loop.sh",
|
|
4
|
+
"name": "init: config-resolved caps",
|
|
5
|
+
"argv": [
|
|
6
|
+
"init",
|
|
7
|
+
"--slug",
|
|
8
|
+
"g",
|
|
9
|
+
"--loop",
|
|
10
|
+
"code",
|
|
11
|
+
"--iteration",
|
|
12
|
+
"1.1",
|
|
13
|
+
"--files",
|
|
14
|
+
"src/a.txt"
|
|
15
|
+
],
|
|
16
|
+
"exit": 0,
|
|
17
|
+
"stdout": "{\"baseline_sha\":\"<SHA>\",\"caps\":{\"max_passes\":2,\"diff_cap_lines\":10,\"severity_floor\":\"Major\"},\"state_file\":\"<DIR>/repo/.claude/somi-state/loop/g.1.1.json\"}",
|
|
18
|
+
"stderr": ""
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"script": "somi-loop.sh",
|
|
22
|
+
"name": "pass: 1st pass (1 of 2)",
|
|
23
|
+
"argv": [
|
|
24
|
+
"pass",
|
|
25
|
+
"--slug",
|
|
26
|
+
"g",
|
|
27
|
+
"--iteration",
|
|
28
|
+
"1.1"
|
|
29
|
+
],
|
|
30
|
+
"exit": 0,
|
|
31
|
+
"stdout": "{\"pass\":1,\"max_passes\":2}",
|
|
32
|
+
"stderr": ""
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"script": "somi-loop.sh",
|
|
36
|
+
"name": "pass: 2nd pass (2 of 2, at cap, allowed)",
|
|
37
|
+
"argv": [
|
|
38
|
+
"pass",
|
|
39
|
+
"--slug",
|
|
40
|
+
"g",
|
|
41
|
+
"--iteration",
|
|
42
|
+
"1.1"
|
|
43
|
+
],
|
|
44
|
+
"exit": 0,
|
|
45
|
+
"stdout": "{\"pass\":2,\"max_passes\":2}",
|
|
46
|
+
"stderr": ""
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"script": "somi-loop.sh",
|
|
50
|
+
"name": "pass: 3rd pass exceeds max_passes (exit 2)",
|
|
51
|
+
"argv": [
|
|
52
|
+
"pass",
|
|
53
|
+
"--slug",
|
|
54
|
+
"g",
|
|
55
|
+
"--iteration",
|
|
56
|
+
"1.1"
|
|
57
|
+
],
|
|
58
|
+
"exit": 2,
|
|
59
|
+
"stdout": "",
|
|
60
|
+
"stderr": "max-passes-exceeded: pass 3 > cap 2"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"script": "somi-loop.sh",
|
|
64
|
+
"name": "check-diff: in-scope only, under cap",
|
|
65
|
+
"argv": [
|
|
66
|
+
"check-diff",
|
|
67
|
+
"--slug",
|
|
68
|
+
"g",
|
|
69
|
+
"--iteration",
|
|
70
|
+
"1.1"
|
|
71
|
+
],
|
|
72
|
+
"exit": 0,
|
|
73
|
+
"stdout": "{\"diff_lines\":2,\"weighted_lines\":2,\"cap\":10,\"out_of_scope\":[]}",
|
|
74
|
+
"stderr": ""
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"script": "somi-loop.sh",
|
|
78
|
+
"name": "check-diff: out-of-scope doubled, exactly at cap",
|
|
79
|
+
"argv": [
|
|
80
|
+
"check-diff",
|
|
81
|
+
"--slug",
|
|
82
|
+
"g",
|
|
83
|
+
"--iteration",
|
|
84
|
+
"1.1"
|
|
85
|
+
],
|
|
86
|
+
"exit": 0,
|
|
87
|
+
"stdout": "{\"diff_lines\":6,\"weighted_lines\":10,\"cap\":10,\"out_of_scope\":[\"src/b.txt\"]}",
|
|
88
|
+
"stderr": ""
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"script": "somi-loop.sh",
|
|
92
|
+
"name": "check-diff: over weighted cap (exit 3)",
|
|
93
|
+
"argv": [
|
|
94
|
+
"check-diff",
|
|
95
|
+
"--slug",
|
|
96
|
+
"g",
|
|
97
|
+
"--iteration",
|
|
98
|
+
"1.1"
|
|
99
|
+
],
|
|
100
|
+
"exit": 3,
|
|
101
|
+
"stdout": "{\"diff_lines\":7,\"weighted_lines\":12,\"cap\":10,\"out_of_scope\":[\"src/b.txt\"]}",
|
|
102
|
+
"stderr": "diff-cap-exceeded: weighted 12 > cap 10 (out-of-scope counts double)"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"script": "somi-loop.sh",
|
|
106
|
+
"name": "record-pass: appends history entry",
|
|
107
|
+
"argv": [
|
|
108
|
+
"record-pass",
|
|
109
|
+
"--slug",
|
|
110
|
+
"g",
|
|
111
|
+
"--iteration",
|
|
112
|
+
"1.1",
|
|
113
|
+
"--verdict",
|
|
114
|
+
"request-changes",
|
|
115
|
+
"--blockers",
|
|
116
|
+
"0",
|
|
117
|
+
"--majors",
|
|
118
|
+
"2"
|
|
119
|
+
],
|
|
120
|
+
"exit": 0,
|
|
121
|
+
"stdout": "{\"pass\":2,\"verdict\":\"request-changes\",\"blockers\":0,\"majors\":2,\"diff_lines\":7,\"at\":\"<TS>\"}",
|
|
122
|
+
"stderr": ""
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"script": "somi-loop.sh",
|
|
126
|
+
"name": "resume: state with pass count and history",
|
|
127
|
+
"argv": [
|
|
128
|
+
"resume",
|
|
129
|
+
"--slug",
|
|
130
|
+
"g",
|
|
131
|
+
"--iteration",
|
|
132
|
+
"1.1"
|
|
133
|
+
],
|
|
134
|
+
"exit": 0,
|
|
135
|
+
"stdout": "{\"slug\":\"g\",\"loop\":\"code\",\"iteration\":\"1.1\",\"baseline_sha\":\"<SHA>\",\"started\":\"<TS>\",\"status\":\"running\",\"caps\":{\"max_passes\":2,\"diff_cap_lines\":10,\"severity_floor\":\"Major\"},\"iteration_files\":[\"src/a.txt\"],\"pass\":2,\"history\":[{\"pass\":2,\"verdict\":\"request-changes\",\"blockers\":0,\"majors\":2,\"diff_lines\":7,\"at\":\"<TS>\"}]}",
|
|
136
|
+
"stderr": ""
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"script": "somi-loop.sh",
|
|
140
|
+
"name": "finish: records terminal status",
|
|
141
|
+
"argv": [
|
|
142
|
+
"finish",
|
|
143
|
+
"--slug",
|
|
144
|
+
"g",
|
|
145
|
+
"--iteration",
|
|
146
|
+
"1.1",
|
|
147
|
+
"--status",
|
|
148
|
+
"stopped-diff-cap"
|
|
149
|
+
],
|
|
150
|
+
"exit": 0,
|
|
151
|
+
"stdout": "{\"status\":\"stopped-diff-cap\",\"pass\":2,\"history\":1}",
|
|
152
|
+
"stderr": ""
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"script": "somi-loop.sh",
|
|
156
|
+
"name": "stats: full state ledger",
|
|
157
|
+
"argv": [
|
|
158
|
+
"stats",
|
|
159
|
+
"--slug",
|
|
160
|
+
"g",
|
|
161
|
+
"--iteration",
|
|
162
|
+
"1.1"
|
|
163
|
+
],
|
|
164
|
+
"exit": 0,
|
|
165
|
+
"stdout": "{\n \"slug\": \"g\",\n \"loop\": \"code\",\n \"iteration\": \"1.1\",\n \"baseline_sha\": \"<SHA>\",\n \"started\": \"<TS>\",\n \"status\": \"stopped-diff-cap\",\n \"caps\": {\n \"max_passes\": 2,\n \"diff_cap_lines\": 10,\n \"severity_floor\": \"Major\"\n },\n \"iteration_files\": [\n \"src/a.txt\"\n ],\n \"pass\": 2,\n \"history\": [\n {\n \"pass\": 2,\n \"verdict\": \"request-changes\",\n \"blockers\": 0,\n \"majors\": 2,\n \"diff_lines\": 7,\n \"at\": \"<TS>\"\n }\n ],\n \"finished\": \"<TS>\"\n}",
|
|
166
|
+
"stderr": ""
|
|
167
|
+
}
|
|
168
|
+
]
|