fix(edifice-map-generator): restore deno check on the PNG codec - #73
Merged
Conversation
`main` has been red since 48f89fd. Committing the deployed v10 of this function (444fa3d) brought in the pure-TS PNG codec, whose stream helpers do not type-check under Deno 2.x — 2 × TS2345 on `deno check index.ts`. Every PR since then inherits the failure through its merge with main. Two type facts, neither cosmetic: 1. CompressionStream / DecompressionStream declare `writable: WritableStream<BufferSource>`, wider than Uint8Array — so a `TransformStream<Uint8Array, Uint8Array>` parameter asked for something narrower than either class provides, and neither was assignable. 2. Since TypeScript 5.7 typed arrays are generic over their backing buffer: bare `Uint8Array` means `Uint8Array<ArrayBufferLike>`, which admits SharedArrayBuffer, while `BufferSource` requires `ArrayBufferView<ArrayBuffer>`. Fixed by typing the codec path `Uint8Array<ArrayBuffer>` and widening the transform parameter to `TransformStream<BufferSource, Uint8Array>`. This states that these buffers are never shared — already true, every one comes from `new Uint8Array(n)` or a `Response.arrayBuffer()`. A cast would have silenced the checker without saying so. Types only: the diff touches three signatures and no executable line, so the deployed function is unaffected. Verified with the CI's own toolchain (`denoland/deno` image, `deno check index.ts`): edifice-map-generator goes from 2 errors to clean, hal-mcp stays clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
BluegReeno
added a commit
that referenced
this pull request
Jul 24, 2026
…d main Records the snapshot-refresh obligation the new CI job creates: a stale supabase/schema.snapshot.sql makes the job green against a prod that no longer exists, with no visible error. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
mainhas been red since48f89fd. Committing the deployed v10 ofedifice-map-generator(444fa3d) brought the pure-TS PNG codec into the repo, and its stream helpers do not type-check under Deno 2.x — 2 ×TS2345ondeno check index.ts.This is not confined to
main: every open PR inherits the failure, because a PR's CI tests the merge withmain. It surfaced on #72, whose own changes are unrelated.The two type facts
Neither is cosmetic, and the fix follows from them rather than from silencing the checker:
CompressionStream/DecompressionStreamdeclarewritable: WritableStream<BufferSource>— wider thanUint8Array. ATransformStream<Uint8Array, Uint8Array>parameter therefore asked for something narrower than either class provides, so neither was assignable.Uint8ArraymeansUint8Array<ArrayBufferLike>, which admitsSharedArrayBuffer, whereasBufferSourcerequiresArrayBufferView<ArrayBuffer>. So a bareUint8Arrayis not writable to these streams either.The fix
Type the codec path
Uint8Array<ArrayBuffer>and widen the transform parameter toTransformStream<BufferSource, Uint8Array>.That says out loud that these buffers are never shared — which is already true: every one of them comes from
new Uint8Array(n)or aResponse.arrayBuffer(). A cast (as BufferSource,as any) would have silenced the checker without stating the constraint, and would have hidden the next violation of it.Risk
Types only. The diff touches three signatures and not one executable line — TypeScript types are erased at runtime, so the deployed function is byte-for-byte unaffected in behaviour. No redeploy is implied by this PR.
Verified
With the CI's own toolchain (the
denoland/denoimage, samedeno check index.tsthe workflow runs):edifice-map-generator: 2 errors → cleanhal-mcp: still clean (the other type-check step is untouched)Unblocks
#72 (migration smoke-test), whose
Migration smoke-testjob already passes; only this inheritedDeno type-checkfailure stands between it and a green CI.