StateLedger: Dependency-Closed Analytical State for Executable Data-Analysis Replay
Abstract
Large language models are increasingly used for multi-step data-analysis workflows in which analytical state accumulates across cleaned tables, repaired schemas, intermediate variables, and derived metrics. When such history is stored or retrieved as undifferentiated text, however, a later computation may omit prerequisite transformations or recover the wrong version of a variable, preventing faithful replay. We present StateLedger, which selects executable history through dependency closure over versioned analytical state. StateLedger represents prior analysis as dependency-linked state events, resolves the state versions required by target code, recursively recovers their prerequisite producers, and projects the resulting closure back onto a chronological subsequence of whole historical turns. The result is a reduced history intended to preserve the state required for execution. On 455 stable CoCoNote notebook targets, its source-only instantiation achieves 342 exact replays while selecting 38.4% fewer source characters on average than the full prefix. It substantially outperforms character-budget-matched BM25 and plain static slicing. Its gain over qualified reaching slicing is modest, with notebook-level uncertainty including zero, while prefix-instrumented dynamic recovery is more accurate at similar selected-history cost. With the recent-three guard fixed, adding transitive prerequisite expansion raises exact replay from 25/455 to 339/455, isolating the principal mechanism beyond direct producer recovery. An external notebook-trace pilot and target-code-hidden generation diagnostic provide complementary evidence. Together, these findings support dependency-closed analytical state as a practical unit for repair-free replay from reduced analytical history.
Then back it, or bet against it.
Related papers
Open the market on this paper to see 7 more related papers.