@bbcsoftwarefactory/skills 0.0.0-stage → 0.1.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.
Files changed (100) hide show
  1. package/dist/index.json +42 -0
  2. package/dist/skills/code-quality-gate/SKILL.md +59 -0
  3. package/dist/skills/code-quality-gate/references/gate-bigo.md +31 -0
  4. package/dist/skills/code-quality-gate/references/gate-earlyreturn.md +73 -0
  5. package/dist/skills/code-quality-gate/references/gate-typesafe.md +32 -0
  6. package/dist/skills/code-quality-gate/references/output-schema.yml +40 -0
  7. package/dist/skills/code-quality-gate/scripts/extract-diff-scope.py +225 -0
  8. package/dist/skills/code-quality-gate/tests/extract-diff-scope.test.sh +200 -0
  9. package/dist/skills/delivery-coordinator/SKILL.md +81 -0
  10. package/dist/skills/delivery-coordinator/references/hud-output.md +55 -0
  11. package/dist/skills/delivery-coordinator/references/intake.md +86 -0
  12. package/dist/skills/delivery-coordinator/references/issue-claim.md +143 -0
  13. package/dist/skills/delivery-coordinator/references/issue-dedup.md +38 -0
  14. package/dist/skills/delivery-coordinator/references/sleuth-regression-exercise.md +60 -0
  15. package/dist/skills/delivery-coordinator/references/visual-reference.md +45 -0
  16. package/dist/skills/delivery-coordinator/references/worktree-isolation.md +19 -0
  17. package/dist/skills/delivery-coordinator/scripts/check-issue-claim.py +363 -0
  18. package/dist/skills/delivery-coordinator/scripts/check-worktree-guard.py +220 -0
  19. package/dist/skills/delivery-coordinator/scripts/classify-change-lane.py +263 -0
  20. package/dist/skills/delivery-coordinator/tests/check-issue-claim.test.sh +221 -0
  21. package/dist/skills/delivery-coordinator/tests/check-worktree-guard.test.sh +123 -0
  22. package/dist/skills/delivery-coordinator/tests/classify-change-lane.test.sh +124 -0
  23. package/dist/skills/documentation-steward/SKILL.md +43 -0
  24. package/dist/skills/documentation-steward/references/discovery.md +17 -0
  25. package/dist/skills/documentation-steward/references/handoff.md +15 -0
  26. package/dist/skills/greptile-review-loop/SKILL.md +57 -0
  27. package/dist/skills/greptile-review-loop/references/review-protocol.md +37 -0
  28. package/dist/skills/greptile-review-loop/scripts/review-loop.py +435 -0
  29. package/dist/skills/greptile-review-loop/tests/review-loop.test.sh +331 -0
  30. package/dist/skills/issue-reviewer/SKILL.md +87 -0
  31. package/dist/skills/issue-reviewer/references/review-format.md +100 -0
  32. package/dist/skills/issue-reviewer/references/triage.md +105 -0
  33. package/dist/skills/issue-reviewer/scripts/fetch-issue-attachments.py +239 -0
  34. package/dist/skills/issue-reviewer/scripts/plan-issue-triage.py +311 -0
  35. package/dist/skills/issue-reviewer/tests/fetch-issue-attachments.test.sh +90 -0
  36. package/dist/skills/issue-reviewer/tests/plan-issue-triage.test.sh +168 -0
  37. package/dist/skills/question-gate/SKILL.md +66 -0
  38. package/dist/skills/question-gate/references/client-hooks.md +111 -0
  39. package/dist/skills/question-gate/references/diagram-routing.md +58 -0
  40. package/dist/skills/question-gate/scripts/triage-question.py +713 -0
  41. package/dist/skills/question-gate/tests/fixtures/question-corpus.json +481 -0
  42. package/dist/skills/question-gate/tests/question-corpus.test.sh +32 -0
  43. package/dist/skills/question-gate/tests/triage-question.test.sh +441 -0
  44. package/dist/skills/regression-testing/SKILL.md +49 -0
  45. package/dist/skills/regression-testing/references/evidence-record.md +35 -0
  46. package/dist/skills/requirements-spec/SKILL.md +59 -0
  47. package/dist/skills/risk-scout/SKILL.md +53 -0
  48. package/dist/skills/risk-scout/references/risk-matrix.md +49 -0
  49. package/dist/skills/skill-clean-architecture/SKILL.md +54 -0
  50. package/dist/skills/skill-clean-architecture/references/layer-rules.md +22 -0
  51. package/dist/skills/skill-clean-architecture/references/source-headers.md +31 -0
  52. package/dist/skills/skill-clean-architecture/scripts/measure-bigo.py +427 -0
  53. package/dist/skills/skill-clean-architecture/tests/fixtures/bigo/bad-utf8.js +1 -0
  54. package/dist/skills/skill-clean-architecture/tests/fixtures/bigo/edge-crlf.ts +6 -0
  55. package/dist/skills/skill-clean-architecture/tests/fixtures/bigo/edge-mixed.ts +15 -0
  56. package/dist/skills/skill-clean-architecture/tests/fixtures/bigo/empty.js +0 -0
  57. package/dist/skills/skill-clean-architecture/tests/fixtures/bigo/no-newline.js +1 -0
  58. package/dist/skills/skill-clean-architecture/tests/fixtures/bigo.expected.yml +95 -0
  59. package/dist/skills/skill-clean-architecture/tests/measure-bigo.test.sh +222 -0
  60. package/dist/skills/tool-depot/SKILL.md +47 -0
  61. package/dist/skills/tool-depot/references/checkout.md +29 -0
  62. package/dist/skills/tool-depot/references/loki-read.md +41 -0
  63. package/dist/skills/tool-depot/references/readonly-access.md +84 -0
  64. package/dist/skills/tool-depot/references/tool-catalog.json +47 -0
  65. package/dist/skills/tool-depot/scripts/loki-runtime-logs.py +305 -0
  66. package/dist/skills/tool-depot/tests/loki-runtime-logs.test.sh +101 -0
  67. package/dist/skills/watcher-observability/SKILL.md +73 -0
  68. package/dist/skills/watcher-observability/references/batch-protocol.md +44 -0
  69. package/dist/skills/watcher-observability/references/configuration.md +31 -0
  70. package/dist/skills/watcher-observability/references/error-scan.md +102 -0
  71. package/dist/skills/watcher-observability/references/live-protocol.md +49 -0
  72. package/dist/skills/watcher-observability/references/server-account.md +72 -0
  73. package/dist/skills/watcher-observability/scripts/error-scan.py +318 -0
  74. package/dist/skills/watcher-observability/scripts/resolve-containers.py +155 -0
  75. package/dist/skills/watcher-observability/scripts/save-counts.py +381 -0
  76. package/dist/skills/watcher-observability/scripts/summarize-logs.py +113 -0
  77. package/dist/skills/watcher-observability/scripts/watch-live.py +606 -0
  78. package/dist/skills/watcher-observability/server/watcher-gate.sh +51 -0
  79. package/dist/skills/watcher-observability/tests/error-scan.test.sh +257 -0
  80. package/dist/skills/watcher-observability/tests/live-windows.test.sh +177 -0
  81. package/dist/skills/watcher-observability/tests/resolve-containers.test.sh +87 -0
  82. package/dist/skills/watcher-observability/tests/save-counts.test.sh +338 -0
  83. package/dist/skills/watcher-observability/tests/sleuth.test.sh +176 -0
  84. package/dist/skills/watcher-observability/tests/summarize-logs.test.sh +105 -0
  85. package/dist/skills/watcher-observability/tests/watcher-config.test.sh +70 -0
  86. package/dist/skills/watcher-observability/tests/watcher-gate.test.sh +110 -0
  87. package/dist/skills/watcher-observability/watcher.json +1 -0
  88. package/dist/skills/workflow-auditor/SKILL.md +55 -0
  89. package/dist/skills/workflow-auditor/references/audit-protocol.md +49 -0
  90. package/dist/skills/workflow-auditor/references/ledger.md +122 -0
  91. package/dist/skills/workflow-auditor/scripts/audit-ledger.py +624 -0
  92. package/dist/skills/workflow-auditor/scripts/list-zed-commands.py +183 -0
  93. package/dist/skills/workflow-auditor/scripts/render-workflow.py +201 -0
  94. package/dist/skills/workflow-auditor/scripts/validate-skills.py +444 -0
  95. package/dist/skills/workflow-auditor/tests/audit-ledger.test.sh +660 -0
  96. package/dist/skills/workflow-auditor/tests/list-zed-commands.test.sh +93 -0
  97. package/dist/skills/workflow-auditor/tests/render-workflow.test.sh +135 -0
  98. package/dist/skills/workflow-auditor/tests/validate-skills.test.sh +190 -0
  99. package/package.json +27 -6
  100. package/README.md +0 -3
@@ -0,0 +1,481 @@
1
+ {
2
+ "about": "Labelled agent drafts for triage-question.py (#54). Labels are the CORRECT routing per the workflow diagram, not what the classifier currently returns; misses are expected and tracked. tests/question-corpus.test.sh enforces MIN_ACCURACY as a ratchet: raise it when accuracy improves.",
3
+ "items": [
4
+ {
5
+ "text": "¿Corro las pruebas antes de seguir?",
6
+ "verdict": "block_question",
7
+ "owners": [],
8
+ "skills": [
9
+ "regression-testing"
10
+ ]
11
+ },
12
+ {
13
+ "text": "¿Ejecuto los tests ahora?",
14
+ "verdict": "block_question",
15
+ "owners": [],
16
+ "skills": [
17
+ "regression-testing"
18
+ ]
19
+ },
20
+ {
21
+ "text": "¿Prefieres probarlo primero en local?",
22
+ "verdict": "block_question",
23
+ "owners": [],
24
+ "skills": [
25
+ "regression-testing"
26
+ ]
27
+ },
28
+ {
29
+ "text": "¿Prefieres que lo pruebe primero?",
30
+ "verdict": "block_question",
31
+ "owners": [],
32
+ "skills": [
33
+ "regression-testing"
34
+ ]
35
+ },
36
+ {
37
+ "text": "¿Reproduzco el bug primero?",
38
+ "verdict": "block_question",
39
+ "owners": [],
40
+ "skills": [
41
+ "regression-testing"
42
+ ]
43
+ },
44
+ {
45
+ "text": "¿Verifico si funciona?",
46
+ "verdict": "block_question",
47
+ "owners": [],
48
+ "skills": [
49
+ "regression-testing"
50
+ ]
51
+ },
52
+ {
53
+ "text": "¿Hago un smoke test?",
54
+ "verdict": "block_question",
55
+ "owners": [],
56
+ "skills": [
57
+ "regression-testing"
58
+ ]
59
+ },
60
+ {
61
+ "text": "¿Lanzo el build para verificar?",
62
+ "verdict": "block_question",
63
+ "owners": [],
64
+ "skills": [
65
+ "regression-testing"
66
+ ]
67
+ },
68
+ {
69
+ "text": "¿Ejecuto la suite completa?",
70
+ "verdict": "block_question",
71
+ "owners": [],
72
+ "skills": [
73
+ "regression-testing"
74
+ ]
75
+ },
76
+ {
77
+ "text": "Should I run the tests first?",
78
+ "verdict": "block_question",
79
+ "owners": [],
80
+ "skills": [
81
+ "regression-testing"
82
+ ]
83
+ },
84
+ {
85
+ "text": "Should I verify locally?",
86
+ "verdict": "block_question",
87
+ "owners": [],
88
+ "skills": [
89
+ "regression-testing"
90
+ ]
91
+ },
92
+ {
93
+ "text": "Should I reproduce the bug?",
94
+ "verdict": "block_question",
95
+ "owners": [],
96
+ "skills": [
97
+ "regression-testing"
98
+ ]
99
+ },
100
+ {
101
+ "text": "Should I check if it works?",
102
+ "verdict": "block_question",
103
+ "owners": [],
104
+ "skills": [
105
+ "regression-testing"
106
+ ]
107
+ },
108
+ {
109
+ "text": "¿Paso el linter antes del commit?",
110
+ "verdict": "block_question",
111
+ "owners": [],
112
+ "skills": [
113
+ "code-quality-gate"
114
+ ]
115
+ },
116
+ {
117
+ "text": "¿Corro el typecheck?",
118
+ "verdict": "block_question",
119
+ "owners": [],
120
+ "skills": [
121
+ "code-quality-gate"
122
+ ]
123
+ },
124
+ {
125
+ "text": "¿Reviso la calidad del código?",
126
+ "verdict": "block_question",
127
+ "owners": [],
128
+ "skills": [
129
+ "code-quality-gate"
130
+ ]
131
+ },
132
+ {
133
+ "text": "Should I run eslint?",
134
+ "verdict": "block_question",
135
+ "owners": [],
136
+ "skills": [
137
+ "code-quality-gate"
138
+ ]
139
+ },
140
+ {
141
+ "text": "¿Reviso la documentación afectada?",
142
+ "verdict": "block_question",
143
+ "owners": [],
144
+ "skills": [
145
+ "documentation-steward"
146
+ ]
147
+ },
148
+ {
149
+ "text": "¿Actualizo el README?",
150
+ "verdict": "block_question",
151
+ "owners": [],
152
+ "skills": [
153
+ "documentation-steward"
154
+ ]
155
+ },
156
+ {
157
+ "text": "Do you want me to check the docs?",
158
+ "verdict": "block_question",
159
+ "owners": [],
160
+ "skills": [
161
+ "documentation-steward"
162
+ ]
163
+ },
164
+ {
165
+ "text": "Should I also update the wiki?",
166
+ "verdict": "block_question",
167
+ "owners": [],
168
+ "skills": [
169
+ "documentation-steward"
170
+ ]
171
+ },
172
+ {
173
+ "text": "¿Qué puede fallar con este cambio?",
174
+ "verdict": "block_question",
175
+ "owners": [],
176
+ "skills": [
177
+ "risk-scout"
178
+ ]
179
+ },
180
+ {
181
+ "text": "¿Revisamos el riesgo residual?",
182
+ "verdict": "block_question",
183
+ "owners": [],
184
+ "skills": [
185
+ "risk-scout"
186
+ ]
187
+ },
188
+ {
189
+ "text": "What could break here?",
190
+ "verdict": "block_question",
191
+ "owners": [],
192
+ "skills": [
193
+ "risk-scout"
194
+ ]
195
+ },
196
+ {
197
+ "text": "¿Reviso los comentarios de Greptile en el PR?",
198
+ "verdict": "block_question",
199
+ "owners": [],
200
+ "skills": [
201
+ "greptile-review-loop"
202
+ ]
203
+ },
204
+ {
205
+ "text": "Want me to check the Greptile comments?",
206
+ "verdict": "block_question",
207
+ "owners": [],
208
+ "skills": [
209
+ "greptile-review-loop"
210
+ ]
211
+ },
212
+ {
213
+ "text": "¿Quieres que vigile el PR #50 y atienda los comentarios de revisión?",
214
+ "verdict": "block_question",
215
+ "owners": [],
216
+ "skills": [
217
+ "greptile-review-loop"
218
+ ]
219
+ },
220
+ {
221
+ "text": "¿Audito si el ledger cumple el diagrama?",
222
+ "verdict": "block_question",
223
+ "owners": [],
224
+ "skills": [
225
+ "workflow-auditor"
226
+ ]
227
+ },
228
+ {
229
+ "text": "¿Reviso los logs del contenedor?",
230
+ "verdict": "block_question",
231
+ "owners": [],
232
+ "skills": [
233
+ "watcher-observability"
234
+ ]
235
+ },
236
+ {
237
+ "text": "Should I read the docker logs?",
238
+ "verdict": "block_question",
239
+ "owners": [],
240
+ "skills": [
241
+ "watcher-observability"
242
+ ]
243
+ },
244
+ {
245
+ "text": "¿Busco si hay issues duplicadas?",
246
+ "verdict": "block_question",
247
+ "owners": [],
248
+ "skills": [
249
+ "tool-depot"
250
+ ]
251
+ },
252
+ {
253
+ "text": "Should I check for duplicate issues?",
254
+ "verdict": "block_question",
255
+ "owners": [],
256
+ "skills": [
257
+ "tool-depot"
258
+ ]
259
+ },
260
+ {
261
+ "text": "¿Qué hacemos ahora?",
262
+ "verdict": "block_question",
263
+ "owners": [],
264
+ "skills": [
265
+ "delivery-coordinator"
266
+ ]
267
+ },
268
+ {
269
+ "text": "¿Cómo seguimos?",
270
+ "verdict": "block_question",
271
+ "owners": [],
272
+ "skills": [
273
+ "delivery-coordinator"
274
+ ]
275
+ },
276
+ {
277
+ "text": "What should we do next?",
278
+ "verdict": "block_question",
279
+ "owners": [],
280
+ "skills": [
281
+ "delivery-coordinator"
282
+ ]
283
+ },
284
+ {
285
+ "text": "¿Quieres que haga merge del PR #50?",
286
+ "verdict": "allow_question",
287
+ "owners": [
288
+ "Code Owner"
289
+ ],
290
+ "skills": []
291
+ },
292
+ {
293
+ "text": "Should I merge the PR?",
294
+ "verdict": "allow_question",
295
+ "owners": [
296
+ "Code Owner"
297
+ ],
298
+ "skills": []
299
+ },
300
+ {
301
+ "text": "¿Despliego a producción?",
302
+ "verdict": "allow_question",
303
+ "owners": [
304
+ "Release Owner"
305
+ ],
306
+ "skills": []
307
+ },
308
+ {
309
+ "text": "¿Quieres desplegar a producción ahora?",
310
+ "verdict": "allow_question",
311
+ "owners": [
312
+ "Release Owner"
313
+ ],
314
+ "skills": []
315
+ },
316
+ {
317
+ "text": "Should I deploy to production now?",
318
+ "verdict": "allow_question",
319
+ "owners": [
320
+ "Release Owner"
321
+ ],
322
+ "skills": []
323
+ },
324
+ {
325
+ "text": "¿Hago merge a main y despliego a producción?",
326
+ "verdict": "allow_question",
327
+ "owners": [
328
+ "Code Owner",
329
+ "Release Owner"
330
+ ],
331
+ "skills": []
332
+ },
333
+ {
334
+ "text": "¿Quieres que haga el commit?",
335
+ "verdict": "allow_question",
336
+ "owners": [
337
+ "Tech Lead / Commit & PR authorization"
338
+ ],
339
+ "skills": []
340
+ },
341
+ {
342
+ "text": "¿Quieres que cree el commit y abra el PR?",
343
+ "verdict": "allow_question",
344
+ "owners": [
345
+ "Tech Lead / Commit & PR authorization"
346
+ ],
347
+ "skills": []
348
+ },
349
+ {
350
+ "text": "¿Creo la issue?",
351
+ "verdict": "allow_question",
352
+ "owners": [
353
+ "Tech Lead / Commit & PR authorization"
354
+ ],
355
+ "skills": []
356
+ },
357
+ {
358
+ "text": "¿Abro el PR?",
359
+ "verdict": "allow_question",
360
+ "owners": [
361
+ "Tech Lead / Commit & PR authorization"
362
+ ],
363
+ "skills": []
364
+ },
365
+ {
366
+ "text": "¿Lo abro?",
367
+ "verdict": "allow_question",
368
+ "owners": [
369
+ "Tech Lead / Commit & PR authorization"
370
+ ],
371
+ "skills": []
372
+ },
373
+ {
374
+ "text": "Should I open the PR?",
375
+ "verdict": "allow_question",
376
+ "owners": [
377
+ "Tech Lead / Commit & PR authorization"
378
+ ],
379
+ "skills": []
380
+ },
381
+ {
382
+ "text": "Do you want me to publish the issue?",
383
+ "verdict": "allow_question",
384
+ "owners": [
385
+ "Tech Lead / Commit & PR authorization"
386
+ ],
387
+ "skills": []
388
+ },
389
+ {
390
+ "text": "Should I open a pull request and deploy?",
391
+ "verdict": "allow_question",
392
+ "owners": [
393
+ "Tech Lead / Commit & PR authorization",
394
+ "Release Owner"
395
+ ],
396
+ "skills": []
397
+ },
398
+ {
399
+ "text": "¿Hago la migración de las prioridades 1 y 2 con sus tests?",
400
+ "verdict": "allow_question",
401
+ "owners": [
402
+ "Tech Lead"
403
+ ],
404
+ "skills": []
405
+ },
406
+ {
407
+ "text": "¿Prefieres abrir el enlace en nueva pestaña o en la misma pestaña?",
408
+ "verdict": "allow_question",
409
+ "owners": [
410
+ "Product Manager"
411
+ ],
412
+ "skills": []
413
+ },
414
+ {
415
+ "text": "¿Cuál es el comportamiento esperado cuando el pago falla?",
416
+ "verdict": "allow_question",
417
+ "owners": [
418
+ "Product Manager"
419
+ ],
420
+ "skills": []
421
+ },
422
+ {
423
+ "text": "¿Hago merge del PR y reviso la documentación?",
424
+ "verdict": "block_question",
425
+ "owners": [
426
+ "Code Owner"
427
+ ],
428
+ "skills": [
429
+ "documentation-steward"
430
+ ]
431
+ },
432
+ {
433
+ "text": "🟡 BOSS GATE ─ Tech Lead\n❓ ¿Reescribo el módulo de pagos?\n👉 Recomendado: [A]\n⚡ Opciones\n[A] Sí\n[B] No",
434
+ "verdict": "allow_question",
435
+ "owners": [
436
+ "Tech Lead"
437
+ ],
438
+ "skills": []
439
+ },
440
+ {
441
+ "text": "🟡 BOSS GATE ─ Release Owner\n❓ ¿Lo publicamos hoy?\n👉 Recomendado: [A]\n⚡ Opciones\n[A] Sí\n[B] No",
442
+ "verdict": "allow_question",
443
+ "owners": [
444
+ "Release Owner"
445
+ ],
446
+ "skills": []
447
+ },
448
+ {
449
+ "text": "🟡 BOSS GATE ─ PM\n❓ ¿Mostramos el precio con impuestos?\n👉 Recomendado: [A]\n⚡ Opciones\n[A] Sí\n[B] No",
450
+ "verdict": "allow_question",
451
+ "owners": [
452
+ "Product Manager"
453
+ ],
454
+ "skills": []
455
+ },
456
+ {
457
+ "text": "🟡 BOSS GATE ─ Wizard\n❓ ¿Reescribo el módulo de pagos?\n👉 Recomendado: [A]\n⚡ Opciones\n[A] Sí\n[B] No",
458
+ "verdict": "block_question",
459
+ "owners": [],
460
+ "skills": []
461
+ },
462
+ {
463
+ "text": "¿Reescribo el módulo de pagos?",
464
+ "verdict": "block_question",
465
+ "owners": [],
466
+ "skills": []
467
+ },
468
+ {
469
+ "text": "Listo, los tests pasan.",
470
+ "verdict": "no_question",
471
+ "owners": [],
472
+ "skills": []
473
+ },
474
+ {
475
+ "text": "Hecho. PR #51 abierto y CI en verde.",
476
+ "verdict": "no_question",
477
+ "owners": [],
478
+ "skills": []
479
+ }
480
+ ]
481
+ }
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env bash
2
+ # Accuracy ratchet for triage-question.py over a labelled corpus of agent drafts (#54).
3
+ # Labels are the correct routing per the workflow diagram; misses are expected and
4
+ # listed. Raise MIN_ACCURACY when the classifier improves; never lower it.
5
+ set -eu
6
+ cd -- "${BASH_SOURCE[0]%/*}/.."
7
+ PYTHON_BIN=$(command -v python3 || command -v python)
8
+ MIN_ACCURACY=${MIN_ACCURACY_OVERRIDE:-0.96}
9
+ "$PYTHON_BIN" -I -B - "$MIN_ACCURACY" <<'PY'
10
+ import json, runpy, sys
11
+ from pathlib import Path
12
+
13
+ minimum = float(sys.argv[1])
14
+ evaluate = runpy.run_path('scripts/triage-question.py')['evaluate_text']
15
+ corpus = json.loads(Path('tests/fixtures/question-corpus.json').read_text(encoding='utf-8'))['items']
16
+ assert len(corpus) >= 50, f'corpus too small: {len(corpus)}'
17
+ hits, misses = 0, []
18
+ for item in corpus:
19
+ report = evaluate(item['text'])
20
+ got = (report['verdict'], sorted(g['role'] for g in report['human_gates']), sorted(report['resolved_by']))
21
+ want = (item['verdict'], sorted(item['owners']), sorted(item['skills']))
22
+ if got == want:
23
+ hits += 1
24
+ else:
25
+ misses.append(f' {item["text"].splitlines()[-6] if "BOSS GATE" in item["text"] else item["text"]!r}\n'
26
+ f' got {got}\n want {want}')
27
+ accuracy = hits / len(corpus)
28
+ print(f'question-corpus: {hits}/{len(corpus)} correct ({accuracy:.1%}); minimum {minimum:.0%}')
29
+ if misses:
30
+ print('misses (backlog for the classifier):\n' + '\n'.join(misses))
31
+ sys.exit(0 if accuracy >= minimum else 1)
32
+ PY