-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_aarvi_run.ts
More file actions
36 lines (29 loc) · 1.65 KB
/
Copy pathcheck_aarvi_run.ts
File metadata and controls
36 lines (29 loc) · 1.65 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
import { PrismaClient } from '@prisma/client';
const prisma = new PrismaClient();
async function main() {
const company = await prisma.company.findUnique({ where: { ticker: 'AARVI' } });
if (!company) { console.log('AARVI not found'); return; }
const runs = await prisma.agentRun.findMany({
where: { companyId: company.id },
orderBy: { createdAt: 'desc' },
include: { steps: true }
});
console.log(`--- Runs for AARVI (${runs.length}) ---`);
for (const run of runs) {
console.log(`\nRun: ${run.id} | Status: ${run.status} | Confidence: ${run.confidence}`);
console.log(`Recommendation: ${run.recommendation}`);
console.log(`Hypothesis: ${run.hypothesis?.substring(0, 100)}...`);
console.log(`\nSteps executed: ${run.steps.length}`);
for (const step of run.steps.sort((a: any, b: any) => (a.startedAt?.getTime() || 0) - (b.startedAt?.getTime() || 0))) {
console.log(`- ${step.role} [${step.status}] (${step.startedAt?.toISOString()} - ${step.completedAt?.toISOString()})`);
if (step.error) console.log(` Error: ${step.error}`);
}
}
const claims = await prisma.claim.findMany({ where: { companyId: company.id } });
console.log(`\n--- Verified Claims (${claims.length}) ---`);
claims.forEach(c => console.log(`[${c.severity}] ${c.claimType}: ${c.statement.substring(0, 80)}...`));
const flags = await prisma.riskFlag.findMany({ where: { companyId: company.id } });
console.log(`\n--- Risk Flags (${flags.length}) ---`);
flags.forEach(f => console.log(`[${f.severity}] ${f.flagType}: ${f.title}`));
}
main().then(() => prisma.$disconnect()).catch(e => { console.error(e); prisma.$disconnect(); });