mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-12-05 14:35:17 +01:00
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - The chat-feature evals measure whether agents complete real chat requests through the product > - The chat catalog eval harness and its repairs live on the `chat-eval/master-candidate` branch, not on master > - Today's work made 139 of 242 chat evals pass in verified single-case live runs. Each product fix landed on master as its own pull request > - The eval-side changes (setups, graders, fault seams, evidence capture) still exist only on the candidate > - This pull request lands the harness on master. Master stays the source of truth for product behavior > - The benefit is one tree: evals run against master commits, and product fixes reach the evals as soon as they merge ## Linked Issues or Issue Description Refs #19441, Refs #19599, Refs #20270, Refs #20334, Refs #20342, Refs #20344, Refs #20354, Refs #20360, Refs #20373, Refs #20382, Refs #20409 **What existing behavior does this improve?** The chat catalog eval harness and the product it evaluates live on a long-running branch outside master. Eval fixes do not reach master, so master-based eval runs use old setups and graders. **Subsystem affected** `tests/runner-e2e` chat catalog harness, plus a small set of product changes that exist only on the candidate. **Proposed change** Land the harness on master. Every product fix from this eval work already merged to master as its own pull request. Conflicts keep master's product behavior. ## What Changed - Most of the diff (808 of 851 files) is under `tests/runner-e2e/`: chat-catalog domains, scenarios, descriptors, the TestOps manifest, private evidence tooling, and their tests. - Graders now check saved state, setup literals and rendered or clicked links. Many keyword and regex checks on free-form replies are removed. Each changed grader has a bumped `oracleVersion` and calibration tests (a valid reply, a reworded valid reply, and broken variants that must fail). - The shared link helper `hasLink` no longer treats a list link (for example `/COM/issues?view=mine`) as a link to every task without a URL key. - Setup fixes build real state through supported product routes: routine history, agent grants through the board grant route, budget holds with a real cap, and a storage-layer archive fault for `inbox-search.archive-partial-failure`. - Browser boundary journeys (sign-in, chat-disabled, onboarding) now write the standard pass evidence files. - Retargeted cases, approved by the maintainer: `agent-chat.chat-disabled` (Conference Room gate), `agents.restore-instructions` (no saved instruction history), `access.manage-membership` (member permission edits stay board-only). - The private evidence trusted files (`manual-private-handoff.ts`, `manual-private-retention.ts`, `manual-private-report-assets.ts`) are byte-identical to master. - Product files outside `tests/` (43 files, +1,328 −49) carry candidate-only changes that master does not yet have. Most are tests. The main code changes are in `request-human-input.ts`, `heartbeat-run-summary.ts`, `native-completion-feedback.ts`, `native-run-finalizer.ts`, `openapi.ts`, `secrets.ts` and `IssueChatLongThreadPerf.tsx`. ## Verification - `pnpm vitest run chat-catalog-domains chat-catalog-contract.test.ts chat-catalog-consistency.test.ts unit-launcher.test.mjs --testTimeout=180000` in `tests/runner-e2e`: 269 files pass, 3,550 tests pass. - `node --test chat-full-catalog-testops-manifest.test.mjs`: 10 pass. - `node tests/runner-e2e/source-sdk-public-inputs.mjs <HEAD> --check`: no change. - `tsc` for `server` and `tests/runner-e2e`: clean. - Live single-case verification: 139 of 242 cases passed on paid runs, and a person read the saved evidence for each. These are single-case runs, not one full-cohort run. ## Risks - Large diff. Most of it is test-only, but the 43 non-test files change product code paths. Review those files first. - Some graders are now less strict on reply wording. A person must read replies for meaning on those cases. - 42 cases need disposable outside accounts (Notion, Slack, GitHub, Daytona and others) and stay blocked. `access.invite-teammate` stays failing until local agent isolation lands, because the runner's durable state keeps a live invite token. - The paid workflow compares the trusted private-evidence files with master. They are unchanged, so this risk is low. ## Model Used Anthropic Claude Opus 5.5 (`claude-opus-5-5`), with tool use and code execution, in Claude Code. Subagents used the same model. ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have searched GitHub for duplicate or related PRs and linked them above - [x] I have either (a) linked existing issues with `Fixes: #` / `Closes #` / `Refs #` OR (b) described the issue in-PR following the relevant issue template - [x] I have not referenced internal/instance-local Paperclip issues or links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip` URLs) - [x] My branch name describes the change (e.g. `docs/...`, `fix/...`) and contains no internal Paperclip ticket id or instance-derived details - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [ ] All Paperclip CI gates are green - [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Paperclip <noreply@paperclip.ing>
94 lines
9.5 KiB
TypeScript
94 lines
9.5 KiB
TypeScript
import { expect } from "@playwright/test";
|
|
import type { ChatCatalogCase, ChatCatalogContext } from "../chat-catalog-contract.js";
|
|
import { checks, entity, project } from "./internal-support.js";
|
|
import { createAuthenticatedPerson, enrollPrerequisitePerson } from "./identity-auth.js";
|
|
import { identityDefinition, identityObservation, probeAgentPermission, waitForReply } from "./identity-support.js";
|
|
type Person = Awaited<ReturnType<typeof createAuthenticatedPerson>>;
|
|
const observers = new WeakMap<ChatCatalogContext, Person>();
|
|
interface Order { orderedIds: string[] }
|
|
export function gradeSidebarOrder(value: unknown) {
|
|
const c = checks(); const o = identityObservation(value);
|
|
c.add("actual-supported-classic-context", !!o && o.state.shell === "classic" && o.state.humanSelectedShell === true,
|
|
"The person explicitly selected the supported classic shell before the original query; this does not claim streamlined-shell ordering support."); if (!o) return c.result();
|
|
const launch = entity(o.state, "project");
|
|
c.add("agent-keeps-personal-boundary", o.state.agentPreferenceWriteStatus === 403 && JSON.stringify(o.state.orderBefore) === JSON.stringify(o.state.orderAfterReply)
|
|
&& /drag|reorder|sidebar|sort/i.test(o.reply) && !/\bI(?:'ve| have)?\s+(?:reordered|moved|collapsed)\b/i.test(o.reply),
|
|
"The answer explains the human controls and does not impersonate their board preference identity.");
|
|
c.add("human-order-persisted", (o.state.orderAfterDrag as Order | undefined)?.orderedIds?.[0] === launch.id
|
|
&& (o.state.orderAfterReload as Order | undefined)?.orderedIds?.[0] === launch.id && o.state.launchFirstInBrowser === true,
|
|
"The actual mouse reorder writes the person's company-scoped project order and the visible first position survives reload.");
|
|
c.add("collapse-has-session-scope", o.state.agentsCollapsed === true && o.state.collapseRetainedDuringNavigation === true && o.state.collapseResetAfterReload === true,
|
|
"The actual Agents section collapses, stays collapsed through client navigation and resets on full reload according to its component-session contract.");
|
|
c.add("other-person-unchanged", o.state.observerId !== o.state.humanId && typeof o.state.observerId === "string"
|
|
&& JSON.stringify(o.state.observerBefore) === JSON.stringify(o.state.observerAfter) && o.state.observerAgentsExpanded === true,
|
|
"A separately authenticated Riley retains their own saved order and expanded local section.");
|
|
return c.result();
|
|
}
|
|
export const sidebarOrderIdentityCases: readonly ChatCatalogCase[] = [identityDefinition("navigation-preferences.sidebar-order", async ctx => {
|
|
const browser = ctx.input.page.context().browser(); if (!browser || !ctx.input.privateSecrets) throw new Error("Sidebar scope requires real human browser identities");
|
|
const session = await ctx.input.api.get<{ user: { id: string } }>("/api/auth/get-session");
|
|
if (!session.user?.id || session.user.id === "local-board") throw new Error("Personal sidebar order requires actual human authentication");
|
|
const settings = await ctx.input.api.get<{ enableStreamlinedUi: boolean }>("/api/instance/settings/experimental");
|
|
try {
|
|
const source = ctx.input.page.url();
|
|
await ctx.input.page.goto(`/${ctx.input.fixtures.company.issuePrefix}/company/settings/instance/experimental`, { waitUntil: "domcontentloaded" });
|
|
const toggle = ctx.input.page.getByRole("switch", { name: "Toggle Streamlined UI experimental setting", exact: true });
|
|
await expect(toggle).toBeVisible();
|
|
if (await toggle.isChecked()) await toggle.click();
|
|
await expect.poll(async () => (await ctx.input.api.get<{ enableStreamlinedUi: boolean }>("/api/instance/settings/experimental")).enableStreamlinedUi).toBe(false);
|
|
const first = await project(ctx, "Archive"); const launch = await project(ctx);
|
|
const endpoint = `/api/companies/${ctx.input.fixtures.company.id}/sidebar-preferences/me`;
|
|
await ctx.input.api.putSensitive(endpoint, { orderedIds: [first.id, launch.id] });
|
|
const observer = await createAuthenticatedPerson({ api: ctx.input.api, browser, secrets: ctx.input.privateSecrets, name: "Riley" }); observers.set(ctx, observer);
|
|
await enrollPrerequisitePerson(ctx, observer);
|
|
const saved = await observer.request(endpoint, "PUT", { orderedIds: [first.id, launch.id] }); if (!saved.ok) throw new Error("Riley's public sidebar fixture failed"); await saved.body?.cancel();
|
|
const before = await observer.request(endpoint); if (!before.ok) throw new Error("Riley sidebar read failed");
|
|
const observerBefore = (await before.json() as Order).orderedIds;
|
|
await ctx.input.page.goto(source, { waitUntil: "domcontentloaded" });
|
|
await ctx.input.evidence("identity-sidebar-deployment.json", { shell: "classic", selectedThroughHumanExperimentalControl: true, streamlinedOrderingQualified: false });
|
|
return { project: launch, otherProject: first, humanId: session.user.id, observerId: observer.id, observerBefore,
|
|
orderBefore: await ctx.input.api.get<Order>(endpoint), shell: "classic", humanSelectedShell: true, originalStreamlined: settings.enableStreamlinedUi };
|
|
} catch (error) { await observers.get(ctx)?.dispose(); observers.delete(ctx); await ctx.input.api.patch("/api/instance/settings/experimental", { enableStreamlinedUi: settings.enableStreamlinedUi }); throw error; }
|
|
}, gradeSidebarOrder, {
|
|
authentication: "human-session",
|
|
sourceFiles: ["chat-catalog-domains/identity-sidebar-order.ts", "chat-catalog-domains/identity-auth.ts", "chat-catalog-domains/identity-private-browser.ts", "chat-catalog-domains/identity-private-browser-worker.ts", "chat-catalog-domains/identity-wizard.ts", "chat-catalog-domains/identity-support.ts", "chat-catalog-domains/internal-support.ts", "chat-scenarios/navigation-preferences.yaml"],
|
|
async act(ctx, state) {
|
|
await waitForReply(ctx); const endpoint = `/api/companies/${ctx.input.fixtures.company.id}/sidebar-preferences/me`;
|
|
state.orderAfterReply = await ctx.input.api.get<Order>(endpoint);
|
|
state.agentPreferenceWriteStatus = await probeAgentPermission(ctx, endpoint, "PUT", { orderedIds: [entity(state, "project").id, entity(state, "otherProject").id] });
|
|
const page = ctx.input.page; const sidebar = page.locator("aside").filter({ has: page.getByRole("button", { name: "Projects section actions", exact: true }) }).first();
|
|
await sidebar.getByRole("button", { name: "Projects section actions", exact: true }).click();
|
|
await page.getByRole("menuitemradio", { name: "Top", exact: true }).click();
|
|
const from = await sidebar.getByRole("link", { name: "Launch", exact: true }).boundingBox();
|
|
const to = await sidebar.getByRole("link", { name: "Archive", exact: true }).boundingBox();
|
|
if (!from || !to) throw new Error("Supported desktop project drag targets are absent");
|
|
await page.mouse.move(from.x + 30, from.y + from.height / 2); await page.mouse.down();
|
|
await page.mouse.move(from.x + 40, from.y - 10, { steps: 5 }); await page.mouse.move(to.x + 30, to.y + 2, { steps: 10 }); await page.mouse.up();
|
|
await expect.poll(async () => (await ctx.input.api.get<Order>(endpoint)).orderedIds[0]).toBe(entity(state, "project").id);
|
|
state.orderAfterDrag = await ctx.input.api.get<Order>(endpoint);
|
|
await sidebar.getByRole("button", { name: "Collapse Agents", exact: true }).click();
|
|
await expect(sidebar.getByRole("button", { name: "Expand Agents", exact: true })).toBeVisible(); state.agentsCollapsed = true;
|
|
await sidebar.getByRole("link", { name: "Launch", exact: true }).click();
|
|
state.collapseRetainedDuringNavigation = await sidebar.getByRole("button", { name: "Expand Agents", exact: true }).isVisible();
|
|
await page.reload({ waitUntil: "domcontentloaded" }); state.orderAfterReload = await ctx.input.api.get<Order>(endpoint);
|
|
await expect(sidebar.getByRole("link", { name: "Launch", exact: true })).toBeVisible();
|
|
state.launchFirstInBrowser = await sidebar.getByRole("link", { name: /^(Launch|Archive)$/ }).allTextContents().then(names => names[0]?.trim() === "Launch");
|
|
state.collapseResetAfterReload = await sidebar.getByRole("button", { name: "Collapse Agents", exact: true }).isVisible();
|
|
const observer = observers.get(ctx); if (!observer) throw new Error("Independent sidebar person missing");
|
|
const other = await observer.context.newPage();
|
|
try {
|
|
await other.goto(`/${ctx.input.fixtures.company.issuePrefix}/projects/${entity(state, "project").id}`, { waitUntil: "domcontentloaded" });
|
|
await expect(other.getByRole("button", { name: "Collapse Agents", exact: true })).toBeVisible(); state.observerAgentsExpanded = true;
|
|
const after = await observer.request(endpoint); if (!after.ok) throw new Error("Independent sidebar persistence read failed"); state.observerAfter = (await after.json() as Order).orderedIds;
|
|
} finally { await other.close(); }
|
|
await ctx.input.evidence("identity-sidebar-person-scope.json", { humanId: state.humanId, observerId: state.observerId, orderAfterDrag: state.orderAfterDrag,
|
|
orderAfterReload: state.orderAfterReload, observerBefore: state.observerBefore, observerAfter: state.observerAfter,
|
|
agentsCollapsed: state.agentsCollapsed, collapseRetainedDuringNavigation: state.collapseRetainedDuringNavigation, collapseResetAfterReload: state.collapseResetAfterReload });
|
|
await page.goto(`/${ctx.input.fixtures.company.issuePrefix}/chats/${ctx.input.fixtures.agent.id}`, { waitUntil: "domcontentloaded" });
|
|
},
|
|
async cleanup(ctx, state) {
|
|
try { await ctx.input.api.patch("/api/instance/settings/experimental", { enableStreamlinedUi: state.originalStreamlined }); }
|
|
finally { await observers.get(ctx)?.dispose(); observers.delete(ctx); }
|
|
},
|
|
})];
|