docs: update agent docs — add missing packages, fix stale service refs, update test counts
This commit is contained in:
parent
4d78c45e85
commit
cb728d3dfe
@ -17,7 +17,7 @@ Architecture: pnpm monorepo with @bytelyst/* packages + @lysnrai/* Fastify servi
|
|||||||
10. After changes, verify: `pnpm build && pnpm test`
|
10. After changes, verify: `pnpm build && pnpm test`
|
||||||
|
|
||||||
## Key File Locations
|
## Key File Locations
|
||||||
- Packages: `packages/` (@bytelyst/errors, cosmos, config, auth, api-client, react-auth, design-tokens)
|
- Packages: `packages/` (@bytelyst/errors, cosmos, config, auth, api-client, fastify-core, react-auth, logger, testing, blob, extraction, monitoring, design-tokens)
|
||||||
- Services: `services/` (platform-service, billing-service, growth-service, tracker-service)
|
- Services: `services/` (platform-service :4003, extraction-service :4005)
|
||||||
- Base config: `tsconfig.base.json`
|
- Base config: `tsconfig.base.json`
|
||||||
- Full guide: `AGENTS.md`
|
- Full guide: `AGENTS.md`
|
||||||
|
|||||||
16
.cursorrules
16
.cursorrules
@ -13,15 +13,19 @@
|
|||||||
## Monorepo Structure
|
## Monorepo Structure
|
||||||
- packages/errors/ → Typed HTTP errors (400–429)
|
- packages/errors/ → Typed HTTP errors (400–429)
|
||||||
- packages/cosmos/ → Azure Cosmos DB client singleton
|
- packages/cosmos/ → Azure Cosmos DB client singleton
|
||||||
- packages/config/ → Zod env loader + product identity
|
- packages/config/ → Zod env loader + product identity + AKV resolver
|
||||||
- packages/auth/ → JWT, middleware, password hashing
|
- packages/auth/ → JWT, middleware, password hashing
|
||||||
- packages/api-client/ → Fetch wrapper with auth injection
|
- packages/api-client/ → Fetch wrapper with auth injection
|
||||||
|
- packages/fastify-core/ → createServiceApp() + startService()
|
||||||
- packages/react-auth/ → React auth context factory
|
- packages/react-auth/ → React auth context factory
|
||||||
|
- packages/logger/ → Structured logging (pino)
|
||||||
|
- packages/testing/ → Test mocks, Fastify inject helpers
|
||||||
|
- packages/blob/ → Azure Blob Storage client + SAS
|
||||||
|
- packages/extraction/ → createExtractionClient(), shared types
|
||||||
|
- packages/monitoring/ → Health-check utilities
|
||||||
- packages/design-tokens/ → Cross-platform tokens (JSON → CSS/TS/Kotlin/Swift)
|
- packages/design-tokens/ → Cross-platform tokens (JSON → CSS/TS/Kotlin/Swift)
|
||||||
- services/platform-service/ → Auth, audit, flags, blob (port 4003)
|
- services/platform-service/ → Consolidated: auth, audit, flags, blob, subscriptions, stripe, usage, plans, licenses, invitations, referrals, promos, items, comments, votes, public (port 4003)
|
||||||
- services/billing-service/ → Subscriptions, Stripe, usage (port 4002)
|
- services/extraction-service/ → Text extraction + Python sidecar (port 4005)
|
||||||
- services/growth-service/ → Invitations, referrals, promos (port 4001)
|
|
||||||
- services/tracker-service/ → Items, comments, votes, public roadmap (port 4004)
|
|
||||||
- services/monitoring/ → Loki + Grafana, health-check
|
- services/monitoring/ → Loki + Grafana, health-check
|
||||||
|
|
||||||
## TypeScript Rules
|
## TypeScript Rules
|
||||||
@ -58,7 +62,7 @@
|
|||||||
|
|
||||||
## Key Commands
|
## Key Commands
|
||||||
- pnpm build → build all packages + services
|
- pnpm build → build all packages + services
|
||||||
- pnpm test → run all tests (165+)
|
- pnpm test → run all tests (234+)
|
||||||
- pnpm typecheck → type-check everything
|
- pnpm typecheck → type-check everything
|
||||||
- pnpm --filter @lysnrai/platform-service dev → run one service
|
- pnpm --filter @lysnrai/platform-service dev → run one service
|
||||||
- pnpm --filter @bytelyst/design-tokens generate → regen tokens
|
- pnpm --filter @bytelyst/design-tokens generate → regen tokens
|
||||||
|
|||||||
@ -12,8 +12,8 @@ Stack: TypeScript, ESM, pnpm workspace, Fastify 5, Vitest, Azure Cosmos DB
|
|||||||
- Package manager: pnpm — NEVER use npm
|
- Package manager: pnpm — NEVER use npm
|
||||||
|
|
||||||
## Key Paths
|
## Key Paths
|
||||||
- Packages: packages/ (@bytelyst/errors, cosmos, config, auth, api-client, react-auth, design-tokens)
|
- Packages: packages/ (@bytelyst/errors, cosmos, config, auth, api-client, fastify-core, react-auth, logger, testing, blob, extraction, monitoring, design-tokens)
|
||||||
- Services: services/ (platform 4003, billing 4002, growth 4001, tracker 4004)
|
- Services: services/ (platform-service 4003, extraction-service 4005)
|
||||||
- Base TS config: tsconfig.base.json (ES2022, NodeNext, strict)
|
- Base TS config: tsconfig.base.json (ES2022, NodeNext, strict)
|
||||||
- Workspace: pnpm-workspace.yaml
|
- Workspace: pnpm-workspace.yaml
|
||||||
|
|
||||||
|
|||||||
38
AGENTS.md
38
AGENTS.md
@ -26,13 +26,16 @@ learning_ai_common_plat/
|
|||||||
├── packages/ # @bytelyst/* shared libraries
|
├── packages/ # @bytelyst/* shared libraries
|
||||||
│ ├── errors/ # Typed HTTP service errors (400–429)
|
│ ├── errors/ # Typed HTTP service errors (400–429)
|
||||||
│ ├── cosmos/ # Azure Cosmos DB client singleton + container registry
|
│ ├── cosmos/ # Azure Cosmos DB client singleton + container registry
|
||||||
│ ├── config/ # Zod-based env loader + product identity (loadProductIdentity)
|
│ ├── config/ # Zod-based env loader + product identity + AKV resolver
|
||||||
│ ├── auth/ # JWT utilities, auth middleware, password hashing
|
│ ├── auth/ # JWT utilities, auth middleware, password hashing
|
||||||
│ ├── api-client/ # Configurable fetch wrapper with auth token injection
|
│ ├── api-client/ # Configurable fetch wrapper with auth token injection
|
||||||
│ ├── fastify-core/ # createServiceApp() factory + startService() helper
|
│ ├── fastify-core/ # createServiceApp() factory + startService() helper
|
||||||
│ ├── react-auth/ # React auth context factory (typed provider + hook)
|
│ ├── react-auth/ # React auth context factory (typed provider + hook)
|
||||||
│ ├── logger/ # Structured logging wrapper
|
│ ├── logger/ # Structured logging wrapper (pino-based)
|
||||||
│ ├── testing/ # Shared test mocks, fixtures, Fastify inject helpers
|
│ ├── testing/ # Shared test mocks, fixtures, Fastify inject helpers
|
||||||
|
│ ├── blob/ # Azure Blob Storage client + SAS token helpers
|
||||||
|
│ ├── extraction/ # createExtractionClient(), shared types for extraction consumers
|
||||||
|
│ ├── monitoring/ # Health-check utilities, Loki/Grafana helpers
|
||||||
│ └── design-tokens/ # Cross-platform tokens (JSON → CSS/TS/Kotlin/Swift)
|
│ └── design-tokens/ # Cross-platform tokens (JSON → CSS/TS/Kotlin/Swift)
|
||||||
│ ├── tokens/bytelyst.tokens.json # ← CANONICAL SOURCE
|
│ ├── tokens/bytelyst.tokens.json # ← CANONICAL SOURCE
|
||||||
│ ├── scripts/generate.ts # Token generator
|
│ ├── scripts/generate.ts # Token generator
|
||||||
@ -159,7 +162,7 @@ pnpm install
|
|||||||
# ── Build all packages + services ──────────────────
|
# ── Build all packages + services ──────────────────
|
||||||
pnpm build
|
pnpm build
|
||||||
|
|
||||||
# ── Run all tests (277 tests across all workspaces) ─
|
# ── Run all tests ────────────────────────────────
|
||||||
pnpm test
|
pnpm test
|
||||||
|
|
||||||
# ── Type-check everything ──────────────────────────
|
# ── Type-check everything ──────────────────────────
|
||||||
@ -169,10 +172,8 @@ pnpm typecheck
|
|||||||
pnpm clean
|
pnpm clean
|
||||||
|
|
||||||
# ── Run a specific service in dev mode ─────────────
|
# ── Run a specific service in dev mode ─────────────
|
||||||
pnpm --filter @lysnrai/platform-service dev
|
pnpm --filter @lysnrai/platform-service dev # port 4003
|
||||||
pnpm --filter @lysnrai/billing-service dev
|
pnpm --filter @lysnrai/extraction-service dev # port 4005
|
||||||
pnpm --filter @lysnrai/growth-service dev
|
|
||||||
pnpm --filter @lysnrai/tracker-service dev
|
|
||||||
|
|
||||||
# ── Run tests for one workspace ────────────────────
|
# ── Run tests for one workspace ────────────────────
|
||||||
pnpm --filter @lysnrai/platform-service test
|
pnpm --filter @lysnrai/platform-service test
|
||||||
@ -265,16 +266,19 @@ DEFAULT_PRODUCT_ID=lysnrai
|
|||||||
```
|
```
|
||||||
@bytelyst/errors ← no deps (foundation)
|
@bytelyst/errors ← no deps (foundation)
|
||||||
@bytelyst/cosmos ← peers: @azure/cosmos
|
@bytelyst/cosmos ← peers: @azure/cosmos
|
||||||
@bytelyst/config ← peers: zod
|
@bytelyst/config ← peers: zod; includes AKV resolver (resolveKeyVaultSecrets)
|
||||||
@bytelyst/auth ← peers: jose, bcryptjs
|
@bytelyst/auth ← peers: jose, bcryptjs
|
||||||
@bytelyst/api-client ← no deps
|
@bytelyst/api-client ← no deps
|
||||||
@bytelyst/react-auth ← deps: @bytelyst/api-client; peers: react
|
@bytelyst/react-auth ← deps: @bytelyst/api-client; peers: react
|
||||||
|
@bytelyst/blob ← peers: @azure/storage-blob
|
||||||
|
@bytelyst/extraction ← no deps (types + client factory)
|
||||||
|
@bytelyst/monitoring ← no deps (health-check utilities)
|
||||||
|
@bytelyst/fastify-core ← deps: fastify; createServiceApp() + startService()
|
||||||
|
@bytelyst/logger ← deps: pino
|
||||||
|
@bytelyst/testing ← deps: vitest; shared mocks + Fastify inject helpers
|
||||||
@bytelyst/design-tokens ← no deps (standalone generator)
|
@bytelyst/design-tokens ← no deps (standalone generator)
|
||||||
|
|
||||||
@lysnrai/platform-service ← @bytelyst/{config, cosmos, errors}
|
@lysnrai/platform-service ← @bytelyst/{fastify-core, config, cosmos, errors, auth, blob}
|
||||||
@lysnrai/billing-service ← @bytelyst/{config, cosmos, errors}
|
|
||||||
@lysnrai/growth-service ← @bytelyst/{config, cosmos, errors}
|
|
||||||
@lysnrai/tracker-service ← @bytelyst/{config, cosmos, errors}
|
|
||||||
@lysnrai/extraction-service ← @bytelyst/{fastify-core, config, cosmos, errors, auth}
|
@lysnrai/extraction-service ← @bytelyst/{fastify-core, config, cosmos, errors, auth}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -295,12 +299,12 @@ Build order: packages first (they have no inter-deps), then services. `pnpm buil
|
|||||||
|
|
||||||
| Service / Package | Tests | Runner |
|
| Service / Package | Tests | Runner |
|
||||||
| ------------------ | -------- | ------ |
|
| ------------------ | -------- | ------ |
|
||||||
| platform-service | 55 | vitest |
|
| platform-service | 158 | vitest |
|
||||||
| tracker-service | 45 | vitest |
|
|
||||||
| extraction-service | 46 | vitest |
|
| extraction-service | 46 | vitest |
|
||||||
| growth-service | 33 | vitest |
|
| packages (various) | ~30 | vitest |
|
||||||
| billing-service | 32 | vitest |
|
| **Total** | **234+** | |
|
||||||
| **Total** | **211+** | |
|
|
||||||
|
> Note: billing-service, growth-service, and tracker-service were consolidated into platform-service (Feb 2026).
|
||||||
|
|
||||||
## 12. Common Pitfalls
|
## 12. Common Pitfalls
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user