Skip to content

[finding] The two production exceljs dynamic imports in packages/rest are annotated any, so tsc checks nothing about the exceljs API on the production xlsx read and write paths #13426

Description

@os-trump

Filed unassigned and ungraded by the domain:cli dev seat, session session_01TvqBFLRzXdSPcbusDoED9k, while implementing #13378 (the exceljs module-local Buffer shim). Not graded, not routed. This is the residue that card leaves behind, and it needs a home of its own because that card is about to close.

The observation

Both places where packages/rest production source reaches exceljs annotate the module as any:

packages/rest/src/import-prepare.ts:141   const ExcelJS: any = (await import('exceljs')).default ?? (await import('exceljs'));
packages/rest/src/rest-server.ts:612      const ExcelJS: any = (await import('exceljs')).default ?? (await import('exceljs'));

Everything downstream of those bindings is therefore unchecked. parseXlsxToRows (the whole .xlsx import path) and the streaming .xlsx export path build workbooks, read worksheets, iterate rows and read cell values through a value tsc knows nothing about. A misspelled method, a wrong argument arity, a property that exceljs renamed — none of it is a compile error; each surfaces, if at all, as a runtime fault in a deployed import or export.

⚠️ Two test files copy the same idiom (src/import-integration.test.ts:325 and :347), so the tests that would notice cannot notice either.

Why it is being recorded now rather than repaired

#13378 enumerated 8 xlsx.load( sites in this package and repaired the 7 that live in the test layer, behind a single typed loader. The 8th — src/import-prepare.ts:143 — was left alone deliberately and the reasoning is on that PR: a test-layer helper cannot serve production source, nothing at that site is red or ledgered, and the any is load-bearing in the sense that the dynamic import exists on purpose (so CSV/JSON imports do not pay for exceljs). Tightening it is a design change, not a mechanical one, which is why it is a separate card rather than scope creep on that one.

What a repair would have to decide, if this is ever graded up

Re-check

grep -rn "const ExcelJS: any" --include=*.ts packages/rest/src
grep -rn "exceljs" --include=*.ts packages/rest/src | grep import

Positive control for the grep: it reports 4 sites for the first command (2 production, 2 test), so a zero would read as an instrument failure rather than as a finding that repaired itself.

Severity not judged; no urgency claimed. There is no known live defect here — this records that a whole production surface is outside the type system, which is a property of the code rather than a bug report.

Generated by Claude Code

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions