Skip to content

mnemonic-toolkit v0.23.0 — D29 migration (sibling-codec native BCH-correction consumption)

Choose a tag to compare

@bg002h bg002h released this 18 May 01:00

Tranche B close of the v0.22.x follow-ups cycle. Migrates the toolkit's BCH error-correction path (`mnemonic repair` + auto-fire in `convert` / `inspect` / `verify-bundle`) from vendored constants to the sibling codecs' newly-public APIs. Deletes ~120 LOC of vendored BCH primitives from `repair.rs`; replaces with thin `repair_via_*` helpers that absorb sibling-codec errors into toolkit's `RepairError` variants.

What's new

  • D29 migration: deleted vendored `MS_NUMS_TARGET` + `MD_NUMS_TARGET` constants + 2 `target_residue()` arms. Ms1 + Md1 repair branches now delegate to `ms_codec::decode_with_correction` (per ms-codec v0.2.0) + `md_codec::decode_with_correction` (per md-codec v0.34.0). Mk1 branch unchanged (still consumes mk-codec primitives directly).
  • New `RepairError::PostCorrectionDecodeFailed { chunk_index: Option, detail: String }` catch-all variant for orphan §4-rule decoder errors surfaced by full-decode chains (Q1 + Q2 architectural locks).
  • Toolkit-side helper absorption: `repair_via_ms_codec` + `repair_via_md_codec` translate sibling-codec error variants into existing `RepairError` shapes per the architectural error-mapping table. Sibling-codec `Display` text drift is absorbable; tests use substring-match (not byte-exact equality) per the architectural review.
  • Manual chapter `41-mnemonic.md` documents the new `PostCorrectionDecodeFailed` variant + cross-references sibling-CLI `repair` subcommands.
  • install.sh pin bumps to lockstep with the 4 sibling-CLI releases shipped concurrently.

Closes FOLLOWUPs (5 from the v0.22.0 cycle close + 1 mk-cli)

  • `toolkit-repair-consume-native-codec-api` (toolkit primary)
  • `ms-codec-decode-with-correction-public-api` (mnemonic-secret + toolkit companions)
  • `md-codec-decode-with-correction-public-api` (descriptor-mnemonic + toolkit companions)
  • `ms-cli-repair-flag` (mnemonic-secret + toolkit companions)
  • `md-cli-repair-flag` (descriptor-mnemonic + toolkit companions)
  • `mk-cli-repair-flag` (mnemonic-key + toolkit; closed earlier in cycle at mk-cli v0.4.0)

New FOLLOWUPs filed

  • `md-codec-decode-with-correction-supports-non-chunked-md1` — descriptor-mnemonic primary + ms-codec + toolkit + mnemonic-gui companions. Documents the chunked-form constraint of md-codec's `decode_with_correction`; non-chunked md1 input falls back to the pre-existing path.

Regression-gate (R3) — all 29 pre-existing repair cells GREEN

`tests/cli_repair.rs` (6) + `tests/cli_inspect.rs` (3) + `tests/cli_auto_repair.rs` (13) + `tests/cli_verify_bundle_multi_cosigner_mk1.rs` (7) = 29 pre-existing cells; ALL pass post-migration. R3 (silent regression) NOT realized.

Sibling-codec parity-smokes — both GREEN (R2 NOT realized)

Both md-codec + ms-codec freshly-vendored BCH decoders parity-tested against mnemonic-toolkit-v0.22.1's pre-existing vendored decoder; byte-exact on corrupted-12-word-abandon round-trip. Berlekamp-Massey port-fidelity confirmed.

Architect review

End-of-cycle opus architect review (post-B.8) verdict: YELLOW → folded 2 defense-in-depth findings inline (I1 `repair_via_md_codec` HrpMismatch synthesis + M2 `parse_md_chunk_index` mid-string matching), 1 cross-sibling pin-format consistency (I2 in md-cli). Final state: all 9 D-locks (D21-D29) + 3 Q-locks (Q1/Q2/Q3) verified; mirror invariant clean across 4 repos.

Install / crates.io status

`mnemonic-toolkit` ships on git+tag only — install via `cargo install --git https://github.com/bg002h/mnemonic-toolkit --tag mnemonic-toolkit-v0.23.0` (crates.io publish blocked on upstream `miniscript` `[patch.crates-io]` per the existing FOLLOWUP). Sibling codecs + CLIs all published to crates.io.

🤖 Tranche B close of the v0.22.x follow-ups cycle.