neural-thinker commited on
Commit
63ca756
·
1 Parent(s): b31857c

refactor: reorganize project structure and dependencies

Browse files

Major structural cleanup and organization improvements:

* Consolidate scattered test files into proper /tests/ structure
- Move 6 test files from root to tests/unit/, tests/integration/, tests/e2e/
- Organize by test type for better maintainability

* Remove duplicate monitoring directories
- Eliminate /grafana/ and /prometheus/ duplicates
- Keep single source in /monitoring/ directory
- Reduce maintenance overhead and confusion

* Standardize requirements management
- Unify dependency structure with clear separation
- Create /requirements/ directory with base/prod/dev/hf variants
- Maintain requirements.txt for HuggingFace compatibility
- Add comprehensive documentation

Structural improvements:
- Better test organization following Python standards
- Cleaner dependency management
- Reduced file duplication
- Improved project maintainability

grafana/dashboards/cidadao-ai-overview.json DELETED
@@ -1,518 +0,0 @@
1
- {
2
- "annotations": {
3
- "list": [
4
- {
5
- "builtIn": 1,
6
- "datasource": {
7
- "type": "grafana",
8
- "uid": "-- Grafana --"
9
- },
10
- "enable": true,
11
- "hide": true,
12
- "iconColor": "rgba(0, 211, 255, 1)",
13
- "name": "Annotations & Alerts",
14
- "type": "dashboard"
15
- }
16
- ]
17
- },
18
- "editable": true,
19
- "fiscalYearStartMonth": 0,
20
- "graphTooltip": 0,
21
- "id": null,
22
- "links": [],
23
- "liveNow": false,
24
- "panels": [
25
- {
26
- "datasource": {
27
- "type": "prometheus",
28
- "uid": "prometheus"
29
- },
30
- "fieldConfig": {
31
- "defaults": {
32
- "color": {
33
- "mode": "palette-classic"
34
- },
35
- "custom": {
36
- "axisLabel": "",
37
- "axisPlacement": "auto",
38
- "barAlignment": 0,
39
- "drawStyle": "line",
40
- "fillOpacity": 10,
41
- "gradientMode": "none",
42
- "hideFrom": {
43
- "legend": false,
44
- "tooltip": false,
45
- "vis": false
46
- },
47
- "lineInterpolation": "linear",
48
- "lineWidth": 2,
49
- "pointSize": 5,
50
- "scaleDistribution": {
51
- "type": "linear"
52
- },
53
- "showPoints": "never",
54
- "spanNulls": false,
55
- "stacking": {
56
- "group": "A",
57
- "mode": "none"
58
- },
59
- "thresholdsStyle": {
60
- "mode": "off"
61
- }
62
- },
63
- "mappings": [],
64
- "thresholds": {
65
- "mode": "absolute",
66
- "steps": [
67
- {
68
- "color": "green",
69
- "value": null
70
- },
71
- {
72
- "color": "red",
73
- "value": 80
74
- }
75
- ]
76
- },
77
- "unit": "reqps"
78
- },
79
- "overrides": []
80
- },
81
- "gridPos": {
82
- "h": 8,
83
- "w": 12,
84
- "x": 0,
85
- "y": 0
86
- },
87
- "id": 1,
88
- "options": {
89
- "legend": {
90
- "calcs": [],
91
- "displayMode": "list",
92
- "placement": "bottom"
93
- },
94
- "tooltip": {
95
- "mode": "single",
96
- "sort": "none"
97
- }
98
- },
99
- "targets": [
100
- {
101
- "datasource": {
102
- "type": "prometheus",
103
- "uid": "prometheus"
104
- },
105
- "expr": "rate(cidadao_ai_requests_total[5m])",
106
- "interval": "",
107
- "legendFormat": "{{method}} {{endpoint}}",
108
- "refId": "A"
109
- }
110
- ],
111
- "title": "API Request Rate",
112
- "type": "timeseries"
113
- },
114
- {
115
- "datasource": {
116
- "type": "prometheus",
117
- "uid": "prometheus"
118
- },
119
- "fieldConfig": {
120
- "defaults": {
121
- "color": {
122
- "mode": "thresholds"
123
- },
124
- "mappings": [],
125
- "thresholds": {
126
- "mode": "absolute",
127
- "steps": [
128
- {
129
- "color": "green",
130
- "value": null
131
- },
132
- {
133
- "color": "red",
134
- "value": 80
135
- }
136
- ]
137
- },
138
- "unit": "short"
139
- },
140
- "overrides": []
141
- },
142
- "gridPos": {
143
- "h": 8,
144
- "w": 12,
145
- "x": 12,
146
- "y": 0
147
- },
148
- "id": 2,
149
- "options": {
150
- "colorMode": "value",
151
- "graphMode": "area",
152
- "justifyMode": "auto",
153
- "orientation": "auto",
154
- "reduceOptions": {
155
- "calcs": [
156
- "lastNotNull"
157
- ],
158
- "fields": "",
159
- "values": false
160
- },
161
- "textMode": "auto"
162
- },
163
- "pluginVersion": "10.2.3",
164
- "targets": [
165
- {
166
- "datasource": {
167
- "type": "prometheus",
168
- "uid": "prometheus"
169
- },
170
- "expr": "sum(cidadao_ai_investigations_total)",
171
- "interval": "",
172
- "legendFormat": "Total Investigations",
173
- "refId": "A"
174
- }
175
- ],
176
- "title": "Total Investigations",
177
- "type": "stat"
178
- },
179
- {
180
- "datasource": {
181
- "type": "prometheus",
182
- "uid": "prometheus"
183
- },
184
- "fieldConfig": {
185
- "defaults": {
186
- "color": {
187
- "mode": "palette-classic"
188
- },
189
- "custom": {
190
- "hideFrom": {
191
- "legend": false,
192
- "tooltip": false,
193
- "vis": false
194
- }
195
- },
196
- "mappings": [],
197
- "unit": "short"
198
- },
199
- "overrides": []
200
- },
201
- "gridPos": {
202
- "h": 8,
203
- "w": 12,
204
- "x": 0,
205
- "y": 8
206
- },
207
- "id": 3,
208
- "options": {
209
- "displayLabels": [],
210
- "legend": {
211
- "displayMode": "list",
212
- "placement": "bottom",
213
- "values": []
214
- },
215
- "pieType": "pie",
216
- "reduceOptions": {
217
- "calcs": [
218
- "lastNotNull"
219
- ],
220
- "fields": "",
221
- "values": false
222
- },
223
- "tooltip": {
224
- "mode": "single",
225
- "sort": "none"
226
- }
227
- },
228
- "targets": [
229
- {
230
- "datasource": {
231
- "type": "prometheus",
232
- "uid": "prometheus"
233
- },
234
- "expr": "sum by (status) (cidadao_ai_investigations_total)",
235
- "interval": "",
236
- "legendFormat": "{{status}}",
237
- "refId": "A"
238
- }
239
- ],
240
- "title": "Investigations by Status",
241
- "type": "piechart"
242
- },
243
- {
244
- "datasource": {
245
- "type": "prometheus",
246
- "uid": "prometheus"
247
- },
248
- "fieldConfig": {
249
- "defaults": {
250
- "color": {
251
- "mode": "palette-classic"
252
- },
253
- "custom": {
254
- "hideFrom": {
255
- "legend": false,
256
- "tooltip": false,
257
- "vis": false
258
- }
259
- },
260
- "mappings": [],
261
- "unit": "short"
262
- },
263
- "overrides": []
264
- },
265
- "gridPos": {
266
- "h": 8,
267
- "w": 12,
268
- "x": 12,
269
- "y": 8
270
- },
271
- "id": 4,
272
- "options": {
273
- "displayLabels": [],
274
- "legend": {
275
- "displayMode": "list",
276
- "placement": "bottom",
277
- "values": []
278
- },
279
- "pieType": "pie",
280
- "reduceOptions": {
281
- "calcs": [
282
- "lastNotNull"
283
- ],
284
- "fields": "",
285
- "values": false
286
- },
287
- "tooltip": {
288
- "mode": "single",
289
- "sort": "none"
290
- }
291
- },
292
- "targets": [
293
- {
294
- "datasource": {
295
- "type": "prometheus",
296
- "uid": "prometheus"
297
- },
298
- "expr": "sum by (anomaly_type) (cidadao_ai_anomalies_detected_total)",
299
- "interval": "",
300
- "legendFormat": "{{anomaly_type}}",
301
- "refId": "A"
302
- }
303
- ],
304
- "title": "Anomalies by Type",
305
- "type": "piechart"
306
- },
307
- {
308
- "datasource": {
309
- "type": "prometheus",
310
- "uid": "prometheus"
311
- },
312
- "fieldConfig": {
313
- "defaults": {
314
- "color": {
315
- "mode": "palette-classic"
316
- },
317
- "custom": {
318
- "axisLabel": "",
319
- "axisPlacement": "auto",
320
- "barAlignment": 0,
321
- "drawStyle": "line",
322
- "fillOpacity": 10,
323
- "gradientMode": "none",
324
- "hideFrom": {
325
- "legend": false,
326
- "tooltip": false,
327
- "vis": false
328
- },
329
- "lineInterpolation": "linear",
330
- "lineWidth": 2,
331
- "pointSize": 5,
332
- "scaleDistribution": {
333
- "type": "linear"
334
- },
335
- "showPoints": "never",
336
- "spanNulls": false,
337
- "stacking": {
338
- "group": "A",
339
- "mode": "none"
340
- },
341
- "thresholdsStyle": {
342
- "mode": "off"
343
- }
344
- },
345
- "mappings": [],
346
- "thresholds": {
347
- "mode": "absolute",
348
- "steps": [
349
- {
350
- "color": "green",
351
- "value": null
352
- },
353
- {
354
- "color": "red",
355
- "value": 80
356
- }
357
- ]
358
- },
359
- "unit": "s"
360
- },
361
- "overrides": []
362
- },
363
- "gridPos": {
364
- "h": 8,
365
- "w": 12,
366
- "x": 0,
367
- "y": 16
368
- },
369
- "id": 5,
370
- "options": {
371
- "legend": {
372
- "calcs": [],
373
- "displayMode": "list",
374
- "placement": "bottom"
375
- },
376
- "tooltip": {
377
- "mode": "single",
378
- "sort": "none"
379
- }
380
- },
381
- "targets": [
382
- {
383
- "datasource": {
384
- "type": "prometheus",
385
- "uid": "prometheus"
386
- },
387
- "expr": "histogram_quantile(0.95, rate(cidadao_ai_request_duration_seconds_bucket[5m]))",
388
- "interval": "",
389
- "legendFormat": "95th percentile",
390
- "refId": "A"
391
- },
392
- {
393
- "datasource": {
394
- "type": "prometheus",
395
- "uid": "prometheus"
396
- },
397
- "expr": "histogram_quantile(0.50, rate(cidadao_ai_request_duration_seconds_bucket[5m]))",
398
- "interval": "",
399
- "legendFormat": "50th percentile",
400
- "refId": "B"
401
- }
402
- ],
403
- "title": "Request Duration",
404
- "type": "timeseries"
405
- },
406
- {
407
- "datasource": {
408
- "type": "prometheus",
409
- "uid": "prometheus"
410
- },
411
- "fieldConfig": {
412
- "defaults": {
413
- "color": {
414
- "mode": "palette-classic"
415
- },
416
- "custom": {
417
- "axisLabel": "",
418
- "axisPlacement": "auto",
419
- "barAlignment": 0,
420
- "drawStyle": "line",
421
- "fillOpacity": 10,
422
- "gradientMode": "none",
423
- "hideFrom": {
424
- "legend": false,
425
- "tooltip": false,
426
- "vis": false
427
- },
428
- "lineInterpolation": "linear",
429
- "lineWidth": 2,
430
- "pointSize": 5,
431
- "scaleDistribution": {
432
- "type": "linear"
433
- },
434
- "showPoints": "never",
435
- "spanNulls": false,
436
- "stacking": {
437
- "group": "A",
438
- "mode": "none"
439
- },
440
- "thresholdsStyle": {
441
- "mode": "off"
442
- }
443
- },
444
- "mappings": [],
445
- "thresholds": {
446
- "mode": "absolute",
447
- "steps": [
448
- {
449
- "color": "green",
450
- "value": null
451
- },
452
- {
453
- "color": "red",
454
- "value": 80
455
- }
456
- ]
457
- },
458
- "unit": "short"
459
- },
460
- "overrides": []
461
- },
462
- "gridPos": {
463
- "h": 8,
464
- "w": 12,
465
- "x": 12,
466
- "y": 16
467
- },
468
- "id": 6,
469
- "options": {
470
- "legend": {
471
- "calcs": [],
472
- "displayMode": "list",
473
- "placement": "bottom"
474
- },
475
- "tooltip": {
476
- "mode": "single",
477
- "sort": "none"
478
- }
479
- },
480
- "targets": [
481
- {
482
- "datasource": {
483
- "type": "prometheus",
484
- "uid": "prometheus"
485
- },
486
- "expr": "rate(cidadao_ai_data_records_processed_total[5m])",
487
- "interval": "",
488
- "legendFormat": "{{data_source}} - {{operation}}",
489
- "refId": "A"
490
- }
491
- ],
492
- "title": "Data Processing Rate",
493
- "type": "timeseries"
494
- }
495
- ],
496
- "refresh": "10s",
497
- "revision": 1,
498
- "schemaVersion": 39,
499
- "style": "dark",
500
- "tags": [
501
- "cidadao-ai",
502
- "overview",
503
- "transparency"
504
- ],
505
- "templating": {
506
- "list": []
507
- },
508
- "time": {
509
- "from": "now-1h",
510
- "to": "now"
511
- },
512
- "timepicker": {},
513
- "timezone": "",
514
- "title": "Cidadão.AI - Overview Dashboard",
515
- "uid": "cidadao-ai-overview",
516
- "version": 1,
517
- "weekStart": ""
518
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
grafana/dashboards/system-performance.json DELETED
@@ -1,624 +0,0 @@
1
- {
2
- "annotations": {
3
- "list": [
4
- {
5
- "builtIn": 1,
6
- "datasource": {
7
- "type": "grafana",
8
- "uid": "-- Grafana --"
9
- },
10
- "enable": true,
11
- "hide": true,
12
- "iconColor": "rgba(0, 211, 255, 1)",
13
- "name": "Annotations & Alerts",
14
- "type": "dashboard"
15
- }
16
- ]
17
- },
18
- "editable": true,
19
- "fiscalYearStartMonth": 0,
20
- "graphTooltip": 0,
21
- "id": null,
22
- "links": [],
23
- "liveNow": false,
24
- "panels": [
25
- {
26
- "datasource": {
27
- "type": "prometheus",
28
- "uid": "prometheus"
29
- },
30
- "fieldConfig": {
31
- "defaults": {
32
- "color": {
33
- "mode": "palette-classic"
34
- },
35
- "custom": {
36
- "axisLabel": "",
37
- "axisPlacement": "auto",
38
- "barAlignment": 0,
39
- "drawStyle": "line",
40
- "fillOpacity": 10,
41
- "gradientMode": "none",
42
- "hideFrom": {
43
- "legend": false,
44
- "tooltip": false,
45
- "vis": false
46
- },
47
- "lineInterpolation": "linear",
48
- "lineWidth": 2,
49
- "pointSize": 5,
50
- "scaleDistribution": {
51
- "type": "linear"
52
- },
53
- "showPoints": "never",
54
- "spanNulls": false,
55
- "stacking": {
56
- "group": "A",
57
- "mode": "none"
58
- },
59
- "thresholdsStyle": {
60
- "mode": "off"
61
- }
62
- },
63
- "mappings": [],
64
- "max": 100,
65
- "min": 0,
66
- "thresholds": {
67
- "mode": "absolute",
68
- "steps": [
69
- {
70
- "color": "green",
71
- "value": null
72
- },
73
- {
74
- "color": "yellow",
75
- "value": 70
76
- },
77
- {
78
- "color": "red",
79
- "value": 90
80
- }
81
- ]
82
- },
83
- "unit": "percent"
84
- },
85
- "overrides": []
86
- },
87
- "gridPos": {
88
- "h": 8,
89
- "w": 12,
90
- "x": 0,
91
- "y": 0
92
- },
93
- "id": 1,
94
- "options": {
95
- "legend": {
96
- "calcs": [],
97
- "displayMode": "list",
98
- "placement": "bottom"
99
- },
100
- "tooltip": {
101
- "mode": "single",
102
- "sort": "none"
103
- }
104
- },
105
- "targets": [
106
- {
107
- "datasource": {
108
- "type": "prometheus",
109
- "uid": "prometheus"
110
- },
111
- "expr": "100 - (avg(rate(node_cpu_seconds_total{mode=\"idle\"}[5m])) * 100)",
112
- "interval": "",
113
- "legendFormat": "CPU Usage",
114
- "refId": "A"
115
- }
116
- ],
117
- "title": "CPU Usage",
118
- "type": "timeseries"
119
- },
120
- {
121
- "datasource": {
122
- "type": "prometheus",
123
- "uid": "prometheus"
124
- },
125
- "fieldConfig": {
126
- "defaults": {
127
- "color": {
128
- "mode": "palette-classic"
129
- },
130
- "custom": {
131
- "axisLabel": "",
132
- "axisPlacement": "auto",
133
- "barAlignment": 0,
134
- "drawStyle": "line",
135
- "fillOpacity": 10,
136
- "gradientMode": "none",
137
- "hideFrom": {
138
- "legend": false,
139
- "tooltip": false,
140
- "vis": false
141
- },
142
- "lineInterpolation": "linear",
143
- "lineWidth": 2,
144
- "pointSize": 5,
145
- "scaleDistribution": {
146
- "type": "linear"
147
- },
148
- "showPoints": "never",
149
- "spanNulls": false,
150
- "stacking": {
151
- "group": "A",
152
- "mode": "none"
153
- },
154
- "thresholdsStyle": {
155
- "mode": "off"
156
- }
157
- },
158
- "mappings": [],
159
- "max": 100,
160
- "min": 0,
161
- "thresholds": {
162
- "mode": "absolute",
163
- "steps": [
164
- {
165
- "color": "green",
166
- "value": null
167
- },
168
- {
169
- "color": "yellow",
170
- "value": 80
171
- },
172
- {
173
- "color": "red",
174
- "value": 95
175
- }
176
- ]
177
- },
178
- "unit": "percent"
179
- },
180
- "overrides": []
181
- },
182
- "gridPos": {
183
- "h": 8,
184
- "w": 12,
185
- "x": 12,
186
- "y": 0
187
- },
188
- "id": 2,
189
- "options": {
190
- "legend": {
191
- "calcs": [],
192
- "displayMode": "list",
193
- "placement": "bottom"
194
- },
195
- "tooltip": {
196
- "mode": "single",
197
- "sort": "none"
198
- }
199
- },
200
- "targets": [
201
- {
202
- "datasource": {
203
- "type": "prometheus",
204
- "uid": "prometheus"
205
- },
206
- "expr": "(1 - (node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes)) * 100",
207
- "interval": "",
208
- "legendFormat": "Memory Usage",
209
- "refId": "A"
210
- }
211
- ],
212
- "title": "Memory Usage",
213
- "type": "timeseries"
214
- },
215
- {
216
- "datasource": {
217
- "type": "prometheus",
218
- "uid": "prometheus"
219
- },
220
- "fieldConfig": {
221
- "defaults": {
222
- "color": {
223
- "mode": "palette-classic"
224
- },
225
- "custom": {
226
- "axisLabel": "",
227
- "axisPlacement": "auto",
228
- "barAlignment": 0,
229
- "drawStyle": "line",
230
- "fillOpacity": 10,
231
- "gradientMode": "none",
232
- "hideFrom": {
233
- "legend": false,
234
- "tooltip": false,
235
- "vis": false
236
- },
237
- "lineInterpolation": "linear",
238
- "lineWidth": 2,
239
- "pointSize": 5,
240
- "scaleDistribution": {
241
- "type": "linear"
242
- },
243
- "showPoints": "never",
244
- "spanNulls": false,
245
- "stacking": {
246
- "group": "A",
247
- "mode": "none"
248
- },
249
- "thresholdsStyle": {
250
- "mode": "off"
251
- }
252
- },
253
- "mappings": [],
254
- "thresholds": {
255
- "mode": "absolute",
256
- "steps": [
257
- {
258
- "color": "green",
259
- "value": null
260
- },
261
- {
262
- "color": "red",
263
- "value": 80
264
- }
265
- ]
266
- },
267
- "unit": "s"
268
- },
269
- "overrides": []
270
- },
271
- "gridPos": {
272
- "h": 8,
273
- "w": 12,
274
- "x": 0,
275
- "y": 8
276
- },
277
- "id": 3,
278
- "options": {
279
- "legend": {
280
- "calcs": [],
281
- "displayMode": "list",
282
- "placement": "bottom"
283
- },
284
- "tooltip": {
285
- "mode": "single",
286
- "sort": "none"
287
- }
288
- },
289
- "targets": [
290
- {
291
- "datasource": {
292
- "type": "prometheus",
293
- "uid": "prometheus"
294
- },
295
- "expr": "histogram_quantile(0.95, rate(cidadao_ai_agent_task_duration_seconds_bucket[5m]))",
296
- "interval": "",
297
- "legendFormat": "95th percentile",
298
- "refId": "A"
299
- },
300
- {
301
- "datasource": {
302
- "type": "prometheus",
303
- "uid": "prometheus"
304
- },
305
- "expr": "histogram_quantile(0.50, rate(cidadao_ai_agent_task_duration_seconds_bucket[5m]))",
306
- "interval": "",
307
- "legendFormat": "50th percentile",
308
- "refId": "B"
309
- }
310
- ],
311
- "title": "Agent Task Duration",
312
- "type": "timeseries"
313
- },
314
- {
315
- "datasource": {
316
- "type": "prometheus",
317
- "uid": "prometheus"
318
- },
319
- "fieldConfig": {
320
- "defaults": {
321
- "color": {
322
- "mode": "palette-classic"
323
- },
324
- "custom": {
325
- "axisLabel": "",
326
- "axisPlacement": "auto",
327
- "barAlignment": 0,
328
- "drawStyle": "line",
329
- "fillOpacity": 10,
330
- "gradientMode": "none",
331
- "hideFrom": {
332
- "legend": false,
333
- "tooltip": false,
334
- "vis": false
335
- },
336
- "lineInterpolation": "linear",
337
- "lineWidth": 2,
338
- "pointSize": 5,
339
- "scaleDistribution": {
340
- "type": "linear"
341
- },
342
- "showPoints": "never",
343
- "spanNulls": false,
344
- "stacking": {
345
- "group": "A",
346
- "mode": "none"
347
- },
348
- "thresholdsStyle": {
349
- "mode": "off"
350
- }
351
- },
352
- "mappings": [],
353
- "thresholds": {
354
- "mode": "absolute",
355
- "steps": [
356
- {
357
- "color": "green",
358
- "value": null
359
- },
360
- {
361
- "color": "red",
362
- "value": 80
363
- }
364
- ]
365
- },
366
- "unit": "short"
367
- },
368
- "overrides": []
369
- },
370
- "gridPos": {
371
- "h": 8,
372
- "w": 12,
373
- "x": 12,
374
- "y": 8
375
- },
376
- "id": 4,
377
- "options": {
378
- "legend": {
379
- "calcs": [],
380
- "displayMode": "list",
381
- "placement": "bottom"
382
- },
383
- "tooltip": {
384
- "mode": "single",
385
- "sort": "none"
386
- }
387
- },
388
- "targets": [
389
- {
390
- "datasource": {
391
- "type": "prometheus",
392
- "uid": "prometheus"
393
- },
394
- "expr": "rate(cidadao_ai_agent_tasks_total[5m])",
395
- "interval": "",
396
- "legendFormat": "{{agent_type}} - {{status}}",
397
- "refId": "A"
398
- }
399
- ],
400
- "title": "Agent Task Rate by Status",
401
- "type": "timeseries"
402
- },
403
- {
404
- "datasource": {
405
- "type": "prometheus",
406
- "uid": "prometheus"
407
- },
408
- "fieldConfig": {
409
- "defaults": {
410
- "color": {
411
- "mode": "palette-classic"
412
- },
413
- "custom": {
414
- "axisLabel": "",
415
- "axisPlacement": "auto",
416
- "barAlignment": 0,
417
- "drawStyle": "line",
418
- "fillOpacity": 10,
419
- "gradientMode": "none",
420
- "hideFrom": {
421
- "legend": false,
422
- "tooltip": false,
423
- "vis": false
424
- },
425
- "lineInterpolation": "linear",
426
- "lineWidth": 2,
427
- "pointSize": 5,
428
- "scaleDistribution": {
429
- "type": "linear"
430
- },
431
- "showPoints": "never",
432
- "spanNulls": false,
433
- "stacking": {
434
- "group": "A",
435
- "mode": "none"
436
- },
437
- "thresholdsStyle": {
438
- "mode": "off"
439
- }
440
- },
441
- "mappings": [],
442
- "thresholds": {
443
- "mode": "absolute",
444
- "steps": [
445
- {
446
- "color": "green",
447
- "value": null
448
- },
449
- {
450
- "color": "red",
451
- "value": 80
452
- }
453
- ]
454
- },
455
- "unit": "bytes"
456
- },
457
- "overrides": []
458
- },
459
- "gridPos": {
460
- "h": 8,
461
- "w": 12,
462
- "x": 0,
463
- "y": 16
464
- },
465
- "id": 5,
466
- "options": {
467
- "legend": {
468
- "calcs": [],
469
- "displayMode": "list",
470
- "placement": "bottom"
471
- },
472
- "tooltip": {
473
- "mode": "single",
474
- "sort": "none"
475
- }
476
- },
477
- "targets": [
478
- {
479
- "datasource": {
480
- "type": "prometheus",
481
- "uid": "prometheus"
482
- },
483
- "expr": "rate(container_network_receive_bytes_total{name=\"cidadao-ai\"}[5m])",
484
- "interval": "",
485
- "legendFormat": "Received",
486
- "refId": "A"
487
- },
488
- {
489
- "datasource": {
490
- "type": "prometheus",
491
- "uid": "prometheus"
492
- },
493
- "expr": "rate(container_network_transmit_bytes_total{name=\"cidadao-ai\"}[5m])",
494
- "interval": "",
495
- "legendFormat": "Transmitted",
496
- "refId": "B"
497
- }
498
- ],
499
- "title": "Network I/O",
500
- "type": "timeseries"
501
- },
502
- {
503
- "datasource": {
504
- "type": "prometheus",
505
- "uid": "prometheus"
506
- },
507
- "fieldConfig": {
508
- "defaults": {
509
- "color": {
510
- "mode": "palette-classic"
511
- },
512
- "custom": {
513
- "axisLabel": "",
514
- "axisPlacement": "auto",
515
- "barAlignment": 0,
516
- "drawStyle": "line",
517
- "fillOpacity": 10,
518
- "gradientMode": "none",
519
- "hideFrom": {
520
- "legend": false,
521
- "tooltip": false,
522
- "vis": false
523
- },
524
- "lineInterpolation": "linear",
525
- "lineWidth": 2,
526
- "pointSize": 5,
527
- "scaleDistribution": {
528
- "type": "linear"
529
- },
530
- "showPoints": "never",
531
- "spanNulls": false,
532
- "stacking": {
533
- "group": "A",
534
- "mode": "none"
535
- },
536
- "thresholdsStyle": {
537
- "mode": "off"
538
- }
539
- },
540
- "mappings": [],
541
- "thresholds": {
542
- "mode": "absolute",
543
- "steps": [
544
- {
545
- "color": "green",
546
- "value": null
547
- },
548
- {
549
- "color": "red",
550
- "value": 80
551
- }
552
- ]
553
- },
554
- "unit": "bytes"
555
- },
556
- "overrides": []
557
- },
558
- "gridPos": {
559
- "h": 8,
560
- "w": 12,
561
- "x": 12,
562
- "y": 16
563
- },
564
- "id": 6,
565
- "options": {
566
- "legend": {
567
- "calcs": [],
568
- "displayMode": "list",
569
- "placement": "bottom"
570
- },
571
- "tooltip": {
572
- "mode": "single",
573
- "sort": "none"
574
- }
575
- },
576
- "targets": [
577
- {
578
- "datasource": {
579
- "type": "prometheus",
580
- "uid": "prometheus"
581
- },
582
- "expr": "rate(container_fs_reads_bytes_total{name=\"cidadao-ai\"}[5m])",
583
- "interval": "",
584
- "legendFormat": "Read",
585
- "refId": "A"
586
- },
587
- {
588
- "datasource": {
589
- "type": "prometheus",
590
- "uid": "prometheus"
591
- },
592
- "expr": "rate(container_fs_writes_bytes_total{name=\"cidadao-ai\"}[5m])",
593
- "interval": "",
594
- "legendFormat": "Write",
595
- "refId": "B"
596
- }
597
- ],
598
- "title": "Disk I/O",
599
- "type": "timeseries"
600
- }
601
- ],
602
- "refresh": "10s",
603
- "revision": 1,
604
- "schemaVersion": 39,
605
- "style": "dark",
606
- "tags": [
607
- "cidadao-ai",
608
- "system",
609
- "performance"
610
- ],
611
- "templating": {
612
- "list": []
613
- },
614
- "time": {
615
- "from": "now-1h",
616
- "to": "now"
617
- },
618
- "timepicker": {},
619
- "timezone": "",
620
- "title": "Cidadão.AI - System Performance Dashboard",
621
- "uid": "system-performance",
622
- "version": 1,
623
- "weekStart": ""
624
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
grafana/dashboards/zumbi-agent-dashboard.json DELETED
@@ -1,660 +0,0 @@
1
- {
2
- "annotations": {
3
- "list": [
4
- {
5
- "builtIn": 1,
6
- "datasource": {
7
- "type": "grafana",
8
- "uid": "-- Grafana --"
9
- },
10
- "enable": true,
11
- "hide": true,
12
- "iconColor": "rgba(0, 211, 255, 1)",
13
- "name": "Annotations & Alerts",
14
- "type": "dashboard"
15
- }
16
- ]
17
- },
18
- "editable": true,
19
- "fiscalYearStartMonth": 0,
20
- "graphTooltip": 0,
21
- "id": null,
22
- "links": [],
23
- "liveNow": false,
24
- "panels": [
25
- {
26
- "datasource": {
27
- "type": "prometheus",
28
- "uid": "prometheus"
29
- },
30
- "fieldConfig": {
31
- "defaults": {
32
- "color": {
33
- "mode": "thresholds"
34
- },
35
- "mappings": [],
36
- "thresholds": {
37
- "mode": "absolute",
38
- "steps": [
39
- {
40
- "color": "green",
41
- "value": null
42
- },
43
- {
44
- "color": "yellow",
45
- "value": 10
46
- },
47
- {
48
- "color": "red",
49
- "value": 50
50
- }
51
- ]
52
- },
53
- "unit": "short"
54
- },
55
- "overrides": []
56
- },
57
- "gridPos": {
58
- "h": 6,
59
- "w": 6,
60
- "x": 0,
61
- "y": 0
62
- },
63
- "id": 1,
64
- "options": {
65
- "colorMode": "background",
66
- "graphMode": "area",
67
- "justifyMode": "center",
68
- "orientation": "auto",
69
- "reduceOptions": {
70
- "calcs": [
71
- "lastNotNull"
72
- ],
73
- "fields": "",
74
- "values": false
75
- },
76
- "textMode": "auto"
77
- },
78
- "pluginVersion": "10.2.3",
79
- "targets": [
80
- {
81
- "datasource": {
82
- "type": "prometheus",
83
- "uid": "prometheus"
84
- },
85
- "expr": "sum(cidadao_ai_investigations_total{agent_type=\"zumbi\"})",
86
- "interval": "",
87
- "legendFormat": "Total Investigations",
88
- "refId": "A"
89
- }
90
- ],
91
- "title": "🏹 Zumbi - Total Investigations",
92
- "type": "stat"
93
- },
94
- {
95
- "datasource": {
96
- "type": "prometheus",
97
- "uid": "prometheus"
98
- },
99
- "fieldConfig": {
100
- "defaults": {
101
- "color": {
102
- "mode": "thresholds"
103
- },
104
- "mappings": [],
105
- "thresholds": {
106
- "mode": "absolute",
107
- "steps": [
108
- {
109
- "color": "green",
110
- "value": null
111
- },
112
- {
113
- "color": "yellow",
114
- "value": 5
115
- },
116
- {
117
- "color": "red",
118
- "value": 20
119
- }
120
- ]
121
- },
122
- "unit": "short"
123
- },
124
- "overrides": []
125
- },
126
- "gridPos": {
127
- "h": 6,
128
- "w": 6,
129
- "x": 6,
130
- "y": 0
131
- },
132
- "id": 2,
133
- "options": {
134
- "colorMode": "background",
135
- "graphMode": "area",
136
- "justifyMode": "center",
137
- "orientation": "auto",
138
- "reduceOptions": {
139
- "calcs": [
140
- "lastNotNull"
141
- ],
142
- "fields": "",
143
- "values": false
144
- },
145
- "textMode": "auto"
146
- },
147
- "pluginVersion": "10.2.3",
148
- "targets": [
149
- {
150
- "datasource": {
151
- "type": "prometheus",
152
- "uid": "prometheus"
153
- },
154
- "expr": "sum(cidadao_ai_anomalies_detected_total{agent=\"zumbi\"})",
155
- "interval": "",
156
- "legendFormat": "Total Anomalies",
157
- "refId": "A"
158
- }
159
- ],
160
- "title": "🚨 Anomalies Detected",
161
- "type": "stat"
162
- },
163
- {
164
- "datasource": {
165
- "type": "prometheus",
166
- "uid": "prometheus"
167
- },
168
- "fieldConfig": {
169
- "defaults": {
170
- "color": {
171
- "mode": "thresholds"
172
- },
173
- "mappings": [],
174
- "thresholds": {
175
- "mode": "absolute",
176
- "steps": [
177
- {
178
- "color": "green",
179
- "value": null
180
- },
181
- {
182
- "color": "red",
183
- "value": 0.5
184
- }
185
- ]
186
- },
187
- "unit": "percent"
188
- },
189
- "overrides": []
190
- },
191
- "gridPos": {
192
- "h": 6,
193
- "w": 6,
194
- "x": 12,
195
- "y": 0
196
- },
197
- "id": 3,
198
- "options": {
199
- "colorMode": "background",
200
- "graphMode": "area",
201
- "justifyMode": "center",
202
- "orientation": "auto",
203
- "reduceOptions": {
204
- "calcs": [
205
- "lastNotNull"
206
- ],
207
- "fields": "",
208
- "values": false
209
- },
210
- "textMode": "auto"
211
- },
212
- "pluginVersion": "10.2.3",
213
- "targets": [
214
- {
215
- "datasource": {
216
- "type": "prometheus",
217
- "uid": "prometheus"
218
- },
219
- "expr": "sum(cidadao_ai_investigations_total{agent_type=\"zumbi\",status=\"completed\"}) / sum(cidadao_ai_investigations_total{agent_type=\"zumbi\"}) * 100",
220
- "interval": "",
221
- "legendFormat": "Success Rate",
222
- "refId": "A"
223
- }
224
- ],
225
- "title": "✅ Investigation Success Rate",
226
- "type": "stat"
227
- },
228
- {
229
- "datasource": {
230
- "type": "prometheus",
231
- "uid": "prometheus"
232
- },
233
- "fieldConfig": {
234
- "defaults": {
235
- "color": {
236
- "mode": "thresholds"
237
- },
238
- "mappings": [],
239
- "thresholds": {
240
- "mode": "absolute",
241
- "steps": [
242
- {
243
- "color": "green",
244
- "value": null
245
- },
246
- {
247
- "color": "red",
248
- "value": 30
249
- }
250
- ]
251
- },
252
- "unit": "s"
253
- },
254
- "overrides": []
255
- },
256
- "gridPos": {
257
- "h": 6,
258
- "w": 6,
259
- "x": 18,
260
- "y": 0
261
- },
262
- "id": 4,
263
- "options": {
264
- "colorMode": "background",
265
- "graphMode": "area",
266
- "justifyMode": "center",
267
- "orientation": "auto",
268
- "reduceOptions": {
269
- "calcs": [
270
- "lastNotNull"
271
- ],
272
- "fields": "",
273
- "values": false
274
- },
275
- "textMode": "auto"
276
- },
277
- "pluginVersion": "10.2.3",
278
- "targets": [
279
- {
280
- "datasource": {
281
- "type": "prometheus",
282
- "uid": "prometheus"
283
- },
284
- "expr": "histogram_quantile(0.95, rate(cidadao_ai_investigation_duration_seconds_bucket{agent_type=\"zumbi\"}[5m]))",
285
- "interval": "",
286
- "legendFormat": "95th percentile",
287
- "refId": "A"
288
- }
289
- ],
290
- "title": "⏱️ Investigation Duration (P95)",
291
- "type": "stat"
292
- },
293
- {
294
- "datasource": {
295
- "type": "prometheus",
296
- "uid": "prometheus"
297
- },
298
- "fieldConfig": {
299
- "defaults": {
300
- "color": {
301
- "mode": "palette-classic"
302
- },
303
- "custom": {
304
- "axisLabel": "",
305
- "axisPlacement": "auto",
306
- "barAlignment": 0,
307
- "drawStyle": "line",
308
- "fillOpacity": 10,
309
- "gradientMode": "none",
310
- "hideFrom": {
311
- "legend": false,
312
- "tooltip": false,
313
- "vis": false
314
- },
315
- "lineInterpolation": "linear",
316
- "lineWidth": 2,
317
- "pointSize": 5,
318
- "scaleDistribution": {
319
- "type": "linear"
320
- },
321
- "showPoints": "never",
322
- "spanNulls": false,
323
- "stacking": {
324
- "group": "A",
325
- "mode": "none"
326
- },
327
- "thresholdsStyle": {
328
- "mode": "off"
329
- }
330
- },
331
- "mappings": [],
332
- "thresholds": {
333
- "mode": "absolute",
334
- "steps": [
335
- {
336
- "color": "green",
337
- "value": null
338
- },
339
- {
340
- "color": "red",
341
- "value": 80
342
- }
343
- ]
344
- },
345
- "unit": "short"
346
- },
347
- "overrides": []
348
- },
349
- "gridPos": {
350
- "h": 8,
351
- "w": 12,
352
- "x": 0,
353
- "y": 6
354
- },
355
- "id": 5,
356
- "options": {
357
- "legend": {
358
- "calcs": [],
359
- "displayMode": "list",
360
- "placement": "bottom"
361
- },
362
- "tooltip": {
363
- "mode": "single",
364
- "sort": "none"
365
- }
366
- },
367
- "targets": [
368
- {
369
- "datasource": {
370
- "type": "prometheus",
371
- "uid": "prometheus"
372
- },
373
- "expr": "rate(cidadao_ai_investigations_total{agent_type=\"zumbi\"}[5m])",
374
- "interval": "",
375
- "legendFormat": "{{investigation_type}} - {{status}}",
376
- "refId": "A"
377
- }
378
- ],
379
- "title": "Investigation Rate by Type & Status",
380
- "type": "timeseries"
381
- },
382
- {
383
- "datasource": {
384
- "type": "prometheus",
385
- "uid": "prometheus"
386
- },
387
- "fieldConfig": {
388
- "defaults": {
389
- "color": {
390
- "mode": "palette-classic"
391
- },
392
- "custom": {
393
- "hideFrom": {
394
- "legend": false,
395
- "tooltip": false,
396
- "vis": false
397
- }
398
- },
399
- "mappings": [],
400
- "unit": "short"
401
- },
402
- "overrides": []
403
- },
404
- "gridPos": {
405
- "h": 8,
406
- "w": 12,
407
- "x": 12,
408
- "y": 6
409
- },
410
- "id": 6,
411
- "options": {
412
- "displayLabels": [
413
- "name",
414
- "value"
415
- ],
416
- "legend": {
417
- "displayMode": "list",
418
- "placement": "right",
419
- "values": []
420
- },
421
- "pieType": "pie",
422
- "reduceOptions": {
423
- "calcs": [
424
- "lastNotNull"
425
- ],
426
- "fields": "",
427
- "values": false
428
- },
429
- "tooltip": {
430
- "mode": "single",
431
- "sort": "none"
432
- }
433
- },
434
- "targets": [
435
- {
436
- "datasource": {
437
- "type": "prometheus",
438
- "uid": "prometheus"
439
- },
440
- "expr": "sum by (anomaly_type) (cidadao_ai_anomalies_detected_total{agent=\"zumbi\"})",
441
- "interval": "",
442
- "legendFormat": "{{anomaly_type}}",
443
- "refId": "A"
444
- }
445
- ],
446
- "title": "Anomaly Types Distribution",
447
- "type": "piechart"
448
- },
449
- {
450
- "datasource": {
451
- "type": "prometheus",
452
- "uid": "prometheus"
453
- },
454
- "fieldConfig": {
455
- "defaults": {
456
- "color": {
457
- "mode": "palette-classic"
458
- },
459
- "custom": {
460
- "axisLabel": "",
461
- "axisPlacement": "auto",
462
- "barAlignment": 0,
463
- "drawStyle": "line",
464
- "fillOpacity": 10,
465
- "gradientMode": "none",
466
- "hideFrom": {
467
- "legend": false,
468
- "tooltip": false,
469
- "vis": false
470
- },
471
- "lineInterpolation": "linear",
472
- "lineWidth": 2,
473
- "pointSize": 5,
474
- "scaleDistribution": {
475
- "type": "linear"
476
- },
477
- "showPoints": "never",
478
- "spanNulls": false,
479
- "stacking": {
480
- "group": "A",
481
- "mode": "none"
482
- },
483
- "thresholdsStyle": {
484
- "mode": "off"
485
- }
486
- },
487
- "mappings": [],
488
- "thresholds": {
489
- "mode": "absolute",
490
- "steps": [
491
- {
492
- "color": "green",
493
- "value": null
494
- },
495
- {
496
- "color": "red",
497
- "value": 80
498
- }
499
- ]
500
- },
501
- "unit": "short"
502
- },
503
- "overrides": [
504
- {
505
- "matcher": {
506
- "id": "byName",
507
- "options": "failed"
508
- },
509
- "properties": [
510
- {
511
- "id": "color",
512
- "value": {
513
- "mode": "fixed",
514
- "fixedColor": "red"
515
- }
516
- }
517
- ]
518
- },
519
- {
520
- "matcher": {
521
- "id": "byName",
522
- "options": "success"
523
- },
524
- "properties": [
525
- {
526
- "id": "color",
527
- "value": {
528
- "mode": "fixed",
529
- "fixedColor": "green"
530
- }
531
- }
532
- ]
533
- }
534
- ]
535
- },
536
- "gridPos": {
537
- "h": 8,
538
- "w": 12,
539
- "x": 0,
540
- "y": 14
541
- },
542
- "id": 7,
543
- "options": {
544
- "legend": {
545
- "calcs": [],
546
- "displayMode": "list",
547
- "placement": "bottom"
548
- },
549
- "tooltip": {
550
- "mode": "single",
551
- "sort": "none"
552
- }
553
- },
554
- "targets": [
555
- {
556
- "datasource": {
557
- "type": "prometheus",
558
- "uid": "prometheus"
559
- },
560
- "expr": "rate(cidadao_ai_transparency_data_fetched_total{endpoint=\"contracts\"}[5m])",
561
- "interval": "",
562
- "legendFormat": "{{status}} - Org {{organization}}",
563
- "refId": "A"
564
- }
565
- ],
566
- "title": "Transparency API Data Fetch Rate",
567
- "type": "timeseries"
568
- },
569
- {
570
- "datasource": {
571
- "type": "prometheus",
572
- "uid": "prometheus"
573
- },
574
- "fieldConfig": {
575
- "defaults": {
576
- "color": {
577
- "mode": "palette-classic"
578
- },
579
- "custom": {
580
- "hideFrom": {
581
- "legend": false,
582
- "tooltip": false,
583
- "vis": false
584
- }
585
- },
586
- "mappings": [],
587
- "unit": "short"
588
- },
589
- "overrides": []
590
- },
591
- "gridPos": {
592
- "h": 8,
593
- "w": 12,
594
- "x": 12,
595
- "y": 14
596
- },
597
- "id": 8,
598
- "options": {
599
- "displayLabels": [
600
- "name",
601
- "value"
602
- ],
603
- "legend": {
604
- "displayMode": "list",
605
- "placement": "right",
606
- "values": []
607
- },
608
- "pieType": "pie",
609
- "reduceOptions": {
610
- "calcs": [
611
- "lastNotNull"
612
- ],
613
- "fields": "",
614
- "values": false
615
- },
616
- "tooltip": {
617
- "mode": "single",
618
- "sort": "none"
619
- }
620
- },
621
- "targets": [
622
- {
623
- "datasource": {
624
- "type": "prometheus",
625
- "uid": "prometheus"
626
- },
627
- "expr": "sum by (severity) (cidadao_ai_anomalies_detected_total{agent=\"zumbi\"})",
628
- "interval": "",
629
- "legendFormat": "{{severity}}",
630
- "refId": "A"
631
- }
632
- ],
633
- "title": "Anomaly Severity Distribution",
634
- "type": "piechart"
635
- }
636
- ],
637
- "refresh": "10s",
638
- "revision": 1,
639
- "schemaVersion": 39,
640
- "style": "dark",
641
- "tags": [
642
- "cidadao-ai",
643
- "zumbi",
644
- "investigations",
645
- "anomalies"
646
- ],
647
- "templating": {
648
- "list": []
649
- },
650
- "time": {
651
- "from": "now-1h",
652
- "to": "now"
653
- },
654
- "timepicker": {},
655
- "timezone": "",
656
- "title": "🏹 Zumbi dos Palmares - Investigador Dashboard",
657
- "uid": "zumbi-agent-dashboard",
658
- "version": 1,
659
- "weekStart": ""
660
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
grafana/provisioning/dashboards/dashboards.yml DELETED
@@ -1,26 +0,0 @@
1
- apiVersion: 1
2
-
3
- providers:
4
- - name: 'default'
5
- orgId: 1
6
- folder: ''
7
- folderUid: ''
8
- type: file
9
- disableDeletion: false
10
- editable: true
11
- updateIntervalSeconds: 30
12
- allowUiUpdates: true
13
- options:
14
- path: /var/lib/grafana/dashboards
15
-
16
- - name: 'Cidadão.AI'
17
- orgId: 1
18
- folder: 'Cidadão.AI'
19
- folderUid: 'cidadao_ai'
20
- type: file
21
- disableDeletion: false
22
- editable: true
23
- updateIntervalSeconds: 30
24
- allowUiUpdates: true
25
- options:
26
- path: /var/lib/grafana/dashboards
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
grafana/provisioning/datasources/prometheus.yml DELETED
@@ -1,17 +0,0 @@
1
- apiVersion: 1
2
-
3
- datasources:
4
- - name: Prometheus
5
- type: prometheus
6
- access: proxy
7
- url: http://prometheus:9090
8
- isDefault: true
9
- editable: true
10
- jsonData:
11
- httpMethod: POST
12
- manageAlerts: true
13
- prometheusType: Prometheus
14
- prometheusVersion: 2.49.1
15
- cacheLevel: 'High'
16
- disableRecordingRules: false
17
- incrementalQueryOverlapWindow: 10m
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
prometheus/prometheus.yml DELETED
@@ -1,52 +0,0 @@
1
- global:
2
- scrape_interval: 15s
3
- evaluation_interval: 15s
4
- external_labels:
5
- monitor: 'cidadao-ai-monitor'
6
-
7
- rule_files:
8
- - "rules/*.yml"
9
-
10
- scrape_configs:
11
- # Cidadão.AI Backend Application Metrics
12
- - job_name: 'cidadao-ai-backend'
13
- static_configs:
14
- - targets: ['cidadao-ai:7860']
15
- metrics_path: /health/metrics
16
- scrape_interval: 10s
17
- scrape_timeout: 5s
18
- params:
19
- format: ['prometheus']
20
-
21
- # Prometheus Self-Monitoring
22
- - job_name: 'prometheus'
23
- static_configs:
24
- - targets: ['localhost:9090']
25
- scrape_interval: 30s
26
-
27
- # Grafana Monitoring
28
- - job_name: 'grafana'
29
- static_configs:
30
- - targets: ['grafana:3000']
31
- scrape_interval: 30s
32
-
33
- # System Metrics via Node Exporter
34
- - job_name: 'node-exporter'
35
- static_configs:
36
- - targets: ['node_exporter:9100']
37
- scrape_interval: 15s
38
-
39
- # Container Metrics via cAdvisor
40
- - job_name: 'cadvisor'
41
- static_configs:
42
- - targets: ['cadvisor:8080']
43
- scrape_interval: 15s
44
-
45
- # Alternative Health Check Endpoint
46
- - job_name: 'cidadao-ai-health'
47
- static_configs:
48
- - targets: ['cidadao-ai:7860']
49
- metrics_path: /health
50
- scrape_interval: 30s
51
- params:
52
- format: ['json']
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
prometheus/rules/cidadao-ai-alerts.yml DELETED
@@ -1,150 +0,0 @@
1
- groups:
2
- - name: cidadao-ai-system
3
- rules:
4
- - alert: HighCPUUsage
5
- expr: 100 - (avg(rate(node_cpu_seconds_total{mode="idle"}[5m])) * 100) > 80
6
- for: 2m
7
- labels:
8
- severity: warning
9
- service: cidadao-ai
10
- annotations:
11
- summary: "High CPU usage detected"
12
- description: "CPU usage is above 80% for more than 2 minutes. Current value: {{ $value }}%"
13
-
14
- - alert: HighMemoryUsage
15
- expr: (1 - (node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes)) * 100 > 85
16
- for: 2m
17
- labels:
18
- severity: warning
19
- service: cidadao-ai
20
- annotations:
21
- summary: "High memory usage detected"
22
- description: "Memory usage is above 85% for more than 2 minutes. Current value: {{ $value }}%"
23
-
24
- - alert: ServiceDown
25
- expr: up{job="cidadao-ai-backend"} == 0
26
- for: 1m
27
- labels:
28
- severity: critical
29
- service: cidadao-ai
30
- annotations:
31
- summary: "Cidadão.AI service is down"
32
- description: "The Cidadão.AI backend service has been down for more than 1 minute."
33
-
34
- - name: cidadao-ai-api
35
- rules:
36
- - alert: HighAPILatency
37
- expr: histogram_quantile(0.95, rate(cidadao_ai_request_duration_seconds_bucket[5m])) > 2
38
- for: 5m
39
- labels:
40
- severity: warning
41
- service: cidadao-ai
42
- component: api
43
- annotations:
44
- summary: "High API latency detected"
45
- description: "95th percentile API latency is above 2 seconds for more than 5 minutes. Current value: {{ $value }}s"
46
-
47
- - alert: HighAPIErrorRate
48
- expr: sum(rate(cidadao_ai_requests_total{status_code=~"5.."}[5m])) / sum(rate(cidadao_ai_requests_total[5m])) > 0.05
49
- for: 3m
50
- labels:
51
- severity: warning
52
- service: cidadao-ai
53
- component: api
54
- annotations:
55
- summary: "High API error rate detected"
56
- description: "API error rate is above 5% for more than 3 minutes. Current rate: {{ $value | humanizePercentage }}"
57
-
58
- - alert: LowAPIThroughput
59
- expr: sum(rate(cidadao_ai_requests_total[5m])) < 0.1
60
- for: 10m
61
- labels:
62
- severity: info
63
- service: cidadao-ai
64
- component: api
65
- annotations:
66
- summary: "Low API throughput"
67
- description: "API throughput is very low (< 0.1 req/sec) for more than 10 minutes. Current rate: {{ $value }} req/sec"
68
-
69
- - name: cidadao-ai-investigations
70
- rules:
71
- - alert: HighInvestigationFailureRate
72
- expr: sum(rate(cidadao_ai_investigations_total{status="failed"}[10m])) / sum(rate(cidadao_ai_investigations_total[10m])) > 0.1
73
- for: 5m
74
- labels:
75
- severity: warning
76
- service: cidadao-ai
77
- component: investigations
78
- annotations:
79
- summary: "High investigation failure rate"
80
- description: "Investigation failure rate is above 10% for more than 5 minutes. Current rate: {{ $value | humanizePercentage }}"
81
-
82
- - alert: LongInvestigationDuration
83
- expr: histogram_quantile(0.95, rate(cidadao_ai_investigation_duration_seconds_bucket[5m])) > 300
84
- for: 5m
85
- labels:
86
- severity: warning
87
- service: cidadao-ai
88
- component: investigations
89
- annotations:
90
- summary: "Long investigation duration detected"
91
- description: "95th percentile investigation duration is above 5 minutes. Current value: {{ $value }}s"
92
-
93
- - alert: NoAnomaliesDetected
94
- expr: increase(cidadao_ai_anomalies_detected_total[1h]) == 0
95
- for: 2h
96
- labels:
97
- severity: info
98
- service: cidadao-ai
99
- component: investigations
100
- annotations:
101
- summary: "No anomalies detected recently"
102
- description: "No anomalies have been detected in the last 2 hours. This might indicate a problem with the detection system."
103
-
104
- - name: cidadao-ai-data
105
- rules:
106
- - alert: TransparencyAPIFailures
107
- expr: sum(rate(cidadao_ai_transparency_data_fetched_total{status="failed"}[5m])) > 0
108
- for: 3m
109
- labels:
110
- severity: warning
111
- service: cidadao-ai
112
- component: transparency-api
113
- annotations:
114
- summary: "Transparency API failures detected"
115
- description: "There are failures when fetching data from the Transparency API. Rate: {{ $value }} failures/sec"
116
-
117
- - alert: LowDataProcessingRate
118
- expr: sum(rate(cidadao_ai_data_records_processed_total[5m])) < 1
119
- for: 15m
120
- labels:
121
- severity: info
122
- service: cidadao-ai
123
- component: data-processing
124
- annotations:
125
- summary: "Low data processing rate"
126
- description: "Data processing rate is very low (< 1 record/sec) for more than 15 minutes. Current rate: {{ $value }} records/sec"
127
-
128
- - name: cidadao-ai-agents
129
- rules:
130
- - alert: HighAgentTaskFailureRate
131
- expr: sum(rate(cidadao_ai_agent_tasks_total{status="failed"}[10m])) / sum(rate(cidadao_ai_agent_tasks_total[10m])) > 0.05
132
- for: 5m
133
- labels:
134
- severity: warning
135
- service: cidadao-ai
136
- component: agents
137
- annotations:
138
- summary: "High agent task failure rate"
139
- description: "Agent task failure rate is above 5% for more than 5 minutes. Current rate: {{ $value | humanizePercentage }}"
140
-
141
- - alert: AgentTaskRetries
142
- expr: sum(rate(cidadao_ai_agent_tasks_total{status="retry"}[5m])) > 0.1
143
- for: 5m
144
- labels:
145
- severity: info
146
- service: cidadao-ai
147
- component: agents
148
- annotations:
149
- summary: "Frequent agent task retries"
150
- description: "Agent tasks are retrying frequently. Retry rate: {{ $value }} retries/sec"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
requirements-hf.txt DELETED
@@ -1,61 +0,0 @@
1
- # Cidadão.AI Backend - Production Requirements
2
-
3
- # Web Framework
4
- fastapi>=0.104.0
5
- uvicorn[standard]>=0.24.0
6
- gunicorn>=21.2.0
7
-
8
- # Database
9
- sqlalchemy[asyncio]>=2.0.0
10
- asyncpg>=0.29.0
11
- alembic>=1.13.0
12
-
13
- # Cache and Queue
14
- redis>=5.0.0
15
- celery>=5.3.0
16
-
17
- # Authentication
18
- python-jose[cryptography]>=3.3.0
19
- passlib[bcrypt]>=1.7.4
20
- python-multipart>=0.0.6
21
-
22
- # Data Validation
23
- pydantic>=2.5.0
24
- pydantic-settings>=2.1.0
25
-
26
- # HTTP Client
27
- httpx>=0.27.0
28
- requests>=2.31.0
29
-
30
- # AI/ML
31
- langchain>=0.1.0
32
- transformers>=4.36.0
33
- sentence-transformers>=2.2.0
34
- scikit-learn>=1.3.0
35
- numpy>=1.21.0
36
- pandas>=2.0.0
37
-
38
- # Vector Database
39
- chromadb>=0.4.0
40
-
41
- # LLM Providers
42
- groq>=0.10.0
43
- openai>=1.6.0
44
-
45
- # Configuration
46
- python-dotenv>=1.0.0
47
-
48
- # Monitoring
49
- prometheus-client>=0.19.0
50
- structlog>=23.2.0
51
-
52
- # Development
53
- pytest>=7.4.0
54
- pytest-asyncio>=0.21.0
55
- black>=23.0.0
56
- ruff>=0.1.0
57
- mypy>=1.8.0
58
-
59
- # Security
60
- cryptography>=41.0.0
61
- python-dateutil>=2.8.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
requirements-lock.txt DELETED
@@ -1,65 +0,0 @@
1
- # Cidadão.AI Backend - Locked Dependencies
2
- # Generated for reproducible builds across environments
3
- # This file locks specific versions for production deployment
4
- # Use: pip install -r requirements-lock.txt
5
-
6
- # Core framework
7
- fastapi==0.109.2
8
- uvicorn[standard]==0.27.1
9
- typer==0.9.4
10
- rich==13.7.1
11
-
12
- # Data validation and serialization
13
- pydantic==2.6.3
14
- pydantic-settings==2.2.1
15
-
16
- # Database
17
- sqlalchemy==2.0.28
18
- alembic==1.13.1
19
- asyncpg==0.29.0
20
- redis==5.0.3
21
-
22
- # AI/ML Core
23
- langchain==0.1.11
24
- langchain-community==0.0.27
25
- langchain-openai==0.0.8
26
- transformers==4.38.2
27
- torch==2.2.1
28
- faiss-cpu==1.8.0
29
- chromadb==0.4.24
30
-
31
- # ML/Data Science
32
- scikit-learn==1.4.1
33
- pandas==2.2.1
34
- numpy==1.26.4
35
- scipy==1.12.0
36
- prophet==1.1.5
37
- umap-learn==0.5.5
38
- hdbscan==0.8.33
39
- shap==0.44.1
40
- lime==0.2.0.1
41
-
42
- # Async processing
43
- celery[redis]==5.3.6
44
- flower==2.0.1
45
-
46
- # HTTP and API clients
47
- httpx==0.27.0
48
- aiohttp==3.9.3
49
-
50
- # Monitoring and logging
51
- opentelemetry-api==1.23.0
52
- opentelemetry-sdk==1.23.0
53
- opentelemetry-instrumentation-fastapi==0.44b0
54
- prometheus-client==0.20.0
55
- structlog==24.1.0
56
-
57
- # Security and authentication
58
- python-jose[cryptography]==3.3.0
59
- passlib[bcrypt]==1.7.4
60
- python-multipart==0.0.9
61
-
62
- # Utilities
63
- python-dotenv==1.0.1
64
- tenacity==8.2.3
65
- pendulum==3.0.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
requirements/README.md ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Requirements Structure
2
+
3
+ This directory contains organized dependency files for different environments and use cases.
4
+
5
+ ## File Structure
6
+
7
+ - **`base.txt`** - Core dependencies needed for all environments
8
+ - **`production.txt`** - Full production stack extending base.txt
9
+ - **`dev.txt`** - Development tools and testing dependencies
10
+ - **`hf.txt`** - HuggingFace Spaces minimal requirements
11
+
12
+ ## Usage
13
+
14
+ ### Development Environment
15
+ ```bash
16
+ pip install -r requirements/dev.txt
17
+ ```
18
+
19
+ ### Production Environment
20
+ ```bash
21
+ pip install -r requirements/production.txt
22
+ ```
23
+
24
+ ### HuggingFace Spaces
25
+ ```bash
26
+ pip install -r requirements/hf.txt
27
+ # OR use root requirements.txt (identical to hf.txt)
28
+ pip install -r requirements.txt
29
+ ```
30
+
31
+ ## Primary Source of Truth
32
+
33
+ The main dependency source is `pyproject.toml`. These requirements files are derived from it for specific deployment scenarios.
34
+
35
+ ## Dependencies Overview
36
+
37
+ - **Base:** FastAPI, Pydantic, HTTPX, Prometheus, NumPy, Pandas
38
+ - **Production:** +Database, +AI/ML, +Security, +Monitoring
39
+ - **Development:** +Testing, +Code Quality, +Documentation tools
40
+ - **HuggingFace:** Minimal subset for cloud deployment
requirements/base.txt CHANGED
@@ -1,21 +1,26 @@
1
- # Requirements for Backend API
2
- # FastAPI backend dependencies
3
 
4
- # Core dependencies
5
  fastapi>=0.104.0
6
  uvicorn[standard]>=0.24.0
7
- httpx>=0.27.0
8
  pydantic>=2.5.0
 
 
 
 
 
 
9
  python-dotenv>=1.0.0
10
 
11
- # Optional - for AI analysis
12
- groq>=0.10.0
 
13
 
14
- # Data processing
15
- pandas>=2.0.0
16
- numpy>=1.21.0
17
- scipy>=1.9.0
18
 
19
- # Utilities
20
- python-dateutil>=2.8.0
21
- pillow>=10.0.0
 
1
+ # Base requirements for Cidadão.AI Backend
2
+ # Essential dependencies for all environments
3
 
4
+ # Core Web Framework
5
  fastapi>=0.104.0
6
  uvicorn[standard]>=0.24.0
 
7
  pydantic>=2.5.0
8
+ pydantic-settings>=2.0.0
9
+
10
+ # HTTP Client
11
+ httpx>=0.27.0
12
+
13
+ # Configuration
14
  python-dotenv>=1.0.0
15
 
16
+ # Security
17
+ python-jose[cryptography]>=3.3.0
18
+ python-multipart>=0.0.6
19
 
20
+ # Logging & Monitoring
21
+ structlog>=23.0.0
22
+ prometheus-client>=0.19.0
 
23
 
24
+ # Data Processing
25
+ numpy>=1.24.0
26
+ pandas>=2.0.0
requirements/dev.txt ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Development dependencies
2
+ -r base.txt
3
+
4
+ # Testing
5
+ pytest>=7.4.0
6
+ pytest-asyncio>=0.21.0
7
+ pytest-cov>=4.1.0
8
+ pytest-mock>=3.12.0
9
+ httpx[test]>=0.27.0
10
+
11
+ # Code Quality
12
+ black>=23.0.0
13
+ ruff>=0.1.0
14
+ mypy>=1.8.0
15
+ pre-commit>=3.6.0
16
+
17
+ # Documentation
18
+ mkdocs>=1.5.0
19
+ mkdocs-material>=9.4.0
20
+
21
+ # Development Tools
22
+ ipython>=8.18.0
23
+ python-dotenv>=1.0.0
requirements/hf.txt ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Cidadão.AI Backend - HuggingFace Minimal Requirements
2
+ # Optimized for fast deployment and startup in HF Spaces
3
+
4
+ # Web Framework
5
+ fastapi>=0.104.0
6
+ uvicorn[standard]>=0.24.0
7
+ pydantic>=2.5.0
8
+
9
+ # Monitoring
10
+ prometheus-client>=0.19.0
11
+
12
+ # HTTP Client (lightweight)
13
+ httpx>=0.27.0
14
+
15
+ # Security (essential only)
16
+ python-jose[cryptography]>=3.3.0
17
+ python-multipart>=0.0.6
18
+
19
+ # Utils
20
+ python-dotenv>=1.0.0
21
+
22
+ # Configuration
23
+ pydantic-settings>=2.0.0
24
+
25
+ # Logging
26
+ structlog>=23.0.0
27
+
28
+ # Data Analysis (minimal)
29
+ numpy>=1.24.0
30
+ pandas>=2.0.0
requirements/production.txt CHANGED
@@ -1,48 +1,29 @@
1
- # Production Requirements for Cidadão.AI
2
- # Core Framework
3
- fastapi>=0.104.0
4
- uvicorn[standard]>=0.24.0
5
- pydantic>=2.4.0
6
- python-multipart>=0.0.6
7
 
8
  # Database & Cache
9
  asyncpg>=0.29.0
10
- sqlalchemy[asyncio]>=2.0.23
11
- redis[hiredis]>=5.0.1
12
- aiocache>=0.12.2
13
 
14
- # ML & AI (lightweight for HF Spaces)
15
- transformers>=4.35.0
16
- huggingface-hub>=0.19.0
17
- numpy>=1.24.0
18
- pandas>=2.1.0
19
  scikit-learn>=1.3.0
 
 
20
 
21
- # Async & HTTP
22
- httpx>=0.25.0
23
- aiohttp>=3.9.0
24
- websockets>=12.0
25
 
26
- # Monitoring & Observability (simplified for HF Spaces)
27
- prometheus-client>=0.19.0
28
-
29
- # Serialization & Compression
30
- msgpack>=1.0.7
31
- structlog>=23.2.0
32
 
33
  # System Monitoring
34
- psutil>=5.9.6
35
 
36
- # Security
37
- cryptography>=41.0.7
38
- python-jose[cryptography]>=3.3.0
39
- passlib[bcrypt]>=1.7.4
40
-
41
- # Utilities
42
- python-dotenv>=1.0.0
43
- click>=8.1.7
44
  typer>=0.9.0
45
  rich>=13.7.0
46
-
47
- # Production WSGI
48
- gunicorn>=21.2.0
 
1
+ # Production requirements extending base
2
+ -r base.txt
 
 
 
 
3
 
4
  # Database & Cache
5
  asyncpg>=0.29.0
6
+ sqlalchemy[asyncio]>=2.0.0
7
+ redis>=5.0.0
8
+ alembic>=1.13.0
9
 
10
+ # AI/ML Stack
11
+ transformers>=4.36.0
 
 
 
12
  scikit-learn>=1.3.0
13
+ langchain>=0.1.0
14
+ groq>=0.10.0
15
 
16
+ # Production Server
17
+ gunicorn>=21.2.0
 
 
18
 
19
+ # Advanced Security
20
+ cryptography>=41.0.0
21
+ passlib[bcrypt]>=1.7.4
 
 
 
22
 
23
  # System Monitoring
24
+ psutil>=5.9.0
25
 
26
+ # CLI Tools
 
 
 
 
 
 
 
27
  typer>=0.9.0
28
  rich>=13.7.0
29
+ click>=8.1.0