M4 epic — File experience consolidated (Phase 7 core 7.1–7.13 + deferred M8-3/11/13) #223

Open
opened 2026-11-17 20:04:13 +01:00 by amiryahaya · 2 comments
Owner

NEXT MILESTONE per 2026-11-18 M8-close re-planning (supersedes closed placeholder #8). Plan: ~4–4.5 wk. Kickoff: SEC-12 STRIDE pre-pass over 7.10/7.13 (download governance + metadata-at-rest need threat-model statements; #30).

First up: M8-3 KEM key provisioning (from #222) — generate+persist at unlock via set_setting (ml_kem_pk/kaz_kem_pk/encrypted SKs) + publish PATCH /users/keys. Fixes broken fresh-install folder creation + one-way shares; unblocks M8-13. Design surface: unlock order vs master-key load.

Task checklist

  • 7.1 remainder — iOS (incl. File Provider ext) onto E2EE chunked upload; golden request/response contract fixtures in CI; dead-call sweep (UPL-01)
  • M8-11 streaming upload/download (3× RAM at 5 GB; progress in-stream; zeroize drop-guard) — from #222
  • M8-13 receive-side share envelope unpack (needs M8-3) — from #222
  • 7.2 signed single-purpose upload tokens + size/hash enforcement (UPL-02)
  • 7.3 remainder — accept/decline lifecycle, subtree inheritance, owner share-visibility w/ attribution (owner-revoke + cross-tenant DONE via #219)
  • 7.4 move endpoints (cycle-guarded) + rename UI + real ListFiles pagination + bulk parity (#39 item 4 cleanups ride here)
  • 7.5 activity completeness (E2EE upload logging, file_moved, file_previewed)
  • 7.6 quota enforcement at upload + usage surfaces (#14 BlobSize fix landed; enforcement = this)
  • 7.7 download hardening: Range/ETag, filenames
  • 7.8 preview parity (video/audio Android+desktop, thumbnails, file_previewed)
  • 7.9 post-revoke rotate-key prompt (P2 stretch)
  • 7.10 download governance — policy core (ADR-009): Share.AllowDownload, tenant kill switch, enforcement everywhere, audit enrichment (DL-01/02/05/06/10)
  • 7.11 download governance — client (gated by UX round-4 decisions: view-only preview, watermarks, screenshot suppression)
  • 7.12 MDM/AppConfig hooks (P1)
  • 7.13 metadata-at-rest: no plaintext filenames at rest, preview pace limits → DL-07 anomaly alert (M-1/C-1)
  • #39 item 1 — orphan-blob GC sweep + pending-upload TTL
  • #202 — test-scope UserTenant visibility flake fix
  • #196 remainder — boot API + /health poll in the migrations smoke leg

Exit (plan §11 + adjustments): all platforms pass shared contract suite; sharing matrix integration-tested; preview checklist green; #222 M8-3/11/13 closed; STRIDE statements for 7.10/7.13 published.

**NEXT MILESTONE per 2026-11-18 M8-close re-planning** (supersedes closed placeholder #8). Plan: ~4–4.5 wk. Kickoff: **SEC-12 STRIDE pre-pass** over 7.10/7.13 (download governance + metadata-at-rest need threat-model statements; #30). **First up: M8-3 KEM key provisioning (from #222)** — generate+persist at unlock via `set_setting` (`ml_kem_pk`/`kaz_kem_pk`/encrypted SKs) + publish `PATCH /users/keys`. Fixes broken fresh-install folder creation + one-way shares; unblocks M8-13. Design surface: unlock order vs master-key load. **Task checklist** - [ ] 7.1 remainder — iOS (incl. File Provider ext) onto E2EE chunked upload; golden request/response contract fixtures in CI; dead-call sweep (UPL-01) - [ ] M8-11 streaming upload/download (3× RAM at 5 GB; progress in-stream; zeroize drop-guard) — from #222 - [ ] M8-13 receive-side share envelope unpack (needs M8-3) — from #222 - [ ] 7.2 signed single-purpose upload tokens + size/hash enforcement (UPL-02) - [ ] 7.3 remainder — accept/decline lifecycle, subtree inheritance, owner share-visibility w/ attribution (owner-revoke + cross-tenant DONE via #219) - [ ] 7.4 move endpoints (cycle-guarded) + rename UI + real ListFiles pagination + bulk parity (#39 item 4 cleanups ride here) - [ ] 7.5 activity completeness (E2EE upload logging, file_moved, file_previewed) - [ ] 7.6 quota enforcement at upload + usage surfaces (#14 BlobSize fix landed; enforcement = this) - [ ] 7.7 download hardening: Range/ETag, filenames - [ ] 7.8 preview parity (video/audio Android+desktop, thumbnails, file_previewed) - [ ] 7.9 post-revoke rotate-key prompt (P2 stretch) - [ ] 7.10 download governance — policy core (ADR-009): Share.AllowDownload, tenant kill switch, enforcement everywhere, audit enrichment (DL-01/02/05/06/10) - [ ] 7.11 download governance — client (gated by UX round-4 decisions: view-only preview, watermarks, screenshot suppression) - [ ] 7.12 MDM/AppConfig hooks (P1) - [ ] 7.13 metadata-at-rest: no plaintext filenames at rest, preview pace limits → DL-07 anomaly alert (M-1/C-1) - [ ] #39 item 1 — orphan-blob GC sweep + pending-upload TTL - [ ] #202 — test-scope UserTenant visibility flake fix - [ ] #196 remainder — boot API + /health poll in the migrations smoke leg **Exit (plan §11 + adjustments)**: all platforms pass shared contract suite; sharing matrix integration-tested; preview checklist green; #222 M8-3/11/13 closed; STRIDE statements for 7.10/7.13 published.
Author
Owner

7.1 contract-inconsistency inventory (server survey while building the golden fixtures, PR #229) — recorded for the normalization pass, NOT blockers:

  1. Five success-envelope shapes across file/folder endpoints ({data} vs raw DTO vs {folder,files,subfolders} vs paged vs bare {status})
  2. 201 asymmetry: CreateFolder returns {data} while UploadFile returns a raw DTO
  3. Root-contents file row is NOT FileDto parity (missing 13 fields; encrypted_key vs encrypted_file_key; created_at vs inserted_at)
  4. Same entity field as mime_type (listing) vs content_type (upload-201)
  5. parent_id vs parent_folder_id (RenameFolder raw response)
  6. FileDto has inserted_at, no created_at — every sibling DTO uses created_at
  7. GetFolderKey share-branch mixes provenance (share encrypted_key alongside the FOLDER folder_key_version)
  8. UpdateFile lacks tenant scoping (id + uploader only)
  9. ListFiles accepts page/pageSize/search and silently ignores all three
  10. errorType camelCase leak inside snake_case problem+json
  11. Unauthenticated blob PUT (UPL-02 debt, registered) + spoofable forwarded-header upload_url
  12. GetRootFolderContents auto-creates a personal tenant on GET vs GetRootFolder SuperAdmin-only — divergent GET side effects
  13. Two folder projections with different key material (root-contents legacy pair vs FolderDto E2EE triple)
  14. Content-Disposition not RFC 5987-encoded

Golden fixtures (merged here) pin the CURRENT shapes — normalization is now a deliberate, golden-updating change instead of silent drift.

**7.1 contract-inconsistency inventory** (server survey while building the golden fixtures, PR #229) — recorded for the normalization pass, NOT blockers: 1. Five success-envelope shapes across file/folder endpoints (`{data}` vs raw DTO vs `{folder,files,subfolders}` vs paged vs bare `{status}`) 2. 201 asymmetry: CreateFolder returns `{data}` while UploadFile returns a raw DTO 3. Root-contents file row is NOT FileDto parity (missing 13 fields; `encrypted_key` vs `encrypted_file_key`; `created_at` vs `inserted_at`) 4. Same entity field as `mime_type` (listing) vs `content_type` (upload-201) 5. `parent_id` vs `parent_folder_id` (RenameFolder raw response) 6. FileDto has `inserted_at`, no `created_at` — every sibling DTO uses `created_at` 7. GetFolderKey share-branch mixes provenance (share `encrypted_key` alongside the FOLDER `folder_key_version`) 8. UpdateFile lacks tenant scoping (id + uploader only) 9. ListFiles accepts page/pageSize/search and silently ignores all three 10. `errorType` camelCase leak inside snake_case problem+json 11. Unauthenticated blob PUT (UPL-02 debt, registered) + spoofable forwarded-header upload_url 12. GetRootFolderContents auto-creates a personal tenant on GET vs GetRootFolder SuperAdmin-only — divergent GET side effects 13. Two folder projections with different key material (root-contents legacy pair vs FolderDto E2EE triple) 14. Content-Disposition not RFC 5987-encoded Golden fixtures (merged here) pin the CURRENT shapes — normalization is now a deliberate, golden-updating change instead of silent drift.
Author
Owner

Slice 3 COMPLETE — merged via PR #237 (91c598d -> 7a85273), ios-ci run 650 green.

Delivered:

  • Real ML-KEM-768 (liboqs 0.16.0) + ML-DSA-65 on iOS — placeholders gone, MlKem.usesPlaceholder false
  • KazKemNative.xcframework rebuilt from the desktop's vendored KAZ C (the prebuilt one was a different KAZ implementation — 34 vs 66-byte sk at level 256 — and could never interop)
  • iOS hybrid converged to the desktop contract: HKDF-SHA256(mlSS ‖ kazSS, "combined-kem"), blob mlCT ‖ kazCT, KAZ-KEM-256, "ML-KEM-768+KAZ-KEM-256"
  • Bidirectional interop PROVEN: pinned cross-implementation vectors in tests/fixtures/ml-kem-hybrid-vectors.json — iOS decapsulates desktop PQClean/kaz-sys outputs byte-for-byte and vice versa (failsulit-crypto verify_ios_interop_fixture)
  • FileProvider flows moved off the placeholder replication

Suite: 477 tests, 0 failures, 1 documented skip (keychain entitlements), ~140s. Desktop failsulit-crypto 40/40. Dual-pass review clean (2 Importants fixed: consumer-test count assertions + OpenSSL/liboqs hash pinning).

Follow-up filed: #236 (dual-signature blob order kaz‖ml vs ml‖kaz — found by the reviewer, same contract-drift class; blocks cross-platform share signature verification, not the KEM interop just landed).

M4 7.1 slices 1–3 now done; remaining in epic: STRIDE pre-pass 7.10/7.13 + 7.11–7.13 items per dev plan.

**Slice 3 COMPLETE — merged via PR #237 (91c598d -> 7a85273), ios-ci run 650 green.** Delivered: - Real ML-KEM-768 (liboqs 0.16.0) + ML-DSA-65 on iOS — placeholders gone, `MlKem.usesPlaceholder` false - KazKemNative.xcframework rebuilt from the desktop's vendored KAZ C (the prebuilt one was a different KAZ implementation — 34 vs 66-byte sk at level 256 — and could never interop) - iOS hybrid converged to the desktop contract: HKDF-SHA256(mlSS ‖ kazSS, "combined-kem"), blob mlCT ‖ kazCT, KAZ-KEM-256, "ML-KEM-768+KAZ-KEM-256" - **Bidirectional interop PROVEN**: pinned cross-implementation vectors in tests/fixtures/ml-kem-hybrid-vectors.json — iOS decapsulates desktop PQClean/kaz-sys outputs byte-for-byte and vice versa (failsulit-crypto verify_ios_interop_fixture) - FileProvider flows moved off the placeholder replication Suite: 477 tests, 0 failures, 1 documented skip (keychain entitlements), ~140s. Desktop failsulit-crypto 40/40. Dual-pass review clean (2 Importants fixed: consumer-test count assertions + OpenSSL/liboqs hash pinning). **Follow-up filed: #236** (dual-signature blob order kaz‖ml vs ml‖kaz — found by the reviewer, same contract-drift class; blocks cross-platform share signature verification, not the KEM interop just landed). M4 7.1 slices 1–3 now done; remaining in epic: STRIDE pre-pass 7.10/7.13 + 7.11–7.13 items per dev plan.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
primatekuntech/failsulit#223
No description provided.