Repository navigation
Closed
Labels
area:codecArea: codecs and serializationArea: codecs and serializationarea:typesenhancementNew feature or requestNew feature or requestpriority:p2Priority P2 (medium)Priority P2 (medium)
Milestone
Description
Define conversion once for each logical value kind, then compose it through containers and scientific wrappers. Connect these rules to the callable contracts in #335.
The existing mapper collapses Python integers and floats to number. Return-schema generation and decoding make separate representation decisions. Reproduced outcomes are tracked in #331 and #332.
Scope:
- Specify logical value kinds, numeric constraints, wire encodings, and decoded JavaScript representations separately.
- Own one language-neutral value-contract description for policy, codec identifiers, and compatibility rules. Publish a frozen internal prototype interface for spike(codegen): compile complete callable contracts before emission #335.
- Keep Python encoding and TypeScript decoding implementations explicit. Generate shared constants and structural checks where useful.
- Apply primitive rules through records and collections, including supported scalar and model conversions.
- Make Torch reuse ndarray conversion by dtype. Preserve Arrow payload fast paths without adding a second full traversal for schema validation.
- Treat unsupported conversions as explicit outcomes, with paths and guidance.
Acceptance criteria:
- A bounded prototype covers a safe integer policy, Arrow float16 ndarray conversion reused by Torch, and nested records.
- The same integer policy feeds encoding constraints, generated types, and return validation. Keep the fix(codec): reject unsafe Python integers before JSON encoding #331 rejection policy unless a separately reviewed design changes it.
- Root and nested values apply the same rules; conversion shortcuts cannot bypass numeric checks.
- NumPy and Torch float16 return numeric values, including signed zero, subnormals, and finite extrema.
- Unsupported values, cycles, malformed envelopes, depth, and payload limits produce bounded failures.
- Bigint and dataclass extension sketches identify the rule and adapter changes needed for design(codec): define exact bigint transport and generated integer types #337 and design(codec): define validated dataclass value transport #339.
- Adding a value kind does not require unrelated policy branches across mapper, generator, validator, and codecs.
- Publish fixed proof fixtures and expected outcomes for downstream conformance in test(architecture): verify value contracts across generation and execution #344.
- Document wire compatibility, generated-wrapper regeneration requirements, and migration steps before implementation.
Limit the prototype to two engineering days, one design iteration, and an independent review. This bounds investigation; it is not an implementation estimate. Preserve the existing transports, IR 0.4 inputs, and value-RPC execution model. Broad bigint and dataclass implementation remain separate work.
Metadata
Metadata
Assignees
Labels
area:codecArea: codecs and serializationArea: codecs and serializationarea:typesenhancementNew feature or requestNew feature or requestpriority:p2Priority P2 (medium)Priority P2 (medium)
Activity
bbopen commentedon Sep 20, 2026
The shared value contract now separates logical types, wire forms, decoded values, validators, and runtime capabilities. Default revision 2 freezes safe-number behavior and scientific provenance. Producer, decoder, generated types, and validators agree on root and nested values. Tests challenge dtype, shape, marker provenance, cycles, versions, unsupported kinds, depth, and payload limits.
Independent review accepted union disjointness and the selected composition rules. Isolated revision 3 bigint and Point proofs demonstrate extension through shared descriptions; they are bounded prototypes, not universal extensibility or default transport claims.
Evidence:
docs/maintainers/value-contracts.v2.json,src/contracts/value-contract.ts,test/value_contracts.test.ts,test/architecture_mutations.test.ts, anddocs/maintainers/architecture-decision-0.11.md.Verified release evidence:
0861ebeand mergef6f811dhave identical trees.The architecture decision records the accepted scope and prototype limits.
Closing with the implemented and verified 0.11 release outcome.