deslop 0.2.0

A static analyzer that spots low-context and AI-assisted code patterns across naming, concurrency, security, performance, and test quality.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
use super::{RuleConfigurability, RuleDefaultSeverity, RuleDefinition, RuleLanguage, RuleStatus};

pub(crate) const RULE_DEFINITIONS: &[RuleDefinition] = &[
    RuleDefinition {
        id: "data_pipeline_no_error_handling",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Info,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Pipeline-style functions with no visible error handling or recovery path.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "dataset_not_using_dataloader",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Info,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Manual dataset batching loops that bypass torch.utils.data.DataLoader.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "embedding_computed_per_request",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Info,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Embeddings recomputed on request paths instead of cached or precomputed for stable inputs.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "embedding_dimension_mismatch_silent",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Info,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Embeddings are compared without visible dimension validation before similarity math.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "entire_dataframe_copied_for_transform",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Info,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Whole DataFrames are copied for transforms that could target a smaller subset or reuse views.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "global_state_in_data_pipeline",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Warning,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Pipeline-style functions mutate global state, making concurrency and reproducibility brittle.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "gpu_memory_not_cleared_between_experiments",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Info,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "GPU-backed experiment flows show no visible memory or session cleanup between runs.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "hardcoded_api_key_in_source",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Warning,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Hardcoded model-provider API keys or secret-like tokens appear in source.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "intermediate_dataframe_not_freed",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Info,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Multiple intermediate DataFrames accumulate with no visible cleanup in one pipeline.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "langchain_chain_built_per_request",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Info,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "LangChain or LlamaIndex prompt and chain wiring rebuilt on each request path.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "llm_api_call_in_loop_without_batching",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Warning,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "LLM API calls are made inside loops without batching or aggregation.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "llm_full_response_loaded_into_memory",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Info,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Large LLM responses are loaded fully into memory instead of streamed or incrementally consumed.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "llm_response_not_cached_same_input",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Info,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Repeated LLM calls show no visible caching even when prompt inputs appear likely to repeat.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "model_eval_mode_missing",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Info,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Torch-style inference paths run model(...) without obvious eval() or inference mode setup.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "model_loaded_per_request",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Warning,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Models are loaded on request paths instead of once during application startup.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "model_to_device_in_loop",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Info,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Models or tensors are moved to a device repeatedly inside loops.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "no_schema_validation_on_external_data",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Info,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "External JSON or tabular data is parsed without visible schema validation.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "numpy_append_in_loop",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Info,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "np.append(...) is used inside loops, forcing repeated reallocations.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "numpy_dtype_mismatch_implicit_cast",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Info,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Arrays are constructed and immediately cast, implying a missing upfront dtype choice.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "numpy_python_loop_over_array",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Info,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Python loops iterate directly over arrays where vectorized NumPy operations would be clearer and faster.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "numpy_tolist_in_hot_path",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Info,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "NumPy arrays are converted to Python lists in hot paths, increasing object overhead.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "numpy_vstack_hstack_in_loop",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Info,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Arrays are repeatedly stacked inside loops instead of collected and stacked once.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "pandas_apply_with_simple_vectorizable_op",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Info,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Simple DataFrame transforms are routed through apply(lambda) instead of vectorized operations.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "pandas_chain_assignment_warning",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Info,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Chained DataFrame assignment patterns risk SettingWithCopy-style behavior.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "pandas_concat_in_loop",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Info,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "DataFrames are concatenated inside loops instead of collected and concatenated once.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "pandas_copy_in_loop",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Info,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "DataFrames are copied inside loops, amplifying memory churn.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "pandas_eval_string_manipulation",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Warning,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Dynamic string building is fed into pandas eval/query calls, increasing injection and correctness risk.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "pandas_full_dataframe_print_in_production",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Info,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Full DataFrames are printed or displayed in production-oriented code paths.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "pandas_inplace_false_reassignment_missing",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Info,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "DataFrame-transform methods are called without reassignment or inplace=True, silently discarding results.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "pandas_iterrows_in_loop",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Info,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "iterrows() is used on DataFrames instead of vectorized operations or itertuples().",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "pandas_merge_without_validation",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Info,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "DataFrame merges omit validate= safeguards against multiplicative joins.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "pandas_read_csv_without_dtypes",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Info,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "pd.read_csv(...) calls omit dtype hints, forcing extra inference work.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "pandas_read_without_chunksize_large_file",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Info,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Data-loading functions read large tabular files without chunksize or nrows limits.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "pandas_to_dict_records_in_loop",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Info,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "DataFrame to_dict conversions are repeated inside loops.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "print_metrics_instead_of_logging",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Info,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Training or evaluation code prints metrics directly instead of using logging or experiment tracking.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "prompt_template_string_concat_in_loop",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Info,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Prompt strings are built incrementally inside loops instead of composing a stable template once.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "random_seed_not_set",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Info,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Training or evaluation entrypoints use randomness without an obvious seed.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "retry_on_rate_limit_without_backoff",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Info,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Rate-limit retries appear without visible backoff or Retry-After handling.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "token_count_not_checked_before_api_call",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Info,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "LLM requests are sent without visible token counting or context-window checks.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "tokenizer_encode_in_loop_without_cache",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Info,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Tokenizer encode calls repeated inside loops without caching or batching signals.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "tokenizer_loaded_per_request",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Warning,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Tokenizers are loaded on request paths instead of once during application startup.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "torch_no_grad_missing_in_inference",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Info,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Torch inference paths show no visible no_grad() or inference_mode() guard.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "training_loop_without_zero_grad",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Warning,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "optimizer.step() appears without an obvious zero_grad() reset.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "vector_store_client_created_per_request",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Warning,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "Vector-store clients created on request paths instead of reused application state.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
    RuleDefinition {
        id: "wandb_mlflow_log_in_tight_loop",
        language: RuleLanguage::Python,
        family: "mlops",
        default_severity: RuleDefaultSeverity::Info,
        status: RuleStatus::Stable,
        configurability: &[
            RuleConfigurability::Disable,
            RuleConfigurability::Ignore,
            RuleConfigurability::SeverityOverride,
        ],
        description: "wandb or mlflow metrics are logged in inner loops instead of batched or reported at coarser boundaries.",
        binding_location: super::bindings::PYTHON_MLOPS,
    },
];