Close supervisor review loop and add handoff eval

This commit is contained in:
dahyeon committed 2026-05-18 18:04:01 -07:00
1 parent c14adac162
commit f0b00e5fd2
20 files changed
+2017 -129

No files matched your search

+74
View File
@@ -0,0 +1,74 @@
import { describe, expect, it } from "vitest";
import {
formatReviewList,
formatReviewShow,
formatReviewStats,
} from "./cli.js";
describe("operations review CLI formatters", () => {
it("formats review list rows as tab-separated output", () => {
expect(
formatReviewList([
{
chatroomId: "room-1",
id: "1-0",
queuedAt: "2026-05-18T00:00:00.000Z",
reason: "low-confidence",
requestId: "request-1",
target: "human-review",
userId: "user-1",
},
]),
).toContain("1-0\t2026-05-18T00:00:00.000Z\tlow-confidence");
});
it("formats packet details for show output", () => {
expect(
formatReviewShow({
chatroomId: "room-1",
id: "1-0",
packet: {
constraints: [],
currentState: {},
evidence: [
{
id: "e1",
kind: "message",
summary: "unclear message",
},
],
expectedOutputSchema: "text",
handoffReason: "low-confidence",
sourceChain: ["onboarding", "supervisor"],
summary: "needs review",
userGoal: "의도 확인",
},
queuedAt: "2026-05-18T00:00:00.000Z",
reason: "low-confidence",
requestId: "request-1",
target: "human-review",
userId: "user-1",
}),
).toContain("sourceChain: onboarding > supervisor");
});
it("formats aggregate stats", () => {
expect(
formatReviewStats({
averagePendingAgeMs: 60_000,
byReason: {
"low-confidence": {
pending: 1,
resolved: 2,
total: 3,
},
},
pending: 1,
resolved: 2,
topSourceChains: [{ chain: "onboarding>supervisor", count: 3 }],
total: 3,
}),
).toContain("low-confidence\ttotal=3\tpending=1\tresolved=2");
});
});