fix: tolerate spreadsheet decimal roundoff

This commit is contained in:
Wyndham ARR
2026-08-04 14:49:38 +08:00
parent a2b86cdf10
commit aae3d8e1db
5 changed files with 144 additions and 7 deletions

View File

@@ -27,6 +27,20 @@
- The Docker root dependency chain now installs `openpyxl==3.1.5` through `requirements-monthly-reports.txt`; no
separate npm or Codex-runtime bootstrap is needed.
## Follow-up: 2026-08-03 monthly validation failure
- Operator-provided production evidence showed a 440-row, multi-sheet 2026-08-03 workbook whose sheet names and
channel counts matched, and which passed manual validation when reopened non-read-only with numeric tolerance. The
worker nevertheless emitted `MONTHLY_REPORT_OUTPUT_VALIDATION_FAILED`; outbox event 31 became `dead` and event 30
remained pending/retrying. This isolates the failure to the workbook-validation implementation rather than
container, worker startup, database or OSS publication.
- `_validate_workbook` no longer calls `worksheet.cell(row, column)` on a `read_only=True` workbook. It consumes each
sheet header and data row in order with `iter_rows`, rejects missing/extra rows or columns, and keeps strict formula
and semantic checks. Excel-decimal values now use a finite-Decimal absolute tolerance of `0.000001`.
- Regression coverage builds 440 rows across all five standard sheets over three daily versions, with decimal rate and
price values plus KB rows. The builder validates 440 formulas successfully; the dedicated XLSX class passes 2/2 and
the monthly builder/publishing/worker/service/repository slice passes 18/18.
## Verification
- Targeted report/web/storage/migration suite: 41 tests passed; builder/company integration slice: 15 tests passed