INTEGRATION-CONTRACT.md
PCH-02-FIXES — Integration Contract
Source of truth for integrating these drafts. Where a patch file and this contract disagree, this contract wins.
Integration Contract
Files in src/drafts/PCH-02-FIXES/
| Draft file | Destination / role |
|---|---|
README.md |
index — stays in drafts (or trash after integration) |
INTEGRATION-CONTRACT.md |
this file — keep as reference (cited by tests) |
PCH-02-001-vault-patch-sanitizers.patch.md |
edits → src/background/vault.ts:2375-2388 |
vault.update-entry-sanitize.test.ts |
→ src/background/vault.update-entry-sanitize.test.ts |
PCH-02-003-sas-trust-model-comment.patch.md |
edits → src/shared/chirp-handshake.ts:125-154 |
PCH-02-004-exact-pin-deps.patch.md |
edits → package.json:40-46; then bun install |
WASM-PROVENANCE.md |
→ repo root WASM-PROVENANCE.md (new file) |
PCH-02-005-legacy-pbkdf2-doc.patch.md |
edits → src/shared/backup.ts:146 + src/popup/views/Import.tsx (3 hunks) |
PCH-02-007-hibp-add-padding.patch.md |
edits → src/background/vault.ts:230 |
vault.hibp-padding.test.ts |
→ src/background/vault.hibp-padding.test.ts |
PCH-02-008-binaryreader-bounds.patch.md |
edits → src/crypto/peachPayload.ts:940-969 (+ export seam) |
peachPayload.binaryreader-bounds.test.ts |
→ src/crypto/peachPayload.binaryreader-bounds.test.ts |
PCH-02-010-clipboard-hash-match.patch.md |
Option A (recommended): comment → src/background/clipboard.ts:18-19. Option B: clipboard.ts + offscreen.ts + manifest.json |
clipboard.hash-match.test.ts |
→ src/background/clipboard.hash-match.test.ts — Option B ONLY; do not integrate under Option A |
Decisions required from the integrator (2)
- PCH-02-010 Option A vs B. Option B requires adding
clipboardReadtomanifest.json— a store-visible permission expansion ("Read data you copy and paste"). Recommendation: Option A now, Option B parked. - PCH-02-004 papaparse hunk. The brief pins 5 packages; the report also
cites
papaparse. The patch includes it as an optional sixth line.
PCH-02-004 exact versions (read from bun.lock 2026-06-12 — pin, don't upgrade)
| Package | Pin |
|---|---|
| otpauth | 9.5.0 |
| pako | 2.1.0 |
| @zxing/library | 0.23.0 |
| bwip-js | 4.11.1 (lockfile had drifted above the declared ^4.10.1) |
| pdf-lib | 1.17.1 |
| papaparse | 5.5.3 (optional hunk) |
After the edit run bun install (regenerates bun.lock; resolved tree is
unchanged because every pin equals the installed version).
Estimated test count per finding
| Finding | New tests |
|---|---|
| PCH-02-001 | 8 |
| PCH-02-003 | 0 — doc only (gateOnSAS already pinned by PCH-01-024 test) |
| PCH-02-004 | 0 — dependency metadata only |
| PCH-02-005 | 0 required (1 optional UI contract case sketched in the patch) |
| PCH-02-007 | 3 |
| PCH-02-008 | 8 |
| PCH-02-009 | 5 |
| PCH-02-010 | Option A: 0 — doc only / Option B: 4 |
| Total | 24 (Option A) / 28 (Option B) |
Documentation-only findings (no tests needed)
PCH-02-003, PCH-02-005 (comment + notice), and PCH-02-010 under Option A.
Suggested integration order (one koh save each, tests green at every step)
- PCH-02-001 (the Low) + its tests
- PCH-02-007 and PCH-02-008 + tests (independent hardening)
- PCH-02-003 and PCH-02-005 (comments/UI)
- PCH-02-004 (package.json +
bun install+ WASM-PROVENANCE.md) - PCH-02-010 (whichever option is chosen)
- Version bump + build all three targets (
npm run build)
Gates after every save
npx tsc --noEmitclean (baseline: clean)npx vitest run— baseline 117 files / 3474 passed; after full integration expect +4 test files / +24 tests (Option A) or +5 / +28 (Option B)- No
@ts-ignore/ type suppressions introduced (none in any draft)
Version bump recommendation
v4.0.0 → v4.0.1 (patch: hardening + docs, no feature surface) across
package.json, manifest.json, manifest.firefox.json, then
npm run build (all three targets, per project rule). If PCH-02-010
Option B is chosen, bump v4.0.0 → v4.1.0 instead — a new permission is
not a patch-level change.
Out-of-scope observations recorded during drafting
vault.updateEntryDirect(vault.ts:1978) spreads patches verbatim but has zero production callers — dead-code candidate, noted in the 001 patch.- The fix brief's PCH-02-005 text says "100,000 iterations"; the code and report say 250,000 — drafts use 250,000.
- The brief's PCH-02-004 step references an existing
WASM-PROVENANCE.md; no such file exists in the repo, so the draft ships one.