Skip to content

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

Merged
mfw78 merged 5 commits into
mainfrom
types/t7-derive-adoption
Aug 11, 2026
Merged

refactor(types): adopt derive_more and carve out logging-only bind#115
mfw78 merged 5 commits into
mainfrom
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
mfw78 force-pushed the types/t6-typed-asserts branch from 7102fad to f1bde8c Compare August 11, 2026 03:15
@mfw78
mfw78 force-pushed the types/t7-derive-adoption branch from f0ba911 to b77b991 Compare August 11, 2026 03:15
@mfw78
mfw78 force-pushed the types/t6-typed-asserts branch from f1bde8c to 6954d04 Compare August 11, 2026 03:34
@mfw78
mfw78 force-pushed the types/t7-derive-adoption branch from b77b991 to e2813cb Compare August 11, 2026 03:34
@mfw78
mfw78 force-pushed the types/t6-typed-asserts branch from 6954d04 to 4734c6a Compare August 11, 2026 05:14
@mfw78
mfw78 force-pushed the types/t7-derive-adoption branch from e2813cb to fce0155 Compare August 11, 2026 05:14
@mfw78
mfw78 force-pushed the types/t6-typed-asserts branch from 4734c6a to a5fbb73 Compare August 11, 2026 05:34
@mfw78
mfw78 force-pushed the types/t7-derive-adoption branch from fce0155 to 0846fdb Compare August 11, 2026 05:34
@mfw78
mfw78 force-pushed the types/t6-typed-asserts branch from a5fbb73 to 2547bdd Compare August 11, 2026 05:54
@mfw78
mfw78 force-pushed the types/t7-derive-adoption branch 2 times, most recently from c4ceaad to 1a147a5 Compare August 11, 2026 06:04
Base automatically changed from types/t6-typed-asserts to main August 11, 2026 06:15
mfw78 added 5 commits August 11, 2026 06:16
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.
@mfw78
mfw78 force-pushed the types/t7-derive-adoption branch from 1a147a5 to c398c7c Compare August 11, 2026 06:16
@mfw78
mfw78 merged commit 418840f into main Aug 11, 2026
4 checks passed
@mfw78
mfw78 deleted the types/t7-derive-adoption branch August 11, 2026 06:18
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.

sdk: public logging-only entry point for bind_host_via_wit_bindgen types: adopt derive_more for newtype boilerplate

1 participant