refactor(types): adopt derive_more and carve out logging-only bind - #115
Open
mfw78 wants to merge 5 commits into
Open
refactor(types): adopt derive_more and carve out logging-only bind#115mfw78 wants to merge 5 commits into
mfw78 wants to merge 5 commits into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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):
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.