Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

buffa-remote-derive: generate feature-gated serde/Arbitrary/reflection forwarders

Open
#290 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
28/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
json, rust

Research direction

Start by reading the buffa-remote-derive crate plus the hand-written reference pattern in examples/custom-types/src/types/ and that example's README serde matrix. The issue lists serde, arbitrary::Arbitrary, and ReflectList/ReflectMap forwarders, but the feature-flag versus attribute design and serde delegation model are still unsettled. Done requires an agreed design and generated forwarders matching it.

Written by the indexing model from the issue text.

Description

#251 landed the buffa-remote-derive crate (ProtoString/ProtoBytes/ProtoList/ProtoBox/MapStorage derives for newtypes over remote types), scoped to the binary codec only. This issue tracks the remaining piece of #212's design sketch: optionally generating the feature-gated forwarders so a derived newtype is usable in JSON, fuzzing, and reflection builds without hand-written impls.

What the derives currently do not generate, and where the gap bites:

  • serde forwarders — a string newtype used as a repeated element, an optional field, or a map value serializes through its own Serialize/Deserialize; without them a generate_json(true) build fails with a trait-bound error deep in generated message code. (Bytes newtypes are exempt: all bytes positions route through the base64 with-modules.) The crate docs' "Scope: the binary codec only" section documents the current hand-written workaround (#[derive(serde::Serialize, serde::Deserialize)] + #[serde(transparent)]).
  • arbitrary::Arbitrary — needed for fuzz targets that construct messages containing the newtype.
  • reflection (ReflectList/ReflectMap) — needed for vtable-reflection builds where the newtype backs a repeated or map field.

Design questions to settle before implementing:

  • Feature flags on the derive crate (json/arbitrary/reflect) versus derive-attribute opt-ins (#[buffa(serde)]); a proc-macro crate's features are unified across the dependency graph, which argues for per-derive attributes.
  • Whether the serde forwarder should be #[serde(transparent)]-equivalent (delegate to the remote type's serde) or route through AsRef/From like buffa's own with-modules, which would drop the remote-type-must-support-serde requirement.

Until then, the hand-written pattern in examples/custom-types/src/types/ is the reference, and the per-position serde matrix lives in that example's README.

Dominant language
Rust
Stars
900
Forks
95
Avg merge
5d 10h
Merged PRs (30d)
57

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from anthropics/buffa

All issues in anthropics/buffa

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.