Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions apps/supervisor/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1381,6 +1381,23 @@ describe("classification", () => {
});
});

it("treats committed bot transactions without classifiable actions as terminal", () => {
const stdout = [
botEvent("bot.transaction.built", {
actions: { collectedOrders: 0, completedDeposits: 0, matchedOrders: 0, deposits: 0, withdrawalRequests: 0, withdrawals: 0 },
}),
botEvent("bot.transaction.committed", { txHash: txHash("47"), status: "committed" }),
].map(JSON.stringify).join("\n");

expect(classifyActorResult("bot", commandResult("bot", stdout))).toMatchObject({
outcome: "unknown",
terminal: true,
reason: "bot committed transaction evidence did not include classifiable action evidence",
actions: { matchedOrders: 0, deposits: 0, withdrawalRequests: 0, completedDeposits: 0, withdrawals: 0 },
txHashes: [txHash("47")],
});
});

it("keeps match diagnostics tied to the matching state-read iteration", () => {
const stdout = [
botEvent("bot.state.read", {
Expand Down
13 changes: 12 additions & 1 deletion apps/supervisor/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1371,9 +1371,20 @@ function classifyBotResult(
if (actions === undefined) {
return { ...base, outcome: "malformed_evidence", terminal: true, reason: "bot committed transaction evidence did not include matching built action evidence", publicState };
}
const outcome = classifyBotCommittedActions(actions);
if (outcome === "unknown") {
return {
...base,
outcome,
terminal: true,
reason: "bot committed transaction evidence did not include classifiable action evidence",
actions,
publicState,
};
}
return {
...base,
outcome: classifyBotCommittedActions(actions),
outcome,
terminal: false,
reason: "bot transaction committed according to app evidence",
actions,
Expand Down
Loading