Repository navigation
test: pin claim code shape over 1000 iterations - #66
Merged
Merged
Conversation
The generator encodes 5 random bytes to exactly 8 base32 chars; a 7-char code observed once during staff2 onboarding is not reproducible from the current implementation (100k-iteration standalone probe, 0 anomalies) and is most consistent with manual transcription. Pin the invariant anyway.
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.
Per CTO's NOTICE (e7b53fd5): a 7-char claim code (
synloq-claim-staff2-v7znph3) was observed once during staff2 onboarding; the relay correctly rejected it as malformed.Investigation:
ClaimCodeStore.issue→base32(randomBytes(5)); 5 bytes encode to exactly 8 base32 chars (40 bits / 5), and the JS 32-bit shift overflow inside the encoder only discards already-consumed bits — output length is invariant.^[a-z2-7]{8}$).This PR pins the invariant anyway (as requested): 1000-iteration test asserting every issued code matches
^synloq-claim-<role>-[a-z2-7]{8}$. Test-only change;pnpm verifygreen (86 files / 768 tests).