- PUT /timers/🆔 detect state→fired and state→completed transitions,
emit timer.fired / timer.completed domain events
- PUT /routines/🆔 detect status→completed transition,
emit routine.completed domain event
- POST /routines/:id/start (TODO-004): when isTemplate=true, clone the
template into a new RoutineDoc instead of mutating in-place. Original
template stays reusable. Non-templates still update in place.
All 6 ChronoMind event types are now fully wired end-to-end.
Event bus defines 6 event types but only timer.created was wired.
Wire the two straightforward create/start events:
- routine.started: emitted from POST /routines/:id/start
- household.created: emitted from POST /households
Promise.allSettled only catches rejected promises, not synchronous throws.
Wrap handler calls in Promise.resolve().then() to isolate sync errors.
Add 6 unit tests covering delivery, unsubscribe, error isolation,
singleton, reset, and removeAll.
Add typed event bus (6 events: timer.created/fired/completed,
routine.started/completed, household.created) with Promise.allSettled
isolation. Wire webhook subscriber bridge using @bytelyst/webhook-dispatch
for HMAC-signed delivery with retry.
All 219 tests pass.
Replace ad-hoc AGENTIC-N comments with standardized TODO-NNN format across
the entire codebase. Each TODO has:
- Running number (TODO-001 through TODO-011)
- Priority level (high/medium/low)
- Phase reference (0, A.1, A.4, B, cleanup)
- Clear step-by-step instructions an AI agent can follow
TODO index:
TODO-001: Kill switch maintenance banner (providers.tsx)
TODO-002: Feedback button in settings page
TODO-003: Accessibility focus trap for modals
TODO-004: Clone routine template instead of mutating in-place
TODO-005: Wire real LLM enrichment for context messages
TODO-006: Centralize backend URL configuration
TODO-007: MCP tool integration tests (common-plat)
TODO-008: Wire trackEvent() calls into routes + components
TODO-009: Unit tests for AI context generation
TODO-010: Import PRODUCT_ID from product-config (5 route files)
TODO-011: Wire error boundary to telemetry
Added consolidated TODO Index table at top of AGENTIC_AI_ROADMAP.md
for agent scanning. 219 backend tests pass, no code changes.
3 bugs fixed in recent Phase A code:
1. POST /api/context-message: Add Zod schema validation, feature flag gate
(ai_context_messages.enabled), and safe body parsing. Previously had no
validation and unsafe 'as' cast that could null-ptr on missing body.
2. GET /api/timers/availability: Filter out dismissed/completed/fired timers.
Previously included inactive timers in occupied intervals, causing the
endpoint to report less free time than actually available.
3. agent-actions/routes.ts: Import PRODUCT_ID from product-config.ts instead
of hardcoding 'chronomind' string. Ensures consistency if product identity
changes.
Also: Add EXTRACTION_SERVICE_URL + PLATFORM_SERVICE_URL to .env.example.
All 219 backend tests pass. No breaking changes.
Add 3 new backend REST endpoints for MCP tool support:
- POST /timers/:id/reschedule — shift timer by delta seconds or set new target time
- GET /timers/availability — find free time slots in a window (interval merge algorithm)
- POST /routines/:id/start — transition routine from ready/template → active
All endpoints gated behind isFeatureEnabled('mcp.enabled') flag (default false).
Zod schemas: RescheduleTimerSchema (XOR validation), AvailabilityQuerySchema, FreeSlot type.
All 182 backend tests pass. No breaking changes to existing APIs.
Phase 0 of the Agentic AI Roadmap: ecosystem gap fixes.
- Add @bytelyst/kill-switch-client integration (web/src/lib/kill-switch.ts)
- Wire kill switch check into providers.tsx on app init
- Add @bytelyst/feedback-client integration (web/src/lib/feedback.ts)
- Add @bytelyst/accessibility to web dependencies
- Add 7 agentic feature flags to backend (all default false)
- Define 16 telemetry event constants (backend + web)
- Add AGENTIC_AI_ROADMAP.md with full Phase 0-E plan + audit findings
All 182 backend tests pass. All 394 web tests pass.
No breaking changes to existing functionality.
- Add @bytelyst/backend-flags and @bytelyst/backend-telemetry packages
- Create feature-flags.ts and telemetry.ts wrappers using shared packages
- Add TELEMETRY_ENABLED and FEATURE_FLAGS_ENABLED config fields
- Default DB_PROVIDER to memory (fixes test failures without env vars)
- Add JWT_SECRET dev default and PLATFORM_SERVICE_URL
- 176/176 tests pass
$contains generates CONTAINS() SQL in Cosmos (string match), not
ARRAY_CONTAINS() needed for string[] fields. Use findMany + in-memory
post-filter for correct behavior across both providers.