vroqjs.com

07-debuggable-state/00-overview.md

Debuggable state overview

Debuggable state overview

This section defines how Vroq apps should structure state, actions, and reducers so the system stays easy to inspect, reason about, and debug.

The goal is not only to manage state correctly. The goal is to make state transitions visible, predictable, and organized in a way that helps ChatGPT and humans fix bugs without introducing hacks.

Main goals

Good state architecture should make it easy to:

  • understand what state exists
  • understand which feature owns each slice
  • see which actions caused a transition
  • inspect reducers independently
  • replay and debug state changes
  • keep state logic separate from UI and transport logic

Main rule

Use actions and reducers to make state transitions explicit.

Do not hide important state changes inside random UI event handlers or transport helpers when a reducer boundary would make the behavior clearer.

What this section covers

This section documents:

  • why reducers matter
  • action design
  • reducer boundaries
  • state shape
  • debugging with actions and reducers
  • logging, checkpoints, and replay

Read next

Read these files next:

  • 01-why-reducers-matter.md
  • 02-action-design.md
  • 03-reducer-boundaries.md
  • 04-state-shape.md
  • 05-debugging-with-actions-and-reducers.md
  • 06-logging-checkpoints-replay.md