Skip to content

Commit 6826a71

Browse files
Claudelukekim
authored andcommitted
Fix guides/security-analyzer: retention never runs without retention_check_interval
The guide sets retention_check_enabled and retention_period but no retention_check_interval. RetentionBuilder::build() returns None when check_interval is unset, so the retention task never starts — silently, with no warning. With refresh_mode: append nothing else evicts old rows, so the guide's claim that retention_period keeps a month of history does not hold. Add retention_check_interval: 1h, say why both settings are needed, and add the missing step that starts the runtime and runs analyzer.py — the guide defines the script but never tells the reader to run it.
1 parent 3614178 commit 6826a71

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

guides/security-analyzer/README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ datasets:
9393
refresh_check_interval: 5s
9494
retention_check_enabled: true
9595
retention_period: 30d
96+
retention_check_interval: 1h
9697
params:
9798
pg_host: ${env:PG_HOST}
9899
pg_port: ${env:PG_PORT}
@@ -106,7 +107,7 @@ Let's break down these configuration choices:
106107
107108
- `refresh_mode: append` optimizes for real-time log ingestion by only appending new data based on the `time_column`
108109
- `refresh_check_interval: 5s` provides near-real-time analysis
109-
- `retention_period: 30d` keeps a month of history for pattern analysis
110+
- `retention_period: 30d` with `retention_check_interval: 1h` keeps a month of history for pattern analysis, sweeping expired rows hourly. Both are required: without `retention_check_interval` the retention check never starts, and in `append` mode nothing else evicts old rows.
110111

111112
## Adding AI-Powered Analysis
112113

@@ -259,6 +260,18 @@ if __name__ == "__main__":
259260
analyzer.analyze_patterns()
260261
```
261262

263+
## Running the Analyzer
264+
265+
Start the runtime, then run the analyzer in a second terminal:
266+
267+
```bash
268+
spice run
269+
```
270+
271+
```bash
272+
uv run analyzer.py
273+
```
274+
262275
## Testing the System
263276

264277
To see our security copilot in action, let's simulate some suspicious patterns:

0 commit comments

Comments
 (0)