Add new examples for generating sample .improv data based on the Pest
grammar and pretty-printing existing .improv files.
Co-Authored-By: fiddlerwoaroof/git-smart-commit (gemma-4-31B-it-UD-Q4_K_XL.gguf)
Update the .improv file grammar to require version v2025-04-09 and remove
unnecessary blank line requirements at the start of files. Update
bank-info.improv to comply with the new version and reformat date entries
and categories.
BREAKING CHANGE: The .improv grammar now strictly requires the version line 'v2025-04-09'.
Existing files without this line will fail to parse.
Co-Authored-By: fiddlerwoaroof/git-smart-commit (gemma-4-31B-it-UD-Q4_K_XL.gguf)
Move module declarations from src/main.rs to a new src/lib.rs to transition
the project to a library-first structure. This allows other tools and
examples to utilize the core logic.
Co-Authored-By: fiddlerwoaroof/git-smart-commit (gemma-4-31B-it-UD-Q4_K_XL.gguf)
- gen is a reserved keyword (→ renamed module to generator)
- ref in patterns with implicit borrowing (→ removed ref)
- & pattern with implicit borrowing (→ added & to outer pattern)
Update application initialization and example data.
- `App::new` now recomputes formulas on startup to ensure formula-derived
values are available immediately.
- Updated `examples/demo.improv` to reflect changes in formula and category
structure.
Co-Authored-By: fiddlerwoaroof/git-smart-commit (unsloth/gemma-4-26B-A4B-it-GGUF:UD-Q5_K_XL)
Update persistence logic for formulas and categories.
- Formulas targeting `_Measure` no longer include the category suffix in
Markdown.
- `_Measure` items are now excluded from the category section in Markdown
to avoid duplication with the formulas section.
- Improved Markdown parsing to correctly handle formulas without an
explicit category suffix, defaulting them to `_Measure` .
- Added logic to skip virtual index and dimension categories during
persistence.
Co-Authored-By: fiddlerwoaroof/git-smart-commit (unsloth/gemma-4-26B-A4B-it-GGUF:UD-Q5_K_XL)
Refactor command execution and buffer management.
- `CommitFormula` now defaults to targeting `_Measure` .
- `CommitFormula` no longer automatically clears the buffer; buffer
clearing is now handled by keymap sequences.
- Added `ClearBufferCmd` to the command registry.
- Updated `AddFormulaCmd` to support optional target category.
- Added `SetBuffer` effect to allow clearing buffers.
Co-Authored-By: fiddlerwoaroof/git-smart-commit (unsloth/gemma-4-26B-A4B-it-GGUF:UD-Q5_K_XL)
Implement keymap inheritance and sequence bindings.
- Added `parent` field to `Keymap` to support Emacs-style inheritance.
- Implemented `lookup` in `Keymap` to fall through to parent keymaps.
- Added `bind_seq` to allow multiple commands to be bound to a single key
pattern.
- Refactored existing keymaps to use sequences for common patterns like
Esc/Enter/Tab to clear buffers and change modes.
Co-Authored-By: fiddlerwoaroof/git-smart-commit (unsloth/gemma-4-26B-A4B-it-GGUF:UD-Q5_K_XL)
Refactor formula handling to use a virtual '_Measure' category.
- Formulas now default to targeting '_Measure' if no category is specified.
- '_Measure' items are dynamically computed from existing data items and
formula targets, preventing redundant item storage.
- Updated persistence to handle '_Measure' formulas and items correctly in
Markdown.
- Updated UI and model to use 'effective_item_names' for layout and item
resolution.
- Updated tests to reflect the new '_Measure' behavior.
Co-Authored-By: fiddlerwoaroof/git-smart-commit (unsloth/gemma-4-26B-A4B-it-GGUF:UD-Q5_K_XL)
Replace "Measure" with "Foo" as target_category in formula parser
tests so they don't depend on a specific category name convention.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Executed-By: spot
- Document PEG grammar as single source of truth for .improv format
- Update file format section with v2025-04-09 syntax: version line,
Initial View, pipe quoting, Views→Formulas→Categories→Data order
- Add pipe quoting convention and grammar-driven testing principles
- Update file inventory (persistence: 124+2291 lines, 83 tests)
- Add pest/pest_meta to dependency table
- Update persistence testing guidance for grammar-walking generator
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Executed-By: spot
- Add improv.pest PEG grammar as the single source of truth for the
.improv file format (v2025-04-09)
- Replace hand-written line scanner with pest-derived parser that walks
the grammar's parse tree
- Add grammar-walking test generator that reads improv.pest at test time
via pest_meta and produces random valid files from the AST
- Fix 6 parser bugs: newlines in text, commas in names, brackets in
names, float precision, view name ambiguity, group brackets
- New format: version line, Initial View header, pipe quoting (|...|),
Views→Formulas→Categories→Data section order, comma-separated items
- Bare names restricted to [A-Za-z_][A-Za-z0-9_-]*, everything else
pipe-quoted with \| \\ \n escapes
- Remove all unwrap() calls from production code, propagate errors
with Result throughout parse_md
- Extract shared escape_pipe/unescape_pipe/pipe_quote helpers, deduplicate
hidden/collapsed formatting, add w!() macro for infallible writeln
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Executed-By: spot
Move tests from the monolithic tests.rs into #[cfg(test)] mod tests
blocks in each command module. Shared test helpers live in
mod.rs::test_helpers.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Executed-By: fido
Add VirtualMeasure to CategoryKind description, document _Measure as
third always-present virtual category, add section on fixed-point
formula evaluation strategy.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
_Measure is now a virtual category (CategoryKind::VirtualMeasure),
created automatically in Model::new() alongside _Index and _Dim.
Formula targets are added as items automatically by add_formula.
Formula evaluation uses a fixed-point cache: recompute_formulas()
iterates evaluation of all formula cells until values stabilize,
resolving refs through the cache for formula values and raw data
aggregation for non-formula values. This fixes formulas that
reference other measures when hidden dimensions are present.
evaluate_aggregated now checks the formula cache instead of
recursively evaluating formulas, breaking the dependency between
formula evaluation and aggregation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Model::add_formula now ensures the formula target exists as an item in
the target category (same fix as AddFormula effect, but at the model
level — covers file loading and headless paths).
Formula panel now shows raw formula text instead of debug-formatted
string with redundant target name and quotes.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When there are more tiles than fit in the available width, the tile
bar now auto-scrolls to ensure the selected tile is always visible.
Overflow indicators (◀ ▶) show when tiles exist beyond the visible
area. Scroll offset is computed fresh each frame from tile_cat_idx.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Circular or self-referencing formulas now return CellValue::Error
instead of stack overflowing. eval_expr uses Result<f64, String>
internally so errors (circular refs, div/0, missing refs) propagate
immediately through the expression tree via ?. The depth limit (16)
is checked per evaluate_depth call — normal 1-2 level chains are
unaffected.
Also adds CellValue::Error variant for displaying ERR:reason in the
grid, and handles it in format, persistence, and search.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When adding a formula interactively, the target (e.g. "Margin") was
registered as a formula but never added as an item to the target
category. The grid layout never created cells for it, making the
formula invisible. Now AddFormula::apply calls add_item before
registering the formula.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Four recorded casts at 100x30 with 2s idle cap:
- pivot.cast: axis reassignment with tile mode
- drill.cast: drill-down into aggregated cells
- formulas.cast: formula panel and adding formulas
- import.cast: CSV import wizard walkthrough
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Create docs/demo.tape scripting a ~15s pivot axis reassignment demo.
Hide shell startup and quit so the GIF opens directly on the TUI.
Set up git-lfs for docs/*.gif. Merge LFS hooks with existing beads hooks.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add demo recording tools (asciinema, vhs) and release tooling
(cargo-dist) to nativeBuildInputs. Include a cargo-dist wrapper so
`cargo dist` works as a subcommand. Add scripts/record-demo.sh for
consistent asciinema cast recording at 100x30.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
40-row CSV with obviously-fake sales data (fictional companies like
Acme Corp, Wonka Industries, Cyberdyne Systems). demo.improv generated
via headless import with Profit formula and a default view showing
Region+Product on rows, Date_Month+Measure on columns. Added the
import command to the README quick-start section.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add dedicated sections for the data model (formula examples), views and
axes (tile mode, records mode, drill-down), the .improv file format
(annotated example), import wizard and headless scripting, and the
command/effect architecture. Link docs/design-notes.md from the "Why"
section. Update build instructions to use `nix build .`.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Audited SPEC.md against code — mostly accurate but redundant with
repo-map.md and design-principles.md. Minor drift in storage internals,
wizard step count, and mode representation. Salvaged product vision and
non-goals into docs/design-notes.md with staleness disclaimer.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>