-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverify_assembly.js
More file actions
48 lines (44 loc) · 1.77 KB
/
Copy pathverify_assembly.js
File metadata and controls
48 lines (44 loc) · 1.77 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
const { assembleReport } = require('./backend/src/agents/assemblyAgent');
const mockData = {
product: { productName: "Test Juice", brand: "BioPure", imageUrl: "https://test.com/img.jpg" },
verdict: {
overallVerdict: "limit",
confidenceScore: 92,
primaryAdvice: "Limit intake due to high sodium content.",
consumptionGuideline: "Maximum 150ml per serving.",
safeIntake: "150ml once per day",
frequency: "Daily",
bestTime: "With breakfast",
riskLevel: "Moderate"
},
ingredients: [
{ name: "Sodium Benzoate", standardGuideline: "Potential allergen for sensitive skin.", status: "Caution" }
],
persona: {
dailyConsumption: {
impact: "Clinical impact on hydration.",
impactLabel: "Daily Impact:",
impactValue: "Slightly High",
headline: "High mineral content detected for your profile.",
warnings: ["Monitor sodium levels."]
}
}
};
const result = assembleReport(mockData);
console.log('--- ASSEMBLED REPORT MOCK TEST ---');
console.log('Product:', result.productName);
console.log('Overall Verdict:', result.overallVerdict);
console.log('Ingredient Standard Guideline:', result.ingredients[0].standardGuideline);
console.log('Personal Advice - Safe Intake:', result.adviceCard.safeIntake);
console.log('Personal Advice - Frequency:', result.adviceCard.frequency);
console.log('Personal Advice - Best Time:', result.adviceCard.bestTime);
if (result.ingredients[0].standardGuideline.includes('WHO')) {
console.error('FAIL: Hardcoded WHO fallback still present!');
} else {
console.log('SUCCESS: Dynamic clinical reasoning preserved.');
}
if (result.adviceCard.safeIntake === '150ml once per day') {
console.log('SUCCESS: Dynamic advice correctly mapped.');
} else {
console.error('FAIL: Advice still hardcoded!');
}