feat(contract): invitation-list convergence + signature order/interop vectors #239
No reviewers
Labels
No labels
epic
phase-0
phase-1
phase-2
phase-3
phase-4
phase-5
phase-6
phase-7
phase-8
phase-9
priority/P0
priority/P1
priority/P2
type/backend
type/client
type/docs
type/ops
type/security
type/spike
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
primatekuntech/failsulit!239
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/contract-hygiene-236"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Resolves #236 — three cross-platform contract breaks, all invisible until now.
1. Invitations list contract broken at runtime
Server sends
{items, total, page, page_size, total_pages}with per-item{id, tenant_id, invited_by_id, email, invited_user_id, role, status, short_code, message, expires_at, created_at}— iOS decoded a{data: [...]}envelope with a requiredtenant_namethe server never sends → both list screens failed to decode at runtime, and the old fixtures pinned the drifted shape.Include(Tenant/InvitedBy)and emittenant_name+invited_by_name(DisplayName falling back to Email) — also fixes desktop's blank tenant_name rendering.Received/SentInvitationsResponsedecode the real paged envelope (typealias overPagedInvitationsResponse<T>);TenantInvitationaligned to the DTO (invited_by_namestring,message;invited_byobject dropped — server never sent it); InvitationsListView rendersinvitedByName.2. Signature blob order (latent, desktop parity)
wrapKeyForRecipientdual blob nowmlDSA ‖ kazSIGN(desktopsign_with_keyorder — ML-DSA is a fixed 3309 bytes while the KAZ signature is message-length-dependent, so only ML-first supports a deterministic split). Currently latent — nothing transmits the blob yet — fixed before it can matter.3. Signature interop vectors
tests/fixtures/ml-kem-hybrid-vectors.jsonextended to 8 sections: desktop KAZ-SIGN-256 + ML-DSA-65 signatures verify on iOS, and iOS-signed vectors verify under desktop Rust (verify_ios_interop_fixturewith mandatory >= 2 per section — regeneration can't void the proof).Also
makeDecoder()+ 4 unit tests (server DateTimeOffset values carry fractional digits that plain.iso8601rejects).invitedByNameLabelremoved (commit message of the amended commit originally overclaimed this covered stale comments too — those were fixed separately in-tree).Tests
iOS: 476 tests, 0 failures, 1 documented skip (keychain entitlements). Desktop failsulit-crypto: 40/40 incl. both signature-vector consumers. Server suite: 1110/0 via dotnet exec (local
dotnet testrunner has a broken testhost cache — run delegated to api-ci).The invitations list screens decoded a contract the server never produced, and the iOS dual-signature blob order diverged from desktop. Server: GET /api/invitations + /sent now Include(Tenant/InvitedBy) and emit tenant_name + invited_by_name (DisplayName falling back to Email) per item — fixes desktop's blank tenant_name rendering and gives iOS real names. iOS: Received/SentInvitationsResponse decode the server's paged envelope {items, total, page, page_size, total_pages} (was a data-envelope the server never sent — both list screens failed to decode at runtime); TenantInvitation aligns to the list DTO (invited_by_name string, message; invited_by object dropped — server never sent it); APIClient decoder extracted into makeDecoder() with fractional-seconds-tolerant ISO8601 date decoding (server DateTimeOffset values carry fractional digits) + 4 unit tests. Signatures: wrapKeyForRecipient dual blob now mlDSA ‖ kazSIGN (desktop crypto_service sign_with_key order — ML-DSA fixed 3309 makes ML-first the only deterministic split; KAZ-SIGN length is message-dependent). Signature interop pinned bidirectionally in tests/fixtures/ml-kem-hybrid-vectors.json: desktop KAZ-SIGN-256 + ML-DSA-65 vectors verify on iOS and iOS-signed vectors verify under desktop Rust (failsulit-crypto verify_ios_interop_fixture with mandatory non-empty sections). Suite: 476 tests, 0 failures, 1 documented skip. Desktop failsulit-crypto: 40/40. Server suite: 1110/0 via dotnet exec (local dotnet test runner has a broken testhost cache).