Commit Graph

83 Commits

Author SHA1 Message Date
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
0d0165e950 ci(extraction): add CI workflow for extraction-service (TS + Python)
- TypeScript job: pnpm build, vitest, tsc --noEmit
- Python job: ruff lint, pytest
- Triggers on services/extraction-service/** and packages/extraction/**
2026-02-14 13:59:29 -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
b035908a5a docs(extraction): update roadmap Phase 3-4 checkboxes with commit links
- Phase 3: LysnrAI admin extraction-client (944609a), MindLyst web extraction-client (b545244)
- Phase 4: docker-compose (bdd9bb1), .env.example updates (bdd9bb1, 944609a)
- Deferred items clearly marked for Phase 5
2026-02-14 13:41:56 -08:00
saravanakumardb1
bdd9bb1aa0 feat(extraction): add extraction-service to docker-compose + .env.example
- docker-compose.yml: extraction-service on port 4005 with Traefik, Loki, healthcheck
- .env.example: PYTHON_SIDECAR_URL, DEFAULT_MODEL_ID, GEMINI_API_KEY
2026-02-14 13:41:15 -08:00
saravanakumardb1
38467a9b96 docs(extraction): update roadmap Phase 1-3 checkboxes with commit links 2026-02-14 13:37:51 -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
4b4720aebd docs(extraction): update roadmap Phase 0 checkboxes with commit c292bb5 2026-02-14 13:32:46 -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
6c71255d19 docs: update documentation 2026-02-14 13:22:25 -08:00
c84185da24 test(react-auth): switch vitest env to happy-dom 2026-02-14 13:15:12 -08:00
b2986744fa chore(husky): run hooks from repo root and avoid npx 2026-02-14 12:55:41 -08:00
468a6c6072 docs(codex): platform+product refactor roadmap (2026-02-14) 2026-02-14 12:09:31 -08:00
saravanakumardb1
d97c4ce4f0 chore(workflows): rename repo workflows to repo_* prefix, add sync-repos, remove pull from backup 2026-02-14 11:25:23 -08:00
2fe2d7fbc6 chore(husky): remove deprecated husky.sh sourcing 2026-02-14 09:56:40 -08:00
06aca239f4 chore(security): add secret scanning + playbook 2026-02-14 00:24:41 -08:00
saravanakumardb1
60f0703049 docs(roadmap): audit and correct all task statuses and test counts
- Check 5 items that were actually done: 4.20 (CSS synced), 2C.22 (health-check), 6.27 (depcheck), 6.28 (git clean), 7.6 (testing pkg)
- Fix test counts: 6.1 → 652 (5 pre-existing Pydantic failures), 6.11 → 281
- Fix summary table: 2A 25→24, 2C 21→22, 6 23→21
- Total: 244/278 = 88% (was incorrectly 248/278 = 89%)
2026-02-13 01:00:58 -08:00
saravanakumardb1
54e062b989 chore: remove unused devDeps found by depcheck
- react-auth: removed @testing-library/jest-dom (not imported)
- testing: removed @bytelyst/errors, @fastify/cors (not imported)
2026-02-13 00:17:04 -08:00
saravanakumardb1
13e53d46bf docs: add MIGRATION_GUIDE.md + update ROADMAP to 89% (248/278)
- MIGRATION_GUIDE.md: step-by-step for adopting @bytelyst/* in new projects
- ROADMAP: Phase 3B 25/28 (user/tracker keep custom auth, removed unused deps)
- ROADMAP: Phase 6 23/28 (docs updated, cleanup done, E2E needs running services)
- Test count: 277 tests across 16 suites
2026-02-13 00:09:01 -08:00
saravanakumardb1
4cd5bec42a ci: update CI/CD configuration 2026-02-13 00:02:54 -08:00
saravanakumardb1
a34bc3dc7f ci: update CI/CD configuration 2026-02-12 23:56:23 -08:00
saravanakumardb1
fd6e3d7e8e docs: update AGENTS.md + ROADMAP.md to 83% complete (232/278)
- AGENTS.md: added fastify-core, logger, testing to layout; updated dashboard consumer table; updated test count to 277
- ROADMAP.md: Phase 2B complete (29/29), Phase 5 Docker tasks (15/23), Phase 6 regression (17/28)
- Cross-repo regression verified: 277 tests pass, all 3 dashboards typecheck clean
2026-02-12 23:51:53 -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
33a646c0fe docs(roadmap): note CI workflows disabled (billing paused) 2026-02-12 23:30:58 -08:00
saravanakumardb1
a383b245e5 ci: disable GitHub Actions and add manual quality checks
- Disable CI workflows due to billing issues
- Add quick-check.sh script for 5-min pre-push validation
- Add MANUAL_CI.md with comprehensive instructions
- Update README with CI disabled notice
- Production readiness workflow updated with manual check note
2026-02-12 23:13:07 -08:00
saravanakumardb1
ac24a6ba20 docs(roadmap): update to 77% complete (215/278 tasks)
This session:
- fastify-core: integrated into all 4 services (208 lines eliminated)
- react-auth: 10 tests added (jsdom + React Testing Library)
- @bytelyst/testing: new package with shared mocks, fixtures, helpers (10 tests)
- CI workflow: .github/workflows/ci.yml (build + test + typecheck, NO deploy)
- Total tests: 266 (was 246)
2026-02-12 23:01:59 -08:00
saravanakumardb1
88d3196ce0 ci: add GitHub Actions workflow for common platform
Three parallel job groups (NO deployment):
- build-and-test: full build + typecheck + test + lint
- package-tests: matrix of 9 @bytelyst/* packages
- service-tests: matrix of 4 @lysnrai/* services

Uses pnpm v10, Node 20, dependency caching.
Runs on push/PR to main with concurrency cancellation.
2026-02-12 23:00:39 -08:00
saravanakumardb1
7ffc60c490 feat(testing): create @bytelyst/testing shared package with 10 tests
Exports:
- createCosmosMocks(): full Cosmos DB mock factory for vitest
- TEST_USERS, TEST_JWT_SECRET, createTestTokenPayload(): auth fixtures
- injectGet/Post/Patch/Delete(): Fastify inject wrappers
- expectHealthOk(): health endpoint assertion helper
2026-02-12 22:59:28 -08:00
saravanakumardb1
428e973548 test(react-auth): add 10 tests with jsdom + React Testing Library
Tests: createAuthProvider factory, AuthProvider rendering, login/logout
flows, localStorage persistence, onLoginFallback, useAuth outside provider,
custom storage prefix.
2026-02-12 22:55:44 -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
a4099c8f9b docs(roadmap): update to 72% complete (201/278 tasks)
New completions this session:
- Package tests: cosmos (12), config (15), auth (10), api-client (10), design-tokens (11)
- @bytelyst/fastify-core: new package with 8 tests (createServiceApp factory)
- @bytelyst/react-auth: enhanced with onLoginFallback, admin dashboard refactored
- Total tests: 246 (was 180)
2026-02-12 22:23:53 -08:00
saravanakumardb1
11e79aa4f9 feat(react-auth): add onLoginFallback to createAuthProvider config
Allows dashboards to provide fallback login logic (e.g. mock credentials)
when the API is unavailable. Used by admin-dashboard-web.
2026-02-12 22:21:25 -08:00
saravanakumardb1
832eccafed feat: add package tests (58 new) + @bytelyst/fastify-core package
Package tests added:
- @bytelyst/cosmos: 12 tests (client singleton, env vars, container registry)
- @bytelyst/config: 15 tests (base schema, loadConfig, product identity)
- @bytelyst/auth: 10 tests (JWT round-trip, password hash/verify)
- @bytelyst/api-client: 10 tests (fetch, safeFetch, auth injection)
- @bytelyst/design-tokens: 11 tests (loadTokens, generated file checks)

New package:
- @bytelyst/fastify-core: 8 tests (createServiceApp factory with CORS,
  x-request-id, health endpoint, ServiceError handler)

Total: 246 tests passing (was 180)
2026-02-12 22:17:17 -08:00
saravanakumardb1
81452bc157 docs(roadmap): update task statuses — 59% complete (165/278 tasks)
Cross-referenced every task against actual codebase state:
- Phase 0: 14/14  (scaffolding complete)
- Phase 1A: 22/23  (errors — Docker verify pending)
- Phase 1B: 29/33 ⚠️ (cosmos — package tests pending)
- Phase 2A: 22/25 ⚠️ (config — package tests pending)
- Phase 2B: 22/29 ⚠️ (auth — tracker + E2E pending)
- Phase 2C: 0/24 🔲 (fastify-core — not started)
- Phase 3A: 13/17 ⚠️ (api-client — tests pending)
- Phase 3B: 6/28 ⚠️ (react-auth — extracted, not integrated)
- Phase 4: 19/24 ⚠️ (design-tokens — tests pending)
- Phase 5: 3/23 🔲 (CI/Docker — mostly not started)
- Phase 6: 15/28 ⚠️ (regression done, E2E pending)
- Bonus: @bytelyst/logger (not in original roadmap)
2026-02-12 22:10:24 -08:00
saravanakumardb1
d2cd0aa321 docs(skills): add dual-network setup guide
Documents NETWORK=corp|home env var approach for seamless
switching between corporate proxy and home network.
Covers npm, pnpm, pip, curl, Node.js, lock file cleanup.
2026-02-12 20:52:06 -08:00
saravanakumardb1
2c588c51a3 refactor(scripts): simplify switch-network to env-var based approach
Single env var NETWORK=corp|home controls all proxy config.
Source from ~/.zshrc — sets http_proxy, NPM_CONFIG_REGISTRY,
PIP_TRUSTED_HOST, NODE_TLS_REJECT_UNAUTHORIZED automatically.
No more ~/.npmrc rewriting.
2026-02-12 20:38:57 -08:00
saravanakumardb1
97b6f4b8d1 chore: remove AT&T-specific refs, add dual-network switch script
- Replace hardcoded /Users/sd9235/ paths with $HOME in all SKILLS docs
- Use WORKSPACE_DIR variable in backup-main.sh (auto-resolves from script location)
- Genericize 'Forcepoint CertChecker' / 'corporate proxy' to 'SSL-intercepting proxy'
- Add scripts/switch-network.sh for toggling npm between corporate proxy and home
- No functional code changes — only comments, docs, and paths
2026-02-12 20:34:48 -08:00
saravanakumardb1
2e86353e77 fix(backup): show commits since last backup instead of total count 2026-02-12 20:17:46 -08:00
saravanakumardb1
66899f3891 fix(backup): fix set -e crash on arithmetic increment and repo errors 2026-02-12 20:14:38 -08:00
saravanakumardb1
f82afb3872 fix(backup): fix duplicate detection, add push + rich summary table
Bug fix: cut -d'/' -f2 truncated 'origin/backup/main-*' to just
'backup', so rev-parse always failed and duplicate detection never
worked. Fixed with sed to strip 'origin/' prefix properly.

New features:
- Push unpushed main commits before backing up
- Fetch remote backup refs before comparing
- Rich summary table: repo, status, commit count, push status, last msg
- Color-coded output with dim/bold formatting
- Proper cleanup using sed instead of broken cut
2026-02-12 20:13:57 -08:00
saravanakumardb1
f2a5dcecda fix: improve backup script error handling
- Check if directory is a git repository before proceeding
- Add fallback for git switch (use checkout if switch fails)
- Handle offline/no-origin scenarios gracefully
- Use local HEAD instead of origin/main for comparison
- Add error handling for push operations
- Continue backup locally if remote push fails
2026-02-12 20:02:21 -08:00
saravanakumardb1
ae2e757fb2 feat: add backup main branch workflow with smart duplicate detection
- Create Backup Main Branch skill with comprehensive documentation
- Add Windsurf workflow for easy access
- Implement bash script with multi-repo support
- Smart detection to avoid duplicate backups
- Automatic cleanup of old backups (keeps 7 days)
- Color-coded output for better visibility
- Always returns to main branch after backup
2026-02-12 19:54:29 -08:00
saravanakumardb1
85e0689021 chore: remove test file 2026-02-12 17:29:42 -08:00
saravanakumardb1
61f61862fe test: pre-commit in common_plat 2026-02-12 17:29:36 -08:00
saravanakumardb1
c3b869ceb9 feat: create AI.dev/SKILLS repository with reusable development skills
- Add 15 comprehensive skills extracted from Windsurf workflows
- Cover debugging, testing, releases, deployment, security, and documentation
- Each skill includes step-by-step instructions and copy-pasteable commands
- Skills organized by category with cross-references and difficulty levels
2026-02-12 17:13:16 -08:00