Skip to content

fix: close remaining 0.1.0 release gaps - #15

Merged
tisonkun merged 5 commits into
mainfrom
codex/audit-0.1.0
Sep 1, 2026
Merged

fix: close remaining 0.1.0 release gaps#15
tisonkun merged 5 commits into
mainfrom
codex/audit-0.1.0

Conversation

@tisonkun

@tisonkun tisonkun commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Summary

This is a narrow 0.1.0 release audit, limited to issues with a reproducible downstream failure or an unambiguous release-facing mismatch.

  • preserve valid type-qualified Serde paths such as <T as Trait>::function as parseable Rust token streams, relying on proc_macro2's round-trip contract instead of maintaining a whitespace formatter
  • keep zero-length array fields bound-free inside generic derives, matching the existing [T; 0] shape contract
  • point the README and rustdoc installation snippets at the upcoming 0.1.0 release
  • record that generic-bound traversal follows Serde's deliberately selective implementation so it is not incorrectly replaced by a visitor that enters macros and const expressions

Review order

The commits are intentionally small. The fourth commit is an additive correction to the first one after review; history was not rewritten. Each commit message contains a Why: paragraph describing the concrete user failure or maintenance risk.

  1. fix: preserve qualified Serde paths
  2. fix: avoid empty-array element bounds in derives
  3. docs: target installation examples at 0.1.0
  4. fix: preserve parseable path metadata
  5. docs: identify the derive-bound reference

Deliberate non-changes

The broader "not invented here" audit did not find another production implementation that could be replaced without increasing risk:

  • generic-bound inference remains an explicit AST walk because serde_derive::bound::with_bound uses the same selective approach; a general syn::visit::Visit would enter macro and const-expression syntax and can infer spurious shape bounds
  • paired package verification keeps its unpack-and-patch step because applying Cargo's patch during cargo package conflicts with --locked at the workspace-resolution stage
  • the small cargo metadata JSON lookup remains local; adding cargo_metadata would add more dependency and API surface than it removes
  • graph recursion identity, union normalization, and built-in shapes are domain behavior rather than substitute implementations; built-ins must mirror Serde explicitly because orphan rules prevent deriving them for foreign standard-library types

The audit also found no evidence for deleting existing behavior-boundary tests, changing the public graph model, adding format policy, or expanding built-in coverage speculatively.

Validation

  • cargo x build --locked
  • cargo x test
  • cargo x lint
  • cargo x package --locked
  • cargo +1.85.0 x test
  • cargo +1.85.0 check -p serde-shape --lib --no-default-features --target thumbv7em-none-eabihf
  • cargo +1.85.0 check -p serde-shape-test-no-std --lib --target thumbv7em-none-eabihf
  • cargo semver-checks check-release -p serde-shape --baseline-rev origin/main --release-type patch --all-features (223 checks passed)

Why: removing every space from syn-rendered paths corrupts valid qualified paths such as <T as Trait>::function into a different token sequence. Normalize punctuation spacing while retaining the keyword separators downstream tools need to display and compare the original Serde metadata.
Signed-off-by: tison <[email protected]>
Why: the built-in [T; 0] shape intentionally works without T implementing a shape trait because no element is observed, but derive inference reintroduced that bound for generic container fields. Skip only syntactically zero array lengths so derived wrappers preserve the same valid contract without weakening bounds for populated arrays.
Signed-off-by: tison <[email protected]>
Why: the README is embedded in both publishable crates and the same snippets appear in rustdoc. Leaving them on 0.0.1 would make the 0.1.0 release immediately direct new users to the superseded API.
Signed-off-by: tison <[email protected]>
Why: proc_macro2 owns the round-trip contract for token-stream display, while the handwritten whitespace normalizer depended on incidental formatting and could miss valid Rust syntax. Keep the renderer's output intact, document its whitespace semantics, and test paths by reparsing them instead of comparing cosmetic formatting.
Signed-off-by: tison <[email protected]>
Why: the selective AST walk resembles a local parser but intentionally follows Serde's own bound inference. Recording that source and the const-expression boundary prevents a future generic visitor refactor from introducing spurious Shape bounds.
Signed-off-by: tison <[email protected]>
@tisonkun
tisonkun marked this pull request as ready for review September 1, 2026 02:22
@tisonkun
tisonkun merged commit 20fa68a into main Sep 1, 2026
12 checks passed
@tisonkun
tisonkun deleted the codex/audit-0.1.0 branch September 1, 2026 02:22
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