test(frontend): run the crypto worker and keystore in real browsers #231
All Vouch review confidence checks passed
Residual risk 0.26 = Change Risk (0.66) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.66 · 383 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.356
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.066
Real PR Conversation Timeline
1 comments
"Review active on #231"
general
weight: 0.35
gabrielzubovsky
What and why
Part of #223 (stage A; stage B, the lifecycle specs, remains). Every frontend test ran under Node or jsdom with the keystore, wasm and drive layer mocked. A vitest
browserproject now runs*.browser.test.tsin real headless browsers through Playwright: the module crypto worker, Web Crypto keys, IndexedDB persistence across a worker restart, a drive round trip with ciphertext checked in the real IndexedDB vault, and the device's HPKE key stored sealed (ADR 0007). No backend;npm testandcheck.share unchanged.browser.ymlbuilds the wasm envelope module, then runs Chromium on every pull request and Chromium, Firefox and WebKit onmain, nightly and on demand, keeping failure screenshots and Playwright traces as artifacts. It is not a required check yet.Found a Safari bug, fixed by #200. WebKit refuses to store an X25519
CryptoKeyin IndexedDB, and the device private key used to be stored as one, so the crypto worker could not start in WebKit. #200 stores that key sealed under an AES seed key. Rebased onto it, WebKit passes like the other browsers, so the WebKit exemption and the README's Safari caveat are gone.Updated for #200: test 1 checks
hpkeKeyAvailable; test 2 checks the sealed key (the seed key is non-extractable, encrypt and decrypt only, and the stored key decrypts only under its tenant and public key); the X25519 probe test is gone with the key it probed. The round trip now checks that no 1 KiB window of the plaintext appears in the stored chunk. The browser job's rust-cache saves only frommain, as in #226.Also: the coverage job in
ci.ymlran a barevitest run, which would now start the browser project on a runner without browsers (the error was hidden by| tee); it now runs only the node and dom projects.How it was tested
npm testruns only node and dom (204 passed); typecheck and lint pass; coverage with no browsers installed exits 0.frontend/package-lock.jsonalso drops 14libcfields from an npm version difference; the new packages are@vitest/browser-playwright,playwrightand their deps (MIT/Apache-2.0).Checklist
scripts/check.shpasses locally: all steps pass except the secret scan, which fails for the reason #230 fixesSECURITY_AUDIT_EVENTcovered byaudit_coverage.rs: n/adocs/DATA_POLICY.md)CHANGELOG.mdupdated for user-visible changesdocs/adr/if one was made: n/a