sydes 0.1.0__tar.gz
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.
- sydes-0.1.0/.gitignore +50 -0
- sydes-0.1.0/PKG-INFO +300 -0
- sydes-0.1.0/README.md +281 -0
- sydes-0.1.0/docs/contributing.md +50 -0
- sydes-0.1.0/docs/pipeline.md +63 -0
- sydes-0.1.0/docs/testing.md +312 -0
- sydes-0.1.0/docs/usage.md +370 -0
- sydes-0.1.0/pyproject.toml +53 -0
- sydes-0.1.0/src/aiautopsy/__init__.py +2 -0
- sydes-0.1.0/src/aiautopsy/cli/__init__.py +8 -0
- sydes-0.1.0/src/aiautopsy/cli/app.py +60 -0
- sydes-0.1.0/src/aiautopsy/cli/commands.py +1742 -0
- sydes-0.1.0/src/aiautopsy/config/__init__.py +6 -0
- sydes-0.1.0/src/aiautopsy/config/logging.py +11 -0
- sydes-0.1.0/src/aiautopsy/config/settings.py +17 -0
- sydes-0.1.0/src/aiautopsy/core/__init__.py +2 -0
- sydes-0.1.0/src/aiautopsy/core/consolidation/__init__.py +6 -0
- sydes-0.1.0/src/aiautopsy/core/consolidation/consolidator.py +272 -0
- sydes-0.1.0/src/aiautopsy/core/consolidation/models.py +30 -0
- sydes-0.1.0/src/aiautopsy/core/evidence/__init__.py +53 -0
- sydes-0.1.0/src/aiautopsy/core/evidence/framing.py +524 -0
- sydes-0.1.0/src/aiautopsy/core/evidence/models.py +112 -0
- sydes-0.1.0/src/aiautopsy/core/evidence/profile_apply.py +522 -0
- sydes-0.1.0/src/aiautopsy/core/evidence/profile_inference.py +657 -0
- sydes-0.1.0/src/aiautopsy/core/evidence/timestamp_families.py +462 -0
- sydes-0.1.0/src/aiautopsy/core/evidence/timestamping.py +243 -0
- sydes-0.1.0/src/aiautopsy/core/ingestion/__init__.py +23 -0
- sydes-0.1.0/src/aiautopsy/core/ingestion/filters.py +125 -0
- sydes-0.1.0/src/aiautopsy/core/ingestion/loader.py +114 -0
- sydes-0.1.0/src/aiautopsy/core/ingestion/query_selection.py +671 -0
- sydes-0.1.0/src/aiautopsy/core/ingestion/records.py +15 -0
- sydes-0.1.0/src/aiautopsy/core/ingestion/timestamps.py +21 -0
- sydes-0.1.0/src/aiautopsy/core/interpretation/__init__.py +43 -0
- sydes-0.1.0/src/aiautopsy/core/interpretation/adapters.py +217 -0
- sydes-0.1.0/src/aiautopsy/core/interpretation/chunking.py +48 -0
- sydes-0.1.0/src/aiautopsy/core/interpretation/interpreter.py +183 -0
- sydes-0.1.0/src/aiautopsy/core/interpretation/models.py +34 -0
- sydes-0.1.0/src/aiautopsy/core/ml/__init__.py +21 -0
- sydes-0.1.0/src/aiautopsy/core/ml/burst_scoring.py +42 -0
- sydes-0.1.0/src/aiautopsy/core/ml/enhancer.py +75 -0
- sydes-0.1.0/src/aiautopsy/core/ml/hypothesis_scoring.py +215 -0
- sydes-0.1.0/src/aiautopsy/core/ml/models.py +33 -0
- sydes-0.1.0/src/aiautopsy/core/ml/similarity.py +57 -0
- sydes-0.1.0/src/aiautopsy/core/reasoning/__init__.py +56 -0
- sydes-0.1.0/src/aiautopsy/core/reasoning/adapters.py +2384 -0
- sydes-0.1.0/src/aiautopsy/core/reasoning/context.py +58 -0
- sydes-0.1.0/src/aiautopsy/core/reasoning/context_builder.py +667 -0
- sydes-0.1.0/src/aiautopsy/core/reasoning/generator.py +382 -0
- sydes-0.1.0/src/aiautopsy/core/reasoning/incident_flow.py +497 -0
- sydes-0.1.0/src/aiautopsy/core/reasoning/models.py +109 -0
- sydes-0.1.0/src/aiautopsy/core/reasoning/pipeline.py +1717 -0
- sydes-0.1.0/src/aiautopsy/core/reasoning/root_cause.py +217 -0
- sydes-0.1.0/src/aiautopsy/core/reasoning/usage.py +24 -0
- sydes-0.1.0/src/aiautopsy/core/reporting/__init__.py +23 -0
- sydes-0.1.0/src/aiautopsy/core/reporting/builder.py +207 -0
- sydes-0.1.0/src/aiautopsy/core/reporting/models.py +60 -0
- sydes-0.1.0/src/aiautopsy/core/reporting/renderer.py +1308 -0
- sydes-0.1.0/src/aiautopsy/core/scaling/__init__.py +16 -0
- sydes-0.1.0/src/aiautopsy/core/scaling/models.py +23 -0
- sydes-0.1.0/src/aiautopsy/core/scaling/runtime.py +117 -0
- sydes-0.1.0/src/aiautopsy/core/timeline/__init__.py +21 -0
- sydes-0.1.0/src/aiautopsy/core/timeline/builder.py +600 -0
- sydes-0.1.0/src/aiautopsy/core/timeline/models.py +79 -0
- sydes-0.1.0/src/aiautopsy/models/__init__.py +2 -0
sydes-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Python-generated files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[oc]
|
|
4
|
+
build/
|
|
5
|
+
dist/
|
|
6
|
+
wheels/
|
|
7
|
+
*.egg-info
|
|
8
|
+
|
|
9
|
+
# Virtual environments
|
|
10
|
+
.venv
|
|
11
|
+
|
|
12
|
+
# Large public datasets
|
|
13
|
+
data/public/**/raw/**
|
|
14
|
+
data/public/**/meta/**
|
|
15
|
+
data/public/**/slices/generated/**
|
|
16
|
+
data/local/*
|
|
17
|
+
!data/local/.gitkeep
|
|
18
|
+
|
|
19
|
+
# Allow checked-in tiny slices
|
|
20
|
+
!data/public/**/raw/.gitkeep
|
|
21
|
+
!data/public/**/meta/.gitkeep
|
|
22
|
+
!data/public/**/slices/.gitkeep
|
|
23
|
+
!data/public/**/slices/checked_in/**
|
|
24
|
+
!data/public/**/slices/checked_in/.gitkeep
|
|
25
|
+
!data/public/**/slices/generated/.gitkeep
|
|
26
|
+
!data/public/**/manifests/**
|
|
27
|
+
!data/public/**/manifests/.gitkeep
|
|
28
|
+
!data/public/README.md
|
|
29
|
+
|
|
30
|
+
# Reports
|
|
31
|
+
reports/*.txt
|
|
32
|
+
reports/*.json
|
|
33
|
+
reports/*.md
|
|
34
|
+
reports/**/*.txt
|
|
35
|
+
reports/**/*.json
|
|
36
|
+
reports/**/*.md
|
|
37
|
+
|
|
38
|
+
# Misc dataset archives
|
|
39
|
+
*.zip
|
|
40
|
+
*.tar.gz
|
|
41
|
+
*.tgz
|
|
42
|
+
*.npz
|
|
43
|
+
|
|
44
|
+
# local files
|
|
45
|
+
tmp.sh
|
|
46
|
+
tmp_apache.sh
|
|
47
|
+
run_synthetic_tests.sh
|
|
48
|
+
run_synth.sh
|
|
49
|
+
run_query.sh
|
|
50
|
+
.aiautopsy-debug
|
sydes-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sydes
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: System intelligence for backend systems, starting with incident analysis from logs.
|
|
5
|
+
Author-email: karims <karimullasaheb@gmail.com>
|
|
6
|
+
Keywords: cli,incident-analysis,logs,observability,root-cause
|
|
7
|
+
Classifier: Development Status :: 3 - Alpha
|
|
8
|
+
Classifier: Environment :: Console
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: License :: Other/Proprietary License
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Topic :: System :: Monitoring
|
|
15
|
+
Classifier: Topic :: Utilities
|
|
16
|
+
Requires-Python: >=3.12
|
|
17
|
+
Requires-Dist: typer>=0.12.0
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
|
|
20
|
+
# Sydes — Incident Analysis
|
|
21
|
+
|
|
22
|
+
Understand production incidents from logs using AI.
|
|
23
|
+
|
|
24
|
+
Stop reading thousands of log lines manually.
|
|
25
|
+
Get a structured root-cause hypothesis, timeline, and evidence in seconds.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 📦 Installation
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
pip install sydes
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## 📦 Build and Release
|
|
36
|
+
|
|
37
|
+
Build release artifacts locally:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
python -m build
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Upload them to PyPI:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
twine upload dist/*
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Verify the published package:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
pip install sydes
|
|
53
|
+
sydes --help
|
|
54
|
+
sydes incident analyze --help
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## ⚙️ Quickstart Setup
|
|
60
|
+
|
|
61
|
+
Before running incident analysis, choose one model path:
|
|
62
|
+
|
|
63
|
+
### OpenAI
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
export OPENAI_API_KEY=your_openai_api_key
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Then run with:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
--model openai:gpt-4.1-mini
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Ollama
|
|
76
|
+
|
|
77
|
+
Start Ollama and pull a local model:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
ollama serve
|
|
81
|
+
ollama pull llama3.1
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Then run with:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
--model ollama:llama3.1
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Optional environment variables:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
export OLLAMA_BASE_URL=http://127.0.0.1:11434
|
|
94
|
+
export AIAUTOPSY_OLLAMA_MODEL=llama3.1
|
|
95
|
+
export AIAUTOPSY_MODEL_TIMEOUT=60
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Use `--require-model` if the command should fail instead of continuing when the requested model backend is unavailable.
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## ⚡ Quick Demo
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
sydes incident analyze \
|
|
106
|
+
--model openai:gpt-4.1-mini \
|
|
107
|
+
--require-model \
|
|
108
|
+
--query "Why is checkout returning 503 errors?" \
|
|
109
|
+
logs/incident.log
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
== INCIDENT SUMMARY ==
|
|
115
|
+
API Gateway timeouts to db-proxy causing 503 errors on checkout requests
|
|
116
|
+
|
|
117
|
+
== INCIDENT WINDOW ==
|
|
118
|
+
Mode: exact
|
|
119
|
+
Start: 2026-03-25T13:34:05+00:00
|
|
120
|
+
End: 2026-03-25T13:34:05+00:00
|
|
121
|
+
Timeline events: 1
|
|
122
|
+
|
|
123
|
+
== TOP HYPOTHESIS ==
|
|
124
|
+
API Gateway timeouts to db-proxy causing 503 errors on checkout requests
|
|
125
|
+
The API Gateway service is experiencing repeated HTTP 503 errors for checkout endpoints, all linked to upstream db-proxy timeouts. This explains early high-severity error signals and cross-host impact within the API Gateway service, and correlates with observed degraded operations and dependency failures.
|
|
126
|
+
Source: openai:gpt-4.1-mini
|
|
127
|
+
|
|
128
|
+
== CONFIDENCE / STRENGTH ==
|
|
129
|
+
Strength: 0.85
|
|
130
|
+
|
|
131
|
+
== WHY THIS HYPOTHESIS ==
|
|
132
|
+
- Primary cause: API Gateway timeouts to db-proxy causing 503 errors on checkout requests
|
|
133
|
+
- Observed evidence: At 2026-03-25T13:34:05, api-gateway host=api-2 logged ERROR level HTTP 503 responses on /v1/checkout due to upstream=db-proxy timeout | Repeated ERROR level 503 responses on /v1/checkout from api-gateway hosts (api-1 and api-2) within 30 seconds, all citing upstream=db-proxy err=timeout
|
|
134
|
+
- Contributing signals: The upstream db-proxy timeout from api-gateway triggers HTTP 503 errors returned to clients
|
|
135
|
+
- Uncertainty: No direct error or exception logs from db-proxy confirm root cause beyond timeouts reported by api-gateway
|
|
136
|
+
|
|
137
|
+
== ALTERNATIVES CONSIDERED ==
|
|
138
|
+
- Likely api show timeouts causing service 503 errors (Assessment Strength: 0.60)
|
|
139
|
+
- Transient network latency or connectivity issues between api-gateway and db-proxy causing timeouts (Assessment Strength: 0.55)
|
|
140
|
+
|
|
141
|
+
== AFFECTED SERVICES ==
|
|
142
|
+
api, api-gateway
|
|
143
|
+
|
|
144
|
+
== KEY SIGNALS ==
|
|
145
|
+
- 1 timeline events from 2026-03-25T13:34:05+00:00 to 2026-03-25T13:34:05+00:00, with 0 burst(s).
|
|
146
|
+
- 1 cluster(s); largest cluster cluster-000006 contains 2 event(s).
|
|
147
|
+
|
|
148
|
+
== EVIDENCE SUMMARY ==
|
|
149
|
+
Files: 1 | Lines: 4096 | Timestamp candidates: 205
|
|
150
|
+
Parsed timestamps: 205 | Sequence-only records: 0
|
|
151
|
+
Ingestion timestamp hints: 4096 | Seed records: 12 | Evidence refs: 12
|
|
152
|
+
Seed filters: query=Why is checkout returning 503 errors?, query_refined=why is gateway host
|
|
153
|
+
|
|
154
|
+
== NEXT STEPS ==
|
|
155
|
+
- Validate the top hypothesis against recent deploys and dependency changes.
|
|
156
|
+
|
|
157
|
+
== MODEL USED ==
|
|
158
|
+
Requested: openai:gpt-4.1-mini
|
|
159
|
+
Resolved reasoning model: gpt-4.1-mini
|
|
160
|
+
Interpretation backend: local-small
|
|
161
|
+
Reasoning backend: openai:gpt-4.1-mini
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## 🧠 What Sydes does
|
|
167
|
+
|
|
168
|
+
Sydes analyzes raw logs and automatically:
|
|
169
|
+
|
|
170
|
+
- extracts structured events
|
|
171
|
+
- groups related signals
|
|
172
|
+
- builds a timeline of the incident
|
|
173
|
+
- generates root-cause hypotheses
|
|
174
|
+
- shows supporting evidence
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## 🚀 Usage
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
sydes incident analyze [OPTIONS] <log files>
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### Example
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
sydes incident analyze logs/*.log \
|
|
188
|
+
--query "Why are session lookups failing?"
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## 🔍 Modes of Analysis
|
|
194
|
+
|
|
195
|
+
Sydes works best when you guide it.
|
|
196
|
+
|
|
197
|
+
### 1. Whole log (overview)
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
sydes incident analyze logs/*.log
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
→ broad, approximate understanding
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
### 2. Grep (precise signal)
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
sydes incident analyze logs/*.log \
|
|
211
|
+
--grep "cache_unavailable"
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
→ exact failure analysis
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
### 3. Query (semantic focus)
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
sydes incident analyze logs/*.log \
|
|
222
|
+
--query "Why are session lookups failing?"
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
→ AI-driven reasoning
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
### 4. Query + Grep (recommended)
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
sydes incident analyze logs/*.log \
|
|
233
|
+
--query "Why are session lookups failing?" \
|
|
234
|
+
--grep "session lookup failed"
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
→ best results (focused + precise)
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
## ⚙️ Model Support
|
|
242
|
+
|
|
243
|
+
Example:
|
|
244
|
+
|
|
245
|
+
```bash
|
|
246
|
+
--model openai:gpt-4.1-mini
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
Use `--require-model` to fail if the model is unavailable instead of falling back.
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## 🧩 Example Logs
|
|
254
|
+
|
|
255
|
+
```bash
|
|
256
|
+
sydes incident analyze examples/auth_cache_failure.log \
|
|
257
|
+
--query "Why are session lookups failing?"
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
## 🚧 Status
|
|
263
|
+
|
|
264
|
+
This is an early version of Sydes.
|
|
265
|
+
|
|
266
|
+
- AI reasoning may be imperfect
|
|
267
|
+
- best results come from focused queries
|
|
268
|
+
- designed for real-world logs, not toy datasets
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
## 🔮 Roadmap
|
|
273
|
+
|
|
274
|
+
Sydes is evolving into a broader system intelligence platform:
|
|
275
|
+
|
|
276
|
+
- incident analysis (current)
|
|
277
|
+
- system understanding from code
|
|
278
|
+
- integration test generation
|
|
279
|
+
- system graph + reasoning
|
|
280
|
+
|
|
281
|
+
---
|
|
282
|
+
|
|
283
|
+
## 🧠 Philosophy
|
|
284
|
+
|
|
285
|
+
Logs are not the problem.
|
|
286
|
+
|
|
287
|
+
The problem is:
|
|
288
|
+
- too much data
|
|
289
|
+
- no structure
|
|
290
|
+
- no reasoning layer
|
|
291
|
+
|
|
292
|
+
Sydes adds:
|
|
293
|
+
- structure (events, clusters, timeline)
|
|
294
|
+
- reasoning (hypotheses grounded in evidence)
|
|
295
|
+
|
|
296
|
+
---
|
|
297
|
+
|
|
298
|
+
## 🤝 Contributing
|
|
299
|
+
|
|
300
|
+
PRs and feedback welcome.
|
sydes-0.1.0/README.md
ADDED
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
# Sydes — Incident Analysis
|
|
2
|
+
|
|
3
|
+
Understand production incidents from logs using AI.
|
|
4
|
+
|
|
5
|
+
Stop reading thousands of log lines manually.
|
|
6
|
+
Get a structured root-cause hypothesis, timeline, and evidence in seconds.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 📦 Installation
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pip install sydes
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## 📦 Build and Release
|
|
17
|
+
|
|
18
|
+
Build release artifacts locally:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
python -m build
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Upload them to PyPI:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
twine upload dist/*
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Verify the published package:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
pip install sydes
|
|
34
|
+
sydes --help
|
|
35
|
+
sydes incident analyze --help
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## ⚙️ Quickstart Setup
|
|
41
|
+
|
|
42
|
+
Before running incident analysis, choose one model path:
|
|
43
|
+
|
|
44
|
+
### OpenAI
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
export OPENAI_API_KEY=your_openai_api_key
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Then run with:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
--model openai:gpt-4.1-mini
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Ollama
|
|
57
|
+
|
|
58
|
+
Start Ollama and pull a local model:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
ollama serve
|
|
62
|
+
ollama pull llama3.1
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Then run with:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
--model ollama:llama3.1
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Optional environment variables:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
export OLLAMA_BASE_URL=http://127.0.0.1:11434
|
|
75
|
+
export AIAUTOPSY_OLLAMA_MODEL=llama3.1
|
|
76
|
+
export AIAUTOPSY_MODEL_TIMEOUT=60
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Use `--require-model` if the command should fail instead of continuing when the requested model backend is unavailable.
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## ⚡ Quick Demo
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
sydes incident analyze \
|
|
87
|
+
--model openai:gpt-4.1-mini \
|
|
88
|
+
--require-model \
|
|
89
|
+
--query "Why is checkout returning 503 errors?" \
|
|
90
|
+
logs/incident.log
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
== INCIDENT SUMMARY ==
|
|
96
|
+
API Gateway timeouts to db-proxy causing 503 errors on checkout requests
|
|
97
|
+
|
|
98
|
+
== INCIDENT WINDOW ==
|
|
99
|
+
Mode: exact
|
|
100
|
+
Start: 2026-03-25T13:34:05+00:00
|
|
101
|
+
End: 2026-03-25T13:34:05+00:00
|
|
102
|
+
Timeline events: 1
|
|
103
|
+
|
|
104
|
+
== TOP HYPOTHESIS ==
|
|
105
|
+
API Gateway timeouts to db-proxy causing 503 errors on checkout requests
|
|
106
|
+
The API Gateway service is experiencing repeated HTTP 503 errors for checkout endpoints, all linked to upstream db-proxy timeouts. This explains early high-severity error signals and cross-host impact within the API Gateway service, and correlates with observed degraded operations and dependency failures.
|
|
107
|
+
Source: openai:gpt-4.1-mini
|
|
108
|
+
|
|
109
|
+
== CONFIDENCE / STRENGTH ==
|
|
110
|
+
Strength: 0.85
|
|
111
|
+
|
|
112
|
+
== WHY THIS HYPOTHESIS ==
|
|
113
|
+
- Primary cause: API Gateway timeouts to db-proxy causing 503 errors on checkout requests
|
|
114
|
+
- Observed evidence: At 2026-03-25T13:34:05, api-gateway host=api-2 logged ERROR level HTTP 503 responses on /v1/checkout due to upstream=db-proxy timeout | Repeated ERROR level 503 responses on /v1/checkout from api-gateway hosts (api-1 and api-2) within 30 seconds, all citing upstream=db-proxy err=timeout
|
|
115
|
+
- Contributing signals: The upstream db-proxy timeout from api-gateway triggers HTTP 503 errors returned to clients
|
|
116
|
+
- Uncertainty: No direct error or exception logs from db-proxy confirm root cause beyond timeouts reported by api-gateway
|
|
117
|
+
|
|
118
|
+
== ALTERNATIVES CONSIDERED ==
|
|
119
|
+
- Likely api show timeouts causing service 503 errors (Assessment Strength: 0.60)
|
|
120
|
+
- Transient network latency or connectivity issues between api-gateway and db-proxy causing timeouts (Assessment Strength: 0.55)
|
|
121
|
+
|
|
122
|
+
== AFFECTED SERVICES ==
|
|
123
|
+
api, api-gateway
|
|
124
|
+
|
|
125
|
+
== KEY SIGNALS ==
|
|
126
|
+
- 1 timeline events from 2026-03-25T13:34:05+00:00 to 2026-03-25T13:34:05+00:00, with 0 burst(s).
|
|
127
|
+
- 1 cluster(s); largest cluster cluster-000006 contains 2 event(s).
|
|
128
|
+
|
|
129
|
+
== EVIDENCE SUMMARY ==
|
|
130
|
+
Files: 1 | Lines: 4096 | Timestamp candidates: 205
|
|
131
|
+
Parsed timestamps: 205 | Sequence-only records: 0
|
|
132
|
+
Ingestion timestamp hints: 4096 | Seed records: 12 | Evidence refs: 12
|
|
133
|
+
Seed filters: query=Why is checkout returning 503 errors?, query_refined=why is gateway host
|
|
134
|
+
|
|
135
|
+
== NEXT STEPS ==
|
|
136
|
+
- Validate the top hypothesis against recent deploys and dependency changes.
|
|
137
|
+
|
|
138
|
+
== MODEL USED ==
|
|
139
|
+
Requested: openai:gpt-4.1-mini
|
|
140
|
+
Resolved reasoning model: gpt-4.1-mini
|
|
141
|
+
Interpretation backend: local-small
|
|
142
|
+
Reasoning backend: openai:gpt-4.1-mini
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## 🧠 What Sydes does
|
|
148
|
+
|
|
149
|
+
Sydes analyzes raw logs and automatically:
|
|
150
|
+
|
|
151
|
+
- extracts structured events
|
|
152
|
+
- groups related signals
|
|
153
|
+
- builds a timeline of the incident
|
|
154
|
+
- generates root-cause hypotheses
|
|
155
|
+
- shows supporting evidence
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## 🚀 Usage
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
sydes incident analyze [OPTIONS] <log files>
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Example
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
sydes incident analyze logs/*.log \
|
|
169
|
+
--query "Why are session lookups failing?"
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## 🔍 Modes of Analysis
|
|
175
|
+
|
|
176
|
+
Sydes works best when you guide it.
|
|
177
|
+
|
|
178
|
+
### 1. Whole log (overview)
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
sydes incident analyze logs/*.log
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
→ broad, approximate understanding
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
### 2. Grep (precise signal)
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
sydes incident analyze logs/*.log \
|
|
192
|
+
--grep "cache_unavailable"
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
→ exact failure analysis
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
### 3. Query (semantic focus)
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
sydes incident analyze logs/*.log \
|
|
203
|
+
--query "Why are session lookups failing?"
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
→ AI-driven reasoning
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
### 4. Query + Grep (recommended)
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
sydes incident analyze logs/*.log \
|
|
214
|
+
--query "Why are session lookups failing?" \
|
|
215
|
+
--grep "session lookup failed"
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
→ best results (focused + precise)
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## ⚙️ Model Support
|
|
223
|
+
|
|
224
|
+
Example:
|
|
225
|
+
|
|
226
|
+
```bash
|
|
227
|
+
--model openai:gpt-4.1-mini
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
Use `--require-model` to fail if the model is unavailable instead of falling back.
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
## 🧩 Example Logs
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
sydes incident analyze examples/auth_cache_failure.log \
|
|
238
|
+
--query "Why are session lookups failing?"
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
## 🚧 Status
|
|
244
|
+
|
|
245
|
+
This is an early version of Sydes.
|
|
246
|
+
|
|
247
|
+
- AI reasoning may be imperfect
|
|
248
|
+
- best results come from focused queries
|
|
249
|
+
- designed for real-world logs, not toy datasets
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## 🔮 Roadmap
|
|
254
|
+
|
|
255
|
+
Sydes is evolving into a broader system intelligence platform:
|
|
256
|
+
|
|
257
|
+
- incident analysis (current)
|
|
258
|
+
- system understanding from code
|
|
259
|
+
- integration test generation
|
|
260
|
+
- system graph + reasoning
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
## 🧠 Philosophy
|
|
265
|
+
|
|
266
|
+
Logs are not the problem.
|
|
267
|
+
|
|
268
|
+
The problem is:
|
|
269
|
+
- too much data
|
|
270
|
+
- no structure
|
|
271
|
+
- no reasoning layer
|
|
272
|
+
|
|
273
|
+
Sydes adds:
|
|
274
|
+
- structure (events, clusters, timeline)
|
|
275
|
+
- reasoning (hypotheses grounded in evidence)
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
## 🤝 Contributing
|
|
280
|
+
|
|
281
|
+
PRs and feedback welcome.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Contributor Guide
|
|
2
|
+
|
|
3
|
+
## Code map
|
|
4
|
+
|
|
5
|
+
- Core domain modules: `src/aiautopsy/core/`
|
|
6
|
+
- Ingestion: `core/ingestion/`
|
|
7
|
+
- Interpretation: `core/interpretation/`
|
|
8
|
+
- Consolidation: `core/consolidation/`
|
|
9
|
+
- Timeline: `core/timeline/`
|
|
10
|
+
- Reasoning: `core/reasoning/`
|
|
11
|
+
- Reporting: `core/reporting/`
|
|
12
|
+
- Scaling/budgets: `core/scaling/`
|
|
13
|
+
- CLI commands: `src/aiautopsy/cli/commands.py`
|
|
14
|
+
- CLI app registration: `src/aiautopsy/cli/app.py`
|
|
15
|
+
|
|
16
|
+
## Core model locations
|
|
17
|
+
|
|
18
|
+
- Evidence model: `core/ingestion/records.py`
|
|
19
|
+
- Interpreted event model: `core/interpretation/models.py`
|
|
20
|
+
- Cluster model: `core/consolidation/models.py`
|
|
21
|
+
- Timeline models: `core/timeline/models.py`
|
|
22
|
+
- Hypothesis model: `core/reasoning/models.py`
|
|
23
|
+
- Report models: `core/reporting/models.py`
|
|
24
|
+
|
|
25
|
+
## Ollama integration structure
|
|
26
|
+
|
|
27
|
+
- Adapter and validation logic: `core/reasoning/adapters.py`
|
|
28
|
+
- `/api/tags` model validation
|
|
29
|
+
- `/api/generate` requests for reasoning and narrative paths
|
|
30
|
+
- timeout/retry handling and diagnostics
|
|
31
|
+
- Pipeline orchestration: `core/reasoning/pipeline.py`
|
|
32
|
+
- model resolution (`ollama:model` or plain `ollama` with env defaults)
|
|
33
|
+
- fallback handling and backend status metadata
|
|
34
|
+
- Runtime usage counters: `core/reasoning/usage.py`
|
|
35
|
+
- `reasoning_calls`, `narrative_calls`, `validation_calls`, `total_generate_calls`
|
|
36
|
+
|
|
37
|
+
## Running tests
|
|
38
|
+
|
|
39
|
+
- Full test suite:
|
|
40
|
+
- `uv run --group dev pytest`
|
|
41
|
+
- Fast CLI-only smoke checks:
|
|
42
|
+
- `uv run --group dev pytest tests/cli/test_smoke.py -q`
|
|
43
|
+
- Reasoning/Ollama adapter focused tests:
|
|
44
|
+
- `uv run --group dev pytest tests/core/reasoning -q`
|
|
45
|
+
|
|
46
|
+
## Contributor notes
|
|
47
|
+
|
|
48
|
+
- Prefer extending existing pipeline stages instead of adding parallel logic.
|
|
49
|
+
- Keep CLI output deterministic; tests assert specific section shapes/strings.
|
|
50
|
+
- For model integrations, preserve graceful fallback unless strict mode is requested (`--require-model`).
|