37 lines
1.6 KiB
Markdown
37 lines
1.6 KiB
Markdown
---
|
|
id: schema/node-attrs
|
|
name: Define OperationNodeAttrs and CallNodeAttrs TypeBox schemas
|
|
status: completed
|
|
depends_on:
|
|
- schema/enums
|
|
scope: narrow
|
|
risk: trivial
|
|
impact: component
|
|
level: implementation
|
|
---
|
|
|
|
## Description
|
|
|
|
Define the node attribute schemas for both operation graph nodes and call graph nodes. These are the TypeBox schemas that serve as single source of truth for runtime validation and TypeScript type derivation.
|
|
|
|
## Acceptance Criteria
|
|
|
|
- [ ] `src/schema/node.ts` exports `OperationNodeAttrs` and `CallNodeAttrs` schemas with `Static<typeof>` type aliases
|
|
- [ ] `OperationNodeAttrs`: `name` (string), `namespace` (string), `version` (string), `type` (OperationTypeEnum), `inputSchema` (Unknown), `outputSchema` (Unknown), optional `description`, optional `tags` (Array<String>)
|
|
- [ ] `CallNodeAttrs`: `requestId` (string), `operationId` (string), `status` (CallStatusEnum), optional `parentRequestId` (string), `input` (Unknown), optional `output` (Unknown), optional `error` (Object with code/message/optional details), optional `identity` (Object with id/scopes/optional resources), optional `startedAt` (string), optional `completedAt` (string)
|
|
- [ ] Both schemas produce correct TypeScript types via `Static<typeof>`
|
|
- [ ] `src/schema/index.ts` re-exports all node schemas and types
|
|
- [ ] Unit tests: `Value.Check()` against valid and invalid attribute shapes
|
|
|
|
## References
|
|
|
|
- docs/architecture/schema.md — OperationNodeAttrs, CallNodeAttrs full definitions
|
|
- docs/architecture/call-graph.md — CallNodeAttrs field mappings to call events
|
|
|
|
## Notes
|
|
|
|
> To be filled by implementation agent
|
|
|
|
## Summary
|
|
|
|
> To be filled on completion |