Skip to content

Commit 177664f

Browse files
committed
fix: align metrics test and graph queries with schema
1 parent 8bd22b4 commit 177664f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

backend/agent/tests/metrics.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,10 @@ describe("Metrics Test", () => {
129129
kind: string;
130130
sequence: number;
131131
}>`
132-
SELECT kind, sequence
132+
SELECT kind, seq AS sequence
133133
FROM run_events
134134
WHERE run_id = ${runId}
135-
ORDER BY sequence DESC
135+
ORDER BY seq DESC
136136
LIMIT 5
137137
`;
138138

@@ -178,7 +178,7 @@ describe("Metrics Test", () => {
178178
FROM run_events
179179
WHERE run_id = ${runId}
180180
AND kind = 'agent.run.finished'
181-
ORDER BY sequence DESC
181+
ORDER BY seq DESC
182182
LIMIT 1
183183
`;
184184

backend/graph/queries.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export async function countUniqueScreensDiscovered(runId: string): Promise<numbe
99
SELECT COUNT(*)::text as count
1010
FROM graph_persistence_outcomes
1111
WHERE run_id = ${runId}
12-
AND upsert_kind = 'screen_discovered'
12+
AND upsert_kind = 'discovered'
1313
`;
1414

1515
return result ? Number.parseInt(result.count, 10) : 0;
@@ -25,7 +25,7 @@ export async function getUniqueScreensDiscovered(runId: string): Promise<string[
2525
SELECT screen_id
2626
FROM graph_persistence_outcomes
2727
WHERE run_id = ${runId}
28-
AND upsert_kind = 'screen_discovered'
28+
AND upsert_kind = 'discovered'
2929
ORDER BY created_at ASC
3030
`) {
3131
screens.push(row.screen_id);

0 commit comments

Comments
 (0)