arv.moi

Process intelligence / 2026

RitualLens

Privacy-first process intelligence with regression-gated session reconstruction and automation discovery.

01

Scrub

Client redaction plus server-side residual PII rejection

02

Sessionize

Inspectable SQL groups events into process sessions

03

Gate

BCubed and leakage checks fail unsafe releases

Telemetry batch → privacy audit → SQL sessionization → regression scorecard

Problem & constraints

Desktop process intelligence starts with sensitive telemetry. Window titles, URLs, file names, and keystroke-adjacent context can expose people before any model has a chance to help. The system needed privacy controls before analysis, and the reconstruction quality had to be measured rather than asserted.

The core constraint was inspectability. SQL had to remain visible. The embedding space had to stay consistent across browser workers, seed scripts, and server-side ingestion. The evaluation gate needed enough force to block a regression in continuous integration.

System architecture

RitualLens uses a Next.js shell with a framework-independent engine. The engine contains the privacy scrubber, embeddings, synthetic chaos generator, evaluation math, and directly-follows graph construction. It has no Next or React imports, which keeps the core testable outside the product shell.

PostgreSQL logic lives in declarative SQL files. Hybrid sessionization runs in SQL, then the generated serverless bundle embeds the same SQL text for deployment. Neon Postgres uses pgvector vector(384) with HNSW cosine indexing. Xenova all-MiniLM-L6-v2 q8 provides one embedding space across environments.

LLM calls are structured and cached in Neon. Client-provided OpenRouter keys are supported, but missing model output does not become missing telemetry analysis. Fallback behavior stays explicit.

SubsystemContract
IngestionBatches validated against the telemetry schema
PrivacyClient redaction plus server audit; residual raw PII returns HTTP 422
SessionizationSQL hybrid grouping, compared against naive baselines
EvaluationCI scorecards fail unsafe or weaker reconstruction

Evaluation & guardrails

The CI gate fails when PII leakage is above zero. It fails when hybrid BCubed F1 drops below 0.80. It also fails when hybrid reconstruction does not beat the naive baseline by at least 0.15. These are hard stops, not dashboard decorations.

The synthetic chaos generator creates randomized telemetry for regression checks. The privacy subsystem is tested as an audit path with partial persistence forbidden: a rejected batch writes nothing.

Production outcomes

The repository contains a working product shell, seeded pipeline, regression gate, smoke tests, and deployment configuration. The clearest outcome is discipline around evidence. A process graph can be traced back to telemetry batches, sessionization logic, model cache entries, and scorecards.

The next hardening step is a customer-managed key model and signed collector builds. Those matter before desktop telemetry can leave a controlled pilot environment.