@krisada-m/ksd-intelligence 0.0.0-stage → 1.1.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 (119) hide show
  1. package/.antigravity-plugin/plugin.json +20 -0
  2. package/LICENSE +21 -0
  3. package/README.md +195 -2
  4. package/agy-skills/erosiano-review/SKILL.md +17 -0
  5. package/dist/adapters/agy/skills.js +252 -0
  6. package/dist/adapters/cli/check-changed.js +3 -0
  7. package/dist/adapters/cli/main.js +1013 -0
  8. package/dist/adapters/cli/policy-bin.js +10 -0
  9. package/dist/adapters/cli/review-verdict.js +3 -0
  10. package/dist/adapters/omp/extension.js +884 -0
  11. package/dist/adapters/omp/skills.js +130 -0
  12. package/dist/adapters/ui/hud.js +389 -0
  13. package/dist/adapters/ui/tree.js +471 -0
  14. package/dist/core/audit/index.js +2 -0
  15. package/dist/core/audit/log.js +505 -0
  16. package/dist/core/audit/summary.js +188 -0
  17. package/dist/core/changes/changes.js +591 -0
  18. package/dist/core/changes/git.js +266 -0
  19. package/dist/core/changes/plan.js +109 -0
  20. package/dist/core/changes/render.js +356 -0
  21. package/dist/core/engine/build.js +178 -0
  22. package/dist/core/engine/child.js +389 -0
  23. package/dist/core/engine/host.js +206 -0
  24. package/dist/core/engine/lock.js +133 -0
  25. package/dist/core/engine/protocol.js +43 -0
  26. package/dist/core/engine/runtime.js +44 -0
  27. package/dist/core/engine/status.js +452 -0
  28. package/dist/core/engine/typescript.js +194 -0
  29. package/dist/core/engine/workspace.js +72 -0
  30. package/dist/core/graph/graph.js +127 -0
  31. package/dist/core/graph/limits.js +16 -0
  32. package/dist/core/impact/query.js +1292 -0
  33. package/dist/core/impact/render.js +590 -0
  34. package/dist/core/impact/session.js +694 -0
  35. package/dist/core/indexing/declarations.js +455 -0
  36. package/dist/core/indexing/differential.js +345 -0
  37. package/dist/core/indexing/doctor.js +120 -0
  38. package/dist/core/indexing/indexer.js +811 -0
  39. package/dist/core/indexing/keys.js +451 -0
  40. package/dist/core/indexing/lexical.js +212 -0
  41. package/dist/core/indexing/packages.js +57 -0
  42. package/dist/core/indexing/program.js +171 -0
  43. package/dist/core/indexing/resolve.js +1004 -0
  44. package/dist/core/indexing/stamp.js +52 -0
  45. package/dist/core/indexing/surface.js +335 -0
  46. package/dist/core/indexing/ui-progress.js +37 -0
  47. package/dist/core/indexing/verify.js +76 -0
  48. package/dist/core/kernel/config.js +383 -0
  49. package/dist/core/kernel/glob.js +105 -0
  50. package/dist/core/kernel/guards.js +4 -0
  51. package/dist/core/kernel/types.js +3 -0
  52. package/dist/core/kernel/verdict.js +142 -0
  53. package/dist/core/knowledge/anchors.js +139 -0
  54. package/dist/core/knowledge/knowledge.js +95 -0
  55. package/dist/core/knowledge/learning.js +102 -0
  56. package/dist/core/knowledge/render.js +76 -0
  57. package/dist/core/knowledge/store.js +109 -0
  58. package/dist/core/knowledge/yaml.js +87 -0
  59. package/dist/core/search/lexical.js +382 -0
  60. package/dist/core/search/render.js +98 -0
  61. package/dist/core/search/segments.js +118 -0
  62. package/dist/core/verify/parse.js +127 -0
  63. package/dist/core/verify/render.js +67 -0
  64. package/dist/core/verify/report.js +40 -0
  65. package/dist/core/verify/revision.js +79 -0
  66. package/dist/core/verify/run.js +117 -0
  67. package/dist/core/verify/store.js +66 -0
  68. package/dist/core/verify/verify.js +173 -0
  69. package/dist/core/workspace/init.js +267 -0
  70. package/dist/core/workspace/probe.js +56 -0
  71. package/dist/core/workspace/scan.js +420 -0
  72. package/dist/engineering/baseline.js +337 -0
  73. package/dist/engineering/change-scope.js +500 -0
  74. package/dist/engineering/check-changed.js +40 -0
  75. package/dist/engineering/config.js +129 -0
  76. package/dist/engineering/dist/policy.d.ts +17 -0
  77. package/dist/engineering/dist/policy.js +150 -0
  78. package/dist/engineering/dist/runtime.d.ts +40 -0
  79. package/dist/engineering/dist/runtime.js +77 -0
  80. package/dist/engineering/dist/sdlc.d.ts +7 -0
  81. package/dist/engineering/dist/sdlc.js +27 -0
  82. package/dist/engineering/eslint-rules/index.js +107 -0
  83. package/dist/engineering/index.d.ts +7 -0
  84. package/dist/engineering/index.js +319 -0
  85. package/dist/engineering/intelligence.js +44 -0
  86. package/dist/engineering/package.json +36 -0
  87. package/dist/engineering/policy.js +2 -0
  88. package/dist/engineering/practice-tool.js +72 -0
  89. package/dist/engineering/practices.js +283 -0
  90. package/dist/engineering/practices.json +2453 -0
  91. package/dist/engineering/review-verdict.js +262 -0
  92. package/dist/engineering/sdlc.js +2 -0
  93. package/dist/index.js +20 -0
  94. package/dist/storage/records.js +245 -0
  95. package/dist/storage/sqlite.js +314 -0
  96. package/dist/workflow/catalog.js +69 -0
  97. package/dist/workflow/classify.js +55 -0
  98. package/dist/workflow/loader.js +140 -0
  99. package/dist/workflow/packs.js +469 -0
  100. package/dist/workflow/registry.js +359 -0
  101. package/dist/workflow/render.js +61 -0
  102. package/dist/workflow/router.js +141 -0
  103. package/dist/workflow/sources.js +229 -0
  104. package/dist/workflow/types.js +44 -0
  105. package/dist/workflow/updates.js +532 -0
  106. package/engineering.lock.json +94 -0
  107. package/package.json +81 -4
  108. package/rules/engineering.md +20 -0
  109. package/scripts/agy-mcp.mjs +27 -0
  110. package/scripts/mcp/engineering.mjs +91 -0
  111. package/scripts/mcp/stdio.mjs +304 -0
  112. package/scripts/mcp/tools.mjs +491 -0
  113. package/skills/ksd-intelligence/SKILL.md +54 -0
  114. package/skills/matt-sdlc/SKILL.md +42 -0
  115. package/skills/osmani-quality/SKILL.md +38 -0
  116. package/skills/poteto-mode/SKILL.md +40 -0
  117. package/skills/pstack-analysis/SKILL.md +36 -0
  118. package/skills.lock.json +71 -0
  119. package/skills.registry.json +181 -0
@@ -0,0 +1,2453 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "sourceCommit": "6b50161b38cdfcd2406e616eec8b867628b817e6",
4
+ "facets": [
5
+ "api",
6
+ "architecture",
7
+ "async",
8
+ "auth",
9
+ "backend",
10
+ "baseline",
11
+ "code",
12
+ "concurrency",
13
+ "contract",
14
+ "critical",
15
+ "database",
16
+ "destructive",
17
+ "error",
18
+ "frontend",
19
+ "io",
20
+ "logging",
21
+ "migration",
22
+ "module",
23
+ "money",
24
+ "payments",
25
+ "performance",
26
+ "react",
27
+ "regression",
28
+ "resource",
29
+ "review",
30
+ "runtime",
31
+ "secrets",
32
+ "security",
33
+ "state",
34
+ "testing",
35
+ "time",
36
+ "typescript"
37
+ ],
38
+ "practices": [
39
+ {
40
+ "id": "BL01",
41
+ "version": 1,
42
+ "group": "baseline",
43
+ "title": "Observe before prescribing",
44
+ "intent": "Read applicable evidence before imposing changes.",
45
+ "allOf": [],
46
+ "anyOf": [
47
+ "baseline",
48
+ "code",
49
+ "review"
50
+ ],
51
+ "mechanisms": [
52
+ "guidance"
53
+ ],
54
+ "defaultLevel": "PREFERRED",
55
+ "safetyInvariant": false
56
+ },
57
+ {
58
+ "id": "BL02",
59
+ "version": 1,
60
+ "group": "baseline",
61
+ "title": "Local over generic",
62
+ "intent": "Respect established subsystem conventions.",
63
+ "allOf": [],
64
+ "anyOf": [
65
+ "baseline",
66
+ "code",
67
+ "review"
68
+ ],
69
+ "mechanisms": [
70
+ "guidance"
71
+ ],
72
+ "defaultLevel": "PREFERRED",
73
+ "safetyInvariant": false
74
+ },
75
+ {
76
+ "id": "BL03",
77
+ "version": 1,
78
+ "group": "baseline",
79
+ "title": "Current over historical majority",
80
+ "intent": "Do not propagate obsolete patterns.",
81
+ "allOf": [],
82
+ "anyOf": [
83
+ "baseline",
84
+ "code",
85
+ "review"
86
+ ],
87
+ "mechanisms": [
88
+ "guidance"
89
+ ],
90
+ "defaultLevel": "PREFERRED",
91
+ "safetyInvariant": false
92
+ },
93
+ {
94
+ "id": "BL04",
95
+ "version": 1,
96
+ "group": "baseline",
97
+ "title": "Evidence over assumption",
98
+ "intent": "Cite observations and confidence.",
99
+ "allOf": [],
100
+ "anyOf": [
101
+ "baseline",
102
+ "code",
103
+ "review"
104
+ ],
105
+ "mechanisms": [
106
+ "guidance"
107
+ ],
108
+ "defaultLevel": "PREFERRED",
109
+ "safetyInvariant": false
110
+ },
111
+ {
112
+ "id": "BL05",
113
+ "version": 1,
114
+ "group": "baseline",
115
+ "title": "No architectural drift",
116
+ "intent": "Preserve boundaries and existing dependency direction.",
117
+ "allOf": [],
118
+ "anyOf": [
119
+ "baseline",
120
+ "code",
121
+ "review"
122
+ ],
123
+ "mechanisms": [
124
+ "guidance"
125
+ ],
126
+ "defaultLevel": "PREFERRED",
127
+ "safetyInvariant": false
128
+ },
129
+ {
130
+ "id": "BL06",
131
+ "version": 1,
132
+ "group": "baseline",
133
+ "title": "No unsolicited modernization",
134
+ "intent": "Avoid broad unrelated migrations.",
135
+ "allOf": [],
136
+ "anyOf": [
137
+ "baseline",
138
+ "code",
139
+ "review"
140
+ ],
141
+ "mechanisms": [
142
+ "guidance"
143
+ ],
144
+ "defaultLevel": "PREFERRED",
145
+ "safetyInvariant": false
146
+ },
147
+ {
148
+ "id": "BL07",
149
+ "version": 1,
150
+ "group": "baseline",
151
+ "title": "Preserve subsystem boundaries",
152
+ "intent": "Resolve per workspace/package/module/feature.",
153
+ "allOf": [],
154
+ "anyOf": [
155
+ "baseline",
156
+ "code",
157
+ "review"
158
+ ],
159
+ "mechanisms": [
160
+ "guidance"
161
+ ],
162
+ "defaultLevel": "PREFERRED",
163
+ "safetyInvariant": false
164
+ },
165
+ {
166
+ "id": "BL08",
167
+ "version": 1,
168
+ "group": "baseline",
169
+ "title": "Detect migration direction",
170
+ "intent": "Classify mixed patterns and confirm direction.",
171
+ "allOf": [],
172
+ "anyOf": [
173
+ "baseline",
174
+ "code",
175
+ "review"
176
+ ],
177
+ "mechanisms": [
178
+ "guidance"
179
+ ],
180
+ "defaultLevel": "PREFERRED",
181
+ "safetyInvariant": false
182
+ },
183
+ {
184
+ "id": "BL09",
185
+ "version": 1,
186
+ "group": "baseline",
187
+ "title": "Freshness validation",
188
+ "intent": "Check relevant fingerprints before reuse.",
189
+ "allOf": [],
190
+ "anyOf": [
191
+ "baseline"
192
+ ],
193
+ "mechanisms": [
194
+ "guidance"
195
+ ],
196
+ "defaultLevel": "PREFERRED",
197
+ "safetyInvariant": false
198
+ },
199
+ {
200
+ "id": "BL10",
201
+ "version": 1,
202
+ "group": "baseline",
203
+ "title": "Confidence-aware enforcement",
204
+ "intent": "Unknown heuristics are not blocking facts.",
205
+ "allOf": [],
206
+ "anyOf": [
207
+ "baseline",
208
+ "code",
209
+ "review"
210
+ ],
211
+ "mechanisms": [
212
+ "guidance"
213
+ ],
214
+ "defaultLevel": "PREFERRED",
215
+ "safetyInvariant": false
216
+ },
217
+ {
218
+ "id": "BL11",
219
+ "version": 1,
220
+ "group": "baseline",
221
+ "title": "Discover once, reuse when valid",
222
+ "intent": "Keep discovery scoped and bounded.",
223
+ "allOf": [],
224
+ "anyOf": [
225
+ "baseline"
226
+ ],
227
+ "mechanisms": [
228
+ "guidance"
229
+ ],
230
+ "defaultLevel": "PREFERRED",
231
+ "safetyInvariant": false
232
+ },
233
+ {
234
+ "id": "BL12",
235
+ "version": 1,
236
+ "group": "baseline",
237
+ "title": "Refresh when evidence changes",
238
+ "intent": "Invalidate stale or incomplete results.",
239
+ "allOf": [],
240
+ "anyOf": [
241
+ "baseline"
242
+ ],
243
+ "mechanisms": [
244
+ "guidance"
245
+ ],
246
+ "defaultLevel": "PREFERRED",
247
+ "safetyInvariant": false
248
+ },
249
+ {
250
+ "id": "BL13",
251
+ "version": 1,
252
+ "group": "baseline",
253
+ "title": "Never normalize insecure legacy",
254
+ "intent": "Escalate harmful patterns; preserve safe contracts.",
255
+ "allOf": [],
256
+ "anyOf": [
257
+ "baseline",
258
+ "code",
259
+ "review"
260
+ ],
261
+ "mechanisms": [
262
+ "guidance"
263
+ ],
264
+ "defaultLevel": "REQUIRED",
265
+ "safetyInvariant": true
266
+ },
267
+ {
268
+ "id": "BL14",
269
+ "version": 1,
270
+ "group": "baseline",
271
+ "title": "Risk-scaled discovery",
272
+ "intent": "L0-L3 based on impact and uncertainty.",
273
+ "allOf": [],
274
+ "anyOf": [
275
+ "baseline",
276
+ "code",
277
+ "review"
278
+ ],
279
+ "mechanisms": [
280
+ "guidance"
281
+ ],
282
+ "defaultLevel": "PREFERRED",
283
+ "safetyInvariant": false
284
+ },
285
+ {
286
+ "id": "BL15",
287
+ "version": 1,
288
+ "group": "baseline",
289
+ "title": "Repository-native gates",
290
+ "intent": "Discover and honor actual applicable commands.",
291
+ "allOf": [],
292
+ "anyOf": [
293
+ "baseline",
294
+ "code",
295
+ "review"
296
+ ],
297
+ "mechanisms": [
298
+ "guidance"
299
+ ],
300
+ "defaultLevel": "PREFERRED",
301
+ "safetyInvariant": false
302
+ },
303
+ {
304
+ "id": "S01",
305
+ "version": 2,
306
+ "group": "style",
307
+ "title": "Guard clauses, flat flow, early exits",
308
+ "intent": "Prefer guard clauses and early returns where behavior is preserved. Balanced nesting findings are advisory; adaptive avoidable nesting is fix-required in changed-scope review only when a behavior-preserving transformation is established. Warn on uncertain or behavior-sensitive cases.",
309
+ "allOf": [],
310
+ "anyOf": [
311
+ "code",
312
+ "review"
313
+ ],
314
+ "mechanisms": [
315
+ "guidance",
316
+ "optional-native-gate"
317
+ ],
318
+ "defaultLevel": "PREFERRED",
319
+ "safetyInvariant": false
320
+ },
321
+ {
322
+ "id": "S02",
323
+ "version": 1,
324
+ "group": "style",
325
+ "title": "No nested ternaries",
326
+ "intent": "use clear conditional, small named function or map.",
327
+ "allOf": [],
328
+ "anyOf": [
329
+ "code",
330
+ "review"
331
+ ],
332
+ "mechanisms": [
333
+ "guidance",
334
+ "optional-native-gate"
335
+ ],
336
+ "defaultLevel": "PREFERRED",
337
+ "safetyInvariant": false
338
+ },
339
+ {
340
+ "id": "S03",
341
+ "version": 1,
342
+ "group": "style",
343
+ "title": "Blank before return",
344
+ "intent": "exactly one when two or more preceding statements in same block, optional after one, none before first-statement return; never multiple.",
345
+ "allOf": [],
346
+ "anyOf": [
347
+ "code",
348
+ "review"
349
+ ],
350
+ "mechanisms": [
351
+ "optional-native-gate"
352
+ ],
353
+ "defaultLevel": "PREFERRED",
354
+ "safetyInvariant": false
355
+ },
356
+ {
357
+ "id": "S04",
358
+ "version": 1,
359
+ "group": "style",
360
+ "title": "Blank between function implementations",
361
+ "intent": "exactly one, including adjacent arrow function definitions; preserve TS overload groups and existing comment handling.",
362
+ "allOf": [],
363
+ "anyOf": [
364
+ "code",
365
+ "review"
366
+ ],
367
+ "mechanisms": [
368
+ "optional-native-gate"
369
+ ],
370
+ "defaultLevel": "PREFERRED",
371
+ "safetyInvariant": false
372
+ },
373
+ {
374
+ "id": "S05",
375
+ "version": 2,
376
+ "group": "style",
377
+ "title": "Typed Result vs exception boundary",
378
+ "intent": "Prefer discriminated domain results and thrown IO failures caught at the appropriate boundary. Preserve established project error contracts and never weaken error handling.",
379
+ "allOf": [],
380
+ "anyOf": [
381
+ "error",
382
+ "io",
383
+ "backend"
384
+ ],
385
+ "mechanisms": [
386
+ "guidance",
387
+ "review"
388
+ ],
389
+ "defaultLevel": "PREFERRED",
390
+ "safetyInvariant": false
391
+ },
392
+ {
393
+ "id": "S06",
394
+ "version": 1,
395
+ "group": "style",
396
+ "title": "Strict typing",
397
+ "intent": "avoid explicit any, unsafe assertions and non-null assertion; as const allowed; narrow values and declare exported return types when baseline requires.",
398
+ "allOf": [],
399
+ "anyOf": [
400
+ "typescript"
401
+ ],
402
+ "mechanisms": [
403
+ "guidance",
404
+ "optional-native-gate"
405
+ ],
406
+ "defaultLevel": "PREFERRED",
407
+ "safetyInvariant": false
408
+ },
409
+ {
410
+ "id": "S07",
411
+ "version": 1,
412
+ "group": "style",
413
+ "title": "Meaningful helper extraction",
414
+ "intent": "reuse or improve caller clarity, not arbitrary length.",
415
+ "allOf": [],
416
+ "anyOf": [
417
+ "code",
418
+ "review"
419
+ ],
420
+ "mechanisms": [
421
+ "guidance"
422
+ ],
423
+ "defaultLevel": "PREFERRED",
424
+ "safetyInvariant": false
425
+ },
426
+ {
427
+ "id": "S08",
428
+ "version": 1,
429
+ "group": "style",
430
+ "title": "Why-only comments",
431
+ "intent": "explain intent/invariants, not restate code; allow necessary multi-line docs, contracts and legal notices.",
432
+ "allOf": [],
433
+ "anyOf": [
434
+ "code",
435
+ "review"
436
+ ],
437
+ "mechanisms": [
438
+ "guidance"
439
+ ],
440
+ "defaultLevel": "PREFERRED",
441
+ "safetyInvariant": false
442
+ },
443
+ {
444
+ "id": "S09",
445
+ "version": 1,
446
+ "group": "style",
447
+ "title": "Preserve architecture, contracts, validation and accessibility",
448
+ "intent": "no unrelated churn.",
449
+ "allOf": [],
450
+ "anyOf": [
451
+ "code",
452
+ "review"
453
+ ],
454
+ "mechanisms": [
455
+ "review"
456
+ ],
457
+ "defaultLevel": "REQUIRED",
458
+ "safetyInvariant": true
459
+ },
460
+ {
461
+ "id": "S10",
462
+ "version": 2,
463
+ "group": "style",
464
+ "title": "Evidence and risky-behavior escalation",
465
+ "intent": "Never claim unexecuted checks pass. Escalate authentication, authorization, payment, data, secret, concurrency and destructive behavior to applicable security and verification rules.",
466
+ "allOf": [],
467
+ "anyOf": [
468
+ "review",
469
+ "code"
470
+ ],
471
+ "mechanisms": [
472
+ "review"
473
+ ],
474
+ "defaultLevel": "REQUIRED",
475
+ "safetyInvariant": true
476
+ },
477
+ {
478
+ "id": "C01",
479
+ "version": 1,
480
+ "group": "readability",
481
+ "title": "Top-down reading",
482
+ "intent": "make the main flow easy to find and follow.",
483
+ "allOf": [],
484
+ "anyOf": [
485
+ "code",
486
+ "review"
487
+ ],
488
+ "mechanisms": [
489
+ "guidance"
490
+ ],
491
+ "defaultLevel": "PREFERRED",
492
+ "safetyInvariant": false
493
+ },
494
+ {
495
+ "id": "C02",
496
+ "version": 1,
497
+ "group": "readability",
498
+ "title": "Happy path clarity",
499
+ "intent": "handle failure cases early where safe.",
500
+ "allOf": [],
501
+ "anyOf": [
502
+ "code",
503
+ "review"
504
+ ],
505
+ "mechanisms": [
506
+ "guidance"
507
+ ],
508
+ "defaultLevel": "PREFERRED",
509
+ "safetyInvariant": false
510
+ },
511
+ {
512
+ "id": "C03",
513
+ "version": 1,
514
+ "group": "readability",
515
+ "title": "Minimize variable scope",
516
+ "intent": "declare close to use.",
517
+ "allOf": [],
518
+ "anyOf": [
519
+ "code",
520
+ "review"
521
+ ],
522
+ "mechanisms": [
523
+ "guidance"
524
+ ],
525
+ "defaultLevel": "PREFERRED",
526
+ "safetyInvariant": false
527
+ },
528
+ {
529
+ "id": "C04",
530
+ "version": 1,
531
+ "group": "readability",
532
+ "title": "No variable shadowing",
533
+ "intent": "avoid confusing name reuse; use correct language-aware rule.",
534
+ "allOf": [],
535
+ "anyOf": [
536
+ "code",
537
+ "review"
538
+ ],
539
+ "mechanisms": [
540
+ "optional-native-gate"
541
+ ],
542
+ "defaultLevel": "PREFERRED",
543
+ "safetyInvariant": false
544
+ },
545
+ {
546
+ "id": "C05",
547
+ "version": 1,
548
+ "group": "readability",
549
+ "title": "Avoid ambiguous boolean parameters",
550
+ "intent": "named options or enum when positional flags obscure intent.",
551
+ "allOf": [],
552
+ "anyOf": [
553
+ "code",
554
+ "review"
555
+ ],
556
+ "mechanisms": [
557
+ "guidance"
558
+ ],
559
+ "defaultLevel": "PREFERRED",
560
+ "safetyInvariant": false
561
+ },
562
+ {
563
+ "id": "C06",
564
+ "version": 1,
565
+ "group": "readability",
566
+ "title": "No hidden temporal coupling",
567
+ "intent": "make call ordering/lifecycle requirements explicit.",
568
+ "allOf": [],
569
+ "anyOf": [
570
+ "state",
571
+ "resource",
572
+ "api"
573
+ ],
574
+ "mechanisms": [
575
+ "guidance",
576
+ "review"
577
+ ],
578
+ "defaultLevel": "REQUIRED",
579
+ "safetyInvariant": false
580
+ },
581
+ {
582
+ "id": "C07",
583
+ "version": 1,
584
+ "group": "readability",
585
+ "title": "Locality of behavior",
586
+ "intent": "colocate feature-owned logic, types, hooks and helpers when appropriate.",
587
+ "allOf": [],
588
+ "anyOf": [
589
+ "code",
590
+ "review"
591
+ ],
592
+ "mechanisms": [
593
+ "guidance"
594
+ ],
595
+ "defaultLevel": "PREFERRED",
596
+ "safetyInvariant": false
597
+ },
598
+ {
599
+ "id": "C08",
600
+ "version": 1,
601
+ "group": "readability",
602
+ "title": "Prefer composition",
603
+ "intent": "use composition over unnecessary inheritance.",
604
+ "allOf": [],
605
+ "anyOf": [
606
+ "code",
607
+ "review"
608
+ ],
609
+ "mechanisms": [
610
+ "guidance"
611
+ ],
612
+ "defaultLevel": "PREFERRED",
613
+ "safetyInvariant": false
614
+ },
615
+ {
616
+ "id": "C09",
617
+ "version": 1,
618
+ "group": "readability",
619
+ "title": "Consistent vocabulary",
620
+ "intent": "use the domain's established terms.",
621
+ "allOf": [],
622
+ "anyOf": [
623
+ "code",
624
+ "review"
625
+ ],
626
+ "mechanisms": [
627
+ "guidance"
628
+ ],
629
+ "defaultLevel": "PREFERRED",
630
+ "safetyInvariant": false
631
+ },
632
+ {
633
+ "id": "C10",
634
+ "version": 1,
635
+ "group": "readability",
636
+ "title": "No dead code",
637
+ "intent": "remove unused code in changed scope; do not remove dynamic consumers blindly.",
638
+ "allOf": [],
639
+ "anyOf": [
640
+ "code",
641
+ "review"
642
+ ],
643
+ "mechanisms": [
644
+ "optional-native-gate",
645
+ "guidance"
646
+ ],
647
+ "defaultLevel": "PREFERRED",
648
+ "safetyInvariant": false
649
+ },
650
+ {
651
+ "id": "C11",
652
+ "version": 1,
653
+ "group": "readability",
654
+ "title": "Intent-revealing naming",
655
+ "intent": "names express purpose and ownership.",
656
+ "allOf": [],
657
+ "anyOf": [
658
+ "code",
659
+ "review"
660
+ ],
661
+ "mechanisms": [
662
+ "guidance"
663
+ ],
664
+ "defaultLevel": "PREFERRED",
665
+ "safetyInvariant": false
666
+ },
667
+ {
668
+ "id": "C12",
669
+ "version": 1,
670
+ "group": "readability",
671
+ "title": "Positive boolean naming",
672
+ "intent": "isActive, canEdit, hasPermission where natural.",
673
+ "allOf": [],
674
+ "anyOf": [
675
+ "code",
676
+ "review"
677
+ ],
678
+ "mechanisms": [
679
+ "guidance"
680
+ ],
681
+ "defaultLevel": "PREFERRED",
682
+ "safetyInvariant": false
683
+ },
684
+ {
685
+ "id": "C13",
686
+ "version": 1,
687
+ "group": "readability",
688
+ "title": "No magic values",
689
+ "intent": "name business-significant constants, not every literal.",
690
+ "allOf": [],
691
+ "anyOf": [
692
+ "code",
693
+ "review"
694
+ ],
695
+ "mechanisms": [
696
+ "guidance"
697
+ ],
698
+ "defaultLevel": "PREFERRED",
699
+ "safetyInvariant": false
700
+ },
701
+ {
702
+ "id": "C14",
703
+ "version": 1,
704
+ "group": "readability",
705
+ "title": "Named complex conditions",
706
+ "intent": "clarify predicate intent without hiding logic.",
707
+ "allOf": [],
708
+ "anyOf": [
709
+ "code",
710
+ "review"
711
+ ],
712
+ "mechanisms": [
713
+ "guidance"
714
+ ],
715
+ "defaultLevel": "PREFERRED",
716
+ "safetyInvariant": false
717
+ },
718
+ {
719
+ "id": "C15",
720
+ "version": 1,
721
+ "group": "readability",
722
+ "title": "Single level of abstraction",
723
+ "intent": "avoid mixing transport details and domain decisions unnecessarily.",
724
+ "allOf": [],
725
+ "anyOf": [
726
+ "code",
727
+ "review"
728
+ ],
729
+ "mechanisms": [
730
+ "guidance"
731
+ ],
732
+ "defaultLevel": "PREFERRED",
733
+ "safetyInvariant": false
734
+ },
735
+ {
736
+ "id": "T01",
737
+ "version": 1,
738
+ "group": "typescript",
739
+ "title": "Prefer unknown",
740
+ "intent": "narrow untrusted or unknown types before use.",
741
+ "allOf": [
742
+ "typescript"
743
+ ],
744
+ "anyOf": [
745
+ "typescript"
746
+ ],
747
+ "mechanisms": [
748
+ "optional-native-gate",
749
+ "guidance"
750
+ ],
751
+ "defaultLevel": "PREFERRED",
752
+ "safetyInvariant": false
753
+ },
754
+ {
755
+ "id": "T02",
756
+ "version": 1,
757
+ "group": "typescript",
758
+ "title": "Prefer satisfies",
759
+ "intent": "check shape while preserving inference; not a runtime validator.",
760
+ "allOf": [
761
+ "typescript"
762
+ ],
763
+ "anyOf": [
764
+ "typescript"
765
+ ],
766
+ "mechanisms": [
767
+ "guidance",
768
+ "optional-native-gate"
769
+ ],
770
+ "defaultLevel": "PREFERRED",
771
+ "safetyInvariant": false
772
+ },
773
+ {
774
+ "id": "T03",
775
+ "version": 1,
776
+ "group": "typescript",
777
+ "title": "Type inference first",
778
+ "intent": "infer obvious locals; explicit public/boundary contracts when required.",
779
+ "allOf": [
780
+ "typescript"
781
+ ],
782
+ "anyOf": [
783
+ "typescript"
784
+ ],
785
+ "mechanisms": [
786
+ "guidance"
787
+ ],
788
+ "defaultLevel": "PREFERRED",
789
+ "safetyInvariant": false
790
+ },
791
+ {
792
+ "id": "T04",
793
+ "version": 1,
794
+ "group": "typescript",
795
+ "title": "Avoid primitive obsession",
796
+ "intent": "domain types when ambiguity or invariants justify them.",
797
+ "allOf": [
798
+ "typescript"
799
+ ],
800
+ "anyOf": [
801
+ "typescript"
802
+ ],
803
+ "mechanisms": [
804
+ "guidance"
805
+ ],
806
+ "defaultLevel": "PREFERRED",
807
+ "safetyInvariant": false
808
+ },
809
+ {
810
+ "id": "T05",
811
+ "version": 1,
812
+ "group": "typescript",
813
+ "title": "Readonly contracts",
814
+ "intent": "prevent unintended mutation of inputs/contracts; shallow readonly is not deep immutability.",
815
+ "allOf": [
816
+ "typescript"
817
+ ],
818
+ "anyOf": [
819
+ "typescript"
820
+ ],
821
+ "mechanisms": [
822
+ "guidance"
823
+ ],
824
+ "defaultLevel": "PREFERRED",
825
+ "safetyInvariant": false
826
+ },
827
+ {
828
+ "id": "T06",
829
+ "version": 1,
830
+ "group": "typescript",
831
+ "title": "Safe indexed access",
832
+ "intent": "handle absent keys and bounds.",
833
+ "allOf": [
834
+ "typescript"
835
+ ],
836
+ "anyOf": [
837
+ "typescript"
838
+ ],
839
+ "mechanisms": [
840
+ "optional-native-gate"
841
+ ],
842
+ "defaultLevel": "PREFERRED",
843
+ "safetyInvariant": false
844
+ },
845
+ {
846
+ "id": "T07",
847
+ "version": 1,
848
+ "group": "typescript",
849
+ "title": "Exact optional properties",
850
+ "intent": "distinguish absent property and undefined per contract.",
851
+ "allOf": [
852
+ "typescript"
853
+ ],
854
+ "anyOf": [
855
+ "typescript"
856
+ ],
857
+ "mechanisms": [
858
+ "optional-native-gate"
859
+ ],
860
+ "defaultLevel": "PREFERRED",
861
+ "safetyInvariant": false
862
+ },
863
+ {
864
+ "id": "T08",
865
+ "version": 1,
866
+ "group": "typescript",
867
+ "title": "Avoid unnecessary generics",
868
+ "intent": "no speculative flexibility.",
869
+ "allOf": [
870
+ "typescript"
871
+ ],
872
+ "anyOf": [
873
+ "typescript"
874
+ ],
875
+ "mechanisms": [
876
+ "guidance"
877
+ ],
878
+ "defaultLevel": "PREFERRED",
879
+ "safetyInvariant": false
880
+ },
881
+ {
882
+ "id": "T09",
883
+ "version": 1,
884
+ "group": "typescript",
885
+ "title": "Schema-derived types",
886
+ "intent": "derive from authoritative runtime schema when appropriate.",
887
+ "allOf": [
888
+ "typescript"
889
+ ],
890
+ "anyOf": [
891
+ "typescript"
892
+ ],
893
+ "mechanisms": [
894
+ "guidance"
895
+ ],
896
+ "defaultLevel": "PREFERRED",
897
+ "safetyInvariant": false
898
+ },
899
+ {
900
+ "id": "T10",
901
+ "version": 1,
902
+ "group": "typescript",
903
+ "title": "Type-only imports",
904
+ "intent": "separate type and runtime imports in compatible toolchains.",
905
+ "allOf": [
906
+ "typescript"
907
+ ],
908
+ "anyOf": [
909
+ "typescript"
910
+ ],
911
+ "mechanisms": [
912
+ "optional-native-gate"
913
+ ],
914
+ "defaultLevel": "PREFERRED",
915
+ "safetyInvariant": false
916
+ },
917
+ {
918
+ "id": "T11",
919
+ "version": 1,
920
+ "group": "typescript",
921
+ "title": "Exhaustive state handling",
922
+ "intent": "exhaustively narrow discriminated unions and legal transitions; no catch-all that hides missing cases.",
923
+ "allOf": [
924
+ "typescript"
925
+ ],
926
+ "anyOf": [
927
+ "typescript"
928
+ ],
929
+ "mechanisms": [
930
+ "optional-native-gate",
931
+ "review"
932
+ ],
933
+ "defaultLevel": "REQUIRED",
934
+ "safetyInvariant": false
935
+ },
936
+ {
937
+ "id": "T12",
938
+ "version": 1,
939
+ "group": "typescript",
940
+ "title": "Explicit null and undefined",
941
+ "intent": "distinguish 0, false, empty, null and absent according to domain.",
942
+ "allOf": [
943
+ "typescript"
944
+ ],
945
+ "anyOf": [
946
+ "typescript"
947
+ ],
948
+ "mechanisms": [
949
+ "optional-native-gate",
950
+ "guidance"
951
+ ],
952
+ "defaultLevel": "PREFERRED",
953
+ "safetyInvariant": false
954
+ },
955
+ {
956
+ "id": "T13",
957
+ "version": 1,
958
+ "group": "typescript",
959
+ "title": "Make invalid states hard to represent",
960
+ "intent": "discriminated unions or suitable state model, with runtime and persistence checks as needed.",
961
+ "allOf": [
962
+ "typescript"
963
+ ],
964
+ "anyOf": [
965
+ "typescript"
966
+ ],
967
+ "mechanisms": [
968
+ "guidance",
969
+ "review"
970
+ ],
971
+ "defaultLevel": "REQUIRED",
972
+ "safetyInvariant": false
973
+ },
974
+ {
975
+ "id": "A01",
976
+ "version": 1,
977
+ "group": "architecture",
978
+ "title": "High cohesion",
979
+ "intent": "group related behavior.",
980
+ "allOf": [],
981
+ "anyOf": [
982
+ "architecture",
983
+ "code",
984
+ "review"
985
+ ],
986
+ "mechanisms": [
987
+ "guidance"
988
+ ],
989
+ "defaultLevel": "PREFERRED",
990
+ "safetyInvariant": false
991
+ },
992
+ {
993
+ "id": "A02",
994
+ "version": 1,
995
+ "group": "architecture",
996
+ "title": "Low coupling",
997
+ "intent": "avoid unnecessary dependency on internals.",
998
+ "allOf": [],
999
+ "anyOf": [
1000
+ "architecture",
1001
+ "code",
1002
+ "review"
1003
+ ],
1004
+ "mechanisms": [
1005
+ "guidance"
1006
+ ],
1007
+ "defaultLevel": "PREFERRED",
1008
+ "safetyInvariant": false
1009
+ },
1010
+ {
1011
+ "id": "A03",
1012
+ "version": 1,
1013
+ "group": "architecture",
1014
+ "title": "No circular dependencies",
1015
+ "intent": "prevent harmful new cycles using native graph tools when available; distinguish type-only/intentional cases.",
1016
+ "allOf": [],
1017
+ "anyOf": [
1018
+ "architecture",
1019
+ "module"
1020
+ ],
1021
+ "mechanisms": [
1022
+ "optional-native-gate",
1023
+ "review"
1024
+ ],
1025
+ "defaultLevel": "REQUIRED",
1026
+ "safetyInvariant": false
1027
+ },
1028
+ {
1029
+ "id": "A04",
1030
+ "version": 1,
1031
+ "group": "architecture",
1032
+ "title": "Single source of truth",
1033
+ "intent": "canonical owner for each business fact.",
1034
+ "allOf": [],
1035
+ "anyOf": [
1036
+ "state",
1037
+ "database"
1038
+ ],
1039
+ "mechanisms": [
1040
+ "guidance",
1041
+ "review"
1042
+ ],
1043
+ "defaultLevel": "REQUIRED",
1044
+ "safetyInvariant": false
1045
+ },
1046
+ {
1047
+ "id": "A05",
1048
+ "version": 1,
1049
+ "group": "architecture",
1050
+ "title": "Feature-first organization",
1051
+ "intent": "only when consistent with target baseline.",
1052
+ "allOf": [],
1053
+ "anyOf": [
1054
+ "architecture",
1055
+ "code",
1056
+ "review"
1057
+ ],
1058
+ "mechanisms": [
1059
+ "guidance"
1060
+ ],
1061
+ "defaultLevel": "PREFERRED",
1062
+ "safetyInvariant": false
1063
+ },
1064
+ {
1065
+ "id": "A06",
1066
+ "version": 1,
1067
+ "group": "architecture",
1068
+ "title": "Public module boundaries",
1069
+ "intent": "use supported public APIs, avoid private deep imports across boundaries.",
1070
+ "allOf": [],
1071
+ "anyOf": [
1072
+ "module",
1073
+ "api"
1074
+ ],
1075
+ "mechanisms": [
1076
+ "guidance",
1077
+ "review"
1078
+ ],
1079
+ "defaultLevel": "REQUIRED",
1080
+ "safetyInvariant": false
1081
+ },
1082
+ {
1083
+ "id": "A07",
1084
+ "version": 1,
1085
+ "group": "architecture",
1086
+ "title": "Dependency direction",
1087
+ "intent": "respect existing layers and separate domain from infrastructure when useful.",
1088
+ "allOf": [],
1089
+ "anyOf": [
1090
+ "architecture",
1091
+ "module"
1092
+ ],
1093
+ "mechanisms": [
1094
+ "guidance",
1095
+ "review"
1096
+ ],
1097
+ "defaultLevel": "REQUIRED",
1098
+ "safetyInvariant": false
1099
+ },
1100
+ {
1101
+ "id": "A08",
1102
+ "version": 1,
1103
+ "group": "architecture",
1104
+ "title": "Avoid generic dumping grounds",
1105
+ "intent": "prefer meaningful feature ownership to generic utils/common/helpers sprawl.",
1106
+ "allOf": [],
1107
+ "anyOf": [
1108
+ "architecture",
1109
+ "code",
1110
+ "review"
1111
+ ],
1112
+ "mechanisms": [
1113
+ "guidance"
1114
+ ],
1115
+ "defaultLevel": "PREFERRED",
1116
+ "safetyInvariant": false
1117
+ },
1118
+ {
1119
+ "id": "A09",
1120
+ "version": 1,
1121
+ "group": "architecture",
1122
+ "title": "Avoid unnecessary barrel exports",
1123
+ "intent": "preserve intentional public API barrels.",
1124
+ "allOf": [],
1125
+ "anyOf": [
1126
+ "architecture",
1127
+ "code",
1128
+ "review"
1129
+ ],
1130
+ "mechanisms": [
1131
+ "guidance"
1132
+ ],
1133
+ "defaultLevel": "PREFERRED",
1134
+ "safetyInvariant": false
1135
+ },
1136
+ {
1137
+ "id": "A10",
1138
+ "version": 1,
1139
+ "group": "architecture",
1140
+ "title": "Explicit ownership",
1141
+ "intent": "clear owner of rules and state.",
1142
+ "allOf": [],
1143
+ "anyOf": [
1144
+ "architecture",
1145
+ "state"
1146
+ ],
1147
+ "mechanisms": [
1148
+ "guidance",
1149
+ "review"
1150
+ ],
1151
+ "defaultLevel": "REQUIRED",
1152
+ "safetyInvariant": false
1153
+ },
1154
+ {
1155
+ "id": "A11",
1156
+ "version": 1,
1157
+ "group": "architecture",
1158
+ "title": "Explicit dependencies",
1159
+ "intent": "avoid hidden dependency and unnecessary mutable global state.",
1160
+ "allOf": [],
1161
+ "anyOf": [
1162
+ "architecture",
1163
+ "code",
1164
+ "review"
1165
+ ],
1166
+ "mechanisms": [
1167
+ "guidance"
1168
+ ],
1169
+ "defaultLevel": "PREFERRED",
1170
+ "safetyInvariant": false
1171
+ },
1172
+ {
1173
+ "id": "A12",
1174
+ "version": 1,
1175
+ "group": "architecture",
1176
+ "title": "Immutability by default",
1177
+ "intent": "const and non-mutating inputs where appropriate, not a ban on justified local mutation.",
1178
+ "allOf": [],
1179
+ "anyOf": [
1180
+ "architecture",
1181
+ "code",
1182
+ "review"
1183
+ ],
1184
+ "mechanisms": [
1185
+ "guidance"
1186
+ ],
1187
+ "defaultLevel": "PREFERRED",
1188
+ "safetyInvariant": false
1189
+ },
1190
+ {
1191
+ "id": "A13",
1192
+ "version": 1,
1193
+ "group": "architecture",
1194
+ "title": "Pure business logic",
1195
+ "intent": "isolate computation/validation from IO when useful.",
1196
+ "allOf": [],
1197
+ "anyOf": [
1198
+ "architecture",
1199
+ "code",
1200
+ "review"
1201
+ ],
1202
+ "mechanisms": [
1203
+ "guidance"
1204
+ ],
1205
+ "defaultLevel": "PREFERRED",
1206
+ "safetyInvariant": false
1207
+ },
1208
+ {
1209
+ "id": "A14",
1210
+ "version": 1,
1211
+ "group": "architecture",
1212
+ "title": "Minimal public API",
1213
+ "intent": "export what consumers actually need; preserve compatibility.",
1214
+ "allOf": [],
1215
+ "anyOf": [
1216
+ "module",
1217
+ "api"
1218
+ ],
1219
+ "mechanisms": [
1220
+ "guidance",
1221
+ "review"
1222
+ ],
1223
+ "defaultLevel": "REQUIRED",
1224
+ "safetyInvariant": false
1225
+ },
1226
+ {
1227
+ "id": "A15",
1228
+ "version": 1,
1229
+ "group": "architecture",
1230
+ "title": "Explicit side effects",
1231
+ "intent": "make writes and external effects visible in contracts and names.",
1232
+ "allOf": [],
1233
+ "anyOf": [
1234
+ "io",
1235
+ "state"
1236
+ ],
1237
+ "mechanisms": [
1238
+ "guidance",
1239
+ "review"
1240
+ ],
1241
+ "defaultLevel": "REQUIRED",
1242
+ "safetyInvariant": false
1243
+ },
1244
+ {
1245
+ "id": "D01",
1246
+ "version": 1,
1247
+ "group": "correctness",
1248
+ "title": "Fail fast",
1249
+ "intent": "validate preconditions before effects; handle error safely.",
1250
+ "allOf": [],
1251
+ "anyOf": [
1252
+ "io",
1253
+ "state",
1254
+ "api"
1255
+ ],
1256
+ "mechanisms": [
1257
+ "guidance",
1258
+ "review"
1259
+ ],
1260
+ "defaultLevel": "REQUIRED",
1261
+ "safetyInvariant": false
1262
+ },
1263
+ {
1264
+ "id": "D02",
1265
+ "version": 1,
1266
+ "group": "correctness",
1267
+ "title": "No silent fallback",
1268
+ "intent": "do not mask missing critical data or failure as success.",
1269
+ "allOf": [],
1270
+ "anyOf": [
1271
+ "error",
1272
+ "io"
1273
+ ],
1274
+ "mechanisms": [
1275
+ "review"
1276
+ ],
1277
+ "defaultLevel": "REQUIRED",
1278
+ "safetyInvariant": true
1279
+ },
1280
+ {
1281
+ "id": "D03",
1282
+ "version": 1,
1283
+ "group": "correctness",
1284
+ "title": "Preserve error cause",
1285
+ "intent": "preserve context/cause without leaking sensitive data.",
1286
+ "allOf": [],
1287
+ "anyOf": [
1288
+ "error"
1289
+ ],
1290
+ "mechanisms": [
1291
+ "guidance"
1292
+ ],
1293
+ "defaultLevel": "PREFERRED",
1294
+ "safetyInvariant": false
1295
+ },
1296
+ {
1297
+ "id": "D04",
1298
+ "version": 1,
1299
+ "group": "correctness",
1300
+ "title": "Narrow try-catch",
1301
+ "intent": "catch where errors can be translated or handled.",
1302
+ "allOf": [],
1303
+ "anyOf": [
1304
+ "error"
1305
+ ],
1306
+ "mechanisms": [
1307
+ "guidance"
1308
+ ],
1309
+ "defaultLevel": "PREFERRED",
1310
+ "safetyInvariant": false
1311
+ },
1312
+ {
1313
+ "id": "D05",
1314
+ "version": 1,
1315
+ "group": "correctness",
1316
+ "title": "No exception-driven branching",
1317
+ "intent": "avoid using exceptions as ordinary control flow without justification.",
1318
+ "allOf": [],
1319
+ "anyOf": [
1320
+ "error"
1321
+ ],
1322
+ "mechanisms": [
1323
+ "guidance"
1324
+ ],
1325
+ "defaultLevel": "PREFERRED",
1326
+ "safetyInvariant": false
1327
+ },
1328
+ {
1329
+ "id": "D06",
1330
+ "version": 1,
1331
+ "group": "correctness",
1332
+ "title": "Validate before mutation",
1333
+ "intent": "enforce preconditions and integrity before state changes.",
1334
+ "allOf": [],
1335
+ "anyOf": [
1336
+ "state",
1337
+ "database",
1338
+ "api"
1339
+ ],
1340
+ "mechanisms": [
1341
+ "review"
1342
+ ],
1343
+ "defaultLevel": "REQUIRED",
1344
+ "safetyInvariant": true
1345
+ },
1346
+ {
1347
+ "id": "D07",
1348
+ "version": 1,
1349
+ "group": "correctness",
1350
+ "title": "Explicit allowlists",
1351
+ "intent": "validate permitted fields/actions and prevent mass assignment, separately authorize.",
1352
+ "allOf": [],
1353
+ "anyOf": [
1354
+ "api",
1355
+ "auth",
1356
+ "security"
1357
+ ],
1358
+ "mechanisms": [
1359
+ "review"
1360
+ ],
1361
+ "defaultLevel": "REQUIRED",
1362
+ "safetyInvariant": true
1363
+ },
1364
+ {
1365
+ "id": "D08",
1366
+ "version": 1,
1367
+ "group": "correctness",
1368
+ "title": "No hidden side effects",
1369
+ "intent": "a query should not silently mutate critical state.",
1370
+ "allOf": [],
1371
+ "anyOf": [
1372
+ "io",
1373
+ "state"
1374
+ ],
1375
+ "mechanisms": [
1376
+ "guidance",
1377
+ "review"
1378
+ ],
1379
+ "defaultLevel": "REQUIRED",
1380
+ "safetyInvariant": false
1381
+ },
1382
+ {
1383
+ "id": "D09",
1384
+ "version": 1,
1385
+ "group": "correctness",
1386
+ "title": "Parse at the boundary",
1387
+ "intent": "validate external/API/form/JSON/env/provider/DB data where trust and contract warrant it; static types alone are insufficient.",
1388
+ "allOf": [],
1389
+ "anyOf": [
1390
+ "io",
1391
+ "api",
1392
+ "database"
1393
+ ],
1394
+ "mechanisms": [
1395
+ "review"
1396
+ ],
1397
+ "defaultLevel": "REQUIRED",
1398
+ "safetyInvariant": true
1399
+ },
1400
+ {
1401
+ "id": "D10",
1402
+ "version": 1,
1403
+ "group": "correctness",
1404
+ "title": "No floating promises",
1405
+ "intent": "await/return or explicitly supervise asynchronous work and handle rejection; bare void does not prove handling.",
1406
+ "allOf": [],
1407
+ "anyOf": [
1408
+ "async"
1409
+ ],
1410
+ "mechanisms": [
1411
+ "optional-native-gate",
1412
+ "review"
1413
+ ],
1414
+ "defaultLevel": "REQUIRED",
1415
+ "safetyInvariant": false
1416
+ },
1417
+ {
1418
+ "id": "D11",
1419
+ "version": 1,
1420
+ "group": "correctness",
1421
+ "title": "No silent failure",
1422
+ "intent": "do not swallow errors or fabricate success; safe expected fallback may be documented.",
1423
+ "allOf": [],
1424
+ "anyOf": [
1425
+ "error",
1426
+ "io",
1427
+ "async"
1428
+ ],
1429
+ "mechanisms": [
1430
+ "review"
1431
+ ],
1432
+ "defaultLevel": "REQUIRED",
1433
+ "safetyInvariant": true
1434
+ },
1435
+ {
1436
+ "id": "R01",
1437
+ "version": 1,
1438
+ "group": "reliability",
1439
+ "title": "Resource lifecycle",
1440
+ "intent": "release connections, listeners, timers, files and resources even on failure.",
1441
+ "allOf": [],
1442
+ "anyOf": [
1443
+ "resource"
1444
+ ],
1445
+ "mechanisms": [
1446
+ "review"
1447
+ ],
1448
+ "defaultLevel": "REQUIRED",
1449
+ "safetyInvariant": true
1450
+ },
1451
+ {
1452
+ "id": "R02",
1453
+ "version": 1,
1454
+ "group": "reliability",
1455
+ "title": "Timeout and cancellation",
1456
+ "intent": "bounded external waits; propagate cancellation where supported.",
1457
+ "allOf": [],
1458
+ "anyOf": [
1459
+ "io",
1460
+ "async"
1461
+ ],
1462
+ "mechanisms": [
1463
+ "review"
1464
+ ],
1465
+ "defaultLevel": "REQUIRED",
1466
+ "safetyInvariant": true
1467
+ },
1468
+ {
1469
+ "id": "R03",
1470
+ "version": 1,
1471
+ "group": "reliability",
1472
+ "title": "Bounded concurrency",
1473
+ "intent": "avoid unbounded work queues and resource exhaustion.",
1474
+ "allOf": [],
1475
+ "anyOf": [
1476
+ "concurrency"
1477
+ ],
1478
+ "mechanisms": [
1479
+ "review"
1480
+ ],
1481
+ "defaultLevel": "REQUIRED",
1482
+ "safetyInvariant": true
1483
+ },
1484
+ {
1485
+ "id": "R04",
1486
+ "version": 1,
1487
+ "group": "reliability",
1488
+ "title": "Retry with backoff",
1489
+ "intent": "bounded attempts, jitter where useful, distinguish transient/permanent failures; only retry safe/idempotent operations.",
1490
+ "allOf": [],
1491
+ "anyOf": [
1492
+ "io",
1493
+ "async"
1494
+ ],
1495
+ "mechanisms": [
1496
+ "review"
1497
+ ],
1498
+ "defaultLevel": "REQUIRED",
1499
+ "safetyInvariant": true
1500
+ },
1501
+ {
1502
+ "id": "R05",
1503
+ "version": 1,
1504
+ "group": "reliability",
1505
+ "title": "Structured logging",
1506
+ "intent": "actionable context and correlation without secrets or unnecessary personal data.",
1507
+ "allOf": [],
1508
+ "anyOf": [
1509
+ "logging",
1510
+ "runtime"
1511
+ ],
1512
+ "mechanisms": [
1513
+ "guidance",
1514
+ "review"
1515
+ ],
1516
+ "defaultLevel": "REQUIRED",
1517
+ "safetyInvariant": false
1518
+ },
1519
+ {
1520
+ "id": "R06",
1521
+ "version": 1,
1522
+ "group": "reliability",
1523
+ "title": "Money precision",
1524
+ "intent": "appropriate integer minor units or decimal policy, currency-specific rounding and range checks; preserve existing financial contract.",
1525
+ "allOf": [],
1526
+ "anyOf": [
1527
+ "money",
1528
+ "payments"
1529
+ ],
1530
+ "mechanisms": [
1531
+ "review"
1532
+ ],
1533
+ "defaultLevel": "REQUIRED",
1534
+ "safetyInvariant": true
1535
+ },
1536
+ {
1537
+ "id": "R07",
1538
+ "version": 1,
1539
+ "group": "reliability",
1540
+ "title": "Timezone and clock",
1541
+ "intent": "explicit instants/local dates, expiry semantics and deterministic clocks in tests.",
1542
+ "allOf": [],
1543
+ "anyOf": [
1544
+ "time"
1545
+ ],
1546
+ "mechanisms": [
1547
+ "review"
1548
+ ],
1549
+ "defaultLevel": "REQUIRED",
1550
+ "safetyInvariant": true
1551
+ },
1552
+ {
1553
+ "id": "R08",
1554
+ "version": 1,
1555
+ "group": "reliability",
1556
+ "title": "Backward-compatible contracts",
1557
+ "intent": "inspect consumers and version/migration needs.",
1558
+ "allOf": [],
1559
+ "anyOf": [
1560
+ "contract",
1561
+ "api",
1562
+ "migration"
1563
+ ],
1564
+ "mechanisms": [
1565
+ "review"
1566
+ ],
1567
+ "defaultLevel": "REQUIRED",
1568
+ "safetyInvariant": true
1569
+ },
1570
+ {
1571
+ "id": "R09",
1572
+ "version": 1,
1573
+ "group": "reliability",
1574
+ "title": "Query efficiency",
1575
+ "intent": "avoid N+1/unbounded retrieval based on actual workload and evidence.",
1576
+ "allOf": [],
1577
+ "anyOf": [
1578
+ "database",
1579
+ "performance"
1580
+ ],
1581
+ "mechanisms": [
1582
+ "guidance",
1583
+ "review"
1584
+ ],
1585
+ "defaultLevel": "REQUIRED",
1586
+ "safetyInvariant": false
1587
+ },
1588
+ {
1589
+ "id": "R10",
1590
+ "version": 1,
1591
+ "group": "reliability",
1592
+ "title": "State ownership",
1593
+ "intent": "define canonical state, avoid inconsistent copies.",
1594
+ "allOf": [],
1595
+ "anyOf": [
1596
+ "state"
1597
+ ],
1598
+ "mechanisms": [
1599
+ "guidance",
1600
+ "review"
1601
+ ],
1602
+ "defaultLevel": "REQUIRED",
1603
+ "safetyInvariant": false
1604
+ },
1605
+ {
1606
+ "id": "SEC01",
1607
+ "version": 1,
1608
+ "group": "security",
1609
+ "title": "Authorization and least privilege",
1610
+ "intent": "Enforce server-side action/resource permission; verify unauthenticated, cross-tenant and other-owner denial. Admin/service-role success is insufficient.",
1611
+ "allOf": [],
1612
+ "anyOf": [
1613
+ "auth"
1614
+ ],
1615
+ "mechanisms": [
1616
+ "review"
1617
+ ],
1618
+ "defaultLevel": "REQUIRED",
1619
+ "safetyInvariant": true
1620
+ },
1621
+ {
1622
+ "id": "SEC02",
1623
+ "version": 1,
1624
+ "group": "security",
1625
+ "title": "RLS and tenant isolation",
1626
+ "intent": "Check real policy behavior under normal user credentials in safe environment.",
1627
+ "allOf": [],
1628
+ "anyOf": [
1629
+ "auth",
1630
+ "database"
1631
+ ],
1632
+ "mechanisms": [
1633
+ "review"
1634
+ ],
1635
+ "defaultLevel": "REQUIRED",
1636
+ "safetyInvariant": true
1637
+ },
1638
+ {
1639
+ "id": "SEC03",
1640
+ "version": 1,
1641
+ "group": "security",
1642
+ "title": "Payment idempotency and replay protection",
1643
+ "intent": "Verify signature, amount/currency, provider status, event authenticity, replay, duplicate events and safe transition rules; no real payments.",
1644
+ "allOf": [],
1645
+ "anyOf": [
1646
+ "payments"
1647
+ ],
1648
+ "mechanisms": [
1649
+ "review"
1650
+ ],
1651
+ "defaultLevel": "REQUIRED",
1652
+ "safetyInvariant": true
1653
+ },
1654
+ {
1655
+ "id": "SEC04",
1656
+ "version": 1,
1657
+ "group": "security",
1658
+ "title": "Transaction and concurrency integrity",
1659
+ "intent": "Check constraints, locks, conditional writes, transaction boundaries, rollback and competing operations.",
1660
+ "allOf": [],
1661
+ "anyOf": [
1662
+ "concurrency",
1663
+ "database",
1664
+ "payments"
1665
+ ],
1666
+ "mechanisms": [
1667
+ "review"
1668
+ ],
1669
+ "defaultLevel": "REQUIRED",
1670
+ "safetyInvariant": true
1671
+ },
1672
+ {
1673
+ "id": "SEC05",
1674
+ "version": 1,
1675
+ "group": "security",
1676
+ "title": "Secrets and data exposure",
1677
+ "intent": "Least-privilege credentials, no secret logging/commits/prompts, explicit output allowlists.",
1678
+ "allOf": [],
1679
+ "anyOf": [
1680
+ "secrets",
1681
+ "security",
1682
+ "api"
1683
+ ],
1684
+ "mechanisms": [
1685
+ "review"
1686
+ ],
1687
+ "defaultLevel": "REQUIRED",
1688
+ "safetyInvariant": true
1689
+ },
1690
+ {
1691
+ "id": "SEC06",
1692
+ "version": 1,
1693
+ "group": "security",
1694
+ "title": "Destructive operations",
1695
+ "intent": "Check deletion scope, cascades, backup/recovery, migration/rollback and explicit authorization; no shared-database destructive checks.",
1696
+ "allOf": [],
1697
+ "anyOf": [
1698
+ "destructive",
1699
+ "migration"
1700
+ ],
1701
+ "mechanisms": [
1702
+ "review"
1703
+ ],
1704
+ "defaultLevel": "REQUIRED",
1705
+ "safetyInvariant": true
1706
+ },
1707
+ {
1708
+ "id": "SEC07",
1709
+ "version": 1,
1710
+ "group": "security",
1711
+ "title": "Safety over style",
1712
+ "intent": "Never weaken validation, access control, transaction handling, accessibility, tests or other invariants to satisfy formatting or simplification.",
1713
+ "allOf": [],
1714
+ "anyOf": [
1715
+ "code",
1716
+ "review",
1717
+ "security"
1718
+ ],
1719
+ "mechanisms": [
1720
+ "review"
1721
+ ],
1722
+ "defaultLevel": "REQUIRED",
1723
+ "safetyInvariant": true
1724
+ },
1725
+ {
1726
+ "id": "F01",
1727
+ "version": 1,
1728
+ "group": "frontend",
1729
+ "title": "Derive, don't synchronize",
1730
+ "intent": "calculate derived state unless caching/snapshot semantics require state.",
1731
+ "allOf": [
1732
+ "frontend"
1733
+ ],
1734
+ "anyOf": [
1735
+ "react"
1736
+ ],
1737
+ "mechanisms": [
1738
+ "guidance"
1739
+ ],
1740
+ "defaultLevel": "PREFERRED",
1741
+ "safetyInvariant": false
1742
+ },
1743
+ {
1744
+ "id": "F02",
1745
+ "version": 1,
1746
+ "group": "frontend",
1747
+ "title": "Avoid unnecessary effects",
1748
+ "intent": "render/event logic instead of an effect; retain actual external synchronization.",
1749
+ "allOf": [
1750
+ "frontend"
1751
+ ],
1752
+ "anyOf": [
1753
+ "react"
1754
+ ],
1755
+ "mechanisms": [
1756
+ "guidance"
1757
+ ],
1758
+ "defaultLevel": "PREFERRED",
1759
+ "safetyInvariant": false
1760
+ },
1761
+ {
1762
+ "id": "F03",
1763
+ "version": 1,
1764
+ "group": "frontend",
1765
+ "title": "State colocation",
1766
+ "intent": "keep state near its owner.",
1767
+ "allOf": [
1768
+ "frontend"
1769
+ ],
1770
+ "anyOf": [
1771
+ "react"
1772
+ ],
1773
+ "mechanisms": [
1774
+ "guidance"
1775
+ ],
1776
+ "defaultLevel": "PREFERRED",
1777
+ "safetyInvariant": false
1778
+ },
1779
+ {
1780
+ "id": "F04",
1781
+ "version": 1,
1782
+ "group": "frontend",
1783
+ "title": "Stable identity",
1784
+ "intent": "stable keys for changing lists, preserve component identity.",
1785
+ "allOf": [
1786
+ "frontend"
1787
+ ],
1788
+ "anyOf": [
1789
+ "react"
1790
+ ],
1791
+ "mechanisms": [
1792
+ "guidance",
1793
+ "review"
1794
+ ],
1795
+ "defaultLevel": "REQUIRED",
1796
+ "safetyInvariant": false
1797
+ },
1798
+ {
1799
+ "id": "F05",
1800
+ "version": 1,
1801
+ "group": "frontend",
1802
+ "title": "No premature memoization",
1803
+ "intent": "use memoization only for supported benefit or contract.",
1804
+ "allOf": [
1805
+ "frontend"
1806
+ ],
1807
+ "anyOf": [
1808
+ "react"
1809
+ ],
1810
+ "mechanisms": [
1811
+ "guidance"
1812
+ ],
1813
+ "defaultLevel": "PREFERRED",
1814
+ "safetyInvariant": false
1815
+ },
1816
+ {
1817
+ "id": "F06",
1818
+ "version": 1,
1819
+ "group": "frontend",
1820
+ "title": "Complete UI states",
1821
+ "intent": "loading/error/empty/success, retry and disabled state as applicable.",
1822
+ "allOf": [
1823
+ "frontend"
1824
+ ],
1825
+ "anyOf": [
1826
+ "frontend"
1827
+ ],
1828
+ "mechanisms": [
1829
+ "review"
1830
+ ],
1831
+ "defaultLevel": "REQUIRED",
1832
+ "safetyInvariant": false
1833
+ },
1834
+ {
1835
+ "id": "F07",
1836
+ "version": 1,
1837
+ "group": "frontend",
1838
+ "title": "Semantic HTML first",
1839
+ "intent": "native semantics before custom controls.",
1840
+ "allOf": [
1841
+ "frontend"
1842
+ ],
1843
+ "anyOf": [
1844
+ "frontend"
1845
+ ],
1846
+ "mechanisms": [
1847
+ "guidance",
1848
+ "review"
1849
+ ],
1850
+ "defaultLevel": "REQUIRED",
1851
+ "safetyInvariant": false
1852
+ },
1853
+ {
1854
+ "id": "F08",
1855
+ "version": 1,
1856
+ "group": "frontend",
1857
+ "title": "Prevent duplicate submission",
1858
+ "intent": "UI pending protection plus backend idempotency/authorization as relevant.",
1859
+ "allOf": [
1860
+ "frontend"
1861
+ ],
1862
+ "anyOf": [
1863
+ "frontend",
1864
+ "state"
1865
+ ],
1866
+ "mechanisms": [
1867
+ "review"
1868
+ ],
1869
+ "defaultLevel": "REQUIRED",
1870
+ "safetyInvariant": true
1871
+ },
1872
+ {
1873
+ "id": "F09",
1874
+ "version": 1,
1875
+ "group": "frontend",
1876
+ "title": "Server-state ownership",
1877
+ "intent": "avoid unnecessary duplicate server state in stores.",
1878
+ "allOf": [
1879
+ "frontend"
1880
+ ],
1881
+ "anyOf": [
1882
+ "frontend",
1883
+ "state"
1884
+ ],
1885
+ "mechanisms": [
1886
+ "guidance"
1887
+ ],
1888
+ "defaultLevel": "PREFERRED",
1889
+ "safetyInvariant": false
1890
+ },
1891
+ {
1892
+ "id": "F10",
1893
+ "version": 1,
1894
+ "group": "frontend",
1895
+ "title": "Preserve accessibility",
1896
+ "intent": "keyboard, focus, labels and screen-reader semantics; test impacted behavior.",
1897
+ "allOf": [
1898
+ "frontend"
1899
+ ],
1900
+ "anyOf": [
1901
+ "frontend"
1902
+ ],
1903
+ "mechanisms": [
1904
+ "review"
1905
+ ],
1906
+ "defaultLevel": "REQUIRED",
1907
+ "safetyInvariant": true
1908
+ },
1909
+ {
1910
+ "id": "B01",
1911
+ "version": 1,
1912
+ "group": "backend",
1913
+ "title": "Thin controllers",
1914
+ "intent": "transport boundary delegates domain work according to architecture.",
1915
+ "allOf": [],
1916
+ "anyOf": [
1917
+ "backend"
1918
+ ],
1919
+ "mechanisms": [
1920
+ "guidance"
1921
+ ],
1922
+ "defaultLevel": "PREFERRED",
1923
+ "safetyInvariant": false
1924
+ },
1925
+ {
1926
+ "id": "B02",
1927
+ "version": 1,
1928
+ "group": "backend",
1929
+ "title": "Database-enforced invariants",
1930
+ "intent": "constraints/unique keys/foreign keys where supported and appropriate.",
1931
+ "allOf": [],
1932
+ "anyOf": [
1933
+ "database"
1934
+ ],
1935
+ "mechanisms": [
1936
+ "review"
1937
+ ],
1938
+ "defaultLevel": "REQUIRED",
1939
+ "safetyInvariant": true
1940
+ },
1941
+ {
1942
+ "id": "B03",
1943
+ "version": 1,
1944
+ "group": "backend",
1945
+ "title": "Explicit field selection",
1946
+ "intent": "select necessary fields and protect sensitive data.",
1947
+ "allOf": [],
1948
+ "anyOf": [
1949
+ "database"
1950
+ ],
1951
+ "mechanisms": [
1952
+ "guidance",
1953
+ "review"
1954
+ ],
1955
+ "defaultLevel": "REQUIRED",
1956
+ "safetyInvariant": false
1957
+ },
1958
+ {
1959
+ "id": "B04",
1960
+ "version": 1,
1961
+ "group": "backend",
1962
+ "title": "Stable pagination ordering",
1963
+ "intent": "deterministic order and tie-breaker, correct cursor semantics.",
1964
+ "allOf": [],
1965
+ "anyOf": [
1966
+ "database",
1967
+ "api"
1968
+ ],
1969
+ "mechanisms": [
1970
+ "review"
1971
+ ],
1972
+ "defaultLevel": "REQUIRED",
1973
+ "safetyInvariant": false
1974
+ },
1975
+ {
1976
+ "id": "B05",
1977
+ "version": 1,
1978
+ "group": "backend",
1979
+ "title": "Atomic state transitions",
1980
+ "intent": "guard concurrent transition, validate legal source state.",
1981
+ "allOf": [],
1982
+ "anyOf": [
1983
+ "database",
1984
+ "state",
1985
+ "concurrency"
1986
+ ],
1987
+ "mechanisms": [
1988
+ "review"
1989
+ ],
1990
+ "defaultLevel": "REQUIRED",
1991
+ "safetyInvariant": true
1992
+ },
1993
+ {
1994
+ "id": "B06",
1995
+ "version": 1,
1996
+ "group": "backend",
1997
+ "title": "Consistent error contracts",
1998
+ "intent": "stable error codes and responses without leaking internals.",
1999
+ "allOf": [],
2000
+ "anyOf": [
2001
+ "api",
2002
+ "backend"
2003
+ ],
2004
+ "mechanisms": [
2005
+ "guidance",
2006
+ "review"
2007
+ ],
2008
+ "defaultLevel": "REQUIRED",
2009
+ "safetyInvariant": false
2010
+ },
2011
+ {
2012
+ "id": "B07",
2013
+ "version": 1,
2014
+ "group": "backend",
2015
+ "title": "Safe migrations",
2016
+ "intent": "compatibility with existing data and concurrent deployment versions; explicit approval and rollback/recovery.",
2017
+ "allOf": [],
2018
+ "anyOf": [
2019
+ "migration"
2020
+ ],
2021
+ "mechanisms": [
2022
+ "review"
2023
+ ],
2024
+ "defaultLevel": "REQUIRED",
2025
+ "safetyInvariant": true
2026
+ },
2027
+ {
2028
+ "id": "B08",
2029
+ "version": 1,
2030
+ "group": "backend",
2031
+ "title": "Audit critical actions",
2032
+ "intent": "meaningful audit trail without leaking secrets; respect retention policy.",
2033
+ "allOf": [],
2034
+ "anyOf": [
2035
+ "security",
2036
+ "payments",
2037
+ "auth"
2038
+ ],
2039
+ "mechanisms": [
2040
+ "review"
2041
+ ],
2042
+ "defaultLevel": "REQUIRED",
2043
+ "safetyInvariant": false
2044
+ },
2045
+ {
2046
+ "id": "B09",
2047
+ "version": 1,
2048
+ "group": "backend",
2049
+ "title": "Avoid check-then-act races",
2050
+ "intent": "atomic conditional update or suitable transaction/lock; verify result and input constraints.",
2051
+ "allOf": [],
2052
+ "anyOf": [
2053
+ "concurrency",
2054
+ "database"
2055
+ ],
2056
+ "mechanisms": [
2057
+ "review"
2058
+ ],
2059
+ "defaultLevel": "REQUIRED",
2060
+ "safetyInvariant": true
2061
+ },
2062
+ {
2063
+ "id": "B10",
2064
+ "version": 1,
2065
+ "group": "backend",
2066
+ "title": "Explicit data exposure",
2067
+ "intent": "serialize intended public fields, not unchecked entire entities.",
2068
+ "allOf": [],
2069
+ "anyOf": [
2070
+ "api"
2071
+ ],
2072
+ "mechanisms": [
2073
+ "review"
2074
+ ],
2075
+ "defaultLevel": "REQUIRED",
2076
+ "safetyInvariant": true
2077
+ },
2078
+ {
2079
+ "id": "Q01",
2080
+ "version": 1,
2081
+ "group": "testing",
2082
+ "title": "Test behavior, not implementation",
2083
+ "intent": "assertions on public contract and outcomes.",
2084
+ "allOf": [],
2085
+ "anyOf": [
2086
+ "testing",
2087
+ "review"
2088
+ ],
2089
+ "mechanisms": [
2090
+ "guidance",
2091
+ "review"
2092
+ ],
2093
+ "defaultLevel": "REQUIRED",
2094
+ "safetyInvariant": false
2095
+ },
2096
+ {
2097
+ "id": "Q02",
2098
+ "version": 1,
2099
+ "group": "testing",
2100
+ "title": "Regression test for bug fixes",
2101
+ "intent": "show bug-catching test or justify why unavailable; where possible reproduce fail then pass.",
2102
+ "allOf": [],
2103
+ "anyOf": [
2104
+ "regression"
2105
+ ],
2106
+ "mechanisms": [
2107
+ "review"
2108
+ ],
2109
+ "defaultLevel": "REQUIRED",
2110
+ "safetyInvariant": true
2111
+ },
2112
+ {
2113
+ "id": "Q03",
2114
+ "version": 1,
2115
+ "group": "testing",
2116
+ "title": "Deterministic tests",
2117
+ "intent": "control randomness, clocks and dependencies.",
2118
+ "allOf": [],
2119
+ "anyOf": [
2120
+ "testing",
2121
+ "review"
2122
+ ],
2123
+ "mechanisms": [
2124
+ "guidance",
2125
+ "review"
2126
+ ],
2127
+ "defaultLevel": "REQUIRED",
2128
+ "safetyInvariant": false
2129
+ },
2130
+ {
2131
+ "id": "Q04",
2132
+ "version": 1,
2133
+ "group": "testing",
2134
+ "title": "Test isolation",
2135
+ "intent": "no order-dependent shared mutable state.",
2136
+ "allOf": [],
2137
+ "anyOf": [
2138
+ "testing",
2139
+ "review"
2140
+ ],
2141
+ "mechanisms": [
2142
+ "review"
2143
+ ],
2144
+ "defaultLevel": "REQUIRED",
2145
+ "safetyInvariant": true
2146
+ },
2147
+ {
2148
+ "id": "Q05",
2149
+ "version": 1,
2150
+ "group": "testing",
2151
+ "title": "Avoid excessive mocking",
2152
+ "intent": "mock at appropriate boundaries, verify actual integration separately.",
2153
+ "allOf": [],
2154
+ "anyOf": [
2155
+ "testing",
2156
+ "review"
2157
+ ],
2158
+ "mechanisms": [
2159
+ "guidance",
2160
+ "review"
2161
+ ],
2162
+ "defaultLevel": "REQUIRED",
2163
+ "safetyInvariant": true
2164
+ },
2165
+ {
2166
+ "id": "Q06",
2167
+ "version": 1,
2168
+ "group": "testing",
2169
+ "title": "Boundary value testing",
2170
+ "intent": "empty, limits, invalid, edge and failure cases as applicable.",
2171
+ "allOf": [],
2172
+ "anyOf": [
2173
+ "testing",
2174
+ "review"
2175
+ ],
2176
+ "mechanisms": [
2177
+ "review"
2178
+ ],
2179
+ "defaultLevel": "REQUIRED",
2180
+ "safetyInvariant": true
2181
+ },
2182
+ {
2183
+ "id": "Q07",
2184
+ "version": 1,
2185
+ "group": "testing",
2186
+ "title": "Property-based testing",
2187
+ "intent": "use for meaningful invariants, not mandatory everywhere.",
2188
+ "allOf": [],
2189
+ "anyOf": [
2190
+ "testing"
2191
+ ],
2192
+ "mechanisms": [
2193
+ "guidance"
2194
+ ],
2195
+ "defaultLevel": "PREFERRED",
2196
+ "safetyInvariant": false
2197
+ },
2198
+ {
2199
+ "id": "Q08",
2200
+ "version": 1,
2201
+ "group": "testing",
2202
+ "title": "Contract testing",
2203
+ "intent": "R when changing relevant consumer/provider boundaries.",
2204
+ "allOf": [],
2205
+ "anyOf": [
2206
+ "contract",
2207
+ "api"
2208
+ ],
2209
+ "mechanisms": [
2210
+ "guidance"
2211
+ ],
2212
+ "defaultLevel": "REQUIRED",
2213
+ "safetyInvariant": true
2214
+ },
2215
+ {
2216
+ "id": "Q09",
2217
+ "version": 1,
2218
+ "group": "testing",
2219
+ "title": "Failure injection",
2220
+ "intent": "R for critical failure behavior; timeouts, network/provider failures in safe fixtures.",
2221
+ "allOf": [],
2222
+ "anyOf": [
2223
+ "critical",
2224
+ "io"
2225
+ ],
2226
+ "mechanisms": [
2227
+ "guidance"
2228
+ ],
2229
+ "defaultLevel": "REQUIRED",
2230
+ "safetyInvariant": true
2231
+ },
2232
+ {
2233
+ "id": "Q10",
2234
+ "version": 1,
2235
+ "group": "testing",
2236
+ "title": "Meaningful assertions",
2237
+ "intent": "verify business outcome, not merely no throw.",
2238
+ "allOf": [],
2239
+ "anyOf": [
2240
+ "testing",
2241
+ "review"
2242
+ ],
2243
+ "mechanisms": [
2244
+ "review"
2245
+ ],
2246
+ "defaultLevel": "REQUIRED",
2247
+ "safetyInvariant": true
2248
+ },
2249
+ {
2250
+ "id": "AI01",
2251
+ "version": 1,
2252
+ "group": "agent",
2253
+ "title": "No compatibility bypass",
2254
+ "intent": "Never widen types or bypass contracts merely to compile.",
2255
+ "allOf": [],
2256
+ "anyOf": [
2257
+ "code",
2258
+ "review"
2259
+ ],
2260
+ "mechanisms": [
2261
+ "review"
2262
+ ],
2263
+ "defaultLevel": "REQUIRED",
2264
+ "safetyInvariant": true
2265
+ },
2266
+ {
2267
+ "id": "AI02",
2268
+ "version": 1,
2269
+ "group": "agent",
2270
+ "title": "No fabricated APIs",
2271
+ "intent": "Verify actual installed/library version, symbols and supported APIs before use.",
2272
+ "allOf": [],
2273
+ "anyOf": [
2274
+ "code",
2275
+ "review"
2276
+ ],
2277
+ "mechanisms": [
2278
+ "review"
2279
+ ],
2280
+ "defaultLevel": "REQUIRED",
2281
+ "safetyInvariant": true
2282
+ },
2283
+ {
2284
+ "id": "AI03",
2285
+ "version": 1,
2286
+ "group": "agent",
2287
+ "title": "No speculative dependencies",
2288
+ "intent": "Inspect existing tools first; justify any new dependency and obtain approval when required.",
2289
+ "allOf": [],
2290
+ "anyOf": [
2291
+ "code",
2292
+ "review"
2293
+ ],
2294
+ "mechanisms": [
2295
+ "review"
2296
+ ],
2297
+ "defaultLevel": "REQUIRED",
2298
+ "safetyInvariant": true
2299
+ },
2300
+ {
2301
+ "id": "AI04",
2302
+ "version": 1,
2303
+ "group": "agent",
2304
+ "title": "No suppression-driven fixes",
2305
+ "intent": "No ts-ignore, eslint-disable or similar workaround solely to hide root cause; documented narrow exceptions require evidence and authorization.",
2306
+ "allOf": [],
2307
+ "anyOf": [
2308
+ "code",
2309
+ "review"
2310
+ ],
2311
+ "mechanisms": [
2312
+ "review"
2313
+ ],
2314
+ "defaultLevel": "REQUIRED",
2315
+ "safetyInvariant": true
2316
+ },
2317
+ {
2318
+ "id": "AI05",
2319
+ "version": 1,
2320
+ "group": "agent",
2321
+ "title": "No test weakening",
2322
+ "intent": "Never remove assertions or alter expected results merely to pass; genuine contract changes need approval.",
2323
+ "allOf": [],
2324
+ "anyOf": [
2325
+ "code",
2326
+ "review"
2327
+ ],
2328
+ "mechanisms": [
2329
+ "review"
2330
+ ],
2331
+ "defaultLevel": "REQUIRED",
2332
+ "safetyInvariant": true
2333
+ },
2334
+ {
2335
+ "id": "AI06",
2336
+ "version": 1,
2337
+ "group": "agent",
2338
+ "title": "No placeholder production code",
2339
+ "intent": "No stubs, fake success or mock responses presented as complete production flows.",
2340
+ "allOf": [],
2341
+ "anyOf": [
2342
+ "code",
2343
+ "review"
2344
+ ],
2345
+ "mechanisms": [
2346
+ "review"
2347
+ ],
2348
+ "defaultLevel": "REQUIRED",
2349
+ "safetyInvariant": true
2350
+ },
2351
+ {
2352
+ "id": "AI07",
2353
+ "version": 1,
2354
+ "group": "agent",
2355
+ "title": "Preserve existing consumers",
2356
+ "intent": "Inspect affected callers before changing public interfaces.",
2357
+ "allOf": [],
2358
+ "anyOf": [
2359
+ "code",
2360
+ "review"
2361
+ ],
2362
+ "mechanisms": [
2363
+ "review"
2364
+ ],
2365
+ "defaultLevel": "REQUIRED",
2366
+ "safetyInvariant": true
2367
+ },
2368
+ {
2369
+ "id": "AI08",
2370
+ "version": 1,
2371
+ "group": "agent",
2372
+ "title": "No duplicate implementations",
2373
+ "intent": "Search existing source before inventing replacements; reuse when appropriate without premature abstraction.",
2374
+ "allOf": [],
2375
+ "anyOf": [
2376
+ "code",
2377
+ "review"
2378
+ ],
2379
+ "mechanisms": [
2380
+ "review"
2381
+ ],
2382
+ "defaultLevel": "REQUIRED",
2383
+ "safetyInvariant": true
2384
+ },
2385
+ {
2386
+ "id": "AI09",
2387
+ "version": 1,
2388
+ "group": "agent",
2389
+ "title": "No unrelated cleanup",
2390
+ "intent": "Do not reformat/rename/refactor outside the authorized scope.",
2391
+ "allOf": [],
2392
+ "anyOf": [
2393
+ "code",
2394
+ "review"
2395
+ ],
2396
+ "mechanisms": [
2397
+ "review"
2398
+ ],
2399
+ "defaultLevel": "REQUIRED",
2400
+ "safetyInvariant": true
2401
+ },
2402
+ {
2403
+ "id": "AI10",
2404
+ "version": 1,
2405
+ "group": "agent",
2406
+ "title": "Evidence before optimization",
2407
+ "intent": "Explain performance hypothesis and verify meaningful benefit, including trade-offs.",
2408
+ "allOf": [],
2409
+ "anyOf": [
2410
+ "performance"
2411
+ ],
2412
+ "mechanisms": [
2413
+ "review"
2414
+ ],
2415
+ "defaultLevel": "REQUIRED",
2416
+ "safetyInvariant": true
2417
+ },
2418
+ {
2419
+ "id": "AI11",
2420
+ "version": 1,
2421
+ "group": "agent",
2422
+ "title": "Preserve business semantics",
2423
+ "intent": "Refactor without unauthorized behavioral changes.",
2424
+ "allOf": [],
2425
+ "anyOf": [
2426
+ "code",
2427
+ "review"
2428
+ ],
2429
+ "mechanisms": [
2430
+ "review"
2431
+ ],
2432
+ "defaultLevel": "REQUIRED",
2433
+ "safetyInvariant": true
2434
+ },
2435
+ {
2436
+ "id": "AI12",
2437
+ "version": 1,
2438
+ "group": "agent",
2439
+ "title": "Verify generated changes",
2440
+ "intent": "Inspect actual diff and relevant runtime/test evidence; tool success does not prove correctness.",
2441
+ "allOf": [],
2442
+ "anyOf": [
2443
+ "code",
2444
+ "review"
2445
+ ],
2446
+ "mechanisms": [
2447
+ "review"
2448
+ ],
2449
+ "defaultLevel": "REQUIRED",
2450
+ "safetyInvariant": true
2451
+ }
2452
+ ]
2453
+ }