Skip to content

design(codec): define validated dataclass value transport #339

Closed

Description

@bbopen

Define a serializable representation for dataclass returns before implementing support.

Reproduced on 6b84614: fixtures.values_torture.dataclass_instance throws Object of type Point is not JSON serializable. Its generated wrapper declares Promise with an unchecked return schema.

See the fixture and schema generation.

Acceptance criteria:

  • Specify supported fields, nesting, optional values, defaults, and the decoded TypeScript representation.
  • Define failures for cycles, unsupported fields, excessive depth, and payload limits.
  • Decide separately whether dataclass inputs are supported or rejected with guidance.
  • Prototype a generated Point-returning wrapper with exact value assertions and discriminating return validation.
  • Ordinary class instances remain unsupported unless a separate contract covers them.
  • Preserve value RPC without object handles or implicit pickle/joblib.
  • Record the design and independent review before scheduling implementation.

Coordinate with #335. This differs from decorator filtering in #133 and Pydantic dump errors in #55. It does not claim full Pydantic support.

Architectural approach:

Compose dataclass fields from supported value rules in #343 and derive the declared result and validator through #335. Unsupported fields must remain explicit. Coordinate through #345.

Activity

  1. added this to the Backlog milestone on Sep 11, 2026
  2. self-assigned this
    on Sep 11, 2026
  3. bbopen commented on Sep 20, 2026

    @bbopen
    OwnerAuthor

    The bounded dataclass design is complete. Actual Python analysis produces a typed Point wrapper, and a private value adapter passes generated typechecking, execution, and wrong-return validation. Tests cover nested, optional, and defaulted fields, cycles, unsupported fields/classes, depth and payload limits, and explicit input rejection. The design uses values without object handles or pickle.

    Independent review accepted this proof. Default production dataclass transport is not included in 0.11.0.

    Evidence: docs/maintainers/value-contract-prototypes.md, test/value_extensions_generated_point.test.ts, test/python/test_value_extensions_prototype.py, and docs/maintainers/architecture-decision-0.11.md.

    Verified release evidence:

    The architecture decision records the accepted scope and prototype limits.

    Closing as complete within the issue's bounded design scope.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions