Add portable workbook inspection and royalty conformance

Merged
SI
17h ago
+311-4

Summary

  • Expose a portable workbook inspector with bounded row samples, physical coordinates and clipping indicators. Use the same XLSX reader as the Recoup processing core.
  • Exercise independently authored synthetic royalties across two detail sheets and a summary. Preserve exact amounts and identifiers, verify replay and hold details assigned to the wrong account.

Part of https://github.com/recoupable/api/issues/1319 and https://github.com/recoupable/mono/issues/819. Hosted qualification continues under https://github.com/recoupable/api/issues/1320.

Verification

  • 142 local ingestion tests passed, with six database integration cases skipped.
  • Strict ingestion core type check and focused lint passed.
  • A clean Node consumer installed and exercised the development tarball.

Summary by cubic

Adds portable workbook inspection for surveying XLSX layout before drafting ingestion mappings, plus conformance tests and a hosted qualification mode for synthetic royalty statements.

  • inspectIngestionWorkbook() samples up to five nonempty rows per sheet with physical row numbers and clipping markers on cells over 200 code points, reusing the same XLSX reader as the ingestion pipeline. Unsampled sheets keep their inventory entry and report a sheet issue instead of failing.
  • Tests reconcile two detail tabs to a summary total, verify deterministic replay, and hold a misassigned account even when the total still balances.
  • A new royalty qualification mode posts the synthetic statement to a hosted deployment over HTTP and MCP, reconciling both detail tabs and comparing completion receipts and gold records.
  • Storage reads treat NoSuchKey responses — direct or wrapped in a legacy Supabase error response — as a missing object and no longer fail, while denied or unavailable reads still raise an error.