chore(workflows): add onboard-trading-product workflow
This commit is contained in:
parent
c7f45611a8
commit
5fd837358d
256
.windsurf/workflows/onboard-trading-product.md
Normal file
256
.windsurf/workflows/onboard-trading-product.md
Normal file
@ -0,0 +1,256 @@
|
||||
---
|
||||
description: Onboard ByteLyst Trading into the common platform product registry and generate missing ecosystem artifacts
|
||||
---
|
||||
|
||||
# Onboard ByteLyst Trading Product
|
||||
|
||||
Fully registers the `invttrdg` product in the ByteLyst ecosystem. Run this once to close the onboarding gap.
|
||||
|
||||
**Pre-requisites:** Both repos must be checked out as siblings:
|
||||
- `learning_ai_invt_trdg` (this repo)
|
||||
- `learning_ai_common_plat` (common platform)
|
||||
|
||||
---
|
||||
|
||||
## Phase 1 — Create the canonical product manifest in common platform
|
||||
|
||||
### 1. Create `products/invttrdg/product.json` in the common platform
|
||||
|
||||
Create the file `../learning_ai_common_plat/products/invttrdg/product.json` with the full product manifest. The manifest MUST include all of the following sections derived from the trading repo's actual codebase:
|
||||
|
||||
**Identity:**
|
||||
- `productId`: `"invttrdg"`
|
||||
- `displayName`: `"ByteLyst Trading"`
|
||||
- `name`: `"ByteLyst Trading"`
|
||||
- `bundleId`: `{ "ios": "com.bytelyst.trading", "android": "com.bytelyst.trading" }`
|
||||
- `domain`: `"trading.bytelyst.ai"`
|
||||
- `description`: `"AI-assisted trading operations with automated strategies, backtesting, and portfolio management"`
|
||||
- `version`: `"0.1.0"`
|
||||
|
||||
**Platforms:** `["web", "ios", "android"]`
|
||||
- `primarySurface`: `"web"`
|
||||
- `mobileCompanion`: `true`
|
||||
|
||||
**Theme** (use the ByteLyst default palette — same as LysnrAI):
|
||||
```json
|
||||
{
|
||||
"primary": "#5AE68C",
|
||||
"secondary": "#5A8CFF",
|
||||
"accent": "#2EE6D6",
|
||||
"background": "#06070A",
|
||||
"surface": "#121725",
|
||||
"text": "#EFF4FF",
|
||||
"error": "#FF6E6E",
|
||||
"warning": "#F59E0B",
|
||||
"success": "#34D399"
|
||||
}
|
||||
```
|
||||
|
||||
**Features:**
|
||||
```json
|
||||
{
|
||||
"automatedTrading": true,
|
||||
"backtesting": true,
|
||||
"manualEntries": true,
|
||||
"capitalLedger": true,
|
||||
"strategyPresets": true,
|
||||
"tradingControls": true,
|
||||
"portfolioSnapshots": true,
|
||||
"auditTrail": true,
|
||||
"dynamicConfig": true,
|
||||
"alertFeed": true
|
||||
}
|
||||
```
|
||||
|
||||
**Cosmos containers** (13 containers, derived from actual backend repository constants):
|
||||
```json
|
||||
{
|
||||
"containers": [
|
||||
{ "name": "trade_orders", "partitionKey": "/productId" },
|
||||
{ "name": "trade_history", "partitionKey": "/productId" },
|
||||
{ "name": "manual_entries", "partitionKey": "/productId" },
|
||||
{ "name": "reconciliation_backfill_audit", "partitionKey": "/productId" },
|
||||
{ "name": "trade_profiles", "partitionKey": "/productId" },
|
||||
{ "name": "trading_users", "partitionKey": "/productId" },
|
||||
{ "name": "strategy_presets", "partitionKey": "/productId" },
|
||||
{ "name": "capital_ledgers", "partitionKey": "/productId" },
|
||||
{ "name": "bot_state_snapshots", "partitionKey": "/productId" },
|
||||
{ "name": "trading_controls", "partitionKey": "/productId" },
|
||||
{ "name": "audit-events", "partitionKey": "/productId" },
|
||||
{ "name": "dynamic_config", "partitionKey": "/productId" },
|
||||
{ "name": "runtime_locks", "partitionKey": "/productId" }
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
**Flags:**
|
||||
```json
|
||||
[
|
||||
{ "key": "backtest-enabled", "defaultValue": false, "description": "Enable backtesting engine" },
|
||||
{ "key": "tab-marketplace", "defaultValue": true, "description": "Show marketplace tab" },
|
||||
{ "key": "tab-membership", "defaultValue": true, "description": "Show membership tab" },
|
||||
{ "key": "automated-trading", "defaultValue": false, "description": "Enable automated trading strategies" }
|
||||
]
|
||||
```
|
||||
|
||||
**Ports:**
|
||||
```json
|
||||
{
|
||||
"service": 4018,
|
||||
"dashboard": 5173
|
||||
}
|
||||
```
|
||||
|
||||
**Legacy identity fields** (for `@bytelyst/config` `loadProductIdentity()` compatibility):
|
||||
- `licensePrefix`: `"TRADING"`
|
||||
- `configDirName`: `".ByteLystTrading"`
|
||||
- `envVarPrefix`: `"TRADING"`
|
||||
- `packageName`: `"bytelyst-trading"`
|
||||
|
||||
### 2. Verify the manifest validates against the ProductManifest Zod schema
|
||||
|
||||
// turbo
|
||||
|
||||
```bash
|
||||
cd /Users/saravana/BytelystAI/learning_ai/learning_ai_common_plat && node -e "
|
||||
const fs = require('fs');
|
||||
const raw = fs.readFileSync('products/invttrdg/product.json', 'utf-8');
|
||||
const json = JSON.parse(raw);
|
||||
console.log('productId:', json.productId);
|
||||
console.log('displayName:', json.displayName);
|
||||
console.log('containers:', json.cosmos?.containers?.length || 0);
|
||||
console.log('flags:', json.flags?.length || 0);
|
||||
console.log('features:', Object.keys(json.features || {}).length);
|
||||
console.log('theme keys:', Object.keys(json.theme || {}).length);
|
||||
console.log('ports:', JSON.stringify(json.ports));
|
||||
console.log('✅ Manifest looks complete');
|
||||
"
|
||||
```
|
||||
|
||||
Expect: productId=invttrdg, 13 containers, 4 flags, 10 features, 9 theme keys, ports with service=4018.
|
||||
|
||||
---
|
||||
|
||||
## Phase 2 — Enrich the trading repo's local product.json
|
||||
|
||||
### 3. Update `shared/product.json` in the trading repo
|
||||
|
||||
Sync the trading repo's `shared/product.json` to match the canonical manifest created in Step 1. Add the missing `theme`, `cosmos`, `flags`, `features`, and `ports` sections. Keep `id` as an alias for `productId` if it already exists.
|
||||
|
||||
### 4. Verify the updated local manifest
|
||||
|
||||
// turbo
|
||||
|
||||
```bash
|
||||
cd /Users/saravana/BytelystAI/learning_ai/learning_ai_invt_trdg && node -e "
|
||||
const fs = require('fs');
|
||||
const raw = fs.readFileSync('shared/product.json', 'utf-8');
|
||||
const json = JSON.parse(raw);
|
||||
const checks = [
|
||||
['productId', json.productId === 'invttrdg'],
|
||||
['theme', Object.keys(json.theme || {}).length === 9],
|
||||
['cosmos', (json.cosmos?.containers?.length || 0) >= 13],
|
||||
['flags', (json.flags?.length || 0) >= 4],
|
||||
['features', Object.keys(json.features || {}).length >= 10],
|
||||
['ports', json.ports?.service === 4018],
|
||||
];
|
||||
checks.forEach(([k, ok]) => console.log(ok ? '✅' : '❌', k));
|
||||
if (checks.every(([, ok]) => ok)) console.log('All checks passed');
|
||||
else { console.error('Some checks failed'); process.exit(1); }
|
||||
"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Phase 3 — Generate AGENTS.md for the trading repo
|
||||
|
||||
### 5. Generate AGENTS.md
|
||||
|
||||
Create `AGENTS.md` in the trading repo root. Follow the same structure as other ByteLyst product repos (MindLyst, ChronoMind, NoteLett). The AGENTS.md must include:
|
||||
|
||||
- Project overview (ByteLyst Trading — AI-assisted trading operations)
|
||||
- Repo layout tree (backend/, web/, mobile/, shared/, scripts/, docs/)
|
||||
- Tech stack table (Fastify 5 backend, Vite + React web, Expo mobile)
|
||||
- Critical rules (productId, Cosmos conventions, commit format, code style)
|
||||
- Build & run commands (`pnpm build`, `pnpm test`, `pnpm typecheck`, `pnpm verify`)
|
||||
- Coding conventions (MUST follow / MUST NOT do)
|
||||
|
||||
Scan the actual repo structure to populate the layout tree accurately. Reference:
|
||||
- `backend/src/` modules and services
|
||||
- `web/src/` components, views, backtest, assets
|
||||
- `mobile/` app, components, store
|
||||
- `shared/` product.json, feature-flags.ts, control-plane.ts, platform-clients.ts
|
||||
|
||||
### 6. Verify AGENTS.md exists and has minimum content
|
||||
|
||||
// turbo
|
||||
|
||||
```bash
|
||||
cd /Users/saravana/BytelystAI/learning_ai/learning_ai_invt_trdg && wc -l AGENTS.md && head -5 AGENTS.md
|
||||
```
|
||||
|
||||
Expect: File exists with 100+ lines. First line should be `# AGENTS.md`.
|
||||
|
||||
---
|
||||
|
||||
## Phase 4 — Update common platform ecosystem references
|
||||
|
||||
### 7. Add trading to the common platform AGENTS.md product consumer list
|
||||
|
||||
In `../learning_ai_common_plat/AGENTS.md`, find the `Product consumers` row in the Project Identity table and add `[ByteLyst Trading](../learning_ai_invt_trdg)` to the list.
|
||||
|
||||
### 8. Verify the AGENTS.md update
|
||||
|
||||
// turbo
|
||||
|
||||
```bash
|
||||
grep -c 'learning_ai_invt_trdg\|ByteLyst Trading\|invttrdg' /Users/saravana/BytelystAI/learning_ai/learning_ai_common_plat/AGENTS.md
|
||||
```
|
||||
|
||||
Expect: At least 1 match.
|
||||
|
||||
---
|
||||
|
||||
## Phase 5 — Commit and verify
|
||||
|
||||
### 9. Commit the common platform changes
|
||||
|
||||
```bash
|
||||
cd /Users/saravana/BytelystAI/learning_ai/learning_ai_common_plat && git add products/invttrdg/product.json AGENTS.md && git commit -m "feat(products): onboard ByteLyst Trading (invttrdg) into product registry"
|
||||
```
|
||||
|
||||
### 10. Commit the trading repo changes
|
||||
|
||||
```bash
|
||||
cd /Users/saravana/BytelystAI/learning_ai/learning_ai_invt_trdg && git add shared/product.json AGENTS.md && git commit -m "feat(onboard): add full product manifest and AGENTS.md"
|
||||
```
|
||||
|
||||
### 11. Run trading repo verification
|
||||
|
||||
// turbo
|
||||
|
||||
```bash
|
||||
cd /Users/saravana/BytelystAI/learning_ai/learning_ai_invt_trdg && pnpm typecheck
|
||||
```
|
||||
|
||||
### 12. Final ecosystem check — verify all 9 products exist
|
||||
|
||||
// turbo
|
||||
|
||||
```bash
|
||||
ls -1 /Users/saravana/BytelystAI/learning_ai/learning_ai_common_plat/products/ | sort
|
||||
```
|
||||
|
||||
Expect: 9 directories — chronomind, efforise, invttrdg, jarvisjr, lysnrai, mindlyst, nomgap, notelett, peakpulse.
|
||||
|
||||
---
|
||||
|
||||
## Completion Checklist
|
||||
|
||||
After all steps pass:
|
||||
- [ ] `products/invttrdg/product.json` exists in common platform with full schema
|
||||
- [ ] `shared/product.json` in trading repo enriched with theme, cosmos, flags, features, ports
|
||||
- [ ] `AGENTS.md` exists in trading repo root
|
||||
- [ ] Common platform `AGENTS.md` lists ByteLyst Trading as a product consumer
|
||||
- [ ] Both repos committed cleanly
|
||||
- [ ] `pnpm typecheck` passes in trading repo
|
||||
Loading…
Reference in New Issue
Block a user