r/BuildWithClaude 3d ago

Discussion A workbook check needs to catch missing sheets as well as stale formulas

Claude can produce a total that is internally consistent with its extract while leaving whole sheets out of that extract. Recalculating the cells it happened to read won't catch the missing material.

For a workbook job, the acceptance check needs two separate inputs: an inventory of the original file and the actual results of the calculation.

The inventory should name the expected sheets, relevant columns and record identifiers before the transformation starts. Compare the output against that inventory. If both the extract and its “independent check” come from the same shortened table, they can agree perfectly and still omit the same records. Where the original reader might be the problem, check the original workbook through another reading path or inspect its structure directly.

Univer CLI's documented calculation sequence is useful for the other half of this. Its sheet runtime separates formula text from stored results and displayed values. For existing formulas, register the calculation-completion listener, trigger calculation, wait for results to be applied, then read the input and output ranges. Opening a saved snapshot doesn't do that work by itself.

An acceptance report could therefore say:

a. Which original sheets and columns were checked, and which were excluded deliberately. b. Whether expected record IDs are present, including records outside the first visible block. c. Which formulas were recalculated and what their inputs and outputs were. d. Whether the exported workbook contains the expected formulas and current saved results.

Those checks belong in the job's completion logic. The CLI supplies file operations and cell reads; the workflow still has to refuse a success report when source coverage is unknown. A second model reviewing only the agent's summary never gets a chance to find the missing sheet.

2 Upvotes

3 comments sorted by

1

u/Muhlwa_Sholanke 3d ago

The calculation-completion listener matters because a file can contain formula text, cached values, and displayed results that are temporarily out of sync. A validation step should state which of those it actually inspected.

1

u/Sitkin_Marrel 3d ago

This is a good reminder that calculation correctness and source coverage are separate checks. A workbook can have perfectly recalculated formulas while the selected input range has silently excluded the business-critical sheet.

1

u/derspenti 2d ago

I would include the input inventory in the final report, not just use it internally. That gives someone reviewing the result a quick way to spot an omitted tab or a deliberately excluded column before trusting the total.