You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tests: BIP-39 mnemonic detector false-positive corpus #135
You will build a false-positive corpus that locks in the README's claim: English prose that uses wallet words never trips the mnemonic detector.
How it fits together
flowchart TD
A["tests/test_mnemonic.py<br/>new FP corpus (near line 56)"] --> B["English sentences with 12+<br/>consecutive BIP-39 words"]
F["bip39_words.py<br/>WORDS list"] --> B
B --> C["scan_text() -> detect_mnemonics()<br/>(mnemonic.py line 58)"]
C --> D["_bip39_checksum_ok() (line 35)<br/>rejects the window"]
D --> E["assert no bip39-mnemonic finding"]
Loading
Wordlist membership alone would match prose, so detect_mnemonics() confirms a real BIP-39 checksum (or an Electrum HMAC tag) before it reports anything. These tests pin that guarantee from the false-positive side; the existing VALID_12 / VALID_24 cases already pin the true-positive side.
Steps
In tests/test_mnemonic.py, build a small corpus of English sentences that contain 12 or more consecutive words drawn from the BIP-39 list (src/agentsweep/bip39_words.py, which is full of common words like "abandon", "expose", "actor") but do not form a valid checksummed mnemonic.
Assert detect_mnemonics returns no bip39-mnemonic finding for every sentence. Drive it through scan_text, the way the other tests do.
Place the corpus next to the existing positive cases so both directions of the claim stay covered.
Files
tests/test_mnemonic.py (extend near test_natural_english_not_detected, line 56)
Code under test: src/agentsweep/mnemonic.py (detect_mnemonics, line 58)
How to claim
Comment "I'll take this", fork the repo, branch from main, and open a PR that links this issue.
Activity