Description
Endo Patterns currently describe the shape that is valid "now". This works well for authority boundaries and exact validation, but creates friction for wire protocols and published data streams that need forward compatibility.
Consider a published status object:
const StatusShape = M.splitRecord(
{
phase: M.string(),
},
{
progress: M.number(),
},
);
A publisher validates against StatusShape before writing to vstorage.
Later, the publisher evolves to include a new field:
{
phase: 'running',
progress: 0.5,
estimatedCompletion: 12345,
}
An older client using the same pattern to validate reads may reject the object, even though it understands all fields it depends on.
For wire protocols, producers and consumers often have different compatibility requirements:
- Producers should emit the canonical schema.
- Consumers should accept width-compatible extensions and ignore unknown fields.
Many schema systems support this distinction through "open" vs "closed" object validation.
Proposal
Provide a way to derive or express a read-side pattern that:
- Requires all fields described by the pattern.
- Continues validating optional fields described by the pattern.
- Ignores additional unknown fields.
Possible APIs:
allowExtraProperties(StatusShape)
or
or another mechanism consistent with the existing Pattern design.
The goal is to support forward-compatible readers for wire protocols, vstorage data, durable state snapshots, and similar evolvable data formats without requiring duplicate schema definitions.
Motivation
Patterns currently serve both:
- Authority/interface validation.
- Data protocol validation.
The first often benefits from exact validation. The second often benefits from forward-compatible width subtyping.
Providing an explicit read-side validation mode would make protocol evolution easier while preserving strict validation where desired.
Description
Endo Patterns currently describe the shape that is valid "now". This works well for authority boundaries and exact validation, but creates friction for wire protocols and published data streams that need forward compatibility.
Consider a published status object:
A publisher validates against StatusShape before writing to vstorage.
Later, the publisher evolves to include a new field:
An older client using the same pattern to validate reads may reject the object, even though it understands all fields it depends on.
For wire protocols, producers and consumers often have different compatibility requirements:
Many schema systems support this distinction through "open" vs "closed" object validation.
Proposal
Provide a way to derive or express a read-side pattern that:
Possible APIs:
or
or another mechanism consistent with the existing Pattern design.
The goal is to support forward-compatible readers for wire protocols, vstorage data, durable state snapshots, and similar evolvable data formats without requiring duplicate schema definitions.
Motivation
Patterns currently serve both:
The first often benefits from exact validation. The second often benefits from forward-compatible width subtyping.
Providing an explicit read-side validation mode would make protocol evolution easier while preserving strict validation where desired.