paperclip/tests/e2e
Nicky Leach 91c79d28cb
test(e2e): retry run-lock 409 in signoff-policy agentPatch (#10386)
## Thinking Path

> - Paperclip is the control plane people use to manage AI-agent work
across companies
> - This repository's e2e suite verifies the execution and approval
paths that keep the control plane reliable
> - The signoff-policy flow uses a helper that runs a heartbeat and then
PATCHes the issue with that run id
> - That PATCH can race the heartbeat's run-lock ownership and
intermittently receive a transient 409
> - When that happens, a single-positive transition fails the shard even
though the underlying behavior is only a lock contention race
> - This pull request makes the helper retry the 409 path by re-reading
the current lock and re-PATCHing under the winning run id
> - The benefit is a stable e2e shard without weakening the
negative-path assertions that protect the contract

## Linked Issues or Issue Description

No public GitHub issue exists for this change. This PR addresses a flaky
signoff-policy e2e transition where the helper can lose a run-lock race
and receive a transient 409 while the issue is still assigned to the
acting agent.

## What Changed

- Added bounded retry/backoff handling in the signoff-policy
`agentPatch` helper for transient run-lock 409 responses.
- Re-read the issue's current lock before retrying so the helper can
re-PATCH with the winning run id.
- Kept the retry guarded so non-participant rejection and
missing-comment 400s still surface unchanged.
- Preserved the existing positive-path behavior without adding
Playwright retries or weakening assertions.

## Verification

- Reviewed the diff shape for a single-file change in
`tests/e2e/signoff-policy.spec.ts`.
- Verified the pushed commit matches the authorized submit SHA from the
handoff.
- Confirmed the branch contains only the expected commit and no
unrelated history.
- The handoff notes record deterministic harness evidence showing the
pre-fix helper fails on the 409 race and the post-fix path passes.

## Risks

- Low functional risk: the retry is narrowly scoped to the transient 409
lock-contention path.
- If the lock semantics change server-side, the helper may need a
follow-up adjustment.
- The change only affects the e2e helper and does not alter production
API behavior.

## Model Used

OpenAI Codex (GPT-5, tool-using coding agent)

## 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>
2026-07-28 11:53:16 -07:00
..
app-not-connected.spec.ts feat(mcp) [split 8/8]: add e2e coverage and operator docs (#9563) 2026-07-14 15:48:57 -05:00
application-delete-screenshot.spec.ts feat(connections): add v3 schema core (#9958) 2026-07-21 15:16:26 -05:00
applications-crud.spec.ts test(e2e): wait for connections fetch before asserting applications status pill (#10384) 2026-07-28 11:00:04 -07:00
apps-dark-mode-shots.spec.ts feat(mcp) [split 8/8]: add e2e coverage and operator docs (#9563) 2026-07-14 15:48:57 -05:00
apps-prosumer-mcp-flow.spec.ts feat(mcp) [split 8/8]: add e2e coverage and operator docs (#9563) 2026-07-14 15:48:57 -05:00
conference-room-typing-intro.spec.ts Update company creation copy (#8653) 2026-06-26 12:01:02 -05:00
fetch-allowed-port.ts feat(mcp) [split 8/8]: add e2e coverage and operator docs (#9563) 2026-07-14 15:48:57 -05:00
mcp-user-stories.catalog.ts feat(mcp) [split 8/8]: add e2e coverage and operator docs (#9563) 2026-07-14 15:48:57 -05:00
mcp-user-stories.spec.ts feat(mcp) [split 8/8]: add e2e coverage and operator docs (#9563) 2026-07-14 15:48:57 -05:00
multi-user-authenticated.spec.ts feat: implement multi-user access and invite flows (#3784) 2026-04-17 09:44:19 -05:00
multi-user.spec.ts feat: implement multi-user access and invite flows (#3784) 2026-04-17 09:44:19 -05:00
nux-phase4-screenshots.spec.ts Update company creation copy (#8653) 2026-06-26 12:01:02 -05:00
onboarding.spec.ts Update company creation copy (#8653) 2026-06-26 12:01:02 -05:00
pipelines-tutorial-flow.spec.ts test: port pipelines tutorial e2e (#9149) 2026-07-07 05:54:26 -05:00
planning-mode-visual-verification.spec.ts Update company creation copy (#8653) 2026-06-26 12:01:02 -05:00
playwright-multiuser-authenticated.config.ts feat: implement multi-user access and invite flows (#3784) 2026-04-17 09:44:19 -05:00
playwright-multiuser.config.ts feat: implement multi-user access and invite flows (#3784) 2026-04-17 09:44:19 -05:00
playwright.config.ts feat(mcp) [split 8/8]: add e2e coverage and operator docs (#9563) 2026-07-14 15:48:57 -05:00
sidebar-takeover.spec.ts feat(ui): add collapsible sidebar rail and takeover panes (#7824) 2026-06-09 13:25:17 -05:00
signoff-policy.spec.ts test(e2e): retry run-lock 409 in signoff-policy agentPatch (#10386) 2026-07-28 11:53:16 -07:00
smoke-lab-browser-runner.mts feat(connections): add v3 schema core (#9958) 2026-07-21 15:16:26 -05:00
smoke-lab-routine-classifier.test.mts feat(mcp) [split 8/8]: add e2e coverage and operator docs (#9563) 2026-07-14 15:48:57 -05:00
smoke-lab-routine.mts feat(mcp) [split 8/8]: add e2e coverage and operator docs (#9563) 2026-07-14 15:48:57 -05:00
smoke-lab.catalog.ts feat(connections): add v3 schema core (#9958) 2026-07-21 15:16:26 -05:00
smoke-lab.spec.ts feat(connections): add v3 schema core (#9958) 2026-07-21 15:16:26 -05:00