Route every lazy keym-v2 and Shamir import through its typed loader - #211
Merged
404SecNotFound merged 2 commits intoSep 25, 2026
Merged
Conversation
Finding 6 typed the module-load failure in keymaker-crypto.ts and in addShamirSlotKeym2. Twenty-one other sites still used a bare import(): 16 of keym-v2 and 1 of keym-v2-shamir in encryptor-tool.tsx, and 2 each of keym-v2 in crypto-client.ts (the no-worker fallback) and crypto-worker.ts. None can fail today. The page imports keym-v2 statically, the fallback's imports run after encryptContainer has loaded it, and the worker is one IIFE bundle. Each would bring back the untyped "wrong password" failure if that stopped being true. - loadKeym2 (keymaker-crypto.ts) and loadShamir (keym-v2.ts) are exported and all 21 sites use them. - secret-erase-core-test.mjs scans src and fails on any bare import() of either module outside the two loaders, and checks its own pattern against the forms it guards and a type-only import(). No call can model the failure while the static import is there, so the guard is a source check. Controls, each type-checked: one bare import back in crypto-client.ts fails with 1 offender; the bare Shamir import back in the page fails with 1; the three files as they were fail with 21.
7 tasks
404SecNotFound
merged commit Sep 25, 2026
8308d3f
into
claude/trusting-fermi-rx5kxv
15 checks passed
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
Stacked on #210 (
claude/trusting-fermi-rx5kxv). Merge #210 first, and GitHub then retargets this one tomain.#210 typed the failure when the KEYM v2 or Shamir module cannot load (finding 6), in
keymaker-crypto.tsandaddShamirSlotKeym2. Twenty-one other lazy imports of the same two modules still used a bareimport().encryptor-tool.tsxcrypto-client.ts(the no-worker fallback)crypto-worker.tsencryptor-tool.tsxNone of them can fail today. The page already imports
keym-v2statically, the fallback's imports run afterencryptContainerhas loaded the module, and the worker is a single IIFE bundle. They would bring the untyped "wrong password" failure back if any of that changed, so this PR closes the gap now.Changes
loadKeym2(keymaker-crypto.ts) andloadShamir(keym-v2.ts) are exported, and all 21 sites use them.scripts/secret-erase-core-test.mjsscanssrcand fails on any bareimport()of either module outside those two loaders. It also checks that its pattern recognises the forms it guards against and ignorestypeof import().While the static import is in place no call can model the failure, which is why the guard is a source check.
Test plan
crypto-client.tsfails with 1 offender, and the bare Shamir import put back in the page fails with 1 (both type-checked first). The three files as they are on the base branch fail with 21.npm run typecheck, all 37npm run test:*scripts excepttest:browser, andkeym.py selftesttest:secret-erase-core, build with no base path, andnpx playwright test --project=chromium --workers=2. 304 passed, 5 skipped, exit 0.