celilo/scripts is outside the typecheck gate — 18 type errors nobody has ever seen #52
Labels
No labels
area/auth
area/backend
area/ci
area/deploy
area/e2e
area/frontend
area/shared
blocked
good-first-issue
needs-info
priority/high
priority/low
priority/medium
type/bug
type/chore
type/docs
type/feature
type/tech-debt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
celilo/lunacycle#52
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found while doing #51 (capabilities 2.0.0 upgrade). Out of that PR's scope, filing rather than parking in a summary.
What
bun run typecheckis four explicit project references:celilo/scripts/is in none of them, and has notsconfig.jsonof its own. Thecelilo hook scripts — the code that actually runs against the fleet during
install, health check, backup, and restore — have never been typechecked.
bun testruns them, but bun strips types without checking them, so a green
test:hooksproves nothing about types.
The errors
Ad-hoc run against the real dependency graph (capabilities 2.0.0 installed,
@types/bun+@types/nodefrom the root):18 errors. They fall into three groups:
Test spies that no longer match the type they claim to implement (12) —
FsOpsgainedwriteFileand the spies inbackup.test.ts/restore.test.tsnever did;
LunacycleHealthCheckDepsandLunacycleSetupWebDepsgainedsecretsand the call sites in
health-check.test.ts/setup-web.test.tsstill omit it;IdpSpyis missinglist_tokensandrevoke_token. Every one of these is a spythat has silently drifted from the interface it stands in for, which is exactly
the drift a spy is supposed to make impossible.
Real production-code type mismatches (3) —
health-check.ts:410andsmoke-handler.ts:100assign aBrowserthat is missingbind/unbind(two playwright-core
Browsertypes in play), andhealth-check.ts:459passes aFetcherwheretypeof fetchis expected (missingpreconnect).Bundled dependency source (3, in
node_modules/@celilo/*) — resolved byskipLibCheckplus a propertypesfield; noise from the ad-hoc invocation, nota real defect.
Why it matters
These are hook scripts. When one throws at runtime it throws on celilo-mgr in the
middle of a deploy, and the feedback loop is a failed deploy rather than a red
gate. This is the same class of gap as celilo#455 ("Module TypeScript is never
typechecked") but for this repo's own module directory.
Related: the typecheck gate also misses
scripts/andtests/.Fix
celilo/scripts/tsconfig.json(strict,types: ["bun", "node"],skipLibCheck).@types/bunneeds to become a devDependency ofcelilo/scripts/package.json— notethe publish gate compares the bundled
@celilo/*against the pinned version, soconfirm a devDependency does not disturb it.
tsc -p celilo/scripts --noEmitto thetypecheckscript sopr-validatecovers it.widening the interfaces to accept them.
Do 3 before 2, or the gate lands red.