agent-quality-kit 0.10.0 → 0.11.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.
Files changed (66) hide show
  1. package/README.md +8 -3
  2. package/README.ru.md +8 -3
  3. package/kit/gates/_native.sh +4 -0
  4. package/kit/gates/_skip.sh +7 -0
  5. package/kit/gates/api-contract-has-arbiter/check.sh +7 -0
  6. package/kit/gates/color-from-token/check.sh +7 -0
  7. package/kit/gates/commit-explains-itself/check.sh +8 -2
  8. package/kit/gates/complexity-limit/check.sh +22 -4
  9. package/kit/gates/complexity-limit/gate.yml +2 -2
  10. package/kit/gates/complexity-limit/red/deep.js +15 -0
  11. package/kit/gates/duplicate-code/check.sh +7 -0
  12. package/kit/gates/duplicate-code/gate.yml +5 -1
  13. package/kit/gates/file-size-limit/check.sh +7 -0
  14. package/kit/gates/file-size-limit/red/big.js +600 -0
  15. package/kit/gates/gate-not-weakened/check.sh +7 -0
  16. package/kit/gates/gate-not-weakened/green/suppress.js +4 -0
  17. package/kit/gates/gate-not-weakened/red/suppress.js +5 -0
  18. package/kit/gates/mcp-server-resolves/check.sh +7 -0
  19. package/kit/gates/no-phantom-package/check.sh +7 -0
  20. package/kit/gates/no-print-in-prod/gate.yml +3 -3
  21. package/kit/gates/personal-config-not-shared/check.sh +7 -0
  22. package/kit/gates/protection-not-removed/check.sh +22 -13
  23. package/kit/gates/secrets-not-in-code/check.sh +7 -0
  24. package/kit/gates/secrets-not-in-code/green/config.js +4 -0
  25. package/kit/gates/secrets-not-in-code/red/leak.js +6 -0
  26. package/kit/gates/swallowed-error/gate.yml +3 -3
  27. package/kit/gates/test-has-assertion/check.sh +7 -0
  28. package/kit/gates/test-has-assertion/green/checkout.test.js +5 -0
  29. package/kit/gates/test-has-assertion/red/checkout.test.js +8 -0
  30. package/kit/gates/test-not-adjusted/check.sh +8 -2
  31. package/kit/gates/todo-without-task/check.sh +7 -0
  32. package/kit/gates/todo-without-task/gate.yml +2 -2
  33. package/kit/gates/todo-without-task/green/app.js +2 -0
  34. package/kit/gates/todo-without-task/red/later.js +4 -0
  35. package/llms.txt +4 -2
  36. package/package.json +1 -1
  37. package/tool/commands/badge.mjs +1 -1
  38. package/tool/commands/context.mjs +8 -0
  39. package/tool/commands/doctor.mjs +18 -148
  40. package/tool/commands/gates.mjs +2 -0
  41. package/tool/commands/probe.mjs +197 -41
  42. package/tool/commands/report.mjs +1 -1
  43. package/tool/i18n/en-docs.mjs +2 -0
  44. package/tool/i18n/en-gates.mjs +19 -5
  45. package/tool/i18n/en.mjs +3 -0
  46. package/tool/i18n/ru-docs.mjs +2 -0
  47. package/tool/i18n/ru-gates.mjs +20 -6
  48. package/tool/i18n/ru.mjs +3 -0
  49. package/tool/lib/evidence.mjs +15 -2
  50. package/tool/lib/execution.mjs +67 -0
  51. package/tool/lib/history.mjs +79 -8
  52. package/tool/lib/protection.mjs +52 -0
  53. package/tool/lib/prove.mjs +40 -13
  54. package/tool/lib/run.mjs +165 -0
  55. package/tool/selfcheck/gates.sh +32 -4
  56. package/tool/selfcheck/smoke/_fixture.mjs +24 -2
  57. package/tool/selfcheck/smoke/fail-closed.test.mjs +112 -0
  58. package/tool/selfcheck/smoke/own-samples.test.mjs +131 -0
  59. package/tool/selfcheck/smoke/protection.test.mjs +101 -0
  60. package/tool/selfcheck/smoke/release-tools.test.mjs +55 -0
  61. package/tool/selfcheck/smoke.sh +15 -1
  62. package/tool/selfcheck/units-context.mjs +24 -0
  63. package/tool/selfcheck/units-evidence.mjs +34 -0
  64. package/tool/selfcheck/units-execution.mjs +88 -0
  65. package/tool/selfcheck/units-level.mjs +32 -1
  66. package/tool/selfcheck/units-probe.mjs +282 -22
@@ -0,0 +1,600 @@
1
+ // Один файл на шестьсот строк: читать его целиком не будет ни человек, ни агент.
2
+ // Предел прод-кода — 500 строк; здесь их больше намеренно, но лишь настолько, чтобы
3
+ // перешагнуть предел. Первая версия была на 998 строк — вдвое больше нужного: образец
4
+ // обязан доказывать правило, а не весить.
5
+
6
+ export function step1(value) {
7
+ const shifted = value + 1;
8
+ return shifted;
9
+ }
10
+
11
+ export function step2(value) {
12
+ const shifted = value + 2;
13
+ return shifted;
14
+ }
15
+
16
+ export function step3(value) {
17
+ const shifted = value + 3;
18
+ return shifted;
19
+ }
20
+
21
+ export function step4(value) {
22
+ const shifted = value + 4;
23
+ return shifted;
24
+ }
25
+
26
+ export function step5(value) {
27
+ const shifted = value + 5;
28
+ return shifted;
29
+ }
30
+
31
+ export function step6(value) {
32
+ const shifted = value + 6;
33
+ return shifted;
34
+ }
35
+
36
+ export function step7(value) {
37
+ const shifted = value + 7;
38
+ return shifted;
39
+ }
40
+
41
+ export function step8(value) {
42
+ const shifted = value + 8;
43
+ return shifted;
44
+ }
45
+
46
+ export function step9(value) {
47
+ const shifted = value + 9;
48
+ return shifted;
49
+ }
50
+
51
+ export function step10(value) {
52
+ const shifted = value + 10;
53
+ return shifted;
54
+ }
55
+
56
+ export function step11(value) {
57
+ const shifted = value + 11;
58
+ return shifted;
59
+ }
60
+
61
+ export function step12(value) {
62
+ const shifted = value + 12;
63
+ return shifted;
64
+ }
65
+
66
+ export function step13(value) {
67
+ const shifted = value + 13;
68
+ return shifted;
69
+ }
70
+
71
+ export function step14(value) {
72
+ const shifted = value + 14;
73
+ return shifted;
74
+ }
75
+
76
+ export function step15(value) {
77
+ const shifted = value + 15;
78
+ return shifted;
79
+ }
80
+
81
+ export function step16(value) {
82
+ const shifted = value + 16;
83
+ return shifted;
84
+ }
85
+
86
+ export function step17(value) {
87
+ const shifted = value + 17;
88
+ return shifted;
89
+ }
90
+
91
+ export function step18(value) {
92
+ const shifted = value + 18;
93
+ return shifted;
94
+ }
95
+
96
+ export function step19(value) {
97
+ const shifted = value + 19;
98
+ return shifted;
99
+ }
100
+
101
+ export function step20(value) {
102
+ const shifted = value + 20;
103
+ return shifted;
104
+ }
105
+
106
+ export function step21(value) {
107
+ const shifted = value + 21;
108
+ return shifted;
109
+ }
110
+
111
+ export function step22(value) {
112
+ const shifted = value + 22;
113
+ return shifted;
114
+ }
115
+
116
+ export function step23(value) {
117
+ const shifted = value + 23;
118
+ return shifted;
119
+ }
120
+
121
+ export function step24(value) {
122
+ const shifted = value + 24;
123
+ return shifted;
124
+ }
125
+
126
+ export function step25(value) {
127
+ const shifted = value + 25;
128
+ return shifted;
129
+ }
130
+
131
+ export function step26(value) {
132
+ const shifted = value + 26;
133
+ return shifted;
134
+ }
135
+
136
+ export function step27(value) {
137
+ const shifted = value + 27;
138
+ return shifted;
139
+ }
140
+
141
+ export function step28(value) {
142
+ const shifted = value + 28;
143
+ return shifted;
144
+ }
145
+
146
+ export function step29(value) {
147
+ const shifted = value + 29;
148
+ return shifted;
149
+ }
150
+
151
+ export function step30(value) {
152
+ const shifted = value + 30;
153
+ return shifted;
154
+ }
155
+
156
+ export function step31(value) {
157
+ const shifted = value + 31;
158
+ return shifted;
159
+ }
160
+
161
+ export function step32(value) {
162
+ const shifted = value + 32;
163
+ return shifted;
164
+ }
165
+
166
+ export function step33(value) {
167
+ const shifted = value + 33;
168
+ return shifted;
169
+ }
170
+
171
+ export function step34(value) {
172
+ const shifted = value + 34;
173
+ return shifted;
174
+ }
175
+
176
+ export function step35(value) {
177
+ const shifted = value + 35;
178
+ return shifted;
179
+ }
180
+
181
+ export function step36(value) {
182
+ const shifted = value + 36;
183
+ return shifted;
184
+ }
185
+
186
+ export function step37(value) {
187
+ const shifted = value + 37;
188
+ return shifted;
189
+ }
190
+
191
+ export function step38(value) {
192
+ const shifted = value + 38;
193
+ return shifted;
194
+ }
195
+
196
+ export function step39(value) {
197
+ const shifted = value + 39;
198
+ return shifted;
199
+ }
200
+
201
+ export function step40(value) {
202
+ const shifted = value + 40;
203
+ return shifted;
204
+ }
205
+
206
+ export function step41(value) {
207
+ const shifted = value + 41;
208
+ return shifted;
209
+ }
210
+
211
+ export function step42(value) {
212
+ const shifted = value + 42;
213
+ return shifted;
214
+ }
215
+
216
+ export function step43(value) {
217
+ const shifted = value + 43;
218
+ return shifted;
219
+ }
220
+
221
+ export function step44(value) {
222
+ const shifted = value + 44;
223
+ return shifted;
224
+ }
225
+
226
+ export function step45(value) {
227
+ const shifted = value + 45;
228
+ return shifted;
229
+ }
230
+
231
+ export function step46(value) {
232
+ const shifted = value + 46;
233
+ return shifted;
234
+ }
235
+
236
+ export function step47(value) {
237
+ const shifted = value + 47;
238
+ return shifted;
239
+ }
240
+
241
+ export function step48(value) {
242
+ const shifted = value + 48;
243
+ return shifted;
244
+ }
245
+
246
+ export function step49(value) {
247
+ const shifted = value + 49;
248
+ return shifted;
249
+ }
250
+
251
+ export function step50(value) {
252
+ const shifted = value + 50;
253
+ return shifted;
254
+ }
255
+
256
+ export function step51(value) {
257
+ const shifted = value + 51;
258
+ return shifted;
259
+ }
260
+
261
+ export function step52(value) {
262
+ const shifted = value + 52;
263
+ return shifted;
264
+ }
265
+
266
+ export function step53(value) {
267
+ const shifted = value + 53;
268
+ return shifted;
269
+ }
270
+
271
+ export function step54(value) {
272
+ const shifted = value + 54;
273
+ return shifted;
274
+ }
275
+
276
+ export function step55(value) {
277
+ const shifted = value + 55;
278
+ return shifted;
279
+ }
280
+
281
+ export function step56(value) {
282
+ const shifted = value + 56;
283
+ return shifted;
284
+ }
285
+
286
+ export function step57(value) {
287
+ const shifted = value + 57;
288
+ return shifted;
289
+ }
290
+
291
+ export function step58(value) {
292
+ const shifted = value + 58;
293
+ return shifted;
294
+ }
295
+
296
+ export function step59(value) {
297
+ const shifted = value + 59;
298
+ return shifted;
299
+ }
300
+
301
+ export function step60(value) {
302
+ const shifted = value + 60;
303
+ return shifted;
304
+ }
305
+
306
+ export function step61(value) {
307
+ const shifted = value + 61;
308
+ return shifted;
309
+ }
310
+
311
+ export function step62(value) {
312
+ const shifted = value + 62;
313
+ return shifted;
314
+ }
315
+
316
+ export function step63(value) {
317
+ const shifted = value + 63;
318
+ return shifted;
319
+ }
320
+
321
+ export function step64(value) {
322
+ const shifted = value + 64;
323
+ return shifted;
324
+ }
325
+
326
+ export function step65(value) {
327
+ const shifted = value + 65;
328
+ return shifted;
329
+ }
330
+
331
+ export function step66(value) {
332
+ const shifted = value + 66;
333
+ return shifted;
334
+ }
335
+
336
+ export function step67(value) {
337
+ const shifted = value + 67;
338
+ return shifted;
339
+ }
340
+
341
+ export function step68(value) {
342
+ const shifted = value + 68;
343
+ return shifted;
344
+ }
345
+
346
+ export function step69(value) {
347
+ const shifted = value + 69;
348
+ return shifted;
349
+ }
350
+
351
+ export function step70(value) {
352
+ const shifted = value + 70;
353
+ return shifted;
354
+ }
355
+
356
+ export function step71(value) {
357
+ const shifted = value + 71;
358
+ return shifted;
359
+ }
360
+
361
+ export function step72(value) {
362
+ const shifted = value + 72;
363
+ return shifted;
364
+ }
365
+
366
+ export function step73(value) {
367
+ const shifted = value + 73;
368
+ return shifted;
369
+ }
370
+
371
+ export function step74(value) {
372
+ const shifted = value + 74;
373
+ return shifted;
374
+ }
375
+
376
+ export function step75(value) {
377
+ const shifted = value + 75;
378
+ return shifted;
379
+ }
380
+
381
+ export function step76(value) {
382
+ const shifted = value + 76;
383
+ return shifted;
384
+ }
385
+
386
+ export function step77(value) {
387
+ const shifted = value + 77;
388
+ return shifted;
389
+ }
390
+
391
+ export function step78(value) {
392
+ const shifted = value + 78;
393
+ return shifted;
394
+ }
395
+
396
+ export function step79(value) {
397
+ const shifted = value + 79;
398
+ return shifted;
399
+ }
400
+
401
+ export function step80(value) {
402
+ const shifted = value + 80;
403
+ return shifted;
404
+ }
405
+
406
+ export function step81(value) {
407
+ const shifted = value + 81;
408
+ return shifted;
409
+ }
410
+
411
+ export function step82(value) {
412
+ const shifted = value + 82;
413
+ return shifted;
414
+ }
415
+
416
+ export function step83(value) {
417
+ const shifted = value + 83;
418
+ return shifted;
419
+ }
420
+
421
+ export function step84(value) {
422
+ const shifted = value + 84;
423
+ return shifted;
424
+ }
425
+
426
+ export function step85(value) {
427
+ const shifted = value + 85;
428
+ return shifted;
429
+ }
430
+
431
+ export function step86(value) {
432
+ const shifted = value + 86;
433
+ return shifted;
434
+ }
435
+
436
+ export function step87(value) {
437
+ const shifted = value + 87;
438
+ return shifted;
439
+ }
440
+
441
+ export function step88(value) {
442
+ const shifted = value + 88;
443
+ return shifted;
444
+ }
445
+
446
+ export function step89(value) {
447
+ const shifted = value + 89;
448
+ return shifted;
449
+ }
450
+
451
+ export function step90(value) {
452
+ const shifted = value + 90;
453
+ return shifted;
454
+ }
455
+
456
+ export function step91(value) {
457
+ const shifted = value + 91;
458
+ return shifted;
459
+ }
460
+
461
+ export function step92(value) {
462
+ const shifted = value + 92;
463
+ return shifted;
464
+ }
465
+
466
+ export function step93(value) {
467
+ const shifted = value + 93;
468
+ return shifted;
469
+ }
470
+
471
+ export function step94(value) {
472
+ const shifted = value + 94;
473
+ return shifted;
474
+ }
475
+
476
+ export function step95(value) {
477
+ const shifted = value + 95;
478
+ return shifted;
479
+ }
480
+
481
+ export function step96(value) {
482
+ const shifted = value + 96;
483
+ return shifted;
484
+ }
485
+
486
+ export function step97(value) {
487
+ const shifted = value + 97;
488
+ return shifted;
489
+ }
490
+
491
+ export function step98(value) {
492
+ const shifted = value + 98;
493
+ return shifted;
494
+ }
495
+
496
+ export function step99(value) {
497
+ const shifted = value + 99;
498
+ return shifted;
499
+ }
500
+
501
+ export function step100(value) {
502
+ const shifted = value + 100;
503
+ return shifted;
504
+ }
505
+
506
+ export function step101(value) {
507
+ const shifted = value + 101;
508
+ return shifted;
509
+ }
510
+
511
+ export function step102(value) {
512
+ const shifted = value + 102;
513
+ return shifted;
514
+ }
515
+
516
+ export function step103(value) {
517
+ const shifted = value + 103;
518
+ return shifted;
519
+ }
520
+
521
+ export function step104(value) {
522
+ const shifted = value + 104;
523
+ return shifted;
524
+ }
525
+
526
+ export function step105(value) {
527
+ const shifted = value + 105;
528
+ return shifted;
529
+ }
530
+
531
+ export function step106(value) {
532
+ const shifted = value + 106;
533
+ return shifted;
534
+ }
535
+
536
+ export function step107(value) {
537
+ const shifted = value + 107;
538
+ return shifted;
539
+ }
540
+
541
+ export function step108(value) {
542
+ const shifted = value + 108;
543
+ return shifted;
544
+ }
545
+
546
+ export function step109(value) {
547
+ const shifted = value + 109;
548
+ return shifted;
549
+ }
550
+
551
+ export function step110(value) {
552
+ const shifted = value + 110;
553
+ return shifted;
554
+ }
555
+
556
+ export function step111(value) {
557
+ const shifted = value + 111;
558
+ return shifted;
559
+ }
560
+
561
+ export function step112(value) {
562
+ const shifted = value + 112;
563
+ return shifted;
564
+ }
565
+
566
+ export function step113(value) {
567
+ const shifted = value + 113;
568
+ return shifted;
569
+ }
570
+
571
+ export function step114(value) {
572
+ const shifted = value + 114;
573
+ return shifted;
574
+ }
575
+
576
+ export function step115(value) {
577
+ const shifted = value + 115;
578
+ return shifted;
579
+ }
580
+
581
+ export function step116(value) {
582
+ const shifted = value + 116;
583
+ return shifted;
584
+ }
585
+
586
+ export function step117(value) {
587
+ const shifted = value + 117;
588
+ return shifted;
589
+ }
590
+
591
+ export function step118(value) {
592
+ const shifted = value + 118;
593
+ return shifted;
594
+ }
595
+
596
+ export function step119(value) {
597
+ const shifted = value + 119;
598
+ return shifted;
599
+ }
600
+
@@ -24,6 +24,13 @@ if [ ! -f "$SKIP_LIB" ]; then
24
24
  exit 2
25
25
  fi
26
26
  . "$SKIP_LIB"
27
+ # Файл на месте — этого мало: подмена содержимого давала код 0. Метка стоит в КОНЦЕ _skip.sh,
28
+ # поэтому проверка ловит и обрыв файла на середине.
29
+ if [ "${AQK_SKIP_READY:-}" != 1 ]; then
30
+ echo "_skip.sh есть, но обход не собрался — проверка НЕ СОСТОЯЛАСЬ, а не прошла"
31
+ echo " почини: замени kit/gates/_skip.sh целым файлом из каталога"
32
+ exit 2
33
+ fi
27
34
 
28
35
  OUT=""
29
36
  add() { [ -z "$1" ] || OUT="$OUT$1
@@ -0,0 +1,4 @@
1
+ export function risky(cart) {
2
+ // eslint-disable-next-line no-console -- это программа командной строки, вывод и есть интерфейс
3
+ console.log(cart);
4
+ }
@@ -0,0 +1,5 @@
1
+ // Голое отключение гасит ВСЁ в файле: ни правила, ни причины у подавления нет.
2
+ /* eslint-disable */
3
+ export function risky() {
4
+ console.log("тишина куплена оптом");
5
+ }
@@ -24,6 +24,13 @@ if [ ! -f "$SKIP_LIB" ]; then
24
24
  exit 2
25
25
  fi
26
26
  . "$SKIP_LIB"
27
+ # Файл на месте — этого мало: подмена содержимого давала код 0. Метка стоит в КОНЦЕ _skip.sh,
28
+ # поэтому проверка ловит и обрыв файла на середине.
29
+ if [ "${AQK_SKIP_READY:-}" != 1 ]; then
30
+ echo "_skip.sh есть, но обход не собрался — проверка НЕ СОСТОЯЛАСЬ, а не прошла"
31
+ echo " почини: замени kit/gates/_skip.sh целым файлом из каталога"
32
+ exit 2
33
+ fi
27
34
 
28
35
  OUT=""
29
36
  for F in "$DIR/.mcp.json" "$DIR/.cursor/mcp.json" "$DIR/.vscode/mcp.json" "$DIR/.claude/mcp.json"; do
@@ -23,6 +23,13 @@ if [ ! -f "$SKIP_LIB" ]; then
23
23
  exit 2
24
24
  fi
25
25
  . "$SKIP_LIB"
26
+ # Файл на месте — этого мало: подмена содержимого давала код 0. Метка стоит в КОНЦЕ _skip.sh,
27
+ # поэтому проверка ловит и обрыв файла на середине.
28
+ if [ "${AQK_SKIP_READY:-}" != 1 ]; then
29
+ echo "_skip.sh есть, но обход не собрался — проверка НЕ СОСТОЯЛАСЬ, а не прошла"
30
+ echo " почини: замени kit/gates/_skip.sh целым файлом из каталога"
31
+ exit 2
32
+ fi
26
33
 
27
34
  # Даже когда файл на месте, нужных функций в нём может не оказаться: без них конвейер ниже не
28
35
  # напечатает ни одного пути, список окажется пуст, а пустой список — это `exit 0`. Гейт вышел бы
@@ -12,9 +12,9 @@ trigger:
12
12
  # Отличить их от отладки можно только разбором кода, а не поиском по тексту, — и это
13
13
  # ровно то, что уже делают ruff и eslint.
14
14
  recipes:
15
- python: ruff check --select T20 {dir}
16
- typescript: eslint --rule '{"no-console":"error"}' {dir}
17
- javascript: eslint --rule '{"no-console":"error"}' {dir}
15
+ python: ruff check -q --output-format=concise --select T20 {dir}
16
+ typescript: eslint --no-config-lookup --ignore-pattern 'gates/*/red/**' --ignore-pattern 'gates/*/green/**' --rule '{"no-console":"error"}' {dir}
17
+ javascript: eslint --no-config-lookup --ignore-pattern 'gates/*/red/**' --ignore-pattern 'gates/*/green/**' --rule '{"no-console":"error"}' {dir}
18
18
 
19
19
  # Каким рецептом написаны образцы: без переносимого рецепта проверка обязана знать это точно,
20
20
  # иначе питоновские образцы поедут проверяться фронтовым инструментом.
@@ -28,6 +28,13 @@ if [ ! -f "$SKIP_LIB" ]; then
28
28
  exit 2
29
29
  fi
30
30
  . "$SKIP_LIB"
31
+ # Файл на месте — этого мало: подмена содержимого давала код 0. Метка стоит в КОНЦЕ _skip.sh,
32
+ # поэтому проверка ловит и обрыв файла на середине.
33
+ if [ "${AQK_SKIP_READY:-}" != 1 ]; then
34
+ echo "_skip.sh есть, но обход не собрался — проверка НЕ СОСТОЯЛАСЬ, а не прошла"
35
+ echo " почини: замени kit/gates/_skip.sh целым файлом из каталога"
36
+ exit 2
37
+ fi
31
38
 
32
39
  # Образцы (gates.sh) читают список отслеживаемых файлов из `.aqk-tracked`: настоящего git внутри
33
40
  # каталога комплекта взять неоткуда, а вложенный .git создал бы embedded-репозиторий.