Add portable ingestion and reconciled workbook packages

Merged
SI
2d ago
+2105-353

Change

Applications can run the ingestion pipeline outside Next.js from a local Node package. The package exposes the existing typed contract, source and contract hashes, built-in readers, and a versioned local reader interface. The hosted HTTP and MCP operation share the same implementation.

A new workbook contract declares every sheet as detail, a reconciliation source, or an explicitly ignored sheet. Detail tabs can rename headers into one schema. Summed controls compare the normalized detail to literal workbook cells. A missing tab, an ambiguous header, a repeated business key, or a failed control prevents gold publication. Silver preserves sheet coverage and original coordinates.

Legacy contracts and retries keep engine version 1. Workbook packages select version 2 and preserve the existing size, row and artifact budgets across the whole workbook. Workbook receipts carry the source digest and canonical parsed contract digest. Reads verify both against the manifest. Native scientific-notation control totals preserve subcent precision. The development package builds and installs from a local tarball. Registry publication and license selection remain separate release work.

Verification

  • 145 ingestion tests passed locally with PostgreSQL 15 and 17, including the new engine-2 shared-catalog receipt and stored rows through the durable job path.
  • Both ingestion TypeScript projects, repository ESLint, and the staged whitespace check passed.
  • An isolated Node 22.23.4 consumer installed the tarball, imported it from ESM and strict TypeScript, and exercised multiple domains, a custom reader, held data and replay. CI now runs the consumer check.
  • Additional cases cover partial workbook packages, cross-sheet duplicate keys, invalid controls, incompatible schemas, unchanged engine-1 jobs and unsupported pinned generations.

Refs #1318, recoupable/mono#819 and recoupable/mono#820.