Episode 2
Finding audit drift
7:17PREMIUM
The video demonstrates the "audit drift" command on a Tauri application built with React, TanStack Query, and Rust. Audit drift is used to identify bad state management, Boolean explosions, magic strings, duplicated/derived state, state machine opportunities, and source of truth violations. The speaker runs the audit drift command and it reveals several issues in the toolbox app, including impossible state combinations with Booleans, magic strings instead of constants, duplicate definitions between frontend and backend, and derived data stored redundantly. The speaker expresses slight embarrassment at the findings but emphasizes the educational value of the demonstration. The command also identifies positive aspects of the codebase, like the use of queryKeyFactory, Zustand for UI state management, TanStackQuery for server state, event-driven cache invalidation, and Rust enums. Finally, the speaker enters plan mode to automatically fix the fixable issues, leveraging the context gathered during the audit drift process. The speaker recommends using audit drift when the codebase feels fragile, out of sync, or exhibits stale cache issues, indicating a need to "trim" the codebase and enforce proper data structures.

Comments
Nothing yet. Say the first thing.
Sign in to join the conversation.