mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-22 11:54:35 +01:00
ac02de7732e8aad2d44304792db8cec4a5a0ebc0
3
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
6bf312270c |
fix(ci): stabilize database-backed readiness checks (#22476)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - CI checks its recovery workers, attention routes, and external chat admission against real PostgreSQL. > - Large fixtures start from an empty database without statistics for their new rows. > - Slow query plans can exhaust test deadlines before the behavior checks finish. > - Route responses can also leave wakeups writing rows while teardown deletes their agents. > - Setup admission takes an endpoint lock that can deadlock with resource foreign-key checks and agent invalidation. > - This pull request prepares fixture statistics, drains pending work, and uses a compatible endpoint lock. > - The benefit is reliable readiness checks with the same fixtures, assertions, and deadlines. ## Linked Issues or Issue Description Refs: #21941, #21831, #21132. The compiler-memory mitigation in #19383 is already merged and is not repeated here. **What happened?** The recovery census and review-attention equivalence tests repeatedly timed out on unrelated PRs. Recovery-action teardown also failed on an agent-wakeup foreign key, and concurrent first GitHub mentions could deadlock during resource admission. Examples: [census timeout](https://github.com/paperclipai/paperclip/actions/runs/44868742060/job/136738633187), [review timeout](https://github.com/paperclipai/paperclip/actions/runs/44856500775/job/136732143246), [cleanup failure](https://github.com/paperclipai/paperclip/actions/runs/44866635624/job/136731817497), and [chat deadlock](https://github.com/paperclipai/paperclip/actions/runs/44845946341/job/136667344125). **Expected behavior** The complete fixtures retain their regression coverage, pending wakeups finish before deletion, and concurrent chat admission completes with exactly one setup destination enabled. **Steps to reproduce** 1. Run the two timeout suites against a freshly seeded database before its statistics refresh. 2. Complete an issue-update request that schedules an assignee wake, then delete its fixture immediately. 3. Run the new resource-admission regression on the base revision. It forces the endpoint/agent lock order and fails with PostgreSQL SQLSTATE `40P01`. **Paperclip version or commit** Base: `33ffaa5b9a2e0954c2afc063572346cb1be534a7`. ## What Changed - Run `ANALYZE` on the populated fixture tables after seeding the existing census and review-attention populations. No fixture reduction, assertion removal, retry increase, or deadline increase. - Await `drainActiveRunExecutions()` before recovery-action fixture cleanup. This includes pending wake admission after HTTP responses. - Use `NO KEY UPDATE` for setup endpoint admission. It still serializes competing admission transactions and endpoint mutations while allowing resource foreign-key `KEY SHARE` locks. - Add a real PostgreSQL regression using the real `ensureResource` write, with barriers that force concurrent endpoint admission and an agent-locked resource insert. Both transactions must finish and exactly one destination must become enabled. - Document fixture statistics, teardown ownership, and admission locking in `doc/test-infrastructure.md`. ## Verification - The new concurrency regression fails on the original endpoint lock with SQLSTATE `40P01`, then passes with `NO KEY UPDATE`. - Both timeout suites pass with their full populations and original deadlines: 8 tests. - The full recovery-action suite passes: 120 tests. - Existing GitHub first-repository and disabled-repository integration checks pass: 7 tests. - The new PostgreSQL concurrency regression passes: 1 test. - The local baseline timeout suites passed slowly; the review equivalence case took 35.8 seconds before statistics and 0.63 seconds afterward. These are local observations, not a CI speed guarantee. - The first broad typecheck caught an unsupported `Promise.withResolvers` type in the new test. The barriers now use ordinary promises compatible with the repository target. The final `pnpm -r typecheck` passes. - `git diff --check` passes. - `pnpm -r typecheck` and `pnpm build` pass. The full local `pnpm test:run` attempt stopped after all six chat shards: 1,969 tests passed and two Slack tests failed on skill-root discovery. The remaining local groups did not run. Both failures reproduce with the production change reverted to `origin/master`: the resolver selects an unrelated ancestor `skills/` directory without `slack/SKILL.md`, which also prevents the mocked Slack run from starting. This is a confirmed baseline local-layout issue, not a passing full-suite result. The [complete CI run](https://github.com/paperclipai/paperclip/actions/runs/44873350026) passes on `66c146b177b50e052a21921644dfd626c96c010d` on attempt 1. The PR check rollup has 58 successes, three expected skips, and no pending or failing checks. [Greptile reviewed the current head `66c146b`](https://github.com/paperclipai/paperclip/pull/22476#issuecomment-7058185817) at 5/5 with no actionable findings. Review follow-up verification: - Replaced the resource-read stub with the real `createChatInboundAuthority(...).ensureResource` persistence path. The revised regression fails with `FOR UPDATE` and PostgreSQL `40P01`, then passes with `NO KEY UPDATE`. - Scoped `ANALYZE` to the fixture tables and moved the behavior note from `DEVELOPING.md` to `test-infrastructure.md`. - All 9 affected tests pass after these edits; the complete server typecheck also passes. The production lock change is unchanged from the earlier full workspace typecheck and build passes. - The previous CI attempt had two interrupted jobs: [Runner static checks](https://github.com/paperclipai/paperclip/actions/runs/44872465981/job/136749952142) and [serialized server 9/9](https://github.com/paperclipai/paperclip/actions/runs/44872465981/job/136749952782). Both logs record a runner shutdown. The static lane reported 2,371 passing tests before cancellation; the interruption is not counted as a pass. The final head passes the complete fresh CI run linked above, including both lanes. ## Risks Low scope. Production code changes only the endpoint row-lock strength. The regression uses real foreign keys and connector invalidation triggers; the existing integration checks retain first-destination serialization and disabled-destination behavior. No schema, API, or authorization changes. `ANALYZE` updates only test-database statistics. Drain failures still fail teardown. All current-head remote checks now pass, including typecheck, build, tests, and e2e. The baseline local full-suite failure and unrun remaining local groups are recorded above; focused local checks pass. The already merged compiler-input fix does not establish the cause of every past runner shutdown. ## Model Used OpenAI GPT-6.1 Sol (`gpt-6.1-sol`) through the Codex harness, with xhigh reasoning and shell/code execution. The session does not expose its context-window size. ## 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 --------- Co-authored-by: Paperclip <noreply@paperclip.ing> |
||
|
|
6b9952525d |
build(server): omit tests from production compilation (#19383)
Use a separate production TypeScript configuration that excludes colocated tests while retaining every runtime source input and keeping tests in source typechecking. Verify the real compiler input sets and bound compiler-list capture for the larger source graph. Validation: focused compiler-input regression passes; fresh CI has 61 passing checks and three optional skips on 181ad8d; Greptile Apex is 5/5 with no unresolved comments. Co-Authored-By: Scott Goodson <scottgoodson@gmail.com> Co-Authored-By: Devin Foley <devin@paperclip.ing> Co-Authored-By: Paperclip <noreply@paperclip.ing> |
||
|
|
ac114d9479 |
refactor: cut DEVELOPING.md to a setup and workflow guide (#21670)
## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work > - `AGENTS.md` tells every contributor and agent to read `doc/DEVELOPING.md` for setup, commands, testing, and worktrees > - That file grew to 5,495 lines. Most of it was notes on how one subsystem behaves, added one pull request at a time > - Readers could not find the commands. Agents also read behavior notes as rules > - This pull request cuts `doc/DEVELOPING.md` to a 660-line setup and workflow guide. It moves the subsystem notes to focused docs > - The benefit is a guide that a person or an agent can read in full, and a clear place for each kind of note ## Linked Issues or Issue Description **Issue type** Outdated or confusing documentation. **Where is the issue?** `doc/DEVELOPING.md` **What's wrong?** The file was 5,495 lines. It opened with 112 lines about case handoffs before it reached Prerequisites. Unrelated sections sat below the "OpenClaw Docker UI One-Command Script" heading. Statements about current behavior read like policy. **Suggested fix** Keep setup, commands, and workflow in `doc/DEVELOPING.md`. Move each subsystem note to a doc for that subsystem. Add an index. ## What Changed - `doc/DEVELOPING.md` is now 660 lines: prerequisites, start dev, health checks, local run, test drive, Docker, instance layout, database, storage, secrets, worktrees, test commands, Storybook, CLI, and an index of the other docs. - 15 new docs hold the moved text without wording changes: `ci-workflows`, `test-infrastructure`, `worktrees`, `hot-restart-deploys`, `heartbeat-internals`, `runner-internals`, `workspace-repositories`, `workspace-storage`, `skills-and-teams-catalog`, `ui-internals`, `case-handoffs`, `chat-connector-development`, `instance-configuration`, `integration-api-notes`, `database-backups`. - "Publish a branch Storybook" moved to `doc/STORYBOOK-DEPLOYMENT.md`. The privacy rollout notes moved to `doc/ISSUE-PRIVACY.md`. - Deleted about 280 lines: the story-by-story Storybook notes, "Agent Artifact Uploads" (a copy of `doc/AGENT-ARTIFACTS.md`), two pointer-only sections, "Workspace feature checks (2026-10-09)", and "Chat and task navigation caching". The test-drive build-lock paragraph is now four lines. - Repointed every inbound link and every script or workflow comment that named a moved section. - `AGENTS.md` now says where a behavior note goes, so the guide does not grow again. ## Verification - A script split the file by line range. It asserts that each of the 5,495 source lines is kept, moved, or dropped exactly one time. - A link check on every changed Markdown file found 0 missing files and 0 missing anchors. - `node scripts/check-maps.mjs` passes. - `node --test .github/scripts/tests/*.test.mjs`: 808 pass, 0 fail. - `node --check` passes on the three scripts with changed comments. - `pnpm verify` was not run. This worktree has no installed dependencies, and the change has no runtime code. ## Risks - Low risk. The change is documentation and comments only. - A link to a moved section from outside this repository will land on the top of `doc/DEVELOPING.md`. - The new docs are not in the audited prose list in `.github/scripts/ci-inputs.mjs`. An edit to one of them runs full CI. An edit to `doc/DEVELOPING.md` does not. This PR does not change that list. ## Model Used - Claude Fable 5.2 (`claude-fable-5-2`), Claude Code desktop, with tool use. ## 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 - [ ] 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 Fable 5.2 <noreply@anthropic.com> |