Tracks validated spec_ir snapshots together with semantic diff_spec_ir()
transitions and human-readable labels so both programmatic pipelines and
dynamic Shiny modules can undo and redo visual widget tweaks and
conversational refinements seamlessly.
Examples
s1 <- new_spec_ir(hierarchy = list(levels = 1L, n_obs = 100L))
h <- spec_history(s1)
s2 <- refine_spec(s1, "set sample size to 250")$spec
history_push(h, s2, label = "Increase N to 250")
history_can_undo(h)
#> [1] TRUE
undone <- history_undo(h)
undone$spec$hierarchy$n_obs
#> [1] 100
