From e1aed629a9520db1a829613f89efac6bf00ef2db Mon Sep 17 00:00:00 2001 From: Divide-By-0 Date: Sat, 3 Oct 2026 17:56:55 -0700 Subject: [PATCH 1/2] fix(build): type errors breaking every Render deploy since #26; CI now runs tsc -b Render's Docker build runs 'yarn build' (tsc -b && vite build) and has failed since 7313499 (#26): EmailCard passed string[] | undefined, and decodeMaskedBytes passed unknown elements after reassigning its readonly unknown[] parameter. Production stayed on ac35414, so #26's security fixes and #29 never went live. CI ran 'tsc --noEmit' on the root tsconfig, whose files: [] means it checked nothing; it now runs 'tsc -b' like the build. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 5 ++++- src/components/EmailCard.tsx | 2 +- src/utils/proofOutputs.ts | 14 ++++++++------ 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f7a71c..53f5707 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,10 @@ jobs: run: yarn install --frozen-lockfile - name: Run TypeScript check - run: yarn tsc --noEmit + # REASON: must match the production build (`yarn build` = `tsc -b && vite build`). The root + # tsconfig has "files": [] with project references, so `tsc --noEmit` type-checked nothing: + # five errors from #26 passed CI and broke every Render deploy from 2026-10-01 to 10-04. + run: yarn tsc -b # Circuit soundness + decoder tests (synthetic keys only; needs the committed artifacts) - name: Run tests diff --git a/src/components/EmailCard.tsx b/src/components/EmailCard.tsx index 0a93384..2ee7634 100644 --- a/src/components/EmailCard.tsx +++ b/src/components/EmailCard.tsx @@ -1680,7 +1680,7 @@ export default function EmailCard({ : []; } - onMaskChange(headerMask, bodyMask, aggregatedMask.unplacedRedactions); + onMaskChange(headerMask, bodyMask, aggregatedMask.unplacedRedactions ?? []); }, [ aggregatedMask, email.originalEml, diff --git a/src/utils/proofOutputs.ts b/src/utils/proofOutputs.ts index c4fdadc..ad3bb0c 100644 --- a/src/utils/proofOutputs.ts +++ b/src/utils/proofOutputs.ts @@ -89,16 +89,18 @@ export function decodeMaskedBytes( layout: OutputLayout ): { header: Uint8Array; body: Uint8Array } { const { prefix, maxHeaderLength, maxBodyLength } = layout; - publicInputs = canonicalPublicInputs(publicInputs); - if (publicInputs.length !== prefix + maxHeaderLength + maxBodyLength) throw new Error("public input count does not match the circuit"); + // NOTE: a new binding, not a reassignment: the parameter stays `unknown[]` to TypeScript, and + // `tsc -b` (the production Docker build) rejected passing its elements on as strings. + const inputs = canonicalPublicInputs(publicInputs); + if (inputs.length !== prefix + maxHeaderLength + maxBodyLength) throw new Error("public input count does not match the circuit"); const headerBytes = new Uint8Array(maxHeaderLength); - for (let i = 0; i < maxHeaderLength; i++) headerBytes[i] = fieldToByte(publicInputs[prefix + i]); + for (let i = 0; i < maxHeaderLength; i++) headerBytes[i] = fieldToByte(inputs[prefix + i]); const bodyStart = prefix + maxHeaderLength; const bodyBytes = new Uint8Array(maxBodyLength); - for (let i = 0; i < maxBodyLength; i++) bodyBytes[i] = fieldToByte(publicInputs[bodyStart + i]); + for (let i = 0; i < maxBodyLength; i++) bodyBytes[i] = fieldToByte(inputs[bodyStart + i]); if (prefix === V2_PREFIX) { - const headerLen = fieldToNumber(publicInputs[3]); - const bodyLen = fieldToNumber(publicInputs[4]); + const headerLen = fieldToNumber(inputs[3]); + const bodyLen = fieldToNumber(inputs[4]); if (headerLen > maxHeaderLength || bodyLen > maxBodyLength) throw new Error("committed length exceeds circuit maximum"); return { header: headerBytes.slice(0, headerLen), body: bodyBytes.slice(0, bodyLen) }; } From f4f5101bf3fecbe528dc1ec192aed3b0f455f494 Mon Sep 17 00:00:00 2001 From: Divide-By-0 Date: Sat, 3 Oct 2026 17:57:14 -0700 Subject: [PATCH 2/2] docs(maintainer skill): type errors silently block Render deploys; how to confirm a deploy Co-Authored-By: Claude Opus 5.5 --- .agents/skills/redacted-circuit-maintenance/SKILL.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.agents/skills/redacted-circuit-maintenance/SKILL.md b/.agents/skills/redacted-circuit-maintenance/SKILL.md index 71c8624..f058474 100644 --- a/.agents/skills/redacted-circuit-maintenance/SKILL.md +++ b/.agents/skills/redacted-circuit-maintenance/SKILL.md @@ -89,3 +89,14 @@ Each section below is a rule plus the incident that produced it (2026-09-27, PR DKIM sweep therefore misreports ~30 emails as failures. When sweeping, space archive calls ≥6.5 s apart (wrap `fetch`), or interleave them with proving. Always compare before and after runs under the same pacing. + +## Type errors are deploy blockers, never "pre-existing noise" +- Render deploys redacted.zk.email from a Dockerfile that runs `yarn build` = `tsc -b && vite build`. + One type error fails the deploy *silently*: production keeps serving the last good build and nothing alerts. +- Between 2026-10-01 and 10-04, five errors from #26 blocked every deploy, so #26's security + fixes and #29 were "merged" but not live. They had shown up locally and were dismissed as + environment noise because CI was green: CI ran `tsc --noEmit` on the root tsconfig (`files: []`), + which checks nothing. CI now runs `tsc -b`. +- After merging, confirm the deploy: the Render service is `srv-d4tfnou3jp1c73eegmeg` (ZK Email + workspace key `render-api-key-zkemail-team`, `GET /v1/services//deploys`). Or check that a string + from the change appears in the live `/assets/*.js` bundle.