Parent issue for spec 0009 — Unnest to LET (specs/0009-unnest-to-let.md).
A new /Unnest slash command that takes a nested formula and explodes each function call and operator expression into a named LET step (leaf-first), making intermediate values inspectable for debugging. It is the complement to /Refactor (spec 0008): /Refactor hoists leaves into input bindings; /Unnest hoists intermediate calculations into step bindings. The two compose — /Unnest then /Refactor then /LET to LAMBDA.
Key design decisions (approved):
- Separate, composing command — reuses
RefactorEngine's existing calc-binding ref-hoisting for the input half (zero new code there).
- Max granularity, then collapse — every function/operator node becomes a step; an Include toggle inlines unwanted ones.
- Function-derived step names —
sumsq1, sqrt1, round1; operator steps calcN.
- No CSE in v1 — the step tree mirrors the syntax tree.
- Introduces the repo's first recursive-descent formula parser (AST) — the main new engine and risk area.
Tasks
Build order: #270 -> #271 -> #272 -> #273.
Parent issue for spec 0009 — Unnest to LET (
specs/0009-unnest-to-let.md).A new
/Unnestslash command that takes a nested formula and explodes each function call and operator expression into a named LET step (leaf-first), making intermediate values inspectable for debugging. It is the complement to/Refactor(spec 0008):/Refactorhoists leaves into input bindings;/Unnesthoists intermediate calculations into step bindings. The two compose —/Unnestthen/Refactorthen/LET to LAMBDA.Key design decisions (approved):
RefactorEngine's existing calc-binding ref-hoisting for the input half (zero new code there).sumsq1,sqrt1,round1; operator stepscalcN.Tasks
UnnestToLetWindowdialog +/Unnestcommand — UI, wiring, AddinTestsBuild order: #270 -> #271 -> #272 -> #273.