From 49fe8b87a49aa5a8985a08dd3d5ce57bdd24756c Mon Sep 17 00:00:00 2001 From: lorenzozane Date: Wed, 28 Oct 2026 21:20:13 -0700 Subject: [PATCH] test: assert company skills are removed during company cleanup (#13490) ## Thinking Path > - Paperclip is the open source app people use to manage AI agents for work. > - Company removal must remove company-owned database rows. > - The cleanup path already removes company skills. > - The existing test creates a company skill but does not check its removal. > - This pull request adds that missing assertion. > - The assertion guards the company cleanup contract. ## Linked Issues or Issue Description Refs: #3038 Supersedes #13240. This PR restores the original change after its branch was deleted. ## What Changed - Assert that no company_skills rows remain after company removal. ## Verification - The cleanup-removal-service.test.ts suite passed all four tests in CI run 35006708817. - That run failed in execution-control-reconciliation.test.ts and composer-stop.spec.ts. - Those failures concern code outside this one-line test change. - CI must run again after the branch update. - No local test run has been completed during adoption. ## Risks - Low risk. This change adds one test assertion and changes no production code. ## Model Used - Adoption assistance: OpenAI Codex, based on GPT-6, with code review, shell tool use, and GitHub inspection. - The exact backend model ID and context window are not exposed in this session. - This assistance covers CI diagnosis, this description update, and branch integration. - The original author's model use was not disclosed. ## 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) - [ ] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [ ] 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 - [ ] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [ ] 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 Co-authored-by: Andrew Aymeloglu --- server/src/__tests__/cleanup-removal-service.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/server/src/__tests__/cleanup-removal-service.test.ts b/server/src/__tests__/cleanup-removal-service.test.ts index 2bf989846d2..3b10dc6b34d 100644 --- a/server/src/__tests__/cleanup-removal-service.test.ts +++ b/server/src/__tests__/cleanup-removal-service.test.ts @@ -248,6 +248,7 @@ describeEmbeddedPostgres("cleanup removal services", () => { expect(removed?.id).toBe(companyId); await expect(db.select().from(companies).where(eq(companies.id, companyId))).resolves.toHaveLength(0); await expect(db.select().from(issues).where(eq(issues.id, issueId))).resolves.toHaveLength(0); + await expect(db.select().from(companySkills).where(eq(companySkills.companyId, companyId))).resolves.toHaveLength(0); await expect(db.select().from(documents).where(eq(documents.id, documentId))).resolves.toHaveLength(0); await expect(db.select().from(documentRevisions).where(eq(documentRevisions.id, revisionId))).resolves.toHaveLength(0); await expect(db.select().from(issueReadStates).where(eq(issueReadStates.companyId, companyId))).resolves.toHaveLength(0);