feat(DIS-107): Zod schemas for disclaw.yaml, agent.yaml, CLI output #49

Merged
dev merged 1 commit from phase-1/zod-schemas into main 2026-04-09 15:55:00 +00:00
Owner

Summary

  • Add DisclawConfigSchema (Zod) for disclaw.yaml with defaults and validation
  • Add AgentYamlSchema (Zod) for agent.yaml and ClaudeJsonOutputSchema for CLI output
  • Update loader.ts and identity.ts to validate external data at parse time with clear error messages
  • 6 new unit tests covering valid inputs, missing fields, wrong types, and default application

Test plan

  • npx vitest run tests/unit/schemas.test.ts -- all 6 schema tests pass
  • npx vitest run -- full suite (50 tests) passes
  • Verify loadDisclawConfig throws descriptive error on invalid YAML
  • Verify loadAgentIdentity throws descriptive error on missing channel_id
## Summary - Add `DisclawConfigSchema` (Zod) for `disclaw.yaml` with defaults and validation - Add `AgentYamlSchema` (Zod) for `agent.yaml` and `ClaudeJsonOutputSchema` for CLI output - Update `loader.ts` and `identity.ts` to validate external data at parse time with clear error messages - 6 new unit tests covering valid inputs, missing fields, wrong types, and default application ## Test plan - [ ] `npx vitest run tests/unit/schemas.test.ts` -- all 6 schema tests pass - [ ] `npx vitest run` -- full suite (50 tests) passes - [ ] Verify `loadDisclawConfig` throws descriptive error on invalid YAML - [ ] Verify `loadAgentIdentity` throws descriptive error on missing `channel_id`
dev added 1 commit 2026-04-09 15:49:57 +00:00
feat(DIS-107): Zod schemas for disclaw.yaml, agent.yaml, CLI output
Some checks failed
CI / build-and-test (ubuntu-latest) (pull_request) Has been cancelled
CI / build-and-test (windows-latest) (pull_request) Has been cancelled
CI / lint (pull_request) Has been cancelled
5718284518
Add DisclawConfigSchema and AgentYamlSchema with Zod validation.
loader.ts and identity.ts validate external data at parse time.
Clear error messages with field name and expected type.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
dev merged commit 419d0990bf into main 2026-04-09 15:55:00 +00:00
dev deleted branch phase-1/zod-schemas 2026-04-09 15:55:07 +00:00
Sign in to join this conversation.
No description provided.