Field Types
Field types shape generated validation, OpenAPI, GraphQL, MCP tool schemas, projections, and custom pages.
Common guidance
Commands
Command fields should represent what the caller must provide to request a decision. Avoid derived fields that the decider or policy can compute.
Events
Event fields should capture durable facts needed by future decisions, projections, audit, and policies. Be careful when removing or renaming event fields; history still contains older events.
Projections
Projection fields should support read questions, filters, sorting, and UI display. Do not expose sensitive fields just because they exist on events.
Refinement
Use refined types when a field has business constraints. Clear validation messages are part of the runtime contract.