Iter 42. Pins the thiserror-derived Display output for every BfldError
variant. Operators grep log lines for these strings; format drift
between minor versions breaks monitoring queries and alerting rules.
This iter locks the contract.
Added (in tests/bfld_error_display.rs, 11 named tests):
- One test per BfldError variant asserting the documented substrings
appear in to_string():
invalid_magic_displays_both_expected_and_actual_in_hex
unsupported_version_displays_the_offending_version
crc_mismatch_displays_both_values_in_hex
privacy_violation_displays_the_sink_reason
invalid_privacy_class_displays_the_offending_byte
truncated_frame_displays_got_and_need_byte_counts
malformed_section_displays_offset_and_reason
invalid_demote_displays_both_from_and_to_class_bytes
- Meta tests:
bfld_error_implements_std_error_trait
(compile-time witness via fn assert_error_trait<E: std::error::Error>())
bfld_error_is_debug_so_panic_unwrap_messages_carry_diagnostics
every_variant_has_a_non_empty_display_string
(catch-all: 8 variants × non-empty Display assertion;
guards against a future PR that adds a new variant without
the #[error(...)] attribute)
ADR-124 status (iter step 0 sibling check):
- docs/adr/ADR-124-rvagent-mcp-ruvector-npm-integration.md unchanged
at 431 lines. SENSE-BRIDGE scope remains orthogonal.
ACs progressed:
- ADR-118 §2.1 operator observability — error-message contract now
pinned. A monitoring rule that greps for "payload CRC mismatch"
or "privacy violation" continues to fire correctly across BFLD
versions.
Test config:
- cargo test --no-default-features → 90 passed (bfld_error_display cfg-out)
- cargo test → 290 passed (279 + 11)
Out of scope (next iter target):
- PR-readiness pivot remains the genuine next move: CHANGELOG batch,
witness bundle regeneration, AC closeout table. All in-crate ACs
empirically covered; remaining work is external-resource-gated
(KIT BFId, Pi5/Nexmon hardware) or PR-prep.
Co-Authored-By: claude-flow <ruv@ruv.net>