[ORCH-107] Valkey client and state management #242

Closed
opened 2026-02-02 20:51:56 +00:00 by jason.woltje · 0 comments
Owner

Valkey client for orchestrator state management.

Acceptance Criteria

  • src/valkey/client.ts with ioredis connection
  • State schema implemented (tasks, agents, queue)
  • Pub/sub for events (agent spawned, completed, failed)
  • Task state: pending, assigned, executing, completed, failed
  • Agent state: spawning, running, completed, failed, killed
  • Unit tests with 85% coverage (achieved 96.96%)
  • Configuration from environment variables

Implementation Details

Files Created:

  • apps/orchestrator/src/valkey/types/state.types.ts - State management types
  • apps/orchestrator/src/valkey/types/events.types.ts - Event types for pub/sub
  • apps/orchestrator/src/valkey/valkey.client.ts - ioredis client wrapper
  • apps/orchestrator/src/valkey/valkey.service.ts - NestJS service
  • apps/orchestrator/src/valkey/valkey.client.spec.ts - Client tests (27 tests)
  • apps/orchestrator/src/valkey/valkey.service.spec.ts - Service tests (18 tests)
  • apps/orchestrator/src/valkey/index.ts - Public API exports

Files Updated:

  • apps/orchestrator/src/valkey/valkey.module.ts - Added service provider
  • apps/orchestrator/src/config/orchestrator.config.ts - Added VALKEY_PASSWORD
  • .env.example - Added VALKEY_HOST and VALKEY_PASSWORD documentation

Test Coverage:

  • 45 tests passing
  • 96.96% branch coverage (exceeds 85% requirement)
  • All state transitions validated
  • Error handling tested
  • Pub/sub functionality tested

Environment Variables:

  • VALKEY_HOST (default: localhost)
  • VALKEY_PORT (default: 6379)
  • VALKEY_PASSWORD (optional)
  • VALKEY_URL (alternative connection string)

Technical Notes:
See docs/scratchpads/orch-107-valkey.md for implementation details.

Valkey client for orchestrator state management. ## Acceptance Criteria - [x] src/valkey/client.ts with ioredis connection - [x] State schema implemented (tasks, agents, queue) - [x] Pub/sub for events (agent spawned, completed, failed) - [x] Task state: pending, assigned, executing, completed, failed - [x] Agent state: spawning, running, completed, failed, killed - [x] Unit tests with 85% coverage (achieved 96.96%) - [x] Configuration from environment variables ## Implementation Details Files Created: - apps/orchestrator/src/valkey/types/state.types.ts - State management types - apps/orchestrator/src/valkey/types/events.types.ts - Event types for pub/sub - apps/orchestrator/src/valkey/valkey.client.ts - ioredis client wrapper - apps/orchestrator/src/valkey/valkey.service.ts - NestJS service - apps/orchestrator/src/valkey/valkey.client.spec.ts - Client tests (27 tests) - apps/orchestrator/src/valkey/valkey.service.spec.ts - Service tests (18 tests) - apps/orchestrator/src/valkey/index.ts - Public API exports Files Updated: - apps/orchestrator/src/valkey/valkey.module.ts - Added service provider - apps/orchestrator/src/config/orchestrator.config.ts - Added VALKEY_PASSWORD - .env.example - Added VALKEY_HOST and VALKEY_PASSWORD documentation Test Coverage: - 45 tests passing - 96.96% branch coverage (exceeds 85% requirement) - All state transitions validated - Error handling tested - Pub/sub functionality tested Environment Variables: - VALKEY_HOST (default: localhost) - VALKEY_PORT (default: 6379) - VALKEY_PASSWORD (optional) - VALKEY_URL (alternative connection string) Technical Notes: See docs/scratchpads/orch-107-valkey.md for implementation details.
jason.woltje added this to the M6-AgentOrchestration (0.0.6) milestone 2026-02-02 20:51:56 +00:00
jason.woltje added the orchestrator label 2026-02-02 20:51:56 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaic/stack#242