cellproof 0.6.1__tar.gz → 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. cellproof-1.0.0/.github/workflows/ci.yml +53 -0
  2. cellproof-1.0.0/.github/workflows/pages.yml +34 -0
  3. {cellproof-0.6.1 → cellproof-1.0.0}/CHANGELOG.md +26 -1
  4. {cellproof-0.6.1 → cellproof-1.0.0}/PKG-INFO +81 -9
  5. cellproof-1.0.0/PROGRESS.md +212 -0
  6. {cellproof-0.6.1 → cellproof-1.0.0}/README.md +74 -8
  7. cellproof-1.0.0/docs/demo.gif +0 -0
  8. cellproof-1.0.0/docs/superpowers/specs/2026-10-31-postgres-target-design.md +41 -0
  9. cellproof-1.0.0/playground/build.sh +18 -0
  10. cellproof-1.0.0/playground/cellproof_web.py +82 -0
  11. cellproof-1.0.0/playground/index.html +259 -0
  12. cellproof-1.0.0/playground/worker.js +58 -0
  13. {cellproof-0.6.1 → cellproof-1.0.0}/pyproject.toml +3 -1
  14. cellproof-1.0.0/src/cellproof/__init__.py +1 -0
  15. cellproof-1.0.0/src/cellproof/cli.py +115 -0
  16. {cellproof-0.6.1 → cellproof-1.0.0}/src/cellproof/compiler.py +8 -5
  17. {cellproof-0.6.1 → cellproof-1.0.0}/src/cellproof/emitter.py +67 -13
  18. {cellproof-0.6.1 → cellproof-1.0.0}/src/cellproof/expr.py +7 -2
  19. {cellproof-0.6.1 → cellproof-1.0.0}/src/cellproof/fn/aggregate.py +2 -1
  20. {cellproof-0.6.1 → cellproof-1.0.0}/src/cellproof/fn/criteria.py +2 -1
  21. {cellproof-0.6.1 → cellproof-1.0.0}/src/cellproof/fn/dynamic.py +3 -3
  22. {cellproof-0.6.1 → cellproof-1.0.0}/src/cellproof/fn/logic.py +2 -1
  23. {cellproof-0.6.1 → cellproof-1.0.0}/src/cellproof/fn/lookup.py +2 -1
  24. {cellproof-0.6.1 → cellproof-1.0.0}/src/cellproof/fn/text.py +128 -4
  25. cellproof-1.0.0/src/cellproof/impact.py +116 -0
  26. cellproof-1.0.0/src/cellproof/postgres.py +477 -0
  27. {cellproof-0.6.1 → cellproof-1.0.0}/src/cellproof/report.py +22 -4
  28. {cellproof-0.6.1 → cellproof-1.0.0}/src/cellproof/verifier.py +8 -1
  29. {cellproof-0.6.1 → cellproof-1.0.0}/tests/corpus.py +5 -4
  30. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_cli.py +52 -0
  31. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_compiler.py +1 -1
  32. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_impact.py +62 -1
  33. cellproof-1.0.0/tests/test_playground.py +29 -0
  34. cellproof-1.0.0/tests/test_postgres.py +198 -0
  35. cellproof-1.0.0/tests/test_text.py +198 -0
  36. cellproof-0.6.1/.github/workflows/ci.yml +0 -29
  37. cellproof-0.6.1/PROGRESS.md +0 -103
  38. cellproof-0.6.1/src/cellproof/__init__.py +0 -1
  39. cellproof-0.6.1/src/cellproof/cli.py +0 -58
  40. cellproof-0.6.1/src/cellproof/impact.py +0 -57
  41. cellproof-0.6.1/tests/test_text.py +0 -57
  42. {cellproof-0.6.1 → cellproof-1.0.0}/.github/workflows/publish.yml +0 -0
  43. {cellproof-0.6.1 → cellproof-1.0.0}/.gitignore +0 -0
  44. {cellproof-0.6.1 → cellproof-1.0.0}/AGENTS.md +0 -0
  45. {cellproof-0.6.1 → cellproof-1.0.0}/DESIGN.md +0 -0
  46. {cellproof-0.6.1 → cellproof-1.0.0}/INFO.md +0 -0
  47. {cellproof-0.6.1 → cellproof-1.0.0}/LICENSE +0 -0
  48. {cellproof-0.6.1 → cellproof-1.0.0}/PLAN-2a.md +0 -0
  49. {cellproof-0.6.1 → cellproof-1.0.0}/PLAN-2b.md +0 -0
  50. {cellproof-0.6.1 → cellproof-1.0.0}/PLAN.md +0 -0
  51. {cellproof-0.6.1 → cellproof-1.0.0}/SECURITY.md +0 -0
  52. {cellproof-0.6.1 → cellproof-1.0.0}/docs/JOURNEY.md +0 -0
  53. {cellproof-0.6.1 → cellproof-1.0.0}/docs/superpowers/plans/2026-10-14-plan-2c-speed.md +0 -0
  54. {cellproof-0.6.1 → cellproof-1.0.0}/docs/superpowers/plans/2026-10-14-plan-2d-table-mode.md +0 -0
  55. {cellproof-0.6.1 → cellproof-1.0.0}/docs/superpowers/specs/2026-10-14-plan-2c-speed-design.md +0 -0
  56. {cellproof-0.6.1 → cellproof-1.0.0}/docs/superpowers/specs/2026-10-14-plan-2d-table-mode-design.md +0 -0
  57. {cellproof-0.6.1 → cellproof-1.0.0}/docs/superpowers/specs/2026-10-18-running-totals-design.md +0 -0
  58. {cellproof-0.6.1 → cellproof-1.0.0}/docs/superpowers/specs/2026-10-19-lookups-row-wise-design.md +0 -0
  59. {cellproof-0.6.1 → cellproof-1.0.0}/examples/commission.xlsx +0 -0
  60. {cellproof-0.6.1 → cellproof-1.0.0}/examples/errors.xlsx +0 -0
  61. {cellproof-0.6.1 → cellproof-1.0.0}/examples/functions.xlsx +0 -0
  62. {cellproof-0.6.1 → cellproof-1.0.0}/examples/functions_unsaved.xlsx +0 -0
  63. {cellproof-0.6.1 → cellproof-1.0.0}/examples/make_commission.py +0 -0
  64. {cellproof-0.6.1 → cellproof-1.0.0}/examples/make_errors.py +0 -0
  65. {cellproof-0.6.1 → cellproof-1.0.0}/examples/make_functions.py +0 -0
  66. {cellproof-0.6.1 → cellproof-1.0.0}/src/cellproof/__main__.py +0 -0
  67. {cellproof-0.6.1 → cellproof-1.0.0}/src/cellproof/compute.py +0 -0
  68. {cellproof-0.6.1 → cellproof-1.0.0}/src/cellproof/fenwick.py +0 -0
  69. {cellproof-0.6.1 → cellproof-1.0.0}/src/cellproof/fn/__init__.py +0 -0
  70. {cellproof-0.6.1 → cellproof-1.0.0}/src/cellproof/fn/dates.py +0 -0
  71. {cellproof-0.6.1 → cellproof-1.0.0}/src/cellproof/fn/finance.py +0 -0
  72. {cellproof-0.6.1 → cellproof-1.0.0}/src/cellproof/fn/maths.py +0 -0
  73. {cellproof-0.6.1 → cellproof-1.0.0}/src/cellproof/fn/stats.py +0 -0
  74. {cellproof-0.6.1 → cellproof-1.0.0}/src/cellproof/functions.py +0 -0
  75. {cellproof-0.6.1 → cellproof-1.0.0}/src/cellproof/graph.py +0 -0
  76. {cellproof-0.6.1 → cellproof-1.0.0}/src/cellproof/model.py +0 -0
  77. {cellproof-0.6.1 → cellproof-1.0.0}/src/cellproof/parser.py +0 -0
  78. {cellproof-0.6.1 → cellproof-1.0.0}/src/cellproof/r1c1.py +0 -0
  79. {cellproof-0.6.1 → cellproof-1.0.0}/src/cellproof/rangeindex.py +0 -0
  80. {cellproof-0.6.1 → cellproof-1.0.0}/src/cellproof/reader.py +0 -0
  81. {cellproof-0.6.1 → cellproof-1.0.0}/src/cellproof/refs.py +0 -0
  82. {cellproof-0.6.1 → cellproof-1.0.0}/src/cellproof/region.py +0 -0
  83. {cellproof-0.6.1 → cellproof-1.0.0}/src/cellproof/regions.py +0 -0
  84. {cellproof-0.6.1 → cellproof-1.0.0}/src/cellproof/tables.py +0 -0
  85. {cellproof-0.6.1 → cellproof-1.0.0}/tests/bench_shapes.py +0 -0
  86. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_aggregate.py +0 -0
  87. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_arrays.py +0 -0
  88. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_batches.py +0 -0
  89. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_compute.py +0 -0
  90. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_corpus_findings.py +0 -0
  91. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_criteria.py +0 -0
  92. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_dates.py +0 -0
  93. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_dynamic.py +0 -0
  94. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_emitter.py +0 -0
  95. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_errors.py +0 -0
  96. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_excel_findings.py +0 -0
  97. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_excel_saved.py +0 -0
  98. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_fenwick.py +0 -0
  99. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_finance_stats.py +0 -0
  100. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_functions.py +0 -0
  101. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_graph.py +0 -0
  102. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_implicit.py +0 -0
  103. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_index.py +0 -0
  104. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_lexed.py +0 -0
  105. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_limits.py +0 -0
  106. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_logic.py +0 -0
  107. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_lookup.py +0 -0
  108. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_lookups.py +0 -0
  109. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_maths.py +0 -0
  110. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_parser.py +0 -0
  111. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_perf.py +0 -0
  112. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_r1c1.py +0 -0
  113. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_rangeindex.py +0 -0
  114. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_reader.py +0 -0
  115. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_refs.py +0 -0
  116. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_region.py +0 -0
  117. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_regions.py +0 -0
  118. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_regions_differential.py +0 -0
  119. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_regions_split.py +0 -0
  120. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_report.py +0 -0
  121. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_review_regressions.py +0 -0
  122. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_running.py +0 -0
  123. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_shapes.py +0 -0
  124. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_spill.py +0 -0
  125. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_tables.py +0 -0
  126. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_types.py +0 -0
  127. {cellproof-0.6.1 → cellproof-1.0.0}/tests/test_verifier.py +0 -0
  128. {cellproof-0.6.1 → cellproof-1.0.0}/tests/xlsxkit.py +0 -0
@@ -0,0 +1,53 @@
1
+ name: tests
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ test:
13
+ strategy:
14
+ fail-fast: false
15
+ matrix:
16
+ os: [ubuntu-latest, windows-latest, macos-latest]
17
+ python: ["3.10", "3.11", "3.12", "3.13"]
18
+ runs-on: ${{ matrix.os }}
19
+ steps:
20
+ - uses: actions/checkout@v4
21
+ - uses: actions/setup-python@v5
22
+ with:
23
+ python-version: ${{ matrix.python }}
24
+ - name: Install
25
+ run: python -m pip install -e ".[dev,dbt]"
26
+ - name: Test
27
+ run: python -m pytest tests -q
28
+ env:
29
+ DBT_SEND_ANONYMOUS_USAGE_STATS: "False"
30
+
31
+ postgres:
32
+ # the Postgres target: verification on a real Postgres and dbt build with dbt-postgres
33
+ runs-on: ubuntu-latest
34
+ services:
35
+ postgres:
36
+ image: postgres:16
37
+ env:
38
+ POSTGRES_PASSWORD: cellproof
39
+ ports: ["5432:5432"]
40
+ options: >-
41
+ --health-cmd pg_isready --health-interval 5s --health-timeout 5s --health-retries 10
42
+ steps:
43
+ - uses: actions/checkout@v4
44
+ - uses: actions/setup-python@v5
45
+ with:
46
+ python-version: "3.12"
47
+ - name: Install
48
+ run: python -m pip install -e ".[dev,postgres,dbt-postgres]"
49
+ - name: Test
50
+ run: python -m pytest tests/test_postgres.py -q
51
+ env:
52
+ CELLPROOF_TEST_PG_URL: postgresql://postgres:cellproof@localhost:5432/postgres
53
+ DBT_SEND_ANONYMOUS_USAGE_STATS: "False"
@@ -0,0 +1,34 @@
1
+ name: playground
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ paths: ["src/**", "playground/**", "examples/functions.xlsx", "pyproject.toml", ".github/workflows/pages.yml"]
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+ pages: write
12
+ id-token: write
13
+
14
+ concurrency:
15
+ group: pages
16
+ cancel-in-progress: true
17
+
18
+ jobs:
19
+ deploy:
20
+ runs-on: ubuntu-latest
21
+ environment:
22
+ name: github-pages
23
+ url: ${{ steps.deployment.outputs.page_url }}
24
+ steps:
25
+ - uses: actions/checkout@v4
26
+ - uses: actions/setup-python@v5
27
+ with:
28
+ python-version: "3.12"
29
+ - run: playground/build.sh _site
30
+ - uses: actions/upload-pages-artifact@v3
31
+ with:
32
+ path: _site
33
+ - id: deployment
34
+ uses: actions/deploy-pages@v4
@@ -1,10 +1,35 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.0 (2026-11-17)
4
+
5
+ - **Postgres target:** `cellproof convert book.xlsx --target postgres [--pg-url URL] [--dbt]`. Every cell is verified
6
+ on DuckDB, then again on Postgres with the SQL translated (sqlglot, tree rewrites, and `pg_temp` helper functions with
7
+ DuckDB's semantics). On the 85 public test workbooks Postgres gives the same verdicts as DuckDB: 11,080 PASS, the
8
+ same 16 FAIL, none new. A batch that does not translate or run makes its cells UNRESOLVED, and the book is compiled
9
+ again so every cell reading them is too: the dbt project only holds SQL that ran on Postgres.
10
+ - **dbt-postgres project:** with `--target postgres` the generated project targets dbt-postgres. Its helpers are
11
+ created in the target schema by an `on-run-start` macro, and `profiles.yml` reads `CELLPROOF_PG_*` environment
12
+ variables. `--dbt` runs `dbt build` on the Postgres that verified the workbook. New extras: `postgres`,
13
+ `dbt-postgres`.
14
+ - **Browser playground** (https://nikhil414.github.io/cellproof/): drop a workbook, get every verdict and the dbt
15
+ project, in the page (Pyodide, DuckDB 1.2); nothing is uploaded. CONCAT and TEXTJOIN no longer need DuckDB 1.3.
16
+ - **The console says what to fix first.** After the counts line, every conversion prints the top five unresolved
17
+ reasons ranked by how many cells each blocks ("Where to start"), the same ranking `REPORT.md` has always carried -
18
+ so a long list of unfinished cells no longer needs the report opened to be useful. `--stats` still adds the full
19
+ tally.
20
+ - **Wrong answers other cells read are called out** (`REPORT.md`, `report.json`, console): a FAIL whose value feeds
21
+ other formulas can carry its difference further than a FAIL nobody reads. Only direct readers are listed ("read
22
+ by", not "blocks"): a reader may add a difference of its own, so the list is a neighbourhood, not a guarantee.
23
+ The reverse pass reuses the compile's tokenizing and costs one bisect per column, so whole-column references stay
24
+ cheap.
25
+ - Add DEC2BIN, DEC2HEX, DEC2OCT and their reverse conversions; unverified edge cases remain UNRESOLVED.
26
+ - CI: a Postgres 16 service runs the Postgres tests and dbt build on every push.
27
+
3
28
  ## 0.6.1 (2026-10-31)
4
29
 
5
30
  - **ROUND rounds the value Excel shows** (15 significant digits, half away from zero): `ROUND(1.005, 2)` is 1.01,
6
31
  as in Excel. The double 1.005 is 1.00499999..., and the binary rounding before gave 1.0 - an honest FAIL, never a
7
- false PASS. Same method as ROUNDUP/ROUNDDOWN; Microsoft's ROUND examples are tests.
32
+ false PASS. Same method as ROUNDUP/ROUNDDOWN; Microsoft's ROUND examples are tests. (Released from release-0.6.)
8
33
 
9
34
  ## 0.6.0 (2026-10-31)
10
35
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: cellproof
3
- Version: 0.6.1
3
+ Version: 1.0.0
4
4
  Summary: Turn an Excel workbook into SQL (a dbt project on DuckDB) and prove every number matches.
5
5
  Project-URL: Homepage, https://github.com/Nikhil414/cellproof
6
6
  Project-URL: Issues, https://github.com/Nikhil414/cellproof/issues
@@ -27,17 +27,58 @@ Provides-Extra: compute
27
27
  Requires-Dist: formulas<1.4,>=1.3.4; extra == 'compute'
28
28
  Provides-Extra: dbt
29
29
  Requires-Dist: dbt-duckdb>=1.8; extra == 'dbt'
30
+ Provides-Extra: dbt-postgres
31
+ Requires-Dist: dbt-postgres>=1.8; extra == 'dbt-postgres'
30
32
  Provides-Extra: dev
31
33
  Requires-Dist: jinja2>=3.1; extra == 'dev'
32
34
  Requires-Dist: pytest>=8; extra == 'dev'
35
+ Provides-Extra: postgres
36
+ Requires-Dist: pgserver>=0.1; extra == 'postgres'
37
+ Requires-Dist: psycopg[binary]>=3.1; extra == 'postgres'
38
+ Requires-Dist: sqlglot>=25; extra == 'postgres'
33
39
  Description-Content-Type: text/markdown
34
40
 
35
41
  # cellproof
36
42
 
43
+ [![PyPI](https://img.shields.io/pypi/v/cellproof)](https://pypi.org/project/cellproof/)
44
+ [![tests](https://github.com/Nikhil414/cellproof/actions/workflows/ci.yml/badge.svg)](https://github.com/Nikhil414/cellproof/actions/workflows/ci.yml)
45
+ [![Python](https://img.shields.io/pypi/pyversions/cellproof)](https://pypi.org/project/cellproof/)
46
+ [![License: MIT](https://img.shields.io/badge/license-MIT-green)](LICENSE)
47
+
37
48
  **Turn an Excel workbook into SQL, and prove every number matches.**
38
49
 
50
+ <img src="docs/demo.gif" alt="cellproof converting a workbook: every formula checked against Excel's saved value" width="320" align="right">
51
+
52
+ **[Try it in your browser](https://nikhil414.github.io/cellproof/)**: drop a workbook, get every verdict and the dbt
53
+ project back. It runs entirely in the page (Python and DuckDB in WebAssembly); your file is never uploaded.
54
+
55
+ **Or on your machine, in 30 seconds:**
56
+
57
+ ```bash
58
+ pip install cellproof
59
+ curl -LO https://github.com/Nikhil414/cellproof/raw/main/examples/functions.xlsx
60
+ cellproof convert functions.xlsx
61
+ # 74 pass, 0 fail, 2 unresolved -> functions_dbt/REPORT.md
62
+ # Where to start (unresolved, ranked by how many cells each blocks):
63
+ # 2 MATCH approximate match needs descending sorted data: ... (Functions!G13, Functions!G73)
64
+ ```
65
+
66
+ Then open `functions_dbt/REPORT.md`: every formula, the value Excel saved, the value the SQL gave, and why the two
67
+ unresolved cells were not guessed.
68
+
69
+ - **11,080 cells PASS** on 85 public test workbooks (pycel, formulas, xlcalculator). The 16 FAILs are 10 cells in files LibreOffice saved and 6 last-digit NPV
70
+ cancellations; none is a wrong translation.
71
+ - **146 Excel functions**, array formulas, dynamic spills (FILTER, SORT, UNIQUE), Excel tables, LET.
72
+ - **Fast:** 200,000 formulas converted and verified in 26 s.
73
+ - **Local:** workbook values never leave your machine.
74
+
75
+ Have a workbook cellproof gets wrong? [Open an issue](https://github.com/Nikhil414/cellproof/issues/new) with the
76
+ formula (not your data): that is the most useful contribution there is.
77
+
39
78
  (Released as `unexcel` up to 0.1.0; renamed to cellproof in 0.2.0.)
40
79
 
80
+ <br clear="right">
81
+
41
82
  Business logic often lives in a spreadsheet that one person understands. Moving it into a database is risky because
42
83
  nobody can show the new numbers equal the old ones. cellproof translates every formula of an `.xlsx` into SQL, runs that
43
84
  SQL on [DuckDB](https://duckdb.org), and compares each result with the value Excel itself saved in the file. Excel's
@@ -45,7 +86,9 @@ saved values are a free answer key.
45
86
 
46
87
  ```
47
88
  $ cellproof convert examples/functions.xlsx
48
- 72 pass, 0 fail, 4 unresolved -> examples/functions_dbt/REPORT.md
89
+ 74 pass, 0 fail, 2 unresolved -> examples/functions_dbt/REPORT.md
90
+ Where to start (unresolved, ranked by how many cells each blocks):
91
+ 2 MATCH approximate match needs descending sorted data: ... (Functions!G13, Functions!G73)
49
92
  ```
50
93
 
51
94
  Every formula cell gets one verdict:
@@ -67,6 +110,8 @@ Python 3.10 or newer.
67
110
  pip install cellproof
68
111
  pip install "cellproof[dbt]" # also run dbt build (--dbt)
69
112
  pip install "cellproof[compute]" # answer key for files never saved in Excel
113
+ pip install "cellproof[postgres]" # verify on Postgres too (--target postgres)
114
+ pip install "cellproof[postgres,dbt-postgres]" # ... and run the dbt-postgres project (--dbt)
70
115
  ```
71
116
 
72
117
  Runtime dependencies are only `openpyxl` and `duckdb`.
@@ -77,17 +122,41 @@ Runtime dependencies are only `openpyxl` and `duckdb`.
77
122
  cellproof convert book.xlsx # writes book_dbt/ next to the file
78
123
  cellproof convert book.xlsx --out out_dir # choose the folder
79
124
  cellproof convert book.xlsx --dbt # also run `dbt build` on the generated project
125
+ cellproof convert book.xlsx --stats # print the unresolved cells' reasons, most common first
80
126
  ```
81
127
 
128
+ After the counts line, the console shows what to fix first: the top unresolved reasons ranked by how many cells each
129
+ blocks, and any wrong answers other formulas read (direct readers only, so a difference that travels is visible).
130
+ `REPORT.md` and `report.json` hold the full lists.
131
+
82
132
  The output folder holds:
83
133
 
84
134
  - **`REPORT.md` / `report.json`**: every verdict, failed cells with both values, unresolved cells with the reason,
85
135
  findings (for example a number stored as text, which Excel skips in SUM), and which blocks of rows became readable
86
136
  table models. The unresolved reasons are ranked by how many cells depend on them ("Where to start"), so a long list
87
- of unresolved cells says what to fix first.
137
+ of unresolved cells says what to fix first. A failed cell that other formulas read is listed with its readers
138
+ ("Wrong answers other cells read"), because a wrong value that feeds other cells can spread.
88
139
  - **A dbt project** (`dbt_project.yml`, `models/`, `seeds/input_cells.csv`) that recomputes the workbook on DuckDB.
89
140
  It runs exactly the SQL the verifier checked.
90
141
 
142
+ ### On Postgres
143
+
144
+ ```bash
145
+ cellproof convert book.xlsx --target postgres # on a Postgres of cellproof's own (pgserver)
146
+ cellproof convert book.xlsx --target postgres --pg-url postgresql://user:pw@host/db
147
+ cellproof convert book.xlsx --target postgres --dbt # and run dbt build on that same Postgres
148
+ ```
149
+
150
+ Every cell is verified twice: on DuckDB, then again on Postgres with the SQL translated (sqlglot plus rewrites and
151
+ helper functions that give Postgres DuckDB's semantics). The report's verdicts are Postgres's. A batch that does not
152
+ translate or run on Postgres makes its cells UNRESOLVED ("not yet on Postgres: ..."), and every cell reading them too,
153
+ so the dbt project only holds SQL that ran on Postgres. Nothing stays in the database you verify on: the cells table
154
+ is temporary and the helpers live in `pg_temp`.
155
+
156
+ The dbt project targets `dbt-postgres`. Its helper functions are created in the target schema by an `on-run-start`
157
+ macro, and `profiles.yml` reads the connection from `CELLPROOF_PG_HOST`, `CELLPROOF_PG_PORT`, `CELLPROOF_PG_USER`,
158
+ `CELLPROOF_PG_PASSWORD`, `CELLPROOF_PG_DBNAME` and `CELLPROOF_PG_SCHEMA` (default: the workbook's name).
159
+
91
160
  The workbook must have been saved by Excel (so the file holds Excel's values). For a file generated by code and never
92
161
  opened in Excel, install the `compute` extra: the [`formulas`](https://pypi.org/project/formulas/) library then
93
162
  computes the expected values, and the report labels them `computed` (a weaker answer key than Excel).
@@ -111,11 +180,12 @@ reader -> regions -> dependency graph -> compiler -> verifier -> dbt emitter ->
111
180
  code.
112
181
  6. **Emit** the dbt project and the report.
113
182
 
114
- 140 Excel functions are supported: @ (SINGLE), ABS, AND, AVERAGE, AVERAGEIF(S), CEILING, CHAR, CHOOSE, CLEAN, CODE,
115
- COLUMN, COLUMNS, CONCAT(ENATE), COUNT, COUNTA, COUNTBLANK, COUNTIF(S), DATE, DATEDIF, DAY, DAYS, DAYS360, EDATE,
116
- EOMONTH, EXACT, EXP, FILTER, FIND, FLOOR, FV, HLOOKUP, IF, IFERROR, IFNA, IFS, INDEX, INT, IRR, IS* (BLANK, ERR,
183
+ 146 Excel functions are supported: @ (SINGLE), ABS, AND, AVERAGE, AVERAGEIF(S), BIN2DEC, CEILING, CHAR, CHOOSE, CLEAN, CODE,
184
+ COLUMN, COLUMNS, CONCAT(ENATE), COUNT, COUNTA, COUNTBLANK, COUNTIF(S), DATE, DATEDIF, DAY, DAYS, DAYS360, DEC2BIN,
185
+ DEC2HEX, DEC2OCT, EDATE,
186
+ EOMONTH, EXACT, EXP, FILTER, FIND, FLOOR, FV, HEX2DEC, HLOOKUP, IF, IFERROR, IFNA, IFS, INDEX, INT, IRR, IS* (BLANK, ERR,
117
187
  ERROR, LOGICAL, NA, NUMBER, TEXT), ISEVEN, ISODD, LARGE, LEFT, LEN, LET, LN, LOG, LOG10, LOOKUP, LOWER, MATCH, MAX,
118
- MAXIFS, MEDIAN, MID, MIN, MINIFS, MOD, MODE, MONTH, MROUND, N, NA, NETWORKDAYS, NOT, NPER, NPV, OR, PERCENTILE(.INC),
188
+ MAXIFS, MEDIAN, MID, MIN, MINIFS, MOD, MODE, MONTH, MROUND, N, NA, NETWORKDAYS, NOT, NPER, NPV, OCT2DEC, OR, PERCENTILE(.INC),
119
189
  PI, PMT, POWER, PRODUCT, PROPER, PV, QUARTILE(.INC), RANK(.EQ), RATE, REPLACE, REPT, RIGHT, ROUND(UP/DOWN), ROW, ROWS,
120
190
  SEARCH, SEQUENCE, SIGN, SMALL, SORT, SORTBY, SQRT, STDEV(.S/.P/P), SUBSTITUTE, SUBTOTAL, SUM, SUMIF(S), SUMPRODUCT,
121
191
  SWITCH, TEXT, TEXTJOIN, TRIM, TRUE/FALSE, TRUNC, UNICHAR, UNICODE, UNIQUE, UPPER, VALUE, VAR(.S/.P/P), VLOOKUP,
@@ -175,7 +245,8 @@ cellproof prefers an honest UNRESOLVED or FAIL to a guess. Known limits, each re
175
245
  - **Edge cases not checked in real Excel yet** are UNRESOLVED with that reason, never guessed: PMT/PV/FV/NPER with
176
246
  zero periods, a rate of -100% or less or a payment type other than 0 or 1; NPV at a rate of -100%; LARGE/SMALL with
177
247
  a k that is not whole; RANK over a range holding an error; NETWORKDAYS/WORKDAY with text or errors among the
178
- holidays. NETWORKDAYS.INTL, WORKDAY.INTL, IRR, RATE and the other finance and statistics functions are not in yet.
248
+ holidays. NETWORKDAYS.INTL, WORKDAY.INTL and the other finance and statistics functions outside the list above are not in
249
+ yet.
179
250
  - **Some function options:** SUBTOTAL 101-111 (hidden rows), DATEDIF units MD/YM/YD, WEEKDAY types 11-17, TEXT formats
180
251
  outside the supported table, COUNT or MEDIAN of values typed into the formula, criteria taken from an empty cell.
181
252
  - **Floating point:** a running total becomes a fast window function only when Excel's saved values prove the different
@@ -187,7 +258,8 @@ cellproof prefers an honest UNRESOLVED or FAIL to a guess. Known limits, each re
187
258
  other than plain sums (`=C1*1.05+B2`, `=MAX(C1,B2)`) also run cell by cell.
188
259
  - **The answer key:** a workbook must have been saved by Excel; `formulas` (the `compute` extra) is a weaker fallback
189
260
  and is known to disagree with Excel in places.
190
- - **dbt:** the generated project targets DuckDB (`dbt-duckdb`). Other warehouses are not generated yet.
261
+ - **dbt:** the generated project targets DuckDB (`dbt-duckdb`), or Postgres (`dbt-postgres`) with `--target postgres`.
262
+ Other warehouses are not generated yet.
191
263
 
192
264
  ## Security and privacy
193
265
 
@@ -0,0 +1,212 @@
1
+ # cellproof: progress
2
+
3
+ Last updated: 2026-11-16. This file is the single place that says where the project stands. Read it cold: a person
4
+ or a coding agent should be able to pick up the work from here. For the rules of the code read `AGENTS.md`; for what
5
+ the tool does and its limits, `README.md`.
6
+
7
+ ## What cellproof is (one paragraph)
8
+
9
+ `cellproof convert book.xlsx` translates every formula of an Excel workbook into SQL, runs it (DuckDB; Postgres too
10
+ with `--target postgres`), and compares each result with the value Excel saved in the file. Every formula cell gets
11
+ PASS, FAIL (both values shown) or UNRESOLVED (with the reason). It never guesses: a false PASS is the worst possible
12
+ bug. Output: `REPORT.md` / `report.json` and a dbt project that runs exactly the SQL that was checked. Earlier name:
13
+ `unexcel` (until 0.2.0; old plans still use it).
14
+
15
+ ## Status at a glance
16
+
17
+ | What | State |
18
+ |---|---|
19
+ | PyPI | **0.6.1** is the latest release (`pip install cellproof`), released 2026-10-31 from branch `release-0.6` |
20
+ | `main` | 0.6.1 plus: the Postgres target (verification only), the browser playground, README with demo GIF, and the console triage (ranked unresolved reasons and wrong answers other cells read, always printed). Not released |
21
+ | Branch `v1.0-postgres`, [PR #8](https://github.com/Nikhil414/cellproof/pull/8) | **1.0**: dbt-postgres project, `postgres.verify_book`, `--target postgres --dbt`, Postgres 16 job in CI. CI green (13/13). Merge and release planned for after launch week (~2026-11-24) |
22
+ | Playground | Live at https://nikhil414.github.io/cellproof/ (GitHub Pages, deployed by `.github/workflows/pages.yml` on every push to `main` that touches `src/`, `playground/` or the example) |
23
+ | Tests | `main`: 558 pass, 3 skip (2026-11-16). This branch adds the Postgres tests: **563 pass, 3 skip** with dbt-postgres installed (2026-11-17; the 3 skips are the optional `compute` extra and the opt-in 200k benchmark) |
24
+ | CI | `tests` workflow: Windows/macOS/Linux x Python 3.10-3.13, plus a `postgres` job on this branch. All green (the one cancelled macOS job on `main` after PR #7 was rerun 2026-11-15; PR #9's run green 2026-11-15) |
25
+ | Public test workbooks (85) | **11,080 PASS / 16 FAIL / 37,814 UNRESOLVED**, identical on DuckDB 2.0, on DuckDB 1.2 (the playground) and on Postgres (with `dbt build` passing for all 85). The 16 FAIL are explained below. A fresh re-download of the corpus on 2026-11-15 (the source repos changed; 66 files now) measured **13,043 PASS / 34 FAIL / 19,183 UNRESOLVED** — one workbook (formulas' `test.xlsx`, a function catalog) holds 17,454 of the UNRESOLVED, and `CONVERT` alone 3,593 (19%). Of the 34 FAIL, 19 were wrong error codes from PR #7's base conversions ([issue #10](https://github.com/Nikhil414/cellproof/issues/10)), 9 are the known LibreOffice drift in `INFORMATION.xlsx`/`SQRT.xlsx`; 6 are the known npv float cells; the 19 error codes were fixed the same day (PR #12), bringing the fresh-corpus count to **13,062 PASS / 15 FAIL**. 2026-11-15: the six base cross-pairs (HEX2BIN/HEX2OCT/BIN2HEX/BIN2OCT/OCT2HEX/OCT2BIN, semantics verified against Excel-saved values in `test.xlsx`) turned **669** more cells PASS: fresh corpus now **13,732 PASS / 15 FAIL / 18,513 UNRESOLVED**, 0 FAILs on `BASES.xlsx` and `test.xlsx` |
26
+ | Contributors | Open: PR #5 (overflow, changes requested). Merged: PR #7 (DEC2BIN/HEX/OCT and back, MilindLate, 2026-11-13, closes #2; unverified cases guarded, never guessed), PR #9 (`--stats` flag: count-sorted tally of UNRESOLVED reasons on the console, 2026-11-15), PR #12 (base conversions: match real Excel's error codes, closes #10, 2026-11-15), PR #15 (the six base cross-pairs, 2026-11-16, issue #14's first roadmap item), PR #17 (console triage: ranked unresolved reasons and the wrong answers other cells read, 2026-11-16). Closed: PR #6 (superseded by #5). Issues #1, #3, #4, #14 open, #4 pinned; #3 has a contributor spec comment (2026-11-15: TAKE, DROP, CHOOSECOLS, CHOOSEROWS, TOCOL, TOROW against the `fn/dynamic.py` relation model); #10 was fixed in PR #12 and closed 2026-11-15; #14 is the 2.0 roadmap (ranked UNRESOLVED table) |
27
+ | Launch | Public launch (Show HN, r/dataengineering, LinkedIn, Shorts/Reels) planned for Tuesday 2026-11-10. 1.0 is the second announcement |
28
+
29
+ ## Where things live
30
+
31
+ | Path | What |
32
+ |---|---|
33
+ | `src/cellproof/` | the package; module map in `AGENTS.md` |
34
+ | `src/cellproof/postgres.py` | Postgres target: `translate()` (DuckDB SQL -> Postgres via sqlglot + tree rewrites), `PRELUDE` (helper functions with DuckDB semantics, in `pg_temp`), `verify()`, `verify_book()` (1.0 branch), `dbt_env()` |
35
+ | `src/cellproof/emitter.py` | dbt project; on the 1.0 branch `write_project(target="postgres")`, `to_postgres()`, `helpers_macro()` |
36
+ | `playground/` | browser playground: `index.html` (page), `worker.js` (Pyodide in a Web Worker), `cellproof_web.py` (bridge: same conversion as the CLI), `build.sh` (builds the site) |
37
+ | `tests/` | pytest suite; `tests/corpus.py DIR [convert options]` runs the 85 public workbooks; `tests/xlsxkit.py` builds test workbooks |
38
+ | `examples/` | Excel-saved workbooks (`functions.xlsx` is the playground's example) and the scripts that made them |
39
+ | `docs/superpowers/specs/`, `docs/superpowers/plans/` | design and plan of each piece; `PLAN*.md` at the root are the early plans, kept for history |
40
+ | `docs/demo.gif` | README demo, cut from the promo video |
41
+ | `CHANGELOG.md` | what each release changed; 1.0.0 is written as "unreleased" on the 1.0 branch |
42
+
43
+ Local-only files on the maintainer's machine (kept out of git with `.git/info/exclude`): `LAUNCH.md` (launch posts and
44
+ launch-day answers), `PR_REVIEWS.md` (review drafts), `last_histoty.md` (an older session log).
45
+
46
+ ## How to work on it
47
+
48
+ ```bash
49
+ python -m venv .venv && . .venv/bin/activate
50
+ pip install -e ".[dev,dbt,compute]" # + ",postgres" for the Postgres tests, + ",dbt-postgres" on the 1.0 branch
51
+ python -m pytest tests -q # dbt must be on PATH (activate the venv) or the dbt tests skip
52
+ python tests/corpus.py /some/dir # the 85 public workbooks (downloads them once); add --target postgres
53
+ CELLPROOF_PERF=1 python -m pytest tests/test_perf.py -s # the 200k-formula benchmark
54
+ CELLPROOF_TEST_PG_URL=postgresql://... python -m pytest tests/test_postgres.py # against a given Postgres (CI does)
55
+ playground/build.sh _site && python -m http.server -d _site # the playground locally (Pyodide cannot load file://)
56
+ ```
57
+
58
+ Release: bump `version` in `pyproject.toml`, move the CHANGELOG entry from "unreleased" to the date, tag `vX.Y.Z`
59
+ and publish a GitHub release (`gh release create vX.Y.Z`). `.github/workflows/publish.yml` uploads it to PyPI with
60
+ trusted publishing (no token stored).
61
+
62
+ Contributor PRs: GitHub holds the first CI run of a new contributor until the maintainer approves it ("Approve and run
63
+ workflows", or `gh api -X POST repos/Nikhil414/cellproof/actions/runs/<id>/approve`). Review from the diff and let CI
64
+ run their code; don't run an outside contributor's code on a personal machine.
65
+
66
+ ## What is built (history)
67
+
68
+ Everything was built test-first; each piece was reviewed by a fresh reviewer.
69
+
70
+ | Piece | What it does |
71
+ |---|---|
72
+ | Plan 1 | reader, parser, references, dependency graph, cell-mode compiler, verifier, dbt emitter, report, CLI |
73
+ | Plan 2a | batched execution (fixes the crash at ~1k formulas), Excel error codes, recursion and size guards, optional `formulas` answer key |
74
+ | Plan 2b | 93 Excel functions, run-time types, Excel's conversions, one criteria engine for the *IF(S) family |
75
+ | Plan 2c | speed in cell mode: Fenwick-tree dependency order, range index, weight-based batches, small dbt models |
76
+ | Plan 2d | table mode: regions (columns repeating one formula) compile to one readable statement |
77
+ | Slice 2 | a region with a cell between its columns splits instead of dissolving; running totals (`=C1+B2`, `=SUM($B$2:B2)`) become window functions |
78
+ | Lookups row-wise | VLOOKUP, HLOOKUP, MATCH, INDEX, XLOOKUP pasted down compile into the region's statement (one join each instead of one query per cell) |
79
+ | Tokenize once | a formula pasted down a column is tokenized once; the next rows' text is predicted and only re-tokenized when it differs |
80
+ | Implicit intersection | a one-column range where one value is expected takes the formula's row; `INDIRECT` of fixed text; MODE |
81
+ | Criteria row-wise | the *IF(S) family with a criterion from the row (`=COUNTIFS($E:$E,">"&A2,...)`) compiles into the region's statement |
82
+ | Impact-ranked unresolveds | the report groups UNRESOLVED cells by the reason to fix first ("Where to start"), ranked by how many cells each blocks; report.json has `unresolved_groups` and per-cell `blocked_by` |
83
+ | Approximate lookups unsorted | MATCH type 1 / VLOOKUP / HLOOKUP / LOOKUP over a plain numeric input table out of order compile Excel's binary-search path; a changed table is #STALE -> UNRESOLVED, never a stale answer. Type -1 and text stay UNRESOLVED |
84
+ | Arrays in aggregates | `SUM(A1:A10*B1:B10)`, `SUMPRODUCT((A1:A9>5)*C1:C9)`, `MAX(IF(A1:A9="x",B1:B9))`, element by element, modern Excel's rules |
85
+ | 0.3.0 | PMT, PV, FV, NPER, NPV; LARGE, SMALL, RANK, STDEV/VAR, PERCENTILE, QUARTILE; NETWORKDAYS, WORKDAY; Excel table structured references; LET |
86
+ | 0.3.1 | security: WORKDAY's day span sized by the holidays present, not the range's area (DoS) |
87
+ | 0.4.0 | array formulas over a block and dynamic spills, cell by cell; `A1#` and `@`; FILTER, SORT, UNIQUE; Excel 365 error codes; security: array blocks cannot overwrite other formulas |
88
+ | 0.5.0 | FILTER/SORT/UNIQUE inside aggregates; ROWS, COLUMNS, XMATCH, SORTBY, SEQUENCE; each spill computed in one statement (1,334 cells: 31 s -> 0.03 s) |
89
+ | 0.6.0 | a batch DuckDB rejects no longer stops the run (recompiled, its cells UNRESOLVED); ROW, COLUMN, CODE, UNICODE, UNICHAR, N, ISODD, ISEVEN, IRR, RATE |
90
+ | 0.6.1 | ROUND rounds the 15-digit value Excel shows (`ROUND(1.005,2)` = 1.01) |
91
+ | Postgres verification (`main`) | `--target postgres [--pg-url]`: every verified DuckDB batch is translated and every cell verified again on Postgres (bundled `pgserver` or your own). Untranslatable batches and their readers are UNRESOLVED ("not yet on Postgres: ..."). Nothing stays in the database: temp table, helpers in `pg_temp` |
92
+ | Browser playground (`main`) | drop a workbook, get every verdict, "Where to start", the cell table, REPORT.md and the dbt project as a zip; Pyodide 0.27 + DuckDB 1.2 in a Web Worker; nothing uploaded |
93
+ | Console triage (`main`) | every conversion prints the top five unresolved reasons (ranked by cells blocked) and the wrong answers other formulas read (direct readers only, "read by" never "blocks"), so the counts alone no longer need the report; the reverse pass reuses the compile's tokens and bisects per column, so whole-column references are O(log n); `postgres._readers` now delegates to it |
94
+ | 1.0 (`v1.0-postgres`, PR #8) | `postgres.verify_book` recompiles without what Postgres cannot run, so the dbt-postgres project only holds SQL that ran; helpers created in the target schema by an `on-run-start` macro; `profiles.yml` reads `CELLPROOF_PG_*`; `--dbt` builds on the Postgres that verified; CI Postgres 16 job |
95
+ | PR #7 (merged 2026-11-13) | DEC2BIN, DEC2HEX, DEC2OCT and BIN2DEC, HEX2DEC, OCT2DEC (issue #2); hex text cast to BIGINT so DuckDB 1.2 works; cases not checked in real Excel (`HEX2DEC("")`, a negative invalid `places`) stay UNRESOLVED, never guessed |
96
+
97
+ ## The public test workbooks
98
+
99
+ `python tests/corpus.py DIR` runs the 85 .xlsx/.xlsm test files of pycel, formulas and xlcalculator (Excel-saved,
100
+ except 8 LibreOffice ones). Now: **11,080 PASS / 16 FAIL / 37,814 UNRESOLVED**, the same on DuckDB 2.0, DuckDB 1.2
101
+ and Postgres. History: 4,693 PASS (before LOOKUP, YEARFRAC, array constants) -> 6,874 (2026-10-19) -> 7,528 (0.3.0)
102
+ -> 11,080 (0.6.1).
103
+
104
+ The 16 FAIL are not wrong translations: 10 are cells in LibreOffice-saved files (LibreOffice's answer differs from
105
+ Excel's), 6 are in pycel's `npv.xlsx` where `=C7-A7` subtracts two numbers equal to 1e-13 relative, so the last digits
106
+ differ (every NPV cell itself PASSes). The UNRESOLVED are mostly functions those files test on purpose (CONVERT 3,593
107
+ cells in one file alone, DEC2HEX/BIN/OCT, CHAR above 127 in a Mac-calculated file, ...). Findings are tests in
108
+ `tests/test_corpus_findings.py`.
109
+
110
+ A user's practice workbook went 3 PASS / 47 UNRESOLVED -> 48 PASS / 0 FAIL / 2 UNRESOLVED; it found 4 gaps the 85
111
+ public files did not.
112
+
113
+ ## Measured speed (Windows 11 laptop)
114
+
115
+ | Workbook | Before table mode | Now |
116
+ |---|---|---|
117
+ | 200k formulas (4 columns x 50k rows, one running total) | 390 s | 26.0 s (read 8.3, compile 11.3), all PASS |
118
+ | Flat `=A*1.1`, 20k cells | verify 28.3 s | verify 0.2 s |
119
+ | `--dbt`, flat 20k | 225.9 s, 213 MB | 9.6 s, 1.6 MB |
120
+ | VLOOKUP per row, 50k rows | - | 4.6 s (read 2.2, compile 1.8, verify 0.6), all PASS |
121
+ | COUNTIFS per row (`">"&A2`, 2 criteria), 1k rows | verify 29.0 s, 500 batches | verify 0.1 s, 1 batch |
122
+ | SUMIFS / COUNTIFS per row, 50k rows | - | verify 0.6-0.8 s; compile 8.7-9.5 s |
123
+
124
+ Playground (Chromium): the example converts in 3.3 s; a 23,313-cell workbook in about 60 s with the CLI's exact
125
+ verdicts. Startup is 2.5-3.5 s on a good connection (Pyodide from jsDelivr, DuckDB from jsDelivr checked by SHA-256,
126
+ the site's own copy as fallback); on a network that crawls on github.io it took minutes.
127
+
128
+ ## What real Excel taught us (each is a test)
129
+
130
+ From Excel-saved files (`tests/test_excel_findings.py`, `tests/test_corpus_findings.py`):
131
+
132
+ - COUNTIF `"<>5"` skips only the number 5 (the text "5" is counted); `"<>"` counts a formula that returns "".
133
+ - DAYS360 (US): only a 31st is moved; the last day of February ends the period unchanged unless the start is also the
134
+ last day of February.
135
+ - `TEXT(-0.001,"0.00")` is `"0.00"`. `MOD(1,0.1)` is `0.09999999999999995`. Inside 1900 a date is linear:
136
+ `DATE(1900,2,29)`, `DATE(1900,1,60)` and `DATE(1900,3,0)` are all 60.
137
+ - Number -> text is plain digits from 1E-11 to 1E+19 and scientific from 1E+20; ROUND rounds the 15-digit value shown.
138
+ - Errors typed into a formula come before errors inside referenced cells: `SUM(H3,1/0)` is #DIV/0!.
139
+ - `(-8)^(1/3)` is the real cube root (-1.9999999999999998); other fractional powers of a negative number are #NUM!.
140
+ - Past an array's size a block cell is #N/A (even under IFERROR), but IS functions see per-element #N/A padding.
141
+ - EDATE, EOMONTH, MROUND, YEARFRAC, ISODD, ISEVEN do not lift over ranges in array formulas (#VALUE!).
142
+ - ROW of a range is one column of row numbers; COLUMN one row; N of a range is its first cell.
143
+ - PERCENTILE/LARGE: k's error comes before the range's; QUARTILE checks quart before truncating.
144
+ - SORTBY with one-row keys sorts columns; FILTER's if_empty range spills whole.
145
+ - XMATCH next-smaller/larger compares across types with Excel's own collation; ß matches "ss" (both UNRESOLVED).
146
+ - Empty FILTER without if_empty: #CALC! in the docs but #VALUE! in a saved file (UNRESOLVED).
147
+ - `XLOOKUP` is stored as `_xlfn.XLOOKUP` in the file.
148
+
149
+ ## Engine differences worth knowing (learned building the Postgres target and the playground)
150
+
151
+ - **DuckDB versions:** 2.0 accepts only `lambda x: ...`; 1.2 only `x -> ...` (no common syntax), so the playground's
152
+ bridge rewrites lambdas for DuckDB < 1.3. `list_concat` with more than two lists needs DuckDB 1.3 (cellproof nests
153
+ pairs). Hex text cast to HUGEINT fails before DuckDB 2.0 (BIGINT works everywhere). Python 3.10 cannot install
154
+ DuckDB 2.0, so CI's 3.10 jobs run DuckDB 1.5: a good early warning for version-specific SQL.
155
+ - **Pyodide:** the newest DuckDB built for it is 1.2 (Pyodide 0.27, Python 3.12); micropip-installing it crashed in
156
+ Chromium ("null function" on the first `read_csv`), unpacking the wheel works.
157
+ - **Postgres:** unnamed columns are all called `?column?`, so CREATE TABLE AS fails (the dbt models name them);
158
+ `max()` has no boolean form (`bool_or`); a bare `NULL` in a CTE is text; sqlglot writes function names in upper case
159
+ (fine: Postgres folds them).
160
+
161
+ ## Open work
162
+
163
+ - **PR #17 (console triage):** every conversion now prints the top unresolved reasons and the wrong answers other
164
+ cells read (direct readers only), and the report gained that section. Waiting for CI.
165
+ - **PR #8, 1.0:** green, waiting for after launch week. Then: bump to 1.0.0, date the CHANGELOG, merge, tag, release,
166
+ announce.
167
+ - **PR #5 (overflow as #NUM!, imshah-id):** the right approach (checked per operation, so IFERROR sees it; regions,
168
+ cells and arrays agree; CI green). Changes requested: drop the COUNTIF/SUMIF error-criterion change (Excel likely
169
+ counts cells holding the error; unconfirmed, so it must stay UNRESOLVED), and measure SQL size (the check repeats
170
+ the expression per level) and the 200k benchmark.
171
+ - **PR #7 (DEC2BIN/HEX/OCT and back, MilindLate):** merged 2026-11-13 into `main` and the 1.0 branch (closes issue
172
+ #2). The Python 3.10 hex-cast fix and the guards for cases not checked in real Excel (`HEX2DEC("")`, a negative
173
+ invalid `places`) came in with it.
174
+ - **Issues:** #1 overflow (PR #5), #3 TAKE/DROP/CHOOSECOLS/TOCOL (help wanted), #4 "send a workbook cellproof gets
175
+ wrong" (pinned).
176
+
177
+ ## Known gaps
178
+
179
+ - Arithmetic overflow gives `inf`, an honest FAIL instead of `#NUM!` (PR #5).
180
+ - A lookup outside a region (cell mode) runs about 7 s per 1,000 cells.
181
+ - Running totals other than sums (`=C1*1.05+B2`, `=MAX(C1,B2)`), other functions over growing ranges, and a split
182
+ piece that needs a second split stay in cell mode.
183
+ - Compile on the 200k run is 11.3 s (the per-cell dependency loop and reference resolving); read is 8.3 s (openpyxl
184
+ loads the workbook twice).
185
+ - Minors: workbook text equal to the placeholder `__cellproof_cells__` is rewritten; computed-answer results are not
186
+ counted separately; old tables stay in `cellproof.duckdb` after a rerun.
187
+ - Not checked in real Excel yet (UNRESOLVED until they are): number -> text below 1E-11, `(-8)^(2/3)`, `(-16)^(1/4)`,
188
+ `DATE(1900,13,1)`, COUNTIF with an error as the criterion, `HEX2DEC("")`.
189
+
190
+ ## Next
191
+
192
+ 1. Launch (2026-11-10), then answer feedback fast: every "does it handle X?" becomes an issue.
193
+ 2. Finish PR #5 (overflow as #NUM!) and merge it.
194
+ 3. Release 1.0 (PR #8) as the second announcement.
195
+ 4. **2.0 roadmap (issue #14), in order.** The cross-pairs landed first (PR #15). Next:
196
+ - **TTEST / T.TEST** — 384 UNRESOLVED cells (192 each), per the corpus tally. A survey on 2026-11-16 found
197
+ **every** TTEST formula in the corpus sits inside an **array (CSE) block**: `test.xlsx` holds 17
198
+ `<f t="array">` blocks such as `TTEST(C37:D38,E35:E38,{1;2;1;2;1;2},{1;2;3;1;2;3})`, each spilling 6 rows
199
+ (R38:R43 and neighbours), and there are no scalar TTEST formulas anywhere. So this is not just a new function:
200
+ the ranges-in-a-CSE-block behaviour has to be settled (Excel's saved values are the ground truth) before the
201
+ 384 cells can be claimed, and part of the work is the lift/NO_LIFT decision that the cross-pairs deliberately
202
+ left UNRESOLVED.
203
+ - Approximate-match evidence hunt (~617 cells): find real-Excel saved answers for the lookup modes currently
204
+ left UNRESOLVED, then implement only what is proven.
205
+ - `CONVERT` (3,593 cells) stays the contributor-bait item (the largest single reason in the corpus).
206
+ - `CHAR` > 127 from a Mac-calculated file stays honest UNRESOLVED.
207
+ 5. TAKE/DROP/CHOOSECOLS/CHOOSEROWS/TOCOL/TOROW (issue #3).
208
+ 6. More real analyst workbooks: each one found gaps the public files did not.
209
+ 7. Speed: read time (openpyxl twice) and the per-cell dependency loop.
210
+ 8. Other warehouses through the same translation path as Postgres (ask launch users which one).
211
+ 9. Plan 3: an AI retry loop for failed cells (it sees formula structure only, never values), every answer still
212
+ verified against Excel.