-
Notifications
You must be signed in to change notification settings - Fork 0
ADR 001 task system
grave0x edited this page Jul 19, 2026
·
1 revision
Accepted
2026-07-16
rapiscm needed a way to persist, compare, and export scan results. Requirements:
- No database dependency (keep binary self-contained)
- Survive crashes and reboots
- Support listing, showing, deleting, pruning old tasks
- Support diff between two tasks for regression detection
- Support export to multiple formats (markdown, SARIF, HTML)
- Support resume of partially-completed scans
- Support queue for batch scanning
Use a flat-file JSON storage system at ~/.local/share/rapiscm/tasks/.
Each task gets a directory named {id}-{name}/ containing:
-
task.json— full config + metadata + result summary -
results.json— fullVec<ResponseResult>array -
index.json— lightweight index for fast listing -
queue.json— persistent queue with crash recovery -
raw/— optional raw HTTP request/response pairs (with--raw)
- Pros: ACID, queries, indexing, less I/O
- Cons: Adds ~200KB to binary, requires build-time C lib linking
- Rejected: Overkill for ~500KB JSON files per scan
- Pros: Simplest implementation
- Cons: No persistence across runs, no diff, no export
- Rejected: Task system would lose all value
- Zero new dependencies (JSON via existing serde_json)
- Queue mutations are atomic (write to temp file, rename over old)
- Loading full results for large scans reads entire file into memory (~500KB typical)
- Raw mode can use significant disk (~1MB+ per scan with request/response pairs)
- No concurrent write safety (single-user CLI tool)
Powered by rapiscm