ms-codec v0.2.0 — bch module + decode_with_correction
Tranche B Phase B.3 + B.4 of the v0.22.x follow-ups cycle. Vendors BCH primitives + full-decode-semantic decode_with_correction for ms1 single-chunk inputs.
What's new
bchmodule (NEW) — vendored from md-codec's structure, all-public surface, parameterized on `MS_REGULAR_CONST = 0x962958058f2c192a` (byte-exact with toolkit's pre-existing vendored constant).bch_decodemodule (NEW) — ~480 LOC mirror of md-codec's BM+Chien+Forney port. Parity-smoke verified GREEN against mnemonic-toolkit-v0.22.1's vendored decoder.decode_with_correction(s: &str) -> Result<(Tag, Payload, Vec<CorrectionDetail>), Error>— full-decode semantics (Q1 lock): BCH-corrects then runs the existing decoder.- New
Error::TooManyErrors { bound: u8 }variant (nochunk_index; ms1 is single-chunk).
Closes FOLLOWUPs
ms-codec-decode-with-correction-public-api(toolkit + this repo)
12-word ms1 anchor constraint
ms-codec's BCH model targets the 12-word abandon vector. Non-12-word ms1 variants (15/18/21/24-word) hit pre-existing toolkit limitations (their polymod ≠ MS_REGULAR_CONST) — documented in bch_decode.rs module doc.
Lockstep
- mnemonic-toolkit v0.23.0 — toolkit consumes this via
repair_via_ms_codec. - md-codec v0.34.0 — sibling codec; same architectural pattern.
- ms-cli v0.4.0 — sibling CLI ships
ms repairsubcommand.
🤖 Released as part of the v0.22.x follow-ups cycle (Tranche B close).