Skip to content

Triage & Design Notes (Fork-Only): Speculative Schema / Contract APIs #136

Backlog

Description

@clockblocker

Fork-internal triage checklist (do NOT post upstream as an umbrella RFC).

All pre-validated, low-drama PRs (#14, #137 IntegerBounds/TupleBounds, #123 EnumNames, #78, #79, #128, #130, #134, #129, #127, #132, #135, #67, #69, #80, #23, #28) have been moved out of this tracker onto the fork/strictly-better-no-drama branch and should be sent upstream individually against their existing upstream issues once #800–#804 clear.

Scope of this tracker (fork/speculative-contracts)

Only the speculative / larger-surface-area API additions live here. Any piece we decide to upstream should be pitched in its own focused, 1-topic upstream discussion rather than as a single "TS / Zod / Effect" umbrella manifesto.

Area Fork PRs Key design issue / recommendation
Out-of-band schema metadata #119 (Metadata<T>), #121 (SchemaName, SchemaExtension, OmitEmptyRequired, flattened optional<variant>) #119 + #121 currently introduce 3 overlapping traits on T (Metadata<T>, SchemaName<T>, SchemaExtension<T>), and SchemaExt.hpp drags Generic.hpp + Object.hpp into rfl.hpp. Unify into one out-of-band trait (without rfl.hpp bloat), extract flattened optional<variant> as a tiny bugfix, and cut OmitEmptyRequired. (Note: IntegerBounds + TupleBounds already split into #137; inline rfl::Description .o bloat is already solved 85% by #125.)
Structured diagnostics #70 (ErrorKind), #120 (Error::code()) #70 already touches 41 files ({ path, kind, message } covers ~95% of Standard Schema / API needs). Keep #70 as a single focused discussion if needed; defer/drop #120.
Wire presence (absent vs null) #122 (Nullable<T>, TriState<T>, AddNullFields) Prefer processor-first (AddNullFields, zero domain-header contagion), then optionally Nullable<T>. Drop TriState<T> from core unless concretely required.
Heavy wrappers & union parsers #83 (rfl::Alias, 37 files), #82 (nested/flattened TaggedUnion, +3,770 LOC), #133 (rfl::Stringified<T>) Park #82 and #83 unless a real codebase hits a wall without them; #133 is superseded for most uses by #134 (rfl::Int64AsString, zero wrapper contagion).

Design filter for any item promoted from here

  1. Bias toward processors & out-of-band traits over field wrappers so shared domain structs stay plain C++ with zero <rfl/...> header contagion.
  2. One trait, one concept: never add multiple competing specialization points on the same T.
  3. JSON Schema Draft 2020-12 stays the seam: no TS / Zod / Effect specifics inside reflect-cpp.

Activity

  1. changed the title [-]RFC: C++20 single-source-of-truth contracts (reflect-cpp → JSON Schema → Zod / Effect Schema)[/-] [+]Triage & Design Notes (Fork-Only): Speculative Schema / Contract APIs[/+] on Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions