Files
Marcos Paulo e8c8c06d1e
ci / ci (macos-latest) (push) Has been cancelled
ci / ci (ubuntu-latest) (push) Has been cancelled
ci / ci (windows-latest) (push) Has been cancelled
feat: smart folder model, media time fragments, link card URL guard (MiniMax); specs for 10 more gaps (Codex) and the registry with bloat measurements
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-21 14:41:26 -03:00

2.1 KiB

TASK table-formula-model: Bounded formula grammar and cell dependency evaluation

Runs through OpenCode (specs/agents/opencode-runbook.md attached automatically). Task 1 of specs/plugins-parity/table-formulas/tasks.md.

OWNS

crates/blocks/src/table_formulas/mod.rs (new, first write), crates/blocks/src/table_formulas/parse.rs (new), crates/blocks/src/table_formulas/eval.rs (new), crates/blocks/src/lib.rs (module/export and errors), unit tests in new modules

FILES TO OPEN

spec.md D1/D2, crates/blocks/src/lib.rs, crates/bases/src/eval/ops.rs (finite number handling reference only), crates/ui-egui/src/views/note_view/blocks/table.rs

GOAL / API

Write FIRST OWNS file in SECOND tool call (compiling stub plus one failing behavior test first). evaluate(cells: &[Vec<String>]) -> Result<Evaluation> with stable cell diagnostics; parse formulas into bounded AST, compute dependency DAG iteratively, no scripts or IO. Implement D1 coordinate/numeric/aggregate semantics and every D2 resource cap. Follow specs/plugins-parity/table-formulas/spec.md limits, error semantics and acceptance criteria exactly. New modules need rustdoc and parent declaration/re-exports; no IO.

TESTS

Arithmetic precedence/unary; A1 body coords; ranges; each aggregate including empty/text; cycles and propagation; nonfinite/divzero/out-of-bounds; depth/formula/cell/edge/operation caps; deterministic results; raw cell strings unchanged.

VERIFY

export PATH="$HOME/.cargo/bin:$PATH"
cargo test -p notescraft-blocks
cargo clippy -p notescraft-blocks --all-targets -- -D warnings
# rustfmt --edition 2024 followed by the owned Rust paths only

Confirm new tests appear in test output. No cargo execution during specification authoring.

DO NOT

Add dependency or reuse Bases expression grammar as if A1 were note property syntax. No dependency additions, Git mutations, Cargo edits, UI work or files outside OWNS. Reject hostile input with errors; never clamp/truncate or panic. Root Cargo.toml / xtask/src/layers.rs registration is unnecessary because this task extends existing crate.