Skip to content

refactor(types): adopt derive_more and carve out logging-only bind - #115

Open
mfw78 wants to merge 5 commits into
types/t6-typed-assertsfrom
types/t7-derive-adoption
Open

refactor(types): adopt derive_more and carve out logging-only bind#115
mfw78 wants to merge 5 commits into
types/t6-typed-assertsfrom
types/t7-derive-adoption

Conversation

@mfw78

@mfw78 mfw78 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

What

Adopts derive_more for the audited newtype boilerplate (ContentDigest Display, FieldValue Display, ManifestSource From) and carves out a public bind_host_logging_via_wit_bindgen! entry point from the full wit-bindgen host binding macro.
Closes #48
Closes #103

Why

ContentDigest and FieldValue had hand-written Display impls and ManifestSource had hand-written From impls that derive_more replaces with equivalent, audited derive attributes, cutting boilerplate without changing observable output.
The logging-only macro exists because a domain world that remaps nexum:host/types onto its own SDK bindings makes the orphan rule block the whole macro, even though the logging arm only needs the freshly generated nexum::host::logging, so videre's domain SDK integration needs a base-block-free entry point.

Testing

Independent gate on nullislabs/nexum-runtime @ types/t7-derive-adoption (HEAD f0ba911 "refactor(runtime): derive the content-digest Display"), base origin/types/t6-typed-asserts. Fresh clone into /tmp/tmp.lVkmoFEtE9/repo, detached checkout, nothing reused from prior sessions. All commands run inside nix develop (rustc 1.94.0, nextest 0.9.127, sccache 0.16.0, mold 2.40.4).

Results (every step exit 0):

  • cargo fmt --all -- --check: clean.
  • Em-dash scan of added lines over base range: none (checked em dash and en dash).
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: clean (1m59s).
  • just build (engine + example + examples + fixtures, wasm32-wasip2): clean.
  • CI=1 cargo nextest run --workspace --all-features --locked: 694/694 passed, 0 skipped, 0 failed.
  • cargo test --doc --workspace --all-features --locked: all doctest targets ok, 0 failed.
  • RUSTDOCFLAGS='-D warnings' cargo doc --workspace --no-deps --locked: clean (confirms the new intra-doc link to bind_host_logging_via_wit_bindgen! resolves).
  • just test-e2e: 12/12 passed, 428 skipped by filter.

Identity/footers over origin/types/t6-typed-asserts..HEAD (5 commits: d50c792, d74f432, 3d247bf, 7df1fa8, f0ba911): author AND committer are mfw78 mfw78@nxm.rs on all five, no Co-Authored-By, no tool footers.

Diff review (7 files, +95/-37): ContentDigest hand-written Display replaced by derive_more::Display with a scheme-prefixed hex format, byte-identical output to the removed impl. FieldValue Display derived with default enum forwarding matching the removed match arms. ManifestSource From/From replaced by derive_more::From on exactly those two variants, Beside correctly left unmarked. New public bind_host_logging_via_wit_bindgen! is re-invoked from the logging arm of the full macro, so no duplicate item definitions on the full-bind path. New integration test crates/nexum-sdk/tests/wit_bindgen_logging.rs exercises the logging-only bind with no WitBindgenHost/nexum:host/types in scope and asserts the installed tracing facade reaches the bound log call. Cargo.lock carries the committed derive_more dep for nexum-sdk-test, consistent with --locked passing everywhere.

AI Assistance

Implementation by claude-fable-5, red-team review by claude-opus-5, PR authored by claude-sonnet-5.

mfw78 added 5 commits August 6, 2026 16:31
AI Assistance: Claude Fable 5 used for the derive_more sweep and conversion
AI Assistance: Claude Fable 5 used for the macro split and consumer-shaped test
AI Assistance: Claude (Opus 5) used for the red-team pass and the doc fix.
AI Assistance: Claude (Opus 5) used for the mutation check and the assertion strengthening.
AI Assistance: Claude (Opus 5) used for the derive sweep and the flag census.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant