mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-20 00:53:46 +01:00
## Thinking Path
> - Paperclip is the open source app people use to manage AI agents for
work.
> - The restart-chaos harness grades release swaps. One rule,
`MS_double_executor`, flags a run that records a second runner identity
before the first one is shown stopped.
> - The server records stop evidence (`native.local_process_stopped`)
only for local processes. It never records it for a sandbox
(`targetKind: "remote"`) process.
> - So when a sandbox run relaunches its runner inside the same run (a
session retry after a reconnect), the grader counts each new sandbox PID
as a second executor. Sandbox PIDs are also in a different PID space
from the server.
> - In a 197-task wave, run `c5b1f8ae` (a Daytona run that retried its
session after a reconnect) was reported as 2 double executors. The
runner journal shows the first turn was stopped with
`providerExitConfirmed: true` before the relaunch, so nothing ran twice.
> - This pull request makes the rule grade only local identities, as
`SCENARIOS.md` already describes it ("a second local runner identity").
> - The benefit is that the duplicate count in release-swap results
shows only real duplicates.
## Linked Issues or Issue Description
**What happened?**
The release-swap grade reported "2 double executor(s)" for one Daytona
run whose session retried in the same run. The previous provider process
had confirmed exit. No two processes ran together.
**Expected behavior**
`MS_double_executor` charges only local runner identities. A sandbox
relaunch is not a double executor.
**Steps to reproduce**
1. Run a restart-chaos wave on Daytona.
2. Have one run retry its native session in the same run (a reconnect).
3. Read `release-swap-summary.md`. The run appears under double
executors once per relaunch.
**Paperclip version or commit**
`master` at 1c67687998.
## What Changed
- `tests/restart-chaos/multi-server.ts`: reads `payload.targetKind` for
runner identity events and skips `remote` identities in
`MS_double_executor`.
- `tests/restart-chaos/multi-server.test.ts`: adds a red/green test with
three sandbox relaunches of one run.
- `tests/restart-chaos/SCENARIOS.md`: states that sandbox identities are
not graded, and why.
## Verification
- Red: without the filter, the new test fails (2 violations for 3 remote
identities).
- Green: `npx vitest run --config tests/restart-chaos/vitest.config.ts
tests/restart-chaos/multi-server.test.ts` passes (16 tests).
- `tsc -p tests/restart-chaos/tsconfig.json` shows no errors in the
changed files.
## Risks
- Low risk. Harness only; no product code.
- A real double executor inside a sandbox is not caught by this rule. It
was never reliably caught before: no remote stop evidence exists, so
every remote relaunch was flagged. Sandbox ownership stays graded by the
Runner checkpoint owner checks.
## Model Used
- Claude Opus 5.5 (`claude-opus-5-5`), Anthropic, via Claude Code with
tool use (shell, file edit). Extended reasoning on.
## 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
- [ ] 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 Opus 5.5 <noreply@anthropic.com>