44 lines
1.9 KiB
Markdown
44 lines
1.9 KiB
Markdown
---
|
|
id: schema/enums
|
|
name: Define TypeBox categorical enum schemas and type aliases
|
|
status: completed
|
|
depends_on:
|
|
- setup/project-init
|
|
scope: narrow
|
|
risk: trivial
|
|
impact: component
|
|
level: implementation
|
|
---
|
|
|
|
## Description
|
|
|
|
Define all categorical enum schemas using `Type.Union([Type.Literal(...)])` pattern per [schema.md](../docs/architecture/schema.md). Each enum gets a schema constant (PascalCase + `Enum` suffix) and a `Static<typeof>` type alias (PascalCase, no suffix). Also include the `Nullable` helper.
|
|
|
|
The enums: `CallStatusEnum`, `NodeStatusEnum`, `OperationTypeEnum`, `EdgeTypeEnum`.
|
|
|
|
## Acceptance Criteria
|
|
|
|
- [ ] `src/schema/enums.ts` exports all four enum schemas and their type aliases
|
|
- [ ] Each enum uses `Type.Union([Type.Literal("value"), ...])` pattern per typebox conventions
|
|
- [ ] `CallStatusEnum`: `"pending" | "running" | "completed" | "failed" | "aborted"` with transitions documented in JSDoc
|
|
- [ ] `NodeStatusEnum`: `"idle" | "waiting" | "ready" | "running" | "completed" | "failed" | "skipped" | "aborted"`
|
|
- [ ] `OperationTypeEnum`: `"query" | "mutation" | "subscription"`
|
|
- [ ] `EdgeTypeEnum`: `"triggered" | "depends_on" | "typed" | "sequential" | "conditional"`
|
|
- [ ] Type aliases derived via `Static<typeof>`: `CallStatus`, `NodeStatus`, `OperationType`, `EdgeType`
|
|
- [ ] Naming convention matches spec: `Enum` suffix on schema constants only, never on type aliases
|
|
- [ ] `Nullable` helper exported: `const Nullable = <T extends TSchema>(schema: T) => Type.Union([schema, Type.Null()])`
|
|
- [ ] `src/schema/index.ts` re-exports all schemas and types
|
|
- [ ] Unit tests for each enum: `Value.Check()` validation, compile-time type alias verification
|
|
|
|
## References
|
|
|
|
- docs/architecture/schema.md — enum definitions, naming convention, nullable helper
|
|
- docs/architecture/reactive-execution.md — NodeStatus semantics and transitions
|
|
|
|
## Notes
|
|
|
|
> To be filled by implementation agent
|
|
|
|
## Summary
|
|
|
|
> To be filled on completion |