Skip to content

ROADMAP: Aggregation queries for analytics (replace in-memory loadAllEvents pattern) #202

@jpleva91

Description

@jpleva91

Source

  • Type: ROADMAP
  • Location: ROADMAP.md:294 (Phase 10 — Structured Storage Backend)
  • Original text: Aggregation queries for analytics (replace in-memory loadAllEvents() pattern)

Task Description

Implement aggregation queries in the SQLite storage backend that replace the current in-memory loadAllEvents() pattern used by src/analytics/. Today, the analytics engine loads all events from JSONL files into memory before computing aggregations — this does not scale as session count grows.

With the SQLite backend (see #169, #170), aggregation queries should run directly in the database:

  • Violation counts grouped by invariant, action type, or time window
  • Escalation frequency by session
  • Blast radius distribution histograms
  • Top-N most denied actions across sessions

This enables the analytics engine (src/analytics/engine.ts, src/analytics/aggregator.ts) to delegate heavy computation to SQLite rather than loading entire event histories into memory.

Depends on: #169 (SQLite adapter), #170 (schema design)

Labels

Created automatically by the Backlog Steward skill.


Discovered by backlog-steward on 2026-03-10T00:00:00Z

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions