mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-01 23:43:16 +01:00
Remove unused aggregate watchdog diagnostics
The deadline worker retains its incomplete-subtree error and classifier tests. Remove the obsolete reporter and its two isolated tests after its aggregate callers were removed. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
aa8eb8147c
commit
08e27cfe09
2 files changed
+1
-52
No files matched your search
@@ -1,8 +1,6 @@
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { classifyTaskWatchdogSubtree, type TaskWatchdogClassifierIssue } from "../services/task-watchdogs.ts";
|
||||
|
||||
import { createIncompleteTaskWatchdogScanReporter } from "../services/task-watchdog-diagnostics.ts";
|
||||
|
||||
const companyId = "company-1";
|
||||
const sourceId = "source-1";
|
||||
const childId = "child-1";
|
||||
@@ -37,39 +35,6 @@ function classify(overrides: Partial<Parameters<typeof classifyTaskWatchdogSubtr
|
||||
}
|
||||
|
||||
describe("task watchdog subtree classifier", () => {
|
||||
it("reports an unchanged incomplete scan once across startup and a day of periodic ticks", () => {
|
||||
const warn = vi.fn();
|
||||
const report = createIncompleteTaskWatchdogScanReporter(warn);
|
||||
report({ incomplete: 2, incompleteIssueIds: [sourceId, childId] }, "startup");
|
||||
for (let tick = 0; tick < 2880; tick += 1) {
|
||||
report({ incomplete: 2, incompleteIssueIds: [childId, sourceId] }, "periodic");
|
||||
}
|
||||
expect(warn).toHaveBeenCalledTimes(1);
|
||||
expect(warn).toHaveBeenCalledWith(
|
||||
{ incomplete: 2, newIncompleteIssueIds: [sourceId, childId] },
|
||||
"startup task-watchdog reconciliation found incomplete subtree scans",
|
||||
);
|
||||
});
|
||||
|
||||
it("reports new incomplete issues and reports a resolved issue if it becomes incomplete again", () => {
|
||||
const warn = vi.fn();
|
||||
const report = createIncompleteTaskWatchdogScanReporter(warn);
|
||||
report({ incomplete: 1, incompleteIssueIds: [sourceId] }, "startup");
|
||||
report({ incomplete: 2, incompleteIssueIds: [sourceId, childId] }, "periodic");
|
||||
expect(warn).toHaveBeenLastCalledWith(
|
||||
{ incomplete: 2, newIncompleteIssueIds: [childId] },
|
||||
"periodic task-watchdog reconciliation found incomplete subtree scans",
|
||||
);
|
||||
report({ incomplete: 0, incompleteIssueIds: [] }, "periodic");
|
||||
expect(warn).toHaveBeenCalledTimes(2);
|
||||
report({ incomplete: 1, incompleteIssueIds: [sourceId] }, "periodic");
|
||||
expect(warn).toHaveBeenCalledTimes(3);
|
||||
expect(warn).toHaveBeenLastCalledWith(
|
||||
{ incomplete: 1, newIncompleteIssueIds: [sourceId] },
|
||||
"periodic task-watchdog reconciliation found incomplete subtree scans",
|
||||
);
|
||||
});
|
||||
|
||||
it("does not produce a stopped fingerprint from an incomplete scan", () => {
|
||||
const result = classify({ subtreeIncomplete: true });
|
||||
expect(result.state).toBe("incomplete");
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
export function createIncompleteTaskWatchdogScanReporter(
|
||||
warn: (details: { incomplete: number; newIncompleteIssueIds: string[] }, message: string) => void,
|
||||
) {
|
||||
let previousIncompleteIssueIds = new Set<string>();
|
||||
return (result: { incomplete: number; incompleteIssueIds: string[] }, phase: "startup" | "periodic") => {
|
||||
const currentIssueIds = new Set(result.incompleteIssueIds);
|
||||
const newIncompleteIssueIds = [...currentIssueIds].filter((id) => !previousIncompleteIssueIds.has(id));
|
||||
previousIncompleteIssueIds = currentIssueIds;
|
||||
if (newIncompleteIssueIds.length === 0) return;
|
||||
warn(
|
||||
{ incomplete: result.incomplete, newIncompleteIssueIds },
|
||||
`${phase} task-watchdog reconciliation found incomplete subtree scans`,
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user