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. > - Over recent sprints, `scripts/ci/nightly-only-suites.json` accumulated 588 real-clock soak, recovery, lease, and maintenance test files totaling ~326k LOC and ~307 CPU-minutes on `master`, `release-verify`, and `full-ci` runs. > - Most of those files are overlapping single-PR regression soaks whose failure modes are already covered by canonical suites, driving up maintenance cost, typecheck load, and post-merge verification runtime without adding distinct coverage. > - Following `.agents/skills/test-audit/SKILL.md`, this pull request prunes 483 redundant/overlapping soak files (`-158,485` net LOC, ~180 CPU-min saved) while retaining 105 canonical, high-signal nightly suites covering every distinct failure mode and 100% of suites referenced by CI workflows, benchmarks, Slack eval manifests, lifecycle inventories, or tsconfigs. > - All timing manifests and feature/agent-access maps are updated cleanly to remove stale references. > - The benefit is a ~59% reduction in nightly soak CPU time and ~158.5k fewer lines of duplicate test code to compile, typecheck, and maintain while preserving full invariant and canonical soak coverage. ## Linked Issues or Issue Description Refs #22804 **What existing behavior does this improve?** Test suite maintainability, typecheck scope, and nightly/post-merge/full-CI runtime across `scripts/ci/nightly-only-suites.json` and `server/src/`. **Subsystem affected** server/ — REST API & orchestration services **Current behavior** `scripts/ci/nightly-only-suites.json` contains 588 standalone soak test files (~307 CPU-min total), with hundreds of overlapping one-PR recovery, lease, and idle-maintenance soak suites duplicating canonical coverage. **Proposed behavior** Retain 105 canonical high-signal nightly suites covering every distinct failure mode and every hard-referenced suite, delete 483 redundant soak files, and keep `nightly-only-suites.json`, `general-server-shard-durations.json`, and `maps/` 100% synchronized. ## What Changed - **Pruned 483 redundant nightly soak files (`-158,916 / +431` LOC = `-158,485` net LOC, ~59% of nightly soak CPU):** - Retained **105 canonical high-signal nightly suites** covering every distinct failure mode and 100% of hard-referenced suites (`scripts/run-vitest-stable.mjs`, `runner-chaos-evals.yml`, `ci-work-benchmark.yml`, `tests/lifecycle-baseline/inventory.mjs`, `stress-workflow-traceability.json`, `packages/plugins/examples/slack/evals/cases.json`, and `tsconfig*.json`), including the 6 focused suites restored after review (`idle-database-backup-sync`, `isolated-remote-workspace-source-lock`, `agent-chat-response-recovery`, `chat-slack-receipts`, `heartbeat-slack-invitation`, `ephemeral-migration-service`). - **Updated manifests and maps:** - `scripts/ci/nightly-only-suites.json`: 588 → 105 suites (0 missing, 0 duplicates, 0 protected invariants demoted). - `scripts/general-server-shard-durations.json`: 2,138 → 1,655 entries (`coverage: { measured: 1573, withSetup: 1573, inventory: 1655 }`, pruned all 483 deleted paths). - Updated all affected `maps/{agent-access-map,feature-map}/*.md` files with zero dangling references. ## Verification - `node scripts/check-test-budget.mjs --base origin/master` — **PASS** (105 nightly suites validated, 0 invariant violations) - `node scripts/check-maps.mjs` — **PASS** (35 areas, 192 capability IDs aligned) - `node packages/plugins/examples/slack/evals/run-regressions.mjs --list` — **PASS** - `node --test scripts/__tests__/run-vitest-stable-shard.test.mjs scripts/__tests__/run-vitest-stable-pr-mode.test.mjs scripts/check-test-budget.test.mjs scripts/ci/test-selection-pr-timings.test.mjs scripts/ci/test-selection-timings.test.mjs tests/lifecycle-baseline/report.test.mjs .github/scripts/tests/ci-plan.test.mjs` — **102/102 PASS** - Repo-wide scan confirmed 0 test-to-test imports and 0 dangling references in `scripts/`, `.github/`, `maps/`, `tsconfig*.json`, `packages/plugins/examples/slack/evals/cases.json`, or `tests/lifecycle-baseline/inventory.mjs`. ## Risks - Low risk: every deleted file was already nightly-only (not running on ordinary PRs) and every distinct failure mode plus every core control-plane invariant remains covered by PR suites and the 105 retained canonical nightly suites. ## Model Used - Google Gemini (Antigravity agent swarm) with extended reasoning, tool use, and local test execution (`server-prune`, `verifier`, `ci-pipeline`). ## 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 - [x] All Paperclip CI gates are green - [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups - [x] I will address all Greptile and reviewer comments before requesting merge
229 lines
15 KiB
Markdown
229 lines
15 KiB
Markdown
---
|
||
navigation: {"section":"Tasks and conversations","sectionOrder":20,"order":50}
|
||
---
|
||
|
||
# Questions and approvals
|
||
|
||
People answer an agent's questions and decide requests without losing the task's
|
||
history. A question, plan confirmation, governance approval, and app-tool review
|
||
can look similar but have different authority and continuation rules. Each
|
||
decision must stay attached to its original request and survive reload.
|
||
|
||
Feature ID: `questions-and-approvals`.
|
||
|
||
Agent access: [companion](../agent-access-map/questions-and-approvals.md).
|
||
|
||
## Sub-features
|
||
|
||
- `questions`: `questions-and-approvals/questions` — single-choice, multiple-choice, custom, and free-text answers;
|
||
paged forms retain answers until submission and show validation failures.
|
||
- `dismiss-and-reopen`: `questions-and-approvals/dismiss-and-reopen` — questions and composer requests (including completion reviews) remain in the feed after dismissal
|
||
or a newer message; reopening restores the form without inventing an answer.
|
||
- `confirmations`: `questions-and-approvals/confirmations` — accept, decline, or request changes; stale, expired, resolved,
|
||
and withdrawn requests cannot be acted on again.
|
||
- `plan-review`: `questions-and-approvals/plan-review` — inspect the requested plan revision before accepting or asking
|
||
for changes. An ordinary planning task can proceed to execution; Agent Chat
|
||
hands work to linked tasks and remains a conversation.
|
||
- `audience`: `questions-and-approvals/audience` — the current actor, company, named audience, and review policy govern
|
||
resolution. A visible request is not necessarily actionable by that viewer.
|
||
- `governance`: `questions-and-approvals/governance` — pending/history views, approve/reject, revision request, and
|
||
resubmission for formal board approvals.
|
||
- `tool-review`: `questions-and-approvals/tool-review` — inspect the bounded server-redacted arguments and audit hash before approving once, always allowing the displayed scope, or declining;
|
||
decision status and provider execution outcome remain distinct.
|
||
- `continuation`: `questions-and-approvals/continuation` — one recorded response leads to the eligible waiting run or
|
||
continuation; repeated clicks, reloads, and competing tabs do not repeat work.
|
||
|
||
## How to get to it (user POV)
|
||
|
||
### `task-thread`
|
||
|
||
Open a task from Tasks, search, a project, or its direct `/issues/:issueId` link.
|
||
Answer the question near the composer, or reopen its compact unanswered entry
|
||
in the history. Open the plan preview before using the confirmation controls.
|
||
Exercise both available task presentations when a change affects shared cards.
|
||
|
||
### `agent-chat`
|
||
|
||
With Agent Chat enabled, choose Chat and an agent (`/chats/:agentRef`). Answer,
|
||
dismiss, or reopen requests in this persistent conversation. A plan handoff here
|
||
creates linked work rather than turning the conversation into implementation.
|
||
|
||
### `attention`
|
||
|
||
Open Decisions (`/decisions`, including a saved queue) or an Inbox attention row.
|
||
Expand an actionable interaction inline; follow its task link to inspect context.
|
||
With combined Inbox/Tasks enabled, open the corresponding Tasks view instead.
|
||
|
||
### `board-approval`
|
||
|
||
Open Approvals → Pending or All (`/approvals/pending`, `/approvals/all`). Use the
|
||
card action or open `/approvals/:approvalId` for details, comments, revision
|
||
request, and resubmission. These are formal approvals, not ordinary questions.
|
||
|
||
### `app-review`
|
||
|
||
In a task, open **Review request** for an Ask first app call. The same request
|
||
appears in Apps → Review (`/apps/review`) and the connection's Review tab.
|
||
Use **Approve & run**, **Always allow**, or **Decline** on the surface under test.
|
||
|
||
### `skill-test`
|
||
|
||
Open Skill Studio, run a skill test that produces an interaction, and inspect
|
||
its output card. Skill-test authority is narrower than an ordinary company run.
|
||
|
||
### `external-channel`
|
||
|
||
In a configured chat channel, answer a published question or confirmation as a
|
||
linked sender. Open the associated Paperclip task to inspect the saved outcome.
|
||
Channel-specific forms and identity linking require separate provider evidence.
|
||
|
||
## Driving it
|
||
|
||
Preconditions: follow the [baseline](./README.md#before-driving-a-journey).
|
||
Use separate disposable requests for accept, decline, and revision paths. Record
|
||
the actor and request revision. Prepare a waiting question through a test agent;
|
||
a component fixture alone cannot prove live response delivery.
|
||
|
||
**Operation checkpoints**
|
||
|
||
Use these checks alongside the entry-point recipes below and the operation records in the [access companion](../agent-access-map/questions-and-approvals.md). Record the actual actor, surface, saved result and denial separately. Source review and linked tests do not establish a live pass.
|
||
|
||
| Capability ID | Action and persisted result | Denial, race and retry checks |
|
||
| --- | --- | --- |
|
||
| `questions-and-approvals/questions` | Create fixed-ID single/multiple/custom/text questions; move between pages, submit, and reload the saved answer and responder. | Reject missing/invalid answers without resolving. Competing answers settle once. Distinguish cancel, withdraw, historical Done-task answers, and local dismissal; historical answers must not restart work. |
|
||
| `questions-and-approvals/dismiss-and-reopen` | Dismiss questions, completion reviews, confirmations, choices, and item requests without deciding; reload and reopen from history. | Confirm the server request remains pending and a new ordinary comment does not answer it. Resolve in another tab and refresh the old form. Saved-request dismissals persist on the server and suppress repeated agent demands; drafts and raw runtime dismissals remain browser-local. Protected actions still require authorization. |
|
||
| `questions-and-approvals/confirmations` | Use separate accept, decline/change-request, checkbox subset, suggested-task selection, and partial item-verdict requests. Inspect the actual selected items and created task IDs. | Test invalid selections, child-without-parent selection, expiry, supersession, withdrawal, and repeated/conflicting decisions. Partial verdicts persist; skip must not start a continuation. |
|
||
| `questions-and-approvals/plan-review` | Open the exact requested plan revision; reject one request and accept another. Inspect saved revision, work mode, owner, and the resulting continuation. | Edit after requesting review and reject stale acceptance. Test finalization readiness and bound completion review separately. In Agent Chat, inspect the later project/task creation and its source-plan provenance; acceptance alone is not a completed handoff. |
|
||
| `questions-and-approvals/audience` | Repeat a request for a named person, named agent, human-only resolver, and independent reviewer. Inspect actionability and final attribution. | Test creator exclusion, wrong audience/company, private task, missing or cancelled run, and changed responsible-user access. A human comment used by an agent remains subject to that agent’s resolver authority. |
|
||
| `questions-and-approvals/governance` | Create and inspect a formal request, comment, request revision, resubmit, then approve or reject distinct requests. Reload history and linked task state. | Test board decision authority separately from agent request/comment/resubmit authority. A repeated decision cannot repeat activation. Current pending status, payload revision, and governed side effects must agree. |
|
||
| `questions-and-approvals/tool-review` | Invoke a harmless Ask first action with a proposal longer than its preview. Open Arguments and audit hash on task and Apps review surfaces and inspect the tail before a decision. Then exercise Approve once, Always allow, and Decline separately. | No provider call before approval. Repeat decisions and compare invocation count. Change the tool definition, revoke access, or set Off before a decision. Record the approval decision and provider outcome independently. |
|
||
| `questions-and-approvals/continuation` | After answering, inspect the saved response, delivery receipt, eligible run, and useful result in the original task/thread. | Reload, race two tabs, and interrupt delivery after saving. Require one continuation without repeated external actions. Reassignment, Stop, pause, budget, and external-thread boundaries remain effective. |
|
||
|
||
### `task-thread`
|
||
|
||
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)
|
||
cover authority and durable continuation. Run a targeted set with:
|
||
|
||
```sh
|
||
pnpm exec vitest run ui/src/components/TaskChatThread.test.tsx server/src/__tests__/question-response-delivery.test.ts
|
||
```
|
||
|
||
Manual: answer a multi-page question, go back, edit, then submit. Reload and
|
||
confirm the saved answers and one agent continuation. On a fresh request,
|
||
dismiss, reload, reopen, and verify the draft. Send a new comment while a
|
||
question remains unanswered; it must stay reopenable in history. Try a denied
|
||
actor and a request already resolved in another tab; expect an explicit error
|
||
or settled receipt, never a second decision. For plans, change the plan revision
|
||
before trying the old approval, then review the current revision.
|
||
|
||
### `agent-chat`
|
||
|
||
Automated: the [task thread suite](../../ui/src/components/TaskChatThread.test.tsx)
|
||
parameterizes unanswered-question history for conversation mode on and off.
|
||
This proves component parity, not a model's plan handoff.
|
||
|
||
Manual: repeat dismissal, reload, reopening, and answer submission in Chat.
|
||
Approve a plan and inspect the linked execution task and copied plan. The chat
|
||
history remains and the conversation does not close as a completed task.
|
||
|
||
### `attention`
|
||
|
||
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
|
||
from the row; both surfaces must settle after refresh. Check an empty queue,
|
||
loading, permission denial, and a stale request. Repeat with combined Inbox/Tasks
|
||
on when that surface is part of the change. Full navigation parity remains a
|
||
manual coverage gap.
|
||
|
||
### `board-approval`
|
||
|
||
Automated: [approval service](../../server/src/__tests__/approvals-service.test.ts)
|
||
and [idempotency routes](../../server/src/__tests__/approval-routes-idempotency.test.ts)
|
||
cover persistence and duplicate decisions. They do not drive the approval pages.
|
||
|
||
Manual: create disposable formal approval requests; approve one from the list,
|
||
reject another from details, and request revision on a third. Resubmit that
|
||
third request and verify Pending/All and detail history after reload. Confirm
|
||
the recorded decision and its governed effect, not just a success toast.
|
||
|
||
### `app-review`
|
||
|
||
Automated: [connection reviews](../../tests/e2e/connection-reviews.spec.ts) drives
|
||
task/queue synchronization, approve, decline, remembered permission, provider
|
||
failure, and restart with a scripted process agent and local MCP provider:
|
||
|
||
```sh
|
||
pnpm exec playwright test -c tests/e2e/connection-reviews.config.ts
|
||
```
|
||
|
||
Manual: dismiss and reopen a review, decide it from each entry point using fresh
|
||
requests, and inspect the continuation's useful result. Always allow must show
|
||
its scope; a future action with changed arguments should obey the saved rule.
|
||
Provider failure must remain an approved decision with a failed execution.
|
||
Real provider and model checks follow [Task reviews](../../doc/connections/TASK-REVIEWS.md#verification-workflows).
|
||
|
||
### `skill-test`
|
||
|
||
Automated: [read-only interaction contract](../../server/src/__tests__/issue-thread-interaction-routes.test.ts)
|
||
checks that fetching interactions does not mutate them. Shared card suites cover
|
||
rendering. Neither proves the complete Skill Studio host or its permission matrix.
|
||
|
||
Manual: run a skill test with a question, answer through its visible output,
|
||
and inspect the test result. Attempt a governed action outside the test's scope;
|
||
expect denial. The complete Skill Studio browser journey is not covered by the
|
||
referenced unit tests.
|
||
|
||
### `external-channel`
|
||
|
||
Automated: [chat question forms](../../server/src/services/chat-question-forms.test.ts),
|
||
[Discord forms](../../server/src/services/chat-discord-question-forms.test.ts),
|
||
and [interaction publications](../../server/src/__tests__/chat-interaction-publications.test.ts)
|
||
cover serialization and delivery logic with fixtures.
|
||
|
||
Free-text and multi-question cards show their title, prompts, help, and context.
|
||
Slack modals retain instructions and editable starting text. Closed single-choice
|
||
questions use buttons for up to five options and an inline searchable selector
|
||
for six to 100. Multiple choices use checkboxes (up to ten) or a multiple selector,
|
||
then explicit Submit. Custom choices combine direct buttons with an Other modal;
|
||
pattern errors appear beside the native input. Ordinary confirmations use buttons;
|
||
checklists preserve defaults and bounds; item verdicts use radio choices and reasons;
|
||
suggested tasks use Create, selection, and Dismiss. Connection requests offer
|
||
Review connection and native Not now, without granting access from Slack.
|
||
|
||
Governed approvals, unsupported mixed forms, attachments, and oversized requests
|
||
retain the full Paperclip review path. Link clicks navigate without attempting an
|
||
answer. Terminal edits preserve the submitted response in the same authorized
|
||
conversation and remove stale controls. Inspect the saved interaction, exactly
|
||
one continuation, and useful reply independently. See
|
||
[question response delivery](../../server/src/__tests__/question-response-delivery.test.ts)
|
||
and [Slack card tests](../../server/src/services/chat-channels/slack/cards.test.ts).
|
||
Local real-Slack proof for eleven formats, including native validation and public
|
||
link navigation, is recorded with PR #17255. It uses a deterministic protocol
|
||
fixture and does not establish deployed staging or model reliability.
|
||
|
||
Manual: use a disposable provider conversation, answer as the linked sender,
|
||
and check the task's persisted result and one continuation. Repeat from an
|
||
unlinked or wrong sender and with an expired card. A browser answer does not
|
||
qualify Slack, Discord, Telegram, email, or iMessage; record each as not run
|
||
unless its actual provider journey was driven.
|
||
|
||
## Gotchas
|
||
|
||
- Dismissing a question does not answer it. Dismissing an app review neither
|
||
grants permission nor resumes the agent. Ordinary comments cannot approve it.
|
||
- A resolved request and a successful tool execution are separate facts.
|
||
- Do not reuse an accepted request to test rejection; use another request.
|
||
- Agent Chat and skill tests have distinct lifecycle/authority rules despite
|
||
sharing UI. A watchdog cannot acquire board authority by resolving a card.
|
||
- An answer to an old question can queue behind a successor run; it does not
|
||
automatically steer that run. See [steering](./steering.md).
|
||
|
||
### Documentation scope: Formal governance approvals
|
||
|
||
Formal board decisions and signoff have recipes; every approval payload/type and actor/host error permutation is not enumerated.
|