Refine terminal history scrolling and job failure summaries

This commit is contained in:
npc0-hue
2026-08-10 13:48:23 +08:00
parent fbd24b6a44
commit d1f4dce4f5
7 changed files with 54 additions and 11 deletions
@@ -67,6 +67,20 @@ describe("operations console contracts", () => {
expect(summaries.find((item) => item.instance.id === "job-failed")?.failedJobs).toBe(1);
});
it("does not count failed jobs older than the latest healthy server projection", () => {
const summaries = summarizeServerOperations(
[server("recovered", "running", "2026-07-18T10:10:00Z")],
new Map(),
[
job("old-failed-start", "failed", "2026-07-18T10:03:00Z", "recovered"),
job("healthy-start", "succeeded", "2026-07-18T10:10:00Z", "recovered")
]
);
expect(summaries[0]?.failedJobs).toBe(0);
expect(summaries[0]?.latestJob?.id).toBe("healthy-start");
});
it("summarizes only endpoint-safe capacity and status values", () => {
const endpoints: RunEndpointResponse[] = [
{