diff --git a/.github/workflows/ci-incremental-qualification.yml b/.github/workflows/ci-incremental-qualification.yml index 43ea66b942d..3b9f8b1f33e 100644 --- a/.github/workflows/ci-incremental-qualification.yml +++ b/.github/workflows/ci-incremental-qualification.yml @@ -56,7 +56,7 @@ jobs: const lanes = JSON.parse(readFileSync('.github/ci-task-matrix.json', 'utf8')); const head = execFileSync('git', ['rev-parse', 'HEAD'], { encoding: 'utf8' }).trim(); for (const [file, project, related] of [ - ['ui/src/pages/Inbox.tsx', '@paperclipai/ui', 'ui/src/pages/Inbox.test.tsx'], + ['ui/src/pages/Auth.tsx', '@paperclipai/ui', 'ui/src/pages/Auth.test.tsx'], ['server/src/middleware/auth.ts', '@paperclipai/server', 'server/src/__tests__/agent-auth-middleware.test.ts'], ['server/src/storage/config.test.ts', '@paperclipai/server', 'server/src/storage/config.test.ts'], ]) { diff --git a/docs/api/costs.md b/docs/api/costs.md index 1d99df02913..00efd4bbc38 100644 --- a/docs/api/costs.md +++ b/docs/api/costs.md @@ -75,7 +75,7 @@ Both are board-only. Both are separate from budgets. A budget is a budget policy on one scope: `company`, `agent`, or `project`. Only board users can change budgets. -Budgets count billed cost in cents (`billed_cents`). Usage with the billing type `subscription_included` has a cost of 0 cents, so a budget does not stop an agent that runs on a subscription. +Budgets count billed cost in cents (`billed_cents`). Usage with the billing type `subscription_included` has a cost of 0 cents, so it never moves a budget toward its limit. A hard stop and `reservationCents` still apply to runs on a subscription. ### Budget Overview @@ -125,7 +125,7 @@ POST /api/companies/{companyId}/budgets/policies | `notifyEnabled` | `true` | Whether the warning opens | | `hardStopEnabled` | `true` | Whether work stops when spend reaches the limit | | `reservationCents` | `0` | An estimate held against the budget before each run starts | -| `unpricedUsagePolicy` | `block` | `block` or `allow`. What to do when usage has no reliable price | +| `unpricedUsagePolicy` | `block` | `block` or `allow`. What to do when a complete usage receipt has no reliable price | | `isActive` | `true` | Set `false` to turn the policy off and keep its amount | A scope has one policy for each window kind. A second call with the same scope and window updates the policy. Fields you leave out keep their value. diff --git a/docs/guides/agent-developer/cost-reporting.md b/docs/guides/agent-developer/cost-reporting.md index be58fe8b2d5..7cf06c71328 100644 --- a/docs/guides/agent-developer/cost-reporting.md +++ b/docs/guides/agent-developer/cost-reporting.md @@ -86,7 +86,7 @@ POST /api/companies/{companyId}/cost-events Each cost event has a billing type. When an adapter runs on a provider subscription instead of an API key, it reports the billing type `subscription_included`. Paperclip keeps the token counts and records the cost as 0 cents. -Budgets count billed cents only. Subscription usage therefore never moves an agent toward its budget, and a budget does not stop an agent that runs on a subscription. +Budgets count billed cents only. Subscription usage therefore never moves an agent toward its budget. A hard stop on a company or project budget, and the reserve per run, still apply to an agent that runs on a subscription. ## Budget Awareness diff --git a/docs/guides/board-operator/costs-and-budgets.md b/docs/guides/board-operator/costs-and-budgets.md index 1b74c642452..4e7b7ef9faa 100644 --- a/docs/guides/board-operator/costs-and-budgets.md +++ b/docs/guides/board-operator/costs-and-budgets.md @@ -6,7 +6,7 @@ summary: Cost tracking, budget limits, hard stops, and budget incidents Paperclip records the usage and cost of every agent run. You can set a budget for the company, for one agent, or for one project. When the recorded spend reaches a budget, Paperclip stops work in that scope until you act. -A budget counts dollars only. Usage on a Claude, ChatGPT, or other provider subscription is recorded at $0, so **a budget does not stop an agent that runs on a subscription**. See [What a Budget Counts](#what-a-budget-counts). +A budget counts dollars only. Usage on a Claude, ChatGPT, or other provider subscription is recorded at $0, so **subscription usage never moves a budget toward its limit**. A budget does not limit how much of a subscription an agent uses. A hard stop and the reserve per run still apply to subscription agents. See [What a Budget Counts](#what-a-budget-counts). ## What a Budget Counts @@ -18,7 +18,7 @@ Every cost event has a billing type. The billing type decides whether the event | Billing type | Recorded cost | Counts toward a budget | |--------------|---------------|------------------------| | `metered_api` | The cost the provider or Paperclip's price list reports | Yes | -| `subscription_included` | Always $0. Tokens are still recorded | No | +| `subscription_included` | Always $0. Tokens are still recorded | No. It adds $0 | | `subscription_overage`, `credits`, `fixed` | The reported cost, if there is one | Yes, for the reported cost | | `unknown` | The reported cost, if there is one | Yes, for the reported cost | @@ -26,9 +26,17 @@ An agent runs on a subscription when its adapter signs in with a subscription ac For these agents: -- The spend stays at $0, so the warning and the hard stop never trigger. -- The budget card shows $0 observed, even when the agent uses many tokens. -- To stop the agent, pause it. See [Managing Agents](/guides/board-operator/managing-agents). +- Their usage adds $0 to the spend. Subscription usage alone never triggers the warning or the hard stop. +- The budget card shows $0 observed for their runs, even when they use many tokens. + +A budget can still stop an agent that runs on a subscription: + +- A hard stop stops all work in its scope. If API-billed work reaches the company budget or a project budget, the subscription agents in that company or project stop too. +- The reserve per run is held for every run, whatever its billing type. If the reserve does not fit under the limit, the run is refused. See [Reserve per Run](#reserve-per-run). + +To limit how much of a subscription an agent uses: + +- Pause the agent. See [Managing Agents](/guides/board-operator/managing-agents). - To see how much of the subscription is used, open the **Providers** tab. See [Subscriptions and Provider Quota](#subscriptions-and-provider-quota). ## How Cost Tracking Works @@ -181,23 +189,33 @@ If the recorded spend plus the amounts held for unfinished runs would go above t - The default is `0`, which turns the estimate off. - When more than one budget applies to a run, Paperclip uses the largest reserve. - The reserve is an estimate. The real cost of a run can be higher. +- The reserve applies to every run, including a run on a subscription that records $0. Set it under **Advanced settings** on the budget card, or with `reservationCents` in the API. ## Usage With No Reliable Price -Sometimes Paperclip records usage but cannot give it a price. `unpricedUsagePolicy` controls what a budget with a hard stop does in that case: +Sometimes Paperclip has a complete usage receipt for a run but cannot give it a price. `unpricedUsagePolicy` controls what a budget with a hard stop does with that usage: - `block` (default) — a hard stop opens, even when the known spend is under the limit. To resume, resolve the unpriced usage or change the setting to `allow`. You cannot raise the budget past this stop. - `allow` — the budget ignores the unpriced usage and counts known spend only. -Subscription usage is not unpriced usage. It has a price of $0 and never triggers this setting. +The budget card shows the usage that counts for this setting as **usage events are unpriced**. Hosted browser work with a cost that is not known yet also counts. -In the UI, this is the **Block new work when usage has no reliable price** checkbox under **Advanced settings**. To see which runs have no price, expand **run costs unavailable** on the Costs overview. See [Cost Reporting](/guides/agent-developer/cost-reporting). +This setting does not cover every entry that the Costs overview lists under **run costs unavailable**. These entries do not trigger `block`: + +- A run whose final usage receipt is missing or could not be captured +- An entry that has a known partial cost +- A metered API or subscription entry with no tokens +- Subscription usage. It has a price of $0 + +Work continues for those entries. For what each label on the Costs overview means, see [Cost Reporting](/guides/agent-developer/cost-reporting). + +In the UI, this setting is the **Block new work when usage has no reliable price** checkbox under **Advanced settings**. ## Subscriptions and Provider Quota -Budgets do not cover subscriptions. Paperclip shows subscription information in two other places. +Budgets do not measure subscription usage. Paperclip shows subscription information in two other places. ### Subscriptions @@ -234,7 +252,7 @@ See the [Costs API](/api/costs) for the full list. ## Best Practices -- Check how each agent is billed before you rely on a budget. A budget protects API-key usage. It does not limit a subscription +- Check how each agent is billed before you rely on a budget. A budget measures API-billed spend. Subscription usage adds $0 to it - Set conservative budgets initially and increase as you see results - Use per-agent budgets to limit exposure from any single agent - Use a project budget to cap the total cost of one piece of work diff --git a/docs/guides/board-operator/creating-a-company.md b/docs/guides/board-operator/creating-a-company.md index 5ebf0298f4c..1b94b45e5fc 100644 --- a/docs/guides/board-operator/creating-a-company.md +++ b/docs/guides/board-operator/creating-a-company.md @@ -50,9 +50,9 @@ Set monthly budgets at the company and per-agent level. You can also set a budge - **Warning** at 80% of the budget. Work continues - **Hard stop** at 100% — the company, agent, or project is paused, new work is refused, and a budget incident opens -Both thresholds are settings on the budget. +You can change the warning percentage and turn the hard stop on or off. The hard stop always uses 100% of the budget. -Budgets count dollars only. Usage on a provider subscription is recorded at $0, so a budget does not stop an agent that runs on a subscription. See [Costs and Budgets](/guides/board-operator/costs-and-budgets). +Budgets count dollars only. Usage on a provider subscription is recorded at $0, so subscription usage never moves a budget toward its limit. A hard stop still stops every agent in its scope. See [Costs and Budgets](/guides/board-operator/costs-and-budgets). ## Step 6: Launch diff --git a/docs/guides/board-operator/managing-agents.md b/docs/guides/board-operator/managing-agents.md index 59ebb440e2b..16bda7b8dcb 100644 --- a/docs/guides/board-operator/managing-agents.md +++ b/docs/guides/board-operator/managing-agents.md @@ -70,7 +70,7 @@ Edit an agent's configuration from the agent detail page: - **Adapter config** — change model, prompt template, working directory, environment variables - **Heartbeat settings** — interval, cooldown, max concurrent runs, wake triggers -- **Budget** — monthly spend limit. It counts billed cost, so it does not limit an agent that runs on a subscription +- **Budget** — monthly spend limit. It counts billed cost. Usage on a provider subscription adds $0 to it Use the "Test Environment" button to validate that the agent's adapter config is correct before running. @@ -90,7 +90,7 @@ POST /api/agents/{agentId}/resume An agent is also paused when its recorded spend reaches its monthly budget, unless the hard stop is turned off for that budget. A budget pause opens a budget incident. Resolve it from the incident: raise the budget, or keep the agent paused. A budget pause on a monthly budget also ends when the next UTC month starts. -Budgets count dollars only. Usage on a provider subscription is recorded at $0, so a budget does not pause an agent that runs on a subscription. See [Costs and Budgets](/guides/board-operator/costs-and-budgets). +Budgets count dollars only. Usage on a provider subscription is recorded at $0, so an agent's subscription usage never reaches its budget. A hard stop on the company budget or on a project budget still stops the agent. See [Costs and Budgets](/guides/board-operator/costs-and-budgets). ## Terminating Agents diff --git a/docs/start/core-concepts.md b/docs/start/core-concepts.md index 27cfecb1af2..998dc77c431 100644 --- a/docs/start/core-concepts.md +++ b/docs/start/core-concepts.md @@ -24,7 +24,7 @@ Every employee is an AI agent. Each agent has: - **Adapter type + config** — how the agent runs (Claude Code, Codex, shell process, HTTP webhook) - **Role and reporting** — title, who they report to, who reports to them - **Capabilities** — a short description of what the agent does -- **Budget** — per-agent monthly spend limit. It counts billed cost, so it does not limit usage on a provider subscription +- **Budget** — per-agent monthly spend limit. It counts billed cost. Usage on a provider subscription adds $0 to it - **Status** — active, idle, running, error, paused, or terminated Agents are organized in a strict tree hierarchy. Every agent reports to exactly one manager (except the CEO). This chain of command is used for escalation and delegation. diff --git a/maps/agent-access-map/chat-channels.md b/maps/agent-access-map/chat-channels.md index 3a61ad6c461..6a56ae72364 100644 --- a/maps/agent-access-map/chat-channels.md +++ b/maps/agent-access-map/chat-channels.md @@ -216,8 +216,8 @@ Gaps: This individual operation has source review but no recorded HTTP verificat API: `present` — `POST /api/chat-endpoints/{endpointId}/github/app`; JSON REST. Agent access: `available` — agent REST and default native `search_api` / `call_api` return a saved human credential-entry handoff; agents may send an empty body. Policy: `tools:manage_connections`; [shared management policy](../../doc/plans/2026-10-13-connection-api-parity.md#authorization-contract). A human session imports the App credentials and signing key. Delegated service import is rejected, and agent requests persist no caller-chosen key. -Evidence: `verified` — [route](../../server/src/routes/chat-channels.ts), [provider service](../../server/src/services/chat-channels/github/app-setup.ts), and [actual-auth fixture](../../server/src/__tests__/connection-management.integration.test.ts). Agent key/JWT handoffs leave vault refs unchanged. Fresh drafts open the saved import form without the reconnect flag; its component test submits App import with the required webhook secret. Human import persists credentials, then agent repository discovery and verification continue. -Verification: `passed` — deterministic provider fixtures, assembled server and [saved-screen tests](../../ui/src/pages/apps/chat/GitHubChatSetup.test.tsx). +Evidence: `verified` — [route](../../server/src/routes/chat-channels.ts), [provider service](../../server/src/services/chat-channels/github/app-setup.ts), and [actual-auth fixture](../../server/src/__tests__/connection-management.integration.test.ts). Agent key/JWT handoffs leave vault refs unchanged. Fresh drafts open the saved import form without the reconnect flag; browser E2E submits App import with the required webhook secret. Human import persists credentials, then agent repository discovery and verification continue. +Verification: `passed` — deterministic provider fixtures, assembled server, and [browser chat-provider E2E](../../tests/e2e/chat-adapters-ui-providers-catalog.spec.ts). Gaps: Human credential entry is intentional; no live provider qualification. ### `post-chat-endpoints-github-repositories-refresh` diff --git a/maps/feature-map/agents.md b/maps/feature-map/agents.md index 949ddfa48e3..d4f35e3ed0e 100644 --- a/maps/feature-map/agents.md +++ b/maps/feature-map/agents.md @@ -173,7 +173,7 @@ Preconditions: follow the [baseline](./README.md#before-driving-a-journey). Use ### `hire-agent` -Automated: [configuration form](../../ui/src/components/AgentConfigForm.render.test.tsx) covers mocked configuration-form UI behavior (mocked `NewAgent` page tests were removed; verify the new-agent page flow manually). +Automated: [agent configuration E2E](../../tests/e2e/agent-configuration.spec.ts) and [configuration helpers](../../ui/src/components/AgentConfigForm.test.ts) cover configuration persistence (verify the new-agent page flow manually). For an agent-owned plugin environment, verify preparation before connecting, same-agent probes, account preservation after an environment change, failed @@ -223,9 +223,9 @@ from the hiring picker; API fixture creation does not prove this UI journey. Automated: [instruction service](../../server/src/__tests__/agent-instructions-service.test.ts) and [instruction revisions](../../server/src/__tests__/agent-instruction-revisions.test.ts) cover file/revision contracts. -The [AI account field regression](../../ui/src/components/ai-connections/AiConnectionField.test.tsx) -checks duplicate provider names, account identity in choices and adoption confirmation, -the exact selected grant, and disabled unavailable accounts with authorized metadata fixtures. +The [AI connection model tests](../../ui/src/components/ai-connections/model.test.ts) +and [AI personal connection recovery E2E](../../tests/e2e/ai-personal-connection-recovery.spec.ts) +cover provider/account compatibility and recovery. Manually compare a personal API key and shared subscription with the same name in Harness / Runtime. Confirm their method, scope and available identity before saving. Reload the saved choice and verify the next eligible task uses it; labels alone @@ -261,7 +261,7 @@ The notice must stay absent for native agents, other harnesses, and unsupported targets. Discovery failure must not imply that an upgrade is available. Navigate to another agent while an upgrade is pending. Its result must stay with the original agent, without showing success on the new page or redirecting back. -Focused coverage: [configuration form](../../ui/src/components/AgentConfigForm.render.test.tsx) (mocked upgrade save-receipt UI tests were removed; verify upgrade save receipts manually). +Focused coverage: [agent configuration E2E](../../tests/e2e/agent-configuration.spec.ts) (verify upgrade save receipts manually). For an existing native agent on a Daytona snapshot or immutable sandbox image, use **Test** in its saved Harness or Runtime configuration after a managed @@ -281,7 +281,7 @@ or provider execution. ### `organization` -Automated: none (mocked org-chart and built-in agent configuration modal UI tests were removed; verify manually). +Automated: none (verify manually). Manual: Inspect a manager and report, change the relationship through the offered controls, and reload both views. Exercise a rejected invalid relationship. Configure a built-in agent and verify it retains its required identity and restrictions. diff --git a/maps/feature-map/connection-setup.md b/maps/feature-map/connection-setup.md index 446fd0223b5..eb3a9eb2216 100644 --- a/maps/feature-map/connection-setup.md +++ b/maps/feature-map/connection-setup.md @@ -101,14 +101,12 @@ do not establish OAuth registration, public callbacks, or production provider ac ### `apps-catalog` -Automated: [Browse](../../ui/src/pages/apps/Browse.test.tsx) covers catalog entry -with mocked APIs (mocked `AppNotConnected` and `AppsConnect` component tests were -removed; coverage for access selection, method choices, and setup failures now relies -on browser/manual checks). [Connection intents](../../tests/e2e/connection-intents.spec.ts) -drives store and task setup against one fake provider through a useful continuation: +Automated: [Connection intents](../../tests/e2e/connection-intents.spec.ts) +and [chat provider catalog E2E](../../tests/e2e/chat-adapters-ui-providers-catalog.spec.ts) +drive catalog entry and setup against fake providers through a useful continuation +(Tailscale admin gating is covered by [TailscaleConnector](../../ui/src/pages/apps/TailscaleConnector.test.tsx)): ```sh -pnpm exec vitest run ui/src/pages/apps/Browse.test.tsx pnpm exec playwright test -c tests/e2e/playwright.config.ts tests/e2e/connection-intents.spec.ts ``` @@ -242,8 +240,7 @@ Slack setup does not qualify Discord, Telegram, GitHub, email, or iMessage. Automated: [agent-authenticated integration](../../server/src/__tests__/connection-management.integration.test.ts) uses production agent creation, persistent keys, run JWTs, native tool bindings, human sessions, PostgreSQL and deterministic provider fixtures. It covers saved -setup, ownership, attribution, scope, trust, work modes and revocation. (Mocked -`GoogleWorkspaceServices` UI service-picker tests were removed; verify pending +setup, ownership, attribution, scope, trust, work modes and revocation. (verify pending choices and consent-picker UI manually.) These are separate from live provider setup and model success. diff --git a/maps/feature-map/inbox-search.md b/maps/feature-map/inbox-search.md index 112f5178910..9776acc8069 100644 --- a/maps/feature-map/inbox-search.md +++ b/maps/feature-map/inbox-search.md @@ -149,8 +149,9 @@ approvals resolve. Only the stable list placeholder should appear until the initial sources settle; a failed-run row must not jump when tasks arrive. Release visible-row details separately and compare row/title bounds. Mine reads its own 100-row snapshot with parent/run context; sidebar badges use the count endpoint. -The [Inbox component checks](../../ui/src/pages/Inbox.test.tsx) cover the source -barrier and selected-source query; [badge tests](../../server/src/__tests__/inbox-dismissals.test.ts) +The [inbox helpers](../../ui/src/lib/inbox.test.ts) and [coordinator inbox E2E](../../tests/e2e/coordinator-inbox-views.spec.ts) +cover inbox projection and view transitions ; +[badge tests](../../server/src/__tests__/inbox-dismissals.test.ts) cover unread counts. Browser timing and layout proof remain separate from these tests. ### `decisions` @@ -165,9 +166,7 @@ company/private-task isolation, and private v1 targets. [Attention service regressions](../../server/src/__tests__/attention-service.test.ts) cover pending question forms and confirmations in persistent agent chats, removal after an answer with retained history, and company/task-visibility/addressee checks. -Idle chats without structured requests remain absent. (Mocked -`CoordinatorNeedsYou` UI component tests for chat-sourced canonical question -routing were removed; verify Inbox card routing manually alongside the server +Idle chats without structured requests remain absent. (verify Inbox card routing manually alongside the server tests above.) [Audience, badge and claim tests](../../server/src/__tests__/attention-audience-service.test.ts) cover the view partition, the For you badge with per-view counts, the personal @@ -195,9 +194,7 @@ route tests cover the active-member 422 and board-only writes. [Obligation tests](../../server/src/__tests__/attention-obligations.test.ts) cover the approval/review, budget-stop/override-approval and blocked-task/failed-run joins, the separate human review gate, placement with the blocked task's person, one count per obligation, -evidence that hides and restores with its lead, and the split after an answer. -(Mocked UI component tests for `CoordinatorNeedsYou`, `WhatNeedsMe`, and -`CoordinatorTaskCommitment` were removed; UI view switching, Archived/Restore, +evidence that hides and restores with its lead, and the split after an answer. (UI view switching, Archived/Restore, and reduced-motion card behavior are demonstrated in the Storybook stories below and should be verified manually.) The [Decisions views stories](../../ui/storybook/stories/inbox-search/needs-you-views.stories.tsx) @@ -212,7 +209,7 @@ task context on receipt click. Turning the setting off restores the classic surf ### `search` -Automated: [company search service](../../server/src/__tests__/company-search-service.test.ts) covers server search contracts (mocked `Search` page UI tests were removed; verify search page UI manually). +Automated: [company search service](../../server/src/__tests__/company-search-service.test.ts) covers server search contracts (verify search page UI manually). Manual: Search a unique task title and content phrase, open the result, and compare the actual record. Test filters, no results, and a second company. Verify stale results do not expose inaccessible data. @@ -250,8 +247,8 @@ after switching company/account to verify suppression and isolation. - A feature-map recipe and mocked UI tests do not prove live multiplayer behavior. - Combined Inbox/Tasks requires both `enableCombinedInboxTasks` and - `enableStreamlinedUi`. [Standalone Inbox tests](../../ui/src/pages/Inbox.test.tsx) - render archive/read controls and toolbars; this is not live multi-user evidence. + `enableStreamlinedUi`. [Coordinator inbox E2E](../../tests/e2e/coordinator-inbox-views.spec.ts) + exercises combined and standalone inbox views; live multi-user evidence remains separate. - Personal archival is not task cancellation or completion. - Legacy Inbox routes can redirect to the combined task view; record which host actually rendered. @@ -266,7 +263,7 @@ Capability ID: `inbox-search/views`. Scope: ui Storybook: Mine/Recent/Unread/Blocked and broader task views; combined versus standalone host; loading/empty/error/filter states. Production: Use persisted personal participation/read data; verify scoped counts and list navigation/reload; automatic read cleanup must not create Mine membership. -Sources: Source: [Inbox.tsx](../../ui/src/pages/Inbox.tsx), [Issues.tsx](../../ui/src/pages/Issues.tsx). Tests: [Inbox.test.tsx](../../ui/src/pages/Inbox.test.tsx), [Issues.test.tsx](../../ui/src/pages/Issues.test.tsx), [issues-service.test.ts](../../server/src/__tests__/issues-service.test.ts) +Sources: Source: [Inbox.tsx](../../ui/src/pages/Inbox.tsx), [Issues.tsx](../../ui/src/pages/Issues.tsx). Tests: [inbox.test.ts](../../ui/src/lib/inbox.test.ts), [Issues.test.tsx](../../ui/src/pages/Issues.test.tsx), [issues-service.test.ts](../../server/src/__tests__/issues-service.test.ts), [coordinator-inbox-views.spec.ts](../../tests/e2e/coordinator-inbox-views.spec.ts) #### `toasts` diff --git a/maps/feature-map/questions-and-approvals.md b/maps/feature-map/questions-and-approvals.md index 3648347be4a..dd92dade821 100644 --- a/maps/feature-map/questions-and-approvals.md +++ b/maps/feature-map/questions-and-approvals.md @@ -101,8 +101,7 @@ Use these checks alongside the entry-point recipes below and the operation recor ### `task-thread` -Automated: [interaction cards](../../ui/src/components/IssueThreadInteractionCard.test.tsx), -[paged task cards](../../ui/src/components/task-chat/TaskChatInteractionCard.test.tsx), +Automated: [interaction cards](../../ui/src/components/IssueThreadInteractionCard.test.tsx) and [task thread](../../ui/src/components/TaskChatThread.test.tsx) cover form, receipt, and dismissal behavior. [Resolution routes](../../server/src/__tests__/issue-thread-interaction-routes.test.ts) and [response delivery](../../server/src/__tests__/question-response-delivery.test.ts) @@ -132,8 +131,7 @@ history remains and the conversation does not close as a completed task. ### `attention` -Automated: the resolution-route tests above cover the API (mocked -`AttentionInteractionResolver` UI component tests were removed; verify +Automated: the resolution-route tests above cover the API (verify preparing-request refresh and Decisions/Inbox navigation manually). Manual: open the same pending request in an attention row and task tab. Resolve diff --git a/maps/feature-map/routines.md b/maps/feature-map/routines.md index d4292dfc660..5b899f019c9 100644 --- a/maps/feature-map/routines.md +++ b/maps/feature-map/routines.md @@ -42,7 +42,7 @@ Preconditions: follow the [baseline](./README.md#before-driving-a-journey). Use ### `routine-editor` -Automated: [routine form tests](../../ui/src/components/routine-page/routine-form.test.ts) cover schedule and responsibility sync, and [Routine service](../../server/src/__tests__/routines-service.test.ts) covers server contracts (mocked `RoutineDetail` page tests were removed; verify page redirects, History paging, status switch, save conflicts, and running a routine manually). +Automated: [routine form tests](../../ui/src/components/routine-page/routine-form.test.ts) cover schedule and responsibility sync, and [Routine service](../../server/src/__tests__/routines-service.test.ts) covers server contracts (verify page redirects, History paging, status switch, save conflicts, and running a routine manually). Manual: Save an agent, request, project, and a required variable. Reload and inspect the saved definition. Run now with a distinguishable input, follow the resulting task, and verify its output and history entry. Check a missing required input. @@ -53,7 +53,7 @@ complete the generated task or establish a useful task output. ### `trigger-history` -Automated: [webhook instructions](../../ui/src/components/routine-triggers/webhook-instructions.test.ts) and [webhook fields](../../ui/src/components/routine-triggers/WebhookFields.test.tsx) are component coverage; [routine integration](../../server/src/__tests__/routines-e2e.test.ts) is server integration rather than a provider-wide browser proof. +Automated: [webhook instructions](../../ui/src/components/routine-triggers/webhook-instructions.test.ts) and [replay masking](../../ui/src/lib/analytics/replay-masking.test.tsx) cover webhook instructions and secret-field replay blocking; [routine integration](../../server/src/__tests__/routines-e2e.test.ts) is server integration rather than a provider-wide browser proof. Manual: Set a near-term disposable schedule or authorized test webhook, verify one eligible execution and its source trigger, then disable it and confirm further invocations stop. Inspect a failed execution without losing its history. Remove the temporary trigger after testing. diff --git a/packages/db/src/better-auth-account-issuer-migration.test.ts b/packages/db/src/better-auth-account-issuer-migration.test.ts deleted file mode 100644 index 47466f37076..00000000000 --- a/packages/db/src/better-auth-account-issuer-migration.test.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { getTableConfig } from "drizzle-orm/pg-core"; -import { describe, expect, it } from "vitest"; -import { authAccounts } from "./schema/auth.js"; - -describe("account issuer schema", () => { - it("keeps issuer nullable and identifies accounts by provider and account ID", () => { - const config = getTableConfig(authAccounts); - const issuer = config.columns.find((column) => column.name === "issuer"); - expect(issuer).toBeDefined(); - expect(issuer?.notNull).toBe(false); - - const unique = config.indexes.find((index) => index.config.name === "account_provider_account_id_uq"); - expect(unique?.config.unique).toBe(true); - expect(unique?.config.columns.map((column) => (column as { name: string }).name)).toEqual([ - "provider_id", - "account_id", - ]); - }); -}); diff --git a/packages/shared/src/connection-intent-guidance.test.ts b/packages/shared/src/connection-intent-guidance.test.ts deleted file mode 100644 index ae89f72dff4..00000000000 --- a/packages/shared/src/connection-intent-guidance.test.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { describe, expect, it } from "vitest"; -import { CONNECTION_INTENT_AGENT_GUIDANCE, CONNECTION_REQUEST_TOOL_DESCRIPTION, CONNECTION_RUNTIME_TOOL_NAMES, CONNECTIONS_SEARCH_TOOL_DESCRIPTION } from "./connection-intent-guidance.js"; -describe("connection result guidance", () => { - it("delegates route decisions to trusted tool output instead of a provider decision tree", () => { - expect(CONNECTION_INTENT_AGENT_GUIDANCE).toContain("follow the returned `instruction`"); - expect(CONNECTION_INTENT_AGENT_GUIDANCE).toContain("Respect recorded declines and provider choices"); - expect(CONNECTION_INTENT_AGENT_GUIDANCE).not.toMatch(/Composio|Arcade|Executor|Zapier/); - expect(CONNECTION_INTENT_AGENT_GUIDANCE).not.toMatch(/https?:\/\/|bearer/); - }); - it("retains waiting, credential, and arbitrary URL boundaries", () => { - expect(CONNECTION_INTENT_AGENT_GUIDANCE).toContain("yield without retrying or polling"); - expect(CONNECTION_INTENT_AGENT_GUIDANCE).toContain("never ask for credentials in comments"); - expect(CONNECTION_INTENT_AGENT_GUIDANCE).toContain("arbitrary MCP URLs"); - }); - it("binds a request card to the person it is addressed to", () => { - expect(CONNECTION_INTENT_AGENT_GUIDANCE).toContain("Only that person can complete or decline it"); - }); - it("describes exact questions and saved selection proof", () => { - expect(CONNECTIONS_SEARCH_TOOL_DESCRIPTION).toContain("exact providerQuestion"); - expect(CONNECTION_REQUEST_TOOL_DESCRIPTION).toContain("saved provider-selection interaction ID"); - expect(CONNECTION_RUNTIME_TOOL_NAMES).toEqual(["connections_search","connection_request"]); - }); -}); diff --git a/packages/shared/src/telemetry/readme-contract.test.ts b/packages/shared/src/telemetry/readme-contract.test.ts deleted file mode 100644 index eec9d4511dd..00000000000 --- a/packages/shared/src/telemetry/readme-contract.test.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { readFileSync } from "node:fs"; -import { fileURLToPath } from "node:url"; -import { describe, expect, it } from "vitest"; -import * as generatedTelemetry from "./generated/paperclip-telemetry.js"; - -const readmePath = fileURLToPath(new URL("./README.md", import.meta.url)); - -describe("telemetry README contract", () => { - it("documents generated event helper exports that exist", () => { - const readme = readFileSync(readmePath, "utf8"); - - expect(generatedTelemetry.SCHEMA_VERSION).toBeDefined(); - expect(generatedTelemetry.makeEvent).toBeTypeOf("function"); - expect(generatedTelemetry.makeBatch).toBeTypeOf("function"); - expect(readme).toContain("`SCHEMA_VERSION`, `makeEvent()`, and `makeBatch()`"); - expect(readme).not.toContain("createPaperclipTelemetryEvent"); - expect(readme).not.toContain("createPaperclipTelemetryEnvelope"); - }); -}); diff --git a/packages/shared/src/validators/chat-channels.test.ts b/packages/shared/src/validators/chat-channels.test.ts index eb157fcb001..4f58b4abfbc 100644 --- a/packages/shared/src/validators/chat-channels.test.ts +++ b/packages/shared/src/validators/chat-channels.test.ts @@ -5,6 +5,7 @@ import { resolveChatActionSchema, resolveChatPublicationSchema, chatPublicationStateSchema, + updateChatEndpointSchema, } from "./chat-channels.js"; describe("Microsoft Teams chat credential validation", () => { @@ -111,3 +112,14 @@ describe("chat provider-action resolution validation", () => { ); }); }); + +describe("chat endpoint communicationInstructions validation", () => { + it("accepts clearing instructions and rejects oversized instructions and unsupported controls", () => { + expect(updateChatEndpointSchema.parse({ communicationInstructions: " " })).toEqual({ + communicationInstructions: "", + }); + expect(updateChatEndpointSchema.safeParse({ communicationInstructions: "a".repeat(4001) }).success).toBe(false); + expect(updateChatEndpointSchema.safeParse({ replyDetail: "brief" }).success).toBe(false); + expect(updateChatEndpointSchema.safeParse({ progressUpdates: false }).success).toBe(false); + }); +}); diff --git a/packages/skills-catalog/src/release-content-cases-contract.test.ts b/packages/skills-catalog/src/release-content-cases-contract.test.ts deleted file mode 100644 index 64bd29a3372..00000000000 --- a/packages/skills-catalog/src/release-content-cases-contract.test.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { readFileSync } from "node:fs"; -import { describe, expect, it } from "vitest"; - -function readRepoFile(path: string) { - return readFileSync(new URL(`../../../${path}`, import.meta.url), "utf8"); -} - -describe("release-content Cases contract", () => { - it("keeps release-content skills wired to emit the required case tree", () => { - const release = readRepoFile(".agents/skills/release/SKILL.md"); - const changelog = readRepoFile(".agents/skills/release-changelog/SKILL.md"); - const discord = readRepoFile(".agents/skills/release-changelog-discord-message/SKILL.md"); - const announcement = readRepoFile("packages/skills-catalog/catalog/optional/content/release-announcement/SKILL.md"); - const combined = [release, changelog, discord, announcement].join("\n"); - - for (const required of [ - "\"caseType\": \"release\"", - "\"caseType\": \"blog_post\"", - "\"caseType\": \"tweet_storm\"", - "\"parentCaseId\"", - "PUT /api/cases/:caseId/documents/body", - "paperclip-release:vYYYY.MDD.P", - "X-Paperclip-Run-Id", - ]) { - expect(combined).toContain(required); - } - - expect(release).toContain("same three cases instead of duplicating them"); - expect(changelog).toContain("\"release_patch\": 0"); - expect(changelog).toContain("\"stable\": true"); - expect(changelog).toContain("\"channels\": [\"changelog\", \"blog_post\", \"tweet_storm\"]"); - expect(changelog).toContain("\"artifacts\""); - expect(changelog).toContain("\"verification\""); - expect(changelog).toContain("\"notes\": null"); - expect(announcement).toContain("\"word_count_target\": 650"); - expect(announcement).toContain("\"requires_screenshot\": false"); - expect(discord).toContain("\"needs_human_copy_paste\": true"); - expect(discord).toContain("\"approved_by\": null"); - }); -}); diff --git a/scripts/general-server-shard-durations.json b/scripts/general-server-shard-durations.json index e9b11bcf4fd..e5cf2d3d0ba 100644 --- a/scripts/general-server-shard-durations.json +++ b/scripts/general-server-shard-durations.json @@ -10,9 +10,9 @@ } ], "coverage": { - "measured": 1577, - "withSetup": 1577, - "inventory": 2142 + "measured": 1573, + "withSetup": 1573, + "inventory": 2138 }, "durations": { "server/scripts/build-config.test.mjs": 10828, @@ -900,7 +900,6 @@ "server/src/__tests__/prepared-chat-authorization.integration.test.ts": 7209, "server/src/__tests__/prepared-statements-driver.test.ts": 6901, "server/src/__tests__/prepared-statements.test.ts": 803, - "server/src/__tests__/primary-agent-guidance.test.ts": 4326, "server/src/__tests__/primary-agent.test.ts": 10405, "server/src/__tests__/principal-access-compatibility.test.ts": 3032, "server/src/__tests__/privacy-production-review.test.ts": 12611, @@ -1032,7 +1031,6 @@ "server/src/__tests__/scoped-deadline-work-notifications.test.ts": 2950, "server/src/__tests__/scoped-deadline-work.test.ts": 2998, "server/src/__tests__/secret-binding-discovery.test.ts": 2921, - "server/src/__tests__/secret-entry-guidance.test.ts": 3727, "server/src/__tests__/secret-provider-registry.test.ts": 917, "server/src/__tests__/secret-sensitive-request-error.test.ts": 6884, "server/src/__tests__/secrets-service-dangling-user-secret.test.ts": 8396, @@ -1453,7 +1451,6 @@ "server/src/services/chat-channels/slack/receipt-timing.test.ts": 940, "server/src/services/chat-channels/slack/signing-secret-preflight.test.ts": 7167, "server/src/services/chat-channels/slack/wake-authority.test.ts": 908, - "server/src/services/chat-communication-guidance.test.ts": 1886, "server/src/services/chat-control-admission-retry.test.ts": 5391, "server/src/services/chat-discord-adapter-patch.test.ts": 4770, "server/src/services/chat-discord-command-registration-store.test.ts": 7446, @@ -1969,7 +1966,6 @@ "server/src/services/object-run-log-store.test.ts": 9158, "server/src/services/offline-workspace-operation-reconciliation.test.ts": 8220, "server/src/services/onboarding-first-task-assets.test.ts": 2668, - "server/src/services/onboarding-greeting.test.ts": 1943, "server/src/services/online-durable-data-migration-postgres.test.ts": 9418, "server/src/services/online-durable-data-migration.test.ts": 8010, "server/src/services/online-legacy-workspace-recovery.test.ts": 6018, diff --git a/scripts/storybook-button-usage.test.mjs b/scripts/storybook-button-usage.test.mjs deleted file mode 100644 index d63699351be..00000000000 --- a/scripts/storybook-button-usage.test.mjs +++ /dev/null @@ -1,25 +0,0 @@ -import assert from "node:assert/strict"; -import test from "node:test"; -import { buttonReferences } from "./storybook-button-usage.mjs"; - -test("button usage follows canonical imports and aliases, excluding native and unrelated buttons", () => { - const entries = buttonReferences(` - import { Button as Action } from '@/components/ui/button'; - import * as UI from './ui/button'; - import { Button } from './OtherButton'; - export const View = () => <>