nexus/.planning/phases/36-voice-pipeline-foundation/36-02-SUMMARY.md
Nexus Dev 7d47463d5b docs(36-02): complete voice schema foundation plan
- Add 36-02-SUMMARY.md with task details and verification results
- Advance STATE.md to plan 2 of 3, 33% progress
- Update ROADMAP.md plan progress (1 of 3 summaries)
- Mark VPIPE-05 as complete in REQUIREMENTS.md
2026-04-04 01:25:24 +00:00

4.3 KiB

phase plan subsystem tags dependency_graph tech_stack key_files decisions metrics requirements_completed
36-voice-pipeline-foundation 02 shared-validators
voice-mode
schema
types
nexus-settings
requires provides affects
voiceMode field on createMessageSchema
VoiceMode type and VOICE_MODES constant
voiceMode on ChatMessage interface
voiceMode and telegramToken in nexus-settings schema
server/src/routes/chat.ts (createMessageSchema.parse preserves voiceMode)
nexus-settings.json (reads voiceMode with default "text")
added patterns
Zod enum with optional() for optional validated enum fields
Zod schema exported for direct testing without mocking file system
nexusSettingsSchema.parse({}) for consistent defaults in catch blocks
created modified
server/src/__tests__/36-voice-schema.test.ts
packages/shared/src/validators/chat.ts
packages/shared/src/types/chat.ts
server/src/services/nexus-settings.ts
Export nexusSettingsSchema named export to enable direct Zod schema testing without file system mocking
Use nexusSettingsSchema.parse({}) in catch/fallback blocks for consistent Zod defaults
duration_minutes completed_date tasks_completed tasks_total files_created files_modified
7 2026-04-04T01:24:07Z 2 2 1 3
VPIPE-05

Phase 36 Plan 02: Voice Schema Foundation Summary

One-liner: voiceMode enum field added to createMessageSchema and ChatMessage, plus nexus-settings extended with voiceMode (default "text"), telegramToken, piperBinaryPath, and whisperBinaryPath.

Completed Tasks

Task Name Commit Files
1 Extend shared validators and types with voiceMode field 390034c7 packages/shared/src/validators/chat.ts, packages/shared/src/types/chat.ts, server/src/tests/36-voice-schema.test.ts
2 Extend nexus-settings schema with voiceMode and telegramToken 044e3dad server/src/services/nexus-settings.ts, server/src/tests/36-voice-schema.test.ts

What Was Built

packages/shared/src/validators/chat.ts

Added VOICE_MODES constant, VoiceMode type, and optional voiceMode field to createMessageSchema:

export const VOICE_MODES = ["text", "voice_input", "full_voice"] as const;
export type VoiceMode = (typeof VOICE_MODES)[number];

// In createMessageSchema:
voiceMode: z.enum(VOICE_MODES).optional(),

packages/shared/src/types/chat.ts

Added optional voiceMode field to ChatMessage interface:

voiceMode?: "text" | "voice_input" | "full_voice" | null;

server/src/services/nexus-settings.ts

Extended nexusSettingsSchema with four new fields, exported the schema for testing, updated fallback logic:

export const nexusSettingsSchema = z.object({
  mode: z.enum(NEXUS_MODES).default("both"),
  voiceEnabled: z.boolean().default(false),
  voiceMode: z.enum(VOICE_MODES).default("text"),
  telegramToken: z.string().optional(),
  piperBinaryPath: z.string().optional(),
  whisperBinaryPath: z.string().optional(),
});

server/src/tests/36-voice-schema.test.ts

11 tests covering:

  • createMessageSchema voiceMode enum validation (6 tests)
  • nexusSettingsSchema voiceMode defaults and telegramToken (5 tests)

Verification

All verification checks pass:

  • pnpm --filter @paperclipai/server test --run exits 0 for 36-voice-schema.test.ts (11/11 tests)
  • grep "voiceMode" packages/shared/src/validators/chat.ts shows the field
  • grep "voiceMode" packages/shared/src/types/chat.ts shows the field
  • grep "voiceMode" server/src/services/nexus-settings.ts shows the field
  • grep "telegramToken" server/src/services/nexus-settings.ts shows the field

Deviations from Plan

None — plan executed exactly as written.

Known Stubs

None — this plan adds schema/type foundations only. No UI rendering or data flow is introduced.

Self-Check: PASSED

  • packages/shared/src/validators/chat.ts — FOUND, contains voiceMode
  • packages/shared/src/types/chat.ts — FOUND, contains voiceMode
  • server/src/services/nexus-settings.ts — FOUND, contains voiceMode and telegramToken
  • server/src/tests/36-voice-schema.test.ts — FOUND, 11 passing tests
  • Commit 390034c7 — FOUND
  • Commit 044e3dad — FOUND