diff --git a/tests/runner-e2e/chat-catalog-descriptors.json b/tests/runner-e2e/chat-catalog-descriptors.json index defcdd88457..e0730b0cfde 100644 --- a/tests/runner-e2e/chat-catalog-descriptors.json +++ b/tests/runner-e2e/chat-catalog-descriptors.json @@ -3712,7 +3712,7 @@ "chat-catalog-domains/internal-support.ts", "chat-scenarios/onboarding.yaml" ], - "oracleVersion": "paperclip.chat-catalog.identity.first-work.v2", + "oracleVersion": "paperclip.chat-catalog.identity.first-work.v3", "expectedRunCount": 3, "minimumRunCount": 2, "turnTimeoutMs": 120000, diff --git a/tests/runner-e2e/chat-catalog-domains/identity-first-work.ts b/tests/runner-e2e/chat-catalog-domains/identity-first-work.ts index f205b1db167..d1859b10dd9 100644 --- a/tests/runner-e2e/chat-catalog-domains/identity-first-work.ts +++ b/tests/runner-e2e/chat-catalog-domains/identity-first-work.ts @@ -25,16 +25,19 @@ async function actualWebsite(ctx: ChatCatalogContext, state: Record file.attachment.id === o.state.reviewedAttachmentId); c.add("actual-first-request-context", o.state.beforeSourceHumanComments === 0 && o.state.beforeSourceRuns === 0 && o.humanQueries.length === 1 && o.humanQueries[0]?.trim() === "Make me a simple website introducing our business.", "The canonical request is the first real human instruction in this ready company's conversation."); - c.add("separate-requested-ordinary-work", o.tasks.length === 1 && work?.companyId === o.companyId && work.assigneeAgentId === worker.id && work.id !== o.state.sourceId && work.parentId == null + c.add("separate-requested-ordinary-work", o.tasks.length === 1 && work?.companyId === o.companyId && !!executor && work.id !== o.state.sourceId && work.parentId == null && work.status === "done" && hasLink(o, "issues", work) && o.state.sourceStillConversation === true && o.activity.some(row => row.action === "issue.created" && row.entityId === work.id && row.agentId === o.leadId), "The first chat creates one linked ordinary completed task; its standing conversation stays separate. Its delivered HTML (graded below), not its model-written title, proves it is the business website."); c.add("actual-run-attributed-website", !!work && !!website && website.attachment.issueId === work.id && website.attachment.companyId === o.companyId - && website.sha256 === website.attachment.sha256 && website.attachment.createdByAgentId === worker.id - && o.runs.some(run => run.id === website.attachment.originatingRunId && run.agentId === worker.id && run.status === "succeeded" + && website.sha256 === website.attachment.sha256 && !!executor && website.attachment.createdByAgentId === executor + && o.runs.some(run => run.id === website.attachment.originatingRunId && run.agentId === executor && run.status === "succeeded" && (run.contextSnapshot?.issueId === work.id || (run as unknown as { nativeIssueId?: string }).nativeIssueId === work.id)) && /(`/api/issues/${source.id}/comments`); return { sourceId: source.id, worker, project: p, beforeSourceHumanComments: comments.filter(comment => comment.authorUserId).length, beforeSourceRuns: (await ctx.allRuns()).length }; }, gradeFirstWork, { - oracleVersion: "paperclip.chat-catalog.identity.first-work.v2", authentication: "human-session", expectedRunCount: 3, minimumRunCount: 2, attemptTimeoutMs: 600_000, + oracleVersion: "paperclip.chat-catalog.identity.first-work.v3", authentication: "human-session", expectedRunCount: 3, minimumRunCount: 2, attemptTimeoutMs: 600_000, sourceFiles: ["chat-catalog-domains/identity-first-work.ts", "chat-catalog-domains/identity-support.ts", "chat-catalog-domains/internal-support.ts", "chat-scenarios/onboarding.yaml"], async act(ctx, state) { const o = await pollUntil({ label: "first real completed website and delivered HTML", deadlineAt: Date.now() + 360_000, diff --git a/tests/runner-e2e/chat-catalog-domains/identity-onboarding-work.test.ts b/tests/runner-e2e/chat-catalog-domains/identity-onboarding-work.test.ts index df70e66d483..292d487e311 100644 --- a/tests/runner-e2e/chat-catalog-domains/identity-onboarding-work.test.ts +++ b/tests/runner-e2e/chat-catalog-domains/identity-onboarding-work.test.ts @@ -31,6 +31,13 @@ describe("human company creation and genuine first completed website", () => { const file = (o.state.websites as Array<{ body: string }>)[0]!; file.body = "
Acorn Notes

Capture every observation

A notebook for small science teams.

"; expect(gradeFirstWork(o).passed).toBe(true); }); + it("accepts the CEO owning and running the linked task itself, but not an unrelated agent", () => { + const own = website(); own.tasks[0]!.assigneeAgentId = "ceo"; own.runs[0]!.agentId = "ceo"; (own.state.websites as Array<{ attachment: Record }>)[0]!.attachment.createdByAgentId = "ceo"; + expect(gradeFirstWork(own).passed).toBe(true); + const other = website(); other.tasks[0]!.assigneeAgentId = "stranger"; other.runs[0]!.agentId = "stranger"; (other.state.websites as Array<{ attachment: Record }>)[0]!.attachment.createdByAgentId = "stranger"; + expect(gradeFirstWork(other).passed).toBe(false); + const mismatch = website(); (mismatch.state.websites as Array<{ attachment: Record }>)[0]!.attachment.createdByAgentId = "ceo"; expect(gradeFirstWork(mismatch).passed).toBe(false); + }); it("rejects a rendered page without a visible heading or without the business name", () => { const heading = website(); heading.state.renderedHeading = false; expect(gradeFirstWork(heading).passed).toBe(false); const name = website(); name.state.renderedBusinessName = false; expect(gradeFirstWork(name).passed).toBe(false);