Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .agents/skills/redacted-circuit-maintenance/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/<id>/deploys`). Or check that a string
from the change appears in the live `/assets/*.js` bundle.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/components/EmailCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1680,7 +1680,7 @@ export default function EmailCard({
: [];
}

onMaskChange(headerMask, bodyMask, aggregatedMask.unplacedRedactions);
onMaskChange(headerMask, bodyMask, aggregatedMask.unplacedRedactions ?? []);
}, [
aggregatedMask,
email.originalEml,
Expand Down
14 changes: 8 additions & 6 deletions src/utils/proofOutputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) };
}
Expand Down
Loading