test: distinguish agent summaries from bounded recovery notices

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-10-09 21:21:03 -05:00
1 parent b1d3d53edc
commit 6195c98f5a
2 files changed
+18 -4

No files matched your search

+1 -1
View File
@@ -111,7 +111,7 @@ A destination may override either field independently. Omitted fields inherit th
## Verification and rollout limits
Tests must distinguish local fixture proof from live provider qualification. The implementation adds database and protocol tests, compatibility tests for old descriptors, plain-directory and nested-repository persistence fixtures, and sparse/checkpoint/cache tests. A passing fixture does not prove Daytona or SSH production throughput. PAP-171's original run is never interrupted or modified as part of this work.
Tests must distinguish local fixture proof from live provider qualification. The implementation adds database and protocol tests, compatibility tests for old descriptors, plain-directory and nested-repository persistence fixtures, and sparse/checkpoint/cache tests. A passing fixture does not prove Daytona or SSH production throughput. The original diagnostic run is never interrupted or modified as part of this work.
Deploy schema before admitting the new state. Native descriptor v3 requires compatible recovery controllers; mixed-version controllers must not claim new admissions. Rollback retains the schema and immutable seeds and routes existing v3 obligations to compatible controllers. Do not delete legacy home content, existing workspace directories, or accepted-result recovery evidence.
@@ -436,11 +436,25 @@ describeEmbeddedPostgres("heartbeat resolved dependency wake reconciliation", ()
}),
});
const comments = await db.select().from(issueComments).where(eq(issueComments.issueId, issueId));
// Both successful runs publish their final summary on behalf of the real
// responsible user. Recovery notices are additional system comments.
const summaries = comments.filter((comment) => comment.authorType === "agent");
expect(summaries).toHaveLength(2);
expect(summaries).toEqual(expect.arrayContaining(
[followUpRun!.id, recoveryWakes[0].runId].map((runId) => expect.objectContaining({
authorAgentId: agentId,
onBehalfOfUserId: "responsible-user",
createdByRunId: runId,
body: "Acknowledged liveness escalation.",
})),
));
const notices = comments.filter((comment) => comment.authorType !== "agent");
const issue = await db.select().from(issues).where(eq(issues.id, issueId)).then((rows) => rows[0]);
if (disposition === "monitor") {
expect(issue).toMatchObject({ status: "in_review", assigneeAgentId: agentId, monitorNextCheckAt: expect.any(Date) });
expect(await db.select().from(issueRecoveryActions)).toHaveLength(0);
expect(await db.select().from(issueComments)).toHaveLength(0);
expect(notices).toHaveLength(0);
const attention = await issueService(db).listReviewAttention(companyId, [issue]);
expect(attention.get(issueId)).toMatchObject({ state: "covered", paths: expect.arrayContaining([expect.objectContaining({ kind: "monitor" })]) });
return;
@@ -452,7 +466,6 @@ describeEmbeddedPostgres("heartbeat resolved dependency wake reconciliation", ()
ownerType: "board", ownerAgentId: null, ownerUserId: null,
returnOwnerAgentId: agentId, cause: "issue_review_path_lost", attemptCount: 1, maxAttempts: 1,
});
const notices = await db.select().from(issueComments).where(eq(issueComments.issueId, issueId));
expect(notices).toHaveLength(1);
expect(notices[0]).toMatchObject({ authorType: "system", presentation: expect.objectContaining({ title: "No follow-up scheduled" }) });
@@ -460,7 +473,8 @@ describeEmbeddedPostgres("heartbeat resolved dependency wake reconciliation", ()
// Replayed finalization must not duplicate the notice, action, or wake.
expect(await escalateExhaustedIssueReviewPathRecovery(db, { run: recoveryRun, issueId })).toBeNull();
expect(await db.select().from(issueRecoveryActions)).toHaveLength(1);
expect(await db.select().from(issueComments)).toHaveLength(1);
const replayComments = await db.select().from(issueComments).where(eq(issueComments.issueId, issueId));
expect(replayComments.map((comment) => comment.id).sort()).toEqual(comments.map((comment) => comment.id).sort());
expect(await db.select().from(agentWakeupRequests).where(eq(agentWakeupRequests.reason, "issue_review_path_lost"))).toHaveLength(1);
const feed = await attentionService(db).list(companyId, { userId: "responsible-user" });