-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmanifest-008.json
More file actions
208 lines (208 loc) · 7.72 KB
/
manifest-008.json
File metadata and controls
208 lines (208 loc) · 7.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
{
"issue": "exploration-008",
"project": "nykaa-personalisation-mvp",
"phases": [
{
"id": "phase-1",
"name": "Database Foundation",
"parallel": false,
"depends_on": [],
"tasks": [
{
"id": "T1",
"name": "Create Supabase schema (experiment_cohorts, user_affinity_profiles, session_events) with RLS and indexes",
"agent": "backend-engineer",
"files_to_create": [
"supabase/migrations/001_personalisation_schema.sql"
],
"files_to_modify": [],
"verification": "psql $DATABASE_URL -c \"\\dt\" | grep experiment_cohorts && psql $DATABASE_URL -c \"\\dt\" | grep user_affinity_profiles && psql $DATABASE_URL -c \"\\dt\" | grep session_events",
"test_file": "__tests__/db/schema.test.ts"
},
{
"id": "T2",
"name": "Seed experiment_cohorts for staging test users",
"agent": "backend-engineer",
"files_to_create": [
"supabase/seed/seed-cohorts.ts"
],
"files_to_modify": [],
"verification": "ts-node supabase/seed/seed-cohorts.ts && psql $DATABASE_URL -c \"SELECT COUNT(*) FROM experiment_cohorts;\"",
"test_file": null
}
]
},
{
"id": "phase-2",
"name": "Core API",
"parallel": false,
"depends_on": ["phase-1"],
"tasks": [
{
"id": "T3",
"name": "Implement GET /api/personalisation/shelf (PersonalisationService + CohortService)",
"agent": "backend-engineer",
"files_to_create": [
"src/app/api/personalisation/shelf/route.ts",
"src/lib/personalisation/PersonalisationService.ts",
"src/lib/personalisation/CohortService.ts"
],
"files_to_modify": [],
"verification": "curl -H 'Authorization: Bearer $TEST_JWT' http://localhost:3000/api/personalisation/shelf | jq '.products | length'",
"test_file": "__tests__/api/personalisation/shelf.test.ts"
},
{
"id": "T4",
"name": "Implement POST /api/personalisation/ingest-event (EventIngestionService)",
"agent": "backend-engineer",
"files_to_create": [
"src/app/api/personalisation/ingest-event/route.ts",
"src/lib/personalisation/EventIngestionService.ts"
],
"files_to_modify": [],
"verification": "curl -X POST -H 'Authorization: Bearer $TEST_JWT' -H 'Content-Type: application/json' -d '{\"productId\":\"p1\",\"brandId\":\"b1\",\"categoryId\":\"c1\"}' http://localhost:3000/api/personalisation/ingest-event | jq '.ok'",
"test_file": "__tests__/api/personalisation/ingest-event.test.ts"
},
{
"id": "T5",
"name": "Implement GET /api/personalisation/rerank (RerankEngine + Nykaa Catalog API)",
"agent": "backend-engineer",
"files_to_create": [
"src/app/api/personalisation/rerank/route.ts",
"src/lib/personalisation/RerankEngine.ts",
"src/lib/catalog/NykaaCatalogClient.ts"
],
"files_to_modify": [],
"verification": "curl -H 'Authorization: Bearer $TEST_JWT' 'http://localhost:3000/api/personalisation/rerank?q=dress' | jq '.results | length'",
"test_file": "__tests__/api/personalisation/rerank.test.ts"
},
{
"id": "T6",
"name": "Implement POST /api/admin/rebuild-affinity (nightly cron, CRON_SECRET auth)",
"agent": "backend-engineer",
"files_to_create": [
"src/app/api/admin/rebuild-affinity/route.ts",
"src/lib/personalisation/AffinityBuilder.ts"
],
"files_to_modify": [
"vercel.json"
],
"verification": "curl -X POST -H 'x-cron-secret: $CRON_SECRET' -H 'Content-Type: application/json' -d '{\"date\":\"2026-03-27\"}' http://localhost:3000/api/admin/rebuild-affinity | jq '.usersProcessed'",
"test_file": "__tests__/api/admin/rebuild-affinity.test.ts"
}
]
},
{
"id": "phase-3",
"name": "Frontend Components",
"parallel": true,
"depends_on": ["phase-1"],
"tasks": [
{
"id": "T7",
"name": "Build ForYouShelf component with ShelfSkeleton fallback",
"agent": "frontend-engineer",
"files_to_create": [
"src/components/personalisation/ForYouShelf.tsx",
"src/components/personalisation/ShelfSkeleton.tsx"
],
"files_to_modify": [
"src/app/page.tsx"
],
"verification": "npm run build && npx playwright test tests/e2e/shelf.spec.ts",
"test_file": "__tests__/components/ForYouShelf.test.tsx"
},
{
"id": "T8",
"name": "Wrap product card click with intent tracker (sessionStorage + ingest-event)",
"agent": "frontend-engineer",
"files_to_create": [
"src/components/personalisation/withIntentTracker.tsx"
],
"files_to_modify": [
"src/components/ProductCard.tsx"
],
"verification": "npx playwright test tests/e2e/intent-tracker.spec.ts",
"test_file": "__tests__/components/withIntentTracker.test.tsx"
},
{
"id": "T9",
"name": "Integrate search page with /api/personalisation/rerank",
"agent": "frontend-engineer",
"files_to_create": [],
"files_to_modify": [
"src/app/search/page.tsx",
"src/lib/hooks/useSearch.ts"
],
"verification": "npm run build",
"test_file": "__tests__/pages/search.test.tsx"
},
{
"id": "T10",
"name": "Homepage cohort check: render shelf only for test cohort users",
"agent": "frontend-engineer",
"files_to_create": [],
"files_to_modify": [
"src/app/page.tsx",
"src/lib/hooks/useCohort.ts"
],
"verification": "npx playwright test tests/e2e/ab-cohort.spec.ts",
"test_file": "__tests__/pages/home-cohort.test.tsx"
}
]
},
{
"id": "phase-4",
"name": "Instrumentation",
"parallel": false,
"depends_on": ["phase-2", "phase-3"],
"tasks": [
{
"id": "T11",
"name": "Implement PostHog events: shelf_impression, shelf_click, search_rerank_impression, add_to_cart",
"agent": "frontend-engineer",
"files_to_create": [
"src/lib/analytics/events.ts"
],
"files_to_modify": [
"src/components/personalisation/ForYouShelf.tsx",
"src/components/personalisation/withIntentTracker.tsx",
"src/app/search/page.tsx"
],
"verification": "npx playwright test tests/e2e/posthog-events.spec.ts",
"test_file": "__tests__/analytics/events.test.ts"
},
{
"id": "T12",
"name": "Validate A/B split ratio (50/50) in PostHog dashboard",
"agent": "frontend-engineer",
"files_to_create": [],
"files_to_modify": [],
"verification": "Manual check: PostHog → Experiments → personalisation-v1 → cohort distribution ≈ 50/50",
"test_file": null
}
]
}
],
"env_vars": [
"NEXT_PUBLIC_SUPABASE_URL",
"SUPABASE_SERVICE_ROLE_KEY",
"SUPABASE_ANON_KEY",
"CRON_SECRET",
"NEXT_PUBLIC_POSTHOG_KEY",
"POSTHOG_HOST",
"NYKAA_CATALOG_API_KEY",
"NEXT_PUBLIC_AB_EXPERIMENT_SALT"
],
"schema_tables": [
"experiment_cohorts",
"user_affinity_profiles",
"session_events"
],
"posthog_events": [
"shelf_impression",
"shelf_click",
"search_rerank_impression",
"add_to_cart"
]
}