I've been building react-state-basis, a runtime auditor for React state architecture.
The project is inspired by a simple idea from linear algebra: a "basis" is a minimal set of independent vectors. In React, many apps suffer from state that is "linearly dependent" -variables that always move in sync and should really be derived values or a single source of truth.
The tool ignores state values entirely. Instead, it tracks the high-resolution timing of state updates and hook firings. It treats these updates as temporal signals to identify redundant state and reveal hidden "sync leaks" (causal chains) that static analysis usually misses.
What’s new in v0.4.0: I recently moved the engine from simple binary snapshots to Temporal Cross-Correlation (Lead-Lag analysis). Instead of just asking if two states update at the same time, the engine now checks across multiple "temporal planes." It can detect if State B consistently follows State A with a phase shift, allowing it to distinguish between simple redundancy and causal update chains.
Real-World Results: I validated the v0.4.0 engine by running it on Excalidraw (114k stars). It successfully identified a causal sync leak in their theme-switching logic - a manual useEffect synchronization that was causing an unnecessary double-render. I submitted a PR to replace it with a computed value: https://github.com/excalidraw/excalidraw/pull/10637
Engineering Highlights:
Pointer-based Offsets: Uses index offsets to perform temporal analysis directly on raw history buffers, avoiding array slicing (.slice()) or creating temporary objects that cause GC micro-stutters.
Lead-Lag Analysis: Evaluates the correlation across three temporal planes (Sync, Lead, and Lag) to determine the "Direction of Flow" between variables (A → B).
Circuit Breaker: Detects high-frequency state oscillations and halts execution before the browser thread locks up.
Zero Production Overhead: The entire library is replaced with no-op shims in production builds via environment-aware exports.
I’m trying to bridge the gap between "State Management" and "Signal Processing." I’d love to hear your thoughts on using temporal correlation as a heuristic for architectural debt.