I wanted Datary's architecture to follow the way I explain a run: capture first, interpret second, and publish only after every critical artifact is ready.
stdin/file
|
+--> raw.log
|
parser --> records.jsonl / invalid.jsonl
|
temporary disk-backed analysis
|
metrics + quality + data.csv + manifest + hashes
|
atomic session publication
formats.pydetects only clear input signatures.parsers.pyturns inert text into JSON-compatible records.recorder.pyowns staging, flush/fsync, interruption, overwrite recovery, and publication.analysis_store.pyuses temporary local SQLite for exact bounded-memory distribution and quality calculations. It is not a catalogue or session dependency.sessions.pyvalidates manifests, rejects symlinked trust boundaries, reads records, and verifies integrity.metrics.pyandquality.pyprovide the direct in-memory analytical API.comparison.py,replay.py,plotting.py,reports.py, andconversion.pyconsume those boundaries without executing data.cli.pyis orchestration and terminal rendering, not analytical logic.
The temporary database grows with input on disk, while resident analysis state is bounded by field count and small batches. Exact percentiles use indexed disk ordering rather than retaining every measurement in a Python list.
The recorder regression feeds 50,000 generated records without first storing the source and enforces a 32 MiB Python-heap ceiling. That catches accidental record-list accumulation; it is not an operating-system RSS guarantee or a substitute for deployment-specific disk sizing.
Oh! SQLite here is deliberately disposable. Published sessions remain ordinary portable files; there is no daemon, account, central database, network layer, or hidden migration service.
New recordings are built beside the target. An overwrite renames the old directory to a private
backup only after the replacement is complete, then atomically renames the replacement into place.
If publication fails, the backup is restored. Critical streams flush and fsync before analysis.
Critical JSON and text outputs use same-directory temporary files and atomic replacement.
Core operation uses only the standard library. Matplotlib is imported lazily after forcing Agg.
Plot generation may downsample series for display; downsample parameters are written beside the
image and never rewrite published records.