mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-12-05 23:06:17 +01:00
## Thinking Path > - Paperclip manages work for companies of AI agents. > - Remote agents use the sandbox callback bridge to reach the controller. > - The built-in Summarizer reads and writes summary slots through that bridge. > - The server and bundled skill already provide these routes. > - The default bridge allowlist rejects all three documented requests. > - This change admits the exact methods and paths, so remote summaries can reach the existing server checks. ## Linked Issues or Issue Description - Fixes: [#16481](https://github.com/paperclipai/paperclip/issues/16481). - Related: [#16534](https://github.com/paperclipai/paperclip/pull/16534) adds a labels read route in the same allowlist. [#14533](https://github.com/paperclipai/paperclip/pull/14533) changes SSH attachment queue reads. Neither adds summary-slot routes. - Related: [#11682](https://github.com/paperclipai/paperclip/pull/11682) adds routine refresh behavior on the server. This change does not include that work. ## What Changed - Add only GET slot, GET slot revisions, and PUT slot to the shared default allowlist. Each pattern matches the full path. - Test all three requests through the file queue. Check that the method, path, query, and JSON body reach the handler. Check that a controller 403 response stays a 403 response. - Add allowlist checks for both transports and rejection checks for wrong methods, missing or extra path segments, similar resource names, and the board-only generate action. ## Verification - On base `185483e0909246b4609980a0e6e7ad3b8dbad1ba`, the new regressions fail: all three queue requests return 403 instead of 200. The allowlist assertion also fails (4 failed). - PASS: `pnpm exec vitest run packages/adapter-utils/src/sandbox-callback-bridge.test.ts packages/adapter-utils/src/http2-bridge-server.test.ts packages/adapter-utils/src/sandbox-callback-bridge-body.test.ts packages/adapter-utils/src/execution-target.test.ts` (162 passed). - PASS: `PAPERCLIP_ENABLE_DARWIN_SSH_ENV_LAB=1 pnpm exec vitest run packages/adapter-utils/src/ssh-fixture.test.ts` (25 passed, no skips). - PASS: `pnpm exec vitest run server/src/__tests__/summary-slot-routes.test.ts server/src/__tests__/summary-slots.test.ts` (31 passed, no skips). These tests use the existing routes and an isolated PostgreSQL database. They cover company access, board write denial, non-Summarizer denial, and generation task/run checks. - PASS: `pnpm --filter @paperclipai/adapter-utils typecheck`, `pnpm --filter @paperclipai/adapter-utils build`, and `git diff --check`. - Local environment: macOS ARM64, Node 26.11.1, pnpm 9.15.4. The first server test attempt could not load the plugin SDK. Building the existing shared/plugin SDK packages resolved that setup failure. One new mock-call assertion also needed correction because the handler receives a second context argument; the tests then passed. - BLOCKED: `pnpm -r typecheck` stops at missing Node types in an uninstalled workspace. `pnpm test:run` and `pnpm build` stop in preflight because the CLI workspace's `tsx` is not installed. Their full test/build bodies did not run. Only the server dependency closure was installed in this isolated worktree. Disk space was limited and Rust/cargo was unavailable. - NOT_RUN: a model-driven SSH Summarizer run against a real Paperclip instance, full repository gates, PR CI, and Greptile. The queue handler's test 403 proves response forwarding; it does not prove controller authorization. The server tests provide separate authorization evidence. ## Risks - The bridge now admits three existing summary-slot operations. Server company access, the summaries feature flag, and the Summarizer task/run write checks remain in force. - No schema or request contract changes. POST generate and unrelated routes stay denied. A real SSH Summarizer run and full CI remain acceptance limits. ## Model Used - OpenAI Codex, `gpt-6.1-sol`, `xhigh` reasoning, for implementation and validation. Read-only assistants used OpenAI `gpt-6-luna` with `max` reasoning for upstream checks, source inspection, and independent review. A browser assistant used OpenAI `gpt-6.1-sol` with `medium` reasoning to prepare the review page. Tools included shell execution, Git/GitHub APIs, Vitest, TypeScript, and browser interaction. The context window size is not exposed by this session. ## 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 linked existing issues or described the issue in-PR - [x] I have not referenced internal/instance-local Paperclip issues or links - [x] My branch name describes the change and contains no internal Paperclip ticket id - [x] I have run the listed targeted tests locally and they pass - [x] I have added or updated tests where applicable - [x] I have checked the existing API/skill documentation; no request contract changed - [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