saravanakumardb1
81999dcbb3
feat(services): wire AKV secret resolution in platform-service and extraction-service startup
2026-02-14 22:18:01 -08:00
saravanakumardb1
fb3bc750eb
fix: update .env.example comments, Grafana dashboard, and debug-service.md for consolidated services
2026-02-14 22:01:55 -08:00
saravanakumardb1
11ca4e95e3
docs: Phase 5 update AGENTS.md, package.json, monitoring for consolidated services
2026-02-14 21:54:09 -08:00
saravanakumardb1
81609e9358
fix: remove stale port references from monitoring, docs, and AI.dev skills
2026-02-14 21:48:21 -08:00
saravanakumardb1
29fc8124e4
refactor: merge tracker-service into platform-service
...
Phase 3 of service consolidation (5→2 services).
Moved modules:
- items (16 tests)
- comments (6 tests)
- votes (5 tests)
- public (16 tests) — rate-limited, no auth required
Changes:
- Copied 4 modules from tracker-service
- Added DEFAULT_PRODUCT_ID alias in product-config.ts (Gap 1)
- Created src/lib/auth.ts re-exporting extractAuth from @bytelyst/auth (Gap 2)
- Added @bytelyst/auth and @fastify/rate-limit to package.json (Gap 2)
- Registered itemRoutes, commentRoutes, voteRoutes, publicRoutes in server.ts
- Public routes at top level (no auth scope)
- Removed tracker-service directory
Tests: 158 passing (115 + 43 from tracker = 158) ✅
Build: clean ✅
Service consolidation Phases 1-3 complete:
- growth-service: merged ✅
- billing-service: merged ✅
- tracker-service: merged ✅
Remaining: 2 services (platform-service + extraction-service)
2026-02-14 21:34:21 -08:00
saravanakumardb1
f13c676139
refactor: merge billing-service into platform-service
...
Phase 2 of service consolidation (5→2 services).
Moved modules:
- subscriptions (9 tests)
- usage (7 tests)
- plans (9 tests)
- licenses (7 tests)
- stripe (0 tests — webhook signature verified at runtime)
Changes:
- Copied 5 modules + stripe.ts lib from billing-service
- Added billing env vars to config schema (Stripe, internal key, etc.)
- Scoped billing routes with internal key auth guard (Gap 3)
- When BILLING_INTERNAL_KEY is set, billing routes require x-internal-key header
- When unset, billing routes are open (dev mode)
- Stripe routes always outside scope (own webhook signature check)
- Removed billing-service directory
Tests: 115 passing (83 + 32 from billing = 115) ✅
Build: clean ✅
2026-02-14 21:31:04 -08:00
saravanakumardb1
05008ee04f
refactor: merge growth-service into platform-service
...
Phase 1 of service consolidation (5→2 services).
Moved modules:
- invitations (12 tests)
- referrals (9 tests)
- promos (7 tests)
Changes:
- Copied 3 modules + webhooks.ts lib from growth-service
- Added stripe dep to platform-service package.json
- Added webhook env vars to config schema
- Registered invitationRoutes, referralRoutes, promoRoutes in server.ts
- Removed growth-service directory
Tests: 83 passing (was 55 + 28 from growth = 83) ✅
Build: clean ✅
2026-02-14 21:27:44 -08:00
95b45a9fd3
fix(cosmos): init containers on startup for local compose
2026-02-14 20:57:17 -08:00
16bc06d84a
Add local health-check script; mark health verification
2026-02-14 18:59:01 -08:00
607fcbf3d7
fix(docker): make pnpm deploy work under pnpm v10
2026-02-14 18:30:00 -08:00
32f8f7ccf5
chore(docker): include new workspace packages in builds
2026-02-14 16:48:09 -08:00
e9b33fb518
feat(monitoring): add @bytelyst/monitoring package
2026-02-14 15:57:41 -08:00
125eb03745
feat(blob): add @bytelyst/blob shared package
2026-02-14 15:53:33 -08:00
saravanakumardb1
5c1744d3a4
feat(extraction): Phase 6 advanced features (6.1-6.8)
...
- 6.1-6.2: Entity visualization components (bar chart, pie chart, timeline) [in LysnrAI repo]
- 6.3-6.4: Async job queue — POST /extract/jobs, GET /extract/jobs/:id, GET /extract/jobs
- 6.5-6.6: Model registry with tier (standard/premium/free/mock) + GET /extract/models
- 6.7-6.8: Multi-language detection (es/fr/de/pt/ja/zh/ko/ar) + prompt enrichment
- ExtractMetadata.language field added to Python models
- 46 TS tests passing, build clean
2026-02-14 14:08:02 -08:00
saravanakumardb1
b8c0a73e89
feat(extraction): Phase 5 observability + error handling (5.7-5.12)
...
- 5.7: Enhanced structured logging with userId, productId, cacheHit, tokenCount
- 5.8: Metrics module (counters + histograms) + /extract/metrics endpoint
- 5.9: Grafana dashboard config for extraction-service (Loki queries)
- 5.10: Error mapping — sidecar errors → proper HTTP status codes (408, 429, 502, 503)
- 5.11: Circuit breaker for Python sidecar (5 failures → 30s OPEN)
- 5.12: Graceful degradation — circuit open returns 503, cached results still served
- 46 TS tests passing
2026-02-14 14:04:59 -08:00
saravanakumardb1
9c8a3169dc
feat(extraction): Phase 5 caching + cost controls (5.1-5.6)
...
- 5.1: Python sidecar LRU cache (cache.py) with configurable TTL + max size
- 5.2: Fastify-level cache with X-Extraction-Cache HIT/MISS header + /extract/cache-stats
- 5.3-5.5: Per-user daily quota (free=10, pro=100, enterprise=unlimited) with 429 response
- 5.6: GET /extract/usage endpoint for admin usage reporting
- Both Python + TS caches use sha256(taskId:modelId:text) keys
- 46 TS tests + 29 Python tests still passing
2026-02-14 14:02:21 -08:00
saravanakumardb1
37343ae57b
feat(extraction): add Dockerfile + supervisord for extraction-service
...
- Multi-stage: Node.js build + Python sidecar + supervisord runtime
- Stage 1: pnpm workspace build for Fastify TS service
- Stage 2: pip install langextract + FastAPI deps
- Stage 3: node:22-alpine + python3 + supervisord
- supervisord manages both Fastify (4005) and uvicorn (4006)
2026-02-14 13:57:41 -08:00
saravanakumardb1
c2d626c7b5
chore(extraction): add Python .gitignore, remove cached .pyc files
2026-02-14 13:49:39 -08:00
saravanakumardb1
c9d5c0caed
feat(extraction): integration tests + Python tests + fix langextract API
...
- 6 route integration tests (mock sidecar via vitest vi.mock)
- 12 task CRUD route tests (mock repository)
- 29 Python tests: 10 extractor, 12 models, 7 app endpoints
- Fix extractor.py: correct lx.extract() API (text_or_documents positional, prompt_description)
- Mock fallback when no GEMINI_API_KEY or USE_MOCK_EXTRACTOR=true
- 46 TS tests + 29 Python tests = 75 total
2026-02-14 13:49:18 -08:00
saravanakumardb1
6a49823e1d
feat(extraction): add task seed module + 7 seed tests
...
- seed.ts: 5 built-in task definitions with idempotent upsert
- seed.test.ts: 7 tests validating task schema compliance
- 28 total tests passing
2026-02-14 13:36:46 -08:00
saravanakumardb1
0a87d1937b
feat(extraction): add rate limiting + 21 schema tests
...
- Rate limiting on extract routes (30 req/min per IP via @fastify/rate-limit)
- 13 tests for ExtractRequestSchema, BatchExtractRequestSchema, ExtractionExampleSchema
- 8 tests for ExtractionTaskSchema, CreateTaskSchema, UpdateTaskSchema
- All 21 tests passing, pnpm build clean
2026-02-14 13:34:26 -08:00
saravanakumardb1
c292bb5cc1
feat(extraction): scaffold extraction-service + @bytelyst/extraction package
...
- extraction-service: Fastify scaffold (port 4005) with extract/tasks modules
- src/lib/: config, errors, cosmos, product-config, python-bridge
- src/modules/extract/: types (Zod schemas), routes (POST /extract, batch, models)
- src/modules/tasks/: types, repository (Cosmos CRUD), routes (CRUD endpoints)
- Python sidecar: FastAPI app, LangExtract wrapper, models, task registry
- @bytelyst/extraction package: types, client factory, index exports
- Both pnpm build pass clean
2026-02-14 13:31:40 -08:00
saravanakumardb1
261181b182
feat(docker): rewrite service Dockerfiles for pnpm monorepo builds
...
- All 4 service Dockerfiles now use repo root as build context
- Multi-stage: pnpm install → build packages+service → pnpm deploy for production
- docker-compose.yml updated with context: . and dockerfile paths
- Added scripts/docker-prep.sh convenience wrapper
- Docker build blocked by corporate proxy SSL (not a code issue)
2026-02-12 23:48:18 -08:00
saravanakumardb1
446201b423
feat(platform-service): update Dockerfile for pnpm workspace support
...
- Add proper workspace dependency resolution
- Build packages before service
- Use pnpm deploy for production
- Add docker-prep.sh script for helper commands
2026-02-12 23:43:40 -08:00
saravanakumardb1
99cbdf582c
feat(auth): add middleware tests + E2E flow + migrate tracker-service to @bytelyst/auth
...
- Upgraded @bytelyst/auth middleware to throw ServiceError types (UnauthorizedError, ForbiddenError)
- Added @bytelyst/errors as dependency to auth package
- 11 new middleware tests (extractAuth + requireRole)
- 4 new E2E tests (full login → JWT → auth → role check flow)
- Refactored tracker-service lib/auth.ts from 48-line local impl to 1-line re-export
- Added @bytelyst/auth as tracker-service dependency
- All 277 tests pass, 0 regressions
2026-02-12 23:41:46 -08:00
saravanakumardb1
63c08dbb0a
refactor(services): integrate @bytelyst/fastify-core into all 4 services
...
Replaced duplicated server setup code with createServiceApp() factory:
- platform-service: 91 → 39 lines
- billing-service: 105 → 51 lines (keeps service-specific internal key auth)
- growth-service: 83 → 33 lines
- tracker-service: 88 → 36 lines
Enhanced fastify-core with optional Swagger + Prometheus metrics support.
Total reduction: ~208 lines of duplicated boilerplate eliminated.
All 246 tests pass.
2026-02-12 22:53:22 -08:00
saravanakumardb1
90b9cf93d8
fix(common): configure ESLint 9 and fix lint issues
...
- Added @eslint/js dependency
- Updated eslint.config.js for ESLint 9 compatibility
- Added required globals (crypto, localStorage, React, etc.)
- Fixed unused imports and variables
- Disabled sort-imports temporarily
- Formatted all files with Prettier
2026-02-12 16:37:30 -08:00
saravanakumardb1
86a56339ab
fix: replace Math.random() IDs with crypto.randomUUID() across all services
...
- billing-service: licenses, subscriptions (pay_, lic_)
- growth-service: invitations, referrals (inv_, ref_)
- platform-service: auth, audit (usr_, aud_)
- tracker-service: items, comments, votes, public (trk_, cmt_, vote_)
- Add votes.test.ts — closes the only missing module test
2026-02-12 13:03:09 -08:00
saravanakumardb1
4ae7a9d023
refactor(services): rewire lib/ to @bytelyst/* packages + add docker-compose
...
Rewired all 4 services:
- lib/errors.ts → re-exports from @bytelyst/errors
- lib/cosmos.ts → re-exports from @bytelyst/cosmos
- lib/product-config.ts → uses loadProductIdentity()/getProductId() from @bytelyst/config
- lib/config.ts → kept self-contained (zod v3/v4 type mismatch with loadConfig)
Added workspace deps (@bytelyst/errors, @bytelyst/cosmos, @bytelyst/config) to all 4 services.
Added docker-compose.yml with Loki, Grafana, Traefik, and all 4 services.
Added .env.example with required env vars.
Added passWithNoTests to vitest.config.ts.
Pinned root zod to ^3.24.0 to match service zod versions.
All 12 projects build. 175 tests passing.
2026-02-12 11:49:42 -08:00
saravanakumardb1
c97e697097
feat(services): add monitoring (Loki + Grafana config, health-check)
...
- Copied as-is from learning_voice_ai_agent/services/monitoring
- Grafana dashboards + provisioning for Loki datasource
- health-check.ts for service health polling
- Updated pnpm-workspace.yaml to include services/*
2026-02-12 11:39:24 -08:00
saravanakumardb1
2738124ab9
feat(services): add tracker-service (items, comments, votes, public roadmap)
...
- Copied as-is from learning_voice_ai_agent/services/tracker-service
- 45 tests passing (vitest)
- Fastify 5 + Cosmos DB + jose + Zod + @fastify/rate-limit
- Modules: items, comments, votes, public
- Port 4004
2026-02-12 11:39:17 -08:00
saravanakumardb1
b94510aeb9
feat(services): add growth-service (invitations, referrals, promos)
...
- Copied as-is from learning_voice_ai_agent/services/growth-service
- 33 tests passing (vitest)
- Fastify 5 + Cosmos DB + Stripe + Zod
- Modules: invitations, referrals, promos
- Port 4001
2026-02-12 11:39:11 -08:00
saravanakumardb1
fc5f2bf296
feat(services): add billing-service (subscriptions, Stripe, usage, licenses, plans)
...
- Copied as-is from learning_voice_ai_agent/services/billing-service
- 32 tests passing (vitest)
- Fastify 5 + Cosmos DB + Stripe + Zod
- Modules: subscriptions, licenses, plans, usage, stripe
- Port 4002
2026-02-12 11:39:05 -08:00
saravanakumardb1
e1ab956ac3
feat(services): add platform-service (auth, audit, flags, notifications, blob)
...
- Copied as-is from learning_voice_ai_agent/services/platform-service
- 55 tests passing (vitest)
- Fastify 5 + Cosmos DB + jose + bcryptjs + Zod
- Modules: auth, audit, flags, notifications, blob, ratelimit
- Port 4003
2026-02-12 11:39:00 -08:00