bilig

External workbook recalculation proof in Node.js

Use this when an .xlsx model references another workbook and the saved external-link cache is stale. The proof builds a model workbook with cached external values, builds a companion rates workbook with newer values, binds the companion to the exact Excel link target, recalculates formulas, and writes a new XLSX without opening Excel, LibreOffice, or a browser.

Run it in a blank folder

mkdir bilig-external-workbook-proof
cd bilig-external-workbook-proof
npm init -y >/dev/null
npm pkg set type=module
npm install @bilig/xlsx-formula-recalc tsx
curl -fsSLO https://proompteng.github.io/bilig/external-workbook-recalc-proof.ts
npx tsx external-workbook-recalc-proof.ts

Expected output includes:

{
  "proof": "Bilig refreshed an XLSX external-link cache from a companion workbook, recalculated formulas, and wrote a new XLSX without Excel.",
  "verified": true,
  "sum": 180,
  "lookup": 60,
  "externalTarget": "file:///bilig-proof/rates.xlsx",
  "reads": {
    "Model!C1": {
      "value": 180
    },
    "Model!C2": {
      "value": 60
    }
  },
  "checks": {
    "externalWorkbookMatched": true,
    "refreshedExternalCells": true,
    "recalculatedExternalSum": true,
    "recalculatedExternalLookup": true,
    "outputXlsxWritten": true,
    "verified": true
  }
}

The script writes inspectable files to bilig-external-workbook-proof-output/:

What this proves

What this does not prove

This is not full Excel parity. It does not prove every external-link layout, network path, password-protected workbook, volatile formula, data connection, pivot cache, macro, or desktop Excel UI behavior. For customer-critical models, keep a golden workbook fixture and an Excel, LibreOffice, or Microsoft Graph oracle test around the exact files you accept.

Source

After the proof