Commit Graph

273 Commits

Author SHA1 Message Date
saravanakumardb1
d3c3affc1b fix(ios): Fix KillSwitchService — BLKillSwitchClient.check() returns Void
Swift BLKillSwitchClient.check() sets isDisabled/maintenanceMessage as
properties on the client, not a returned result. Expose isDisabled and
maintenanceMessage as computed properties on the wrapper.
2026-03-20 23:09:36 -07:00
saravanakumardb1
151d8361ed fix(android): KillSwitchResult uses 'disabled' not 'killed'
BLKillSwitchClient.KillSwitchResult has field 'disabled: Boolean',
not 'killed'. Fix property access in kill switch check.
2026-03-20 22:59:10 -07:00
saravanakumardb1
c328216a0e refactor(ios): Phase 9A — Add Config.swift + KillSwitchService.swift
- Create Shared/Cloud/Config.swift with shared BLPlatformConfig for ChronoMind
- Create Shared/Cloud/KillSwitchService.swift thin wrapper over BLKillSwitchClient

Part of Mobile DRY Refactoring Roadmap Phase 9A.
2026-03-20 22:48:34 -07:00
saravanakumardb1
2060a831bf refactor(android): Phase 1 — delete dead services, migrate sync to OkHttp, wire kill switch
- Delete auth/AuthService.kt (328 LOC dead code — LoginScreen already uses BLAuthClient)
- Delete telemetry/TelemetryService.kt (178 LOC dead code — TimerViewModel already uses BLTelemetryClient)
- Delete telemetry/FeatureFlagService.kt (89 LOC dead code — PlatformModule provides BLFeatureFlagClient)
- Migrate sync/PlatformApiClient.kt from raw HttpURLConnection to OkHttp (consistent with kotlin-platform-sdk)
- Migrate sync/SyncRepository.kt to use BLSecureStore for auth token instead of manual SharedPreferences
- Wire BLKillSwitchClient in MainActivity.kt with kill switch check on app start
- Update AppModule.kt to inject BLSecureStore into SyncRepository

Part of Mobile DRY Refactoring Roadmap Phase 1.
2026-03-20 22:19:11 -07:00
saravanakumardb1
f7356706cd feat(backend): add GET /api/bootstrap route + test
- Returns productId, displayName, backendPort for client bootstrapping
- Integration test validates response shape and types
2026-03-20 21:15:40 -07:00
saravanakumardb1
fd4d35b308 feat(backend): add GET /health test to diagnostics suite
- Validates standard health response shape: status, service, version, timestamp
- Ensures consistent health endpoint contract across ecosystem
2026-03-20 21:06:56 -07:00
saravanakumardb1
62f94be845 feat(backend): add GET /api/diagnostics/config route + test
- Returns sanitized config: productId, serviceName, port, nodeEnv, dbProvider, telemetryEnabled, featureFlagsEnabled
- Integration test validates response shape
2026-03-20 19:36:04 -07:00
saravanakumardb1
95c2f9426a test(backend): add diagnostics route integration tests
- 3 tests: GET /diagnostics/flags, GET /diagnostics/telemetry, POST /diagnostics/telemetry/flush
- All tests pass
2026-03-20 19:28:09 -07:00
saravanakumardb1
d1f2587cc3 feat(backend): add /diagnostics/flags + /diagnostics/telemetry routes
- GET /api/diagnostics/flags — returns all feature flags
- GET /api/diagnostics/telemetry — returns buffered telemetry events
- POST /api/diagnostics/telemetry/flush — flush telemetry buffer
- No auth required (diagnostics endpoints)
2026-03-20 19:12:27 -07:00
saravanakumardb1
f2450b6e2e refactor(web): migrate telemetry + diagnostics to createWebTelemetry/createWebDiagnostics
- telemetry.ts: 54 → 42 lines via createWebTelemetry() (keeps product-specific trackTimerEvent)
- diagnostics.ts: 53 → 22 lines via createWebDiagnostics()
- 394/394 web tests pass, typecheck clean
2026-03-20 18:54:11 -07:00
saravanakumardb1
bc735dfdb9 feat(backend): add @bytelyst/backend-flags + backend-telemetry, fix config defaults
- 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
2026-03-20 17:31:01 -07:00
saravanakumardb1
15f34c1c80 feat(ci): add backend CI job with common-plat checkout, upgrade Node to 22
- Backend: common-plat checkout, pnpm build, typecheck, 135 tests
- Web: upgrade Node 20→22, add concurrency group
2026-03-20 15:19:28 -07:00
saravanakumardb1
6acc97bf8a fix(backend): use config.DB_PROVIDER instead of process.env.DB_PROVIDER in datastore.ts
- Reads validated DB_PROVIDER from Zod config instead of raw env
- Removes stale isTest fallback logic (now handled by config defaults)
2026-03-20 08:29:36 -07:00
saravanakumardb1
ea508b1fdc fix(backend): make COSMOS_ENDPOINT/KEY validation conditional on DB_PROVIDER
- Only require Cosmos credentials when DB_PROVIDER=cosmos
- Standardize to .refine() pattern matching all other repos
2026-03-20 08:26:07 -07:00
saravanakumardb1
0bda7dd9dc refactor(backend): migrate config.ts to @bytelyst/backend-config base schema
- Extends baseBackendConfigSchema with product-specific overrides
- DB_PROVIDER now declared in all repos (was missing in 3)
2026-03-20 07:56:29 -07:00
saravanakumardb1
a7b0ae9cdc refactor(backend): migrate auth.ts + request-context.ts to @bytelyst/fastify-auth
- auth.ts: 80→18 lines, delegates to createAuthMiddleware()
- request-context.ts: delegates to createRequestContext()
- Re-exports JwtPayload, AuthPayload from shared package
2026-03-20 07:45:58 -07:00
saravanakumardb1
30872465d3 refactor(backend): load product identity from shared/product.json 2026-03-20 07:23:31 -07:00
saravanakumardb1
b4a6c62e15 refactor(backend): remove errors.ts re-export, import @bytelyst/errors directly 2026-03-20 07:19:29 -07:00
saravanakumardb1
c362fa61cf chore: update dependencies 2026-03-19 21:25:38 -07:00
saravanakumardb1
ead99e7729 feat: add product.json manifest (chronomind, port 4011) 2026-03-19 19:44:05 -07:00
saravanakumardb1
83e54c29be fix(web): append /api to baseUrl for shared clients
getBaseUrl() returns 'http://localhost:4003' without /api suffix.
Shared feature-flag-client and subscription-client expect the API
prefix in the URL. Without this fix, requests hit /flags/poll and
/subscriptions/me instead of /api/flags/poll and /api/subscriptions/me.
2026-03-19 17:08:44 -07:00
saravanakumardb1
6dd31490b2 fix(android): complete ChronoMind Android compile fixes — all tests pass
- Fix SyncRepository.timerToDTO: timer.pomodoro → timer.pomodoroConfig/pomodoroState
- Fix SyncRepository.dtoToEntity: add missing TimerEntity fields (dismissedAt, snoozedUntil,
  snoozeCount, elapsedBeforePause, category), fix non-nullable cascadePreset/cascadeIntervalsJson
- Fix PomodoroDTO field mapping: focusMinutes→workMinutes, shortBreakMinutes→breakMinutes, etc.
- ChronoMind Android now compiles and all tests pass
2026-03-19 17:07:57 -07:00
saravanakumardb1
9f2325078d fix(android): partial compile fixes for ChronoMind Android
- Fix AuthService: add MapSerializer/serializer imports, replace fully-qualified calls
- Fix CMColors: add missing textPrimary and textTertiary tokens
- Fix TimerWidget: add Glance clickable/ColorProvider imports, add night param
- Fix SyncRepository: replace pomodoroJson with individual pomodoro fields
- Note: SyncRepository still has CMTimer model drift errors (deferred)
2026-03-19 17:02:16 -07:00
saravanakumardb1
f49ef788a2 feat(web): migrate billing-client + feature-flags to shared packages
- billing-client.ts: hand-rolled fetch → @bytelyst/subscription-client
  wrapper with backwards-compatible Subscription type adapter
- feature-flags.ts: hand-rolled polling → @bytelyst/feature-flag-client
  (71→42 lines, same public API)
- providers.tsx: remove platform param (now configured at client level)
- ChronoMind-specific usage API stays as local fetch call
2026-03-19 16:52:47 -07:00
saravanakumardb1
b7bb6ec53f docs: add corporate network/Gradle proxy section to AGENTS.md 2026-03-19 15:22:41 -07:00
saravanakumardb1
c49829cd3e fix(android): add gradlew + wrapper JAR, fix dependencyResolutionManagement 2026-03-19 15:14:11 -07:00
saravanakumardb1
424e804396 fix(ios): resolve Swift compile errors for iOS 26 / Xcode 26
- Fix CloudKitSyncManager deinit concurrency violation
- Replace deprecated List(selection:) with VStack+ForEach sidebar
- Replace removed Animation.none with Animation.linear(duration: 0)
- Fix CountdownRing initializer parameter mismatch
- Unwrap optional timer.duration in ShareableTimerManager and DataExportManager
- Add missing .event case to exhaustive switch
- Change CascadeWarning.scheduledTime from let to var
- Fix CalendarSyncManager CMTimer init (add elapsedBeforePause, remove non-existent params)
- Add missing UserNotifications import in SleepManager
- Remove parameterized App Intents phrases (iOS 26 restriction)
- Temporarily remove watchOS target dependency for iOS build
2026-03-19 14:22:50 -07:00
saravanakumardb1
403d35e016 chore(web): update lockfile + regenerate service worker 2026-03-12 17:25:20 -07:00
saravanakumardb1
82e7a9c367 fix(auth): JWKS URL-tracking singleton + expanded test coverage 2026-03-12 11:22:03 -07:00
saravanakumardb1
3d2ce9325f feat(auth): RS256 JWKS verification — ChronoMind backend 2026-03-12 11:15:03 -07:00
saravanakumardb1
8cc21d8586 refactor(backend): use shared optional jwt context 2026-03-06 13:38:18 -08:00
saravanakumardb1
f9439f4519 chore(docs): regenerate AI agent config files 2026-03-05 14:37:31 -08:00
saravanakumardb1
909daf8853 fix(diagnostics): getAuthToken throws when no token (type-safe), void .start(), unsyncedCount replaces conflictCount 2026-03-05 11:18:27 -08:00
saravanakumardb1
4a3ac76ff7 feat(mcp): add GET /timers/sync-status endpoint (chronomind.syncStatus MCP tool) 2026-03-05 11:04:44 -08:00
saravanakumardb1
cb79c9b3ad feat(diagnostics): wire @bytelyst/diagnostics-client init in ChronoMind web 2026-03-05 10:57:58 -08:00
saravanakumardb1
2e2f3c25ca ci: update CI/CD configuration 2026-03-04 20:01:34 -08:00
saravanakumardb1
411cc17c3c refactor(workflows): remove duplicate repo-management workflows
- Removed duplicate workflows now centralized in common-plat:

  - repo_sync-repos, repo_push-repos, repo_backup-and-push

  - repo_backup-main-branch, repo_commit-workspace, repo_update-agent-docs

- Updated README.md to reference central workflows in learning_ai_common_plat

All repo-management workflows now maintained in common-plat/.windsurf/workflows/
2026-03-03 16:16:30 -08:00
saravanakumardb1
99889871ff ci: update CI/CD configuration 2026-03-03 12:08:26 -08:00
saravanakumardb1
35756f95c0 chore(backend): remove orphaned cosmos.ts — all repos now use datastore.ts 2026-03-02 01:49:24 -08:00
saravanakumardb1
4cb5d3e627 fix(backend): replace $contains with post-filter for webhook events array query
$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.
2026-03-02 01:49:18 -08:00
saravanakumardb1
8731cf38fd fix(backend): add NODE_ENV=test auto-selection and sync setProvider with global singleton 2026-03-02 01:49:11 -08:00
saravanakumardb1
03d4b7def9 refactor(backend): migrate ChronoMind repositories to @bytelyst/datastore 2026-03-02 01:45:16 -08:00
saravanakumardb1
d6b1bb6f63 fix(sync): fix BatchResult.errors type mismatch — backend returns {id,error} objects not strings 2026-03-01 21:27:44 -08:00
saravanakumardb1
48b88d3a29 fix(sync): add x-product-id header and fix pullDelta response decode mismatch 2026-03-01 21:26:12 -08:00
saravanakumardb1
8cd0ea7fa7 fix(backend): use config.JWT_SECRET instead of direct process.env read 2026-03-01 21:21:12 -08:00
saravanakumardb1
f10b83c122 feat(backend): scaffold product-specific Fastify backend (port 4011)
Add backend/ directory with Fastify 5 + TypeScript ESM service:
- Modules: timers, routines, households, shared-timers, webhooks (migrated from platform-service)
- Cosmos containers: timers, routines, households, shared_timers, webhook_subscriptions, webhook_events
- JWT verification via jose (matches platform-service issuer)
- Shared @bytelyst/* packages via file: refs
- 171 Vitest tests passing

Update AGENTS.md: update backend integration section with product backend details
2026-03-01 20:39:08 -08:00
saravanakumardb1
6b82ca1b33 feat(android): migrate auth, telemetry, feature flags to ByteLyst Kotlin Platform SDK 2026-03-01 18:16:13 -08:00
saravanakumardb1
b7688b55d1 fix(security): move PlatformSyncManager auth token from UserDefaults to Keychain 2026-03-01 16:37:39 -08:00
saravanakumardb1
e0c7f24954 fix(tests): stats.test.ts topCategory test broken on Sundays — wrong Monday calculation 2026-03-01 16:37:07 -08:00
saravanakumardb1
3adab843cd refactor(ios): migrate CrashReporter to ByteLystPlatformSDK's BLCrashReporter
Replaced standalone MetricKit crash reporter (153 lines) with thin wrapper (34 lines)
delegating to SDK's BLCrashReporter. Preserves existing call-site API.
2026-02-28 22:38:55 -08:00