test(contracts): add auth + crypto + attachments schema coverage (Phase 4 U4) - #229
Merged
Merged
Conversation
Adds Zod schema validation tests for 8 contract files in the auth, crypto, and attachments cluster. 198 tests cover happy paths, boundary values, enum validation, optional fields, and deterministic CBOR field ordering. Files: - auth-api.test.ts — OTP, device register, PKCE OAuth, refresh token rotation - ipc-auth.test.ts — renderer-to-main auth command shapes - ipc-devices.test.ts — device list/rename/revoke/link command shapes - crypto.test.ts — passphrase verify, key rotation, recovery phrase envelopes - cbor-ordering.test.ts — pins canonical field order (drift breaks signatures) - ipc-crypto.test.ts — key derivation + rotation request shapes - ipc-attachments.test.ts — attachment IPC command + manifest shapes - blob-api.test.ts — R2 blob metadata (size bounds, content_hash) Part of Phase 4 U4 of tech-debt-remediation plan.
h4yfans
added a commit
that referenced
this pull request
May 6, 2026
Adds Zod schema validation tests for 8 contract files in the auth, crypto, and attachments cluster. 198 tests cover happy paths, boundary values, enum validation, optional fields, and deterministic CBOR field ordering. Files: - auth-api.test.ts — OTP, device register, PKCE OAuth, refresh token rotation - ipc-auth.test.ts — renderer-to-main auth command shapes - ipc-devices.test.ts — device list/rename/revoke/link command shapes - crypto.test.ts — passphrase verify, key rotation, recovery phrase envelopes - cbor-ordering.test.ts — pins canonical field order (drift breaks signatures) - ipc-crypto.test.ts — key derivation + rotation request shapes - ipc-attachments.test.ts — attachment IPC command + manifest shapes - blob-api.test.ts — R2 blob metadata (size bounds, content_hash) Part of Phase 4 U4 of tech-debt-remediation plan.
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.
Summary
Adds Zod schema validation tests for 8 contract files in the auth, crypto, and attachments cluster. 198 tests covering happy paths, boundary values, enum validation, optional fields, and deterministic CBOR field ordering.
Part of Phase 4 U4 of tech-debt-remediation.md.
Files
auth-api.test.ts— OTP, device register, PKCE OAuth, refresh token rotationipc-auth.test.ts— renderer-to-main auth command shapesipc-devices.test.ts— device list/rename/revoke/link command shapescrypto.test.ts— passphrase verify, key rotation, recovery phrase envelopescbor-ordering.test.ts— pins canonical field order (drift breaks Ed25519 signatures)ipc-crypto.test.ts— key derivation + rotation request shapesipc-attachments.test.ts— attachment IPC command + manifest shapesblob-api.test.ts— R2 blob metadata (size bounds, content_hash)Test plan
vitest --project shared— 198 passedpnpm --dir apps/desktop test:coveragefor line coverage report