Skip to main content
ARCHOS 525 BLUEPRINT · /d/dgm_code-command-and-undo-stacks

Command Objects & Undo/Redo Stacks (ArchOS Canvas & Editors)

6 COMPONENTS · 6 FLOWS · UPDATED 2026-11-24
GITHUB README / PR PREVIEW CARD
[![Command Objects & Undo/Redo Stacks (ArchOS Canvas & Editors) — ArchOS Architecture](https://archos.sageideas.dev/d/dgm_code-command-and-undo-stacks/opengraph-image)](https://archos.sageideas.dev/d/dgm_code-command-and-undo-stacks)

*Interactive architecture diagram powered by [ArchOS Studio](https://archos.sageideas.dev/d/dgm_code-command-and-undo-stacks)*
NOTION / DOCS / CONFLUENCE EMBED
<iframe src="https://archos.sageideas.dev/embed/dgm_code-command-and-undo-stacks" width="100%" height="580" style="border:1px solid rgba(240,236,225,0.14);border-radius:6px;" loading="lazy" title="Command Objects & Undo/Redo Stacks (ArchOS Canvas & Editors) — Interactive in ArchOS"></iframe>
PORTABLE MERMAID SPEC (GITHUB / NOTION / RFC)
flowchart LR
  client_0["User Action"]
  n1_1["Command Dispatcher"]
  n2a_2[("Undo Patch Stack")]
  n2b_3[("Redo Patch Stack")]
  n3_4[("Immutable State Store")]
  downstream_5["Downstream & OTel"]
  client_0 -->|"1. Dispatch · Cmd"| n1_1
  n1_1 -->|"2a. Push inv · Stack"| n2a_2
  n1_1 -->|"2b. Push redo · Stack"| n2b_3
  n2a_2 -->|"3a. Apply diff · State"| n3_4
  n2b_3 -->|"3b. Merge · RAM"| n3_4
  n3_4 -.->|"4. Emit / · OTLP/API"| downstream_5

COMPONENT STACK (6)

  • User ActionSTATELESS
    Drag / Edit / Batch Op
  • Command DispatcherSTATELESS
    Groups drag moves into 1 tx
  • Undo Patch StackSTATEFUL
    Bounded inverse ops
  • Redo Patch StackSTATEFUL
    Cleared on new forward mutation
  • Immutable State StoreSTATEFUL
    Zustand/Immer structural share
  • Downstream & OTelSTATELESS
    Consumers, metrics & SLOs

REQUEST & DATA FLOW (6)

  1. User Action → Command Dispatcher (Dispatch)[Cmd]
  2. Command Dispatcher → Undo Patch Stack (Push inv)[Stack]
  3. Command Dispatcher → Redo Patch Stack (Push redo)[Stack]
  4. Undo Patch Stack → Immutable State Store (Apply diff)[State]
  5. Redo Patch Stack → Immutable State Store (Merge)[RAM]
  6. Immutable State Store → Downstream & OTel (Emit /)[OTLP/API]
Configure NGINX / Postgres / K8s →60-Sec L4–L7 Diagnostic →