Skip to content

fix(edifice-map-generator): restore deno check on the PNG codec - #73

Merged
BluegReeno merged 1 commit into
mainfrom
fix/deno-check-map-generator
Jul 24, 2026
Merged

fix(edifice-map-generator): restore deno check on the PNG codec#73
BluegReeno merged 1 commit into
mainfrom
fix/deno-check-map-generator

Conversation

@BluegReeno

Copy link
Copy Markdown
Owner

Why

main has been red since 48f89fd. Committing the deployed v10 of edifice-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 × TS2345 on deno check index.ts.

This is not confined to main: every open PR inherits the failure, because a PR's CI tests the merge with main. 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:

  1. CompressionStream / DecompressionStream declare writable: WritableStream<BufferSource> — wider than Uint8Array. A TransformStream<Uint8Array, Uint8Array> parameter therefore asked for something narrower than either class provides, so neither was assignable.
  2. Since TypeScript 5.7, typed arrays are generic over their backing buffer: bare Uint8Array means Uint8Array<ArrayBufferLike>, which admits SharedArrayBuffer, whereas BufferSource requires ArrayBufferView<ArrayBuffer>. So a bare Uint8Array is not writable to these streams either.

The fix

Type the codec path Uint8Array<ArrayBuffer> and widen the transform parameter to TransformStream<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 a Response.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/deno image, same deno check index.ts the workflow runs):

  • edifice-map-generator: 2 errors → clean
  • hal-mcp: still clean (the other type-check step is untouched)

Unblocks

#72 (migration smoke-test), whose Migration smoke-test job already passes; only this inherited Deno type-check failure stands between it and a green CI.

`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
BluegReeno merged commit dabdfca into main Jul 24, 2026
2 checks passed
@BluegReeno
BluegReeno deleted the fix/deno-check-map-generator branch July 24, 2026 19:38
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant