Commit d14e956
The "masked email never contains the full local part" property test was
seed-flaky in CI. Root cause is a fragile assertion, not the masker:
`expect(masked.includes(local)).toBe(false)` false-positives in two classes
fast-check eventually generates —
1. local part repeats in the preserved domain: "abc@abc.com" -> "ab***@abc.com"
(the kept domain legitimately contains "abc");
2. local part contains the mask character itself: "a.*@a.aa" -> "a.***@a.aa"
(kept "a." + a "*" from the "***" mask reconstructs the local "a.*").
Neither is a real leak — the masker correctly reveals at most the first 2
local chars. Replaced the substring heuristic with an assertion of the exact
masking contract: masked local === first min(2,len) chars + "***", checked on
the local segment only (domain is preserved verbatim by design). Added
deterministic regression cases covering both tricky classes.
Verified seed-independent: a 200k-run local probe of the exact-shape invariant
passes; full suite green (2538 passed, 1 skipped) with no flake. No production
code change.
Co-authored-by: neil <neil@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 7e39abd commit d14e956
2 files changed
Lines changed: 32 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
41 | 47 | | |
42 | 48 | | |
43 | 49 | | |
44 | 50 | | |
45 | 51 | | |
46 | 52 | | |
47 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
48 | 72 | | |
49 | 73 | | |
50 | 74 | | |
| |||
0 commit comments