diff --git a/doc/plans/2026-10-24-recurring-server-sleep-stack.md b/doc/plans/2026-10-24-recurring-server-sleep-stack.md index 21605f826b0..827fdc8c6cc 100644 --- a/doc/plans/2026-10-24-recurring-server-sleep-stack.md +++ b/doc/plans/2026-10-24-recurring-server-sleep-stack.md @@ -12,13 +12,13 @@ Do not mark an item done from a timer removal or a green check alone. | ID | Original checklist duty | Required slices / disposition | PR / evidence | | --- | --- | --- | --- | -| 01 | Custom-image setup expiry | Session writes, existing expiry, startup/retry/drain | [#17443](https://github.com/paperclipai/paperclip/pull/17443), CI/review running | +| 01 | Custom-image setup expiry | Session writes, existing expiry, startup/retry/drain | [#17443](https://github.com/paperclipai/paperclip/pull/17443), all checks passed, Greptile 5/5 at `36844a458b` | | 02 | Remaining chat maintenance | Provider runtime discovery; voice reconciliation; milestones; wake notices; interaction continuations; terminal confirmations; GitHub recovery; Teams maintenance, separately by owner | Pending | | 03 | Run and task recovery | Orphan runs and active leases; shutdown workspace settlement; scheduled retries; queued runs; stranded assignments; resolved dependencies; task watchdogs; silent-run monitoring; stale locks | Pending | | 04 | Decision retention and notifications | Retention deadlines and notification delivery are separate reasons | Pending | | 05 | Decision expiry and interrupted effects | Expiry, effect recovery, continuation recovery | Pending | | 06 | Tool connection health | Configuration/use activation and defined proactive health deadlines | Pending | -| 07 | Secret proposals, tool reviews, gateway tokens | Separate expiry/scrub/recovery owners | Secret proposals: [#17446](https://github.com/paperclipai/paperclip/pull/17446), CI/review running; gateway credential expiry in progress; tool reviews pending | +| 07 | Secret proposals, tool reviews, gateway tokens | Separate expiry/scrub/recovery owners | Secret proposals: [#17446](https://github.com/paperclipai/paperclip/pull/17446), CI/review running; gateway credentials: [#17450](https://github.com/paperclipai/paperclip/pull/17450), CI/review running; tool review duties pending | | 08 | GitHub connection events and continuity | Event discovery/replay and credential continuity separately | Pending | | 09 | Merged-PR confirmations | Candidate writes, webhook activation where supported, outstanding-candidate fallback | Pending | | 10 | External-object refresh | Configuration changes, refresh deadlines, source events | Pending | @@ -61,3 +61,45 @@ connector transport architecture, probes, telemetry/exporter qualification, and end-to-end provider suspension are outside this requested recurring-server stack; none are claimed solved by these PRs. Required active-operation lease renewals and request timeouts remain with their owners. + +## Next owner audit: tool reviews + +Inspected after gateway credential slice `75332b9641`. The existing +`sweepActionReviews` combines four reasons that need separate migration slices: + +1. Pending review expiry: `status = pending` and saved `expiresAt`. +2. Approved action recovery: approved rows that still owe execution/settlement. +3. Interrupted execution: executing rows with the existing ten-minute stale + threshold; unknown provider outcomes must remain quarantined, not replayed. +4. Interaction projection repair: terminal requests whose interaction result + does not reflect the authoritative request/invocation state. + +The next branch is `codex/sleep-04-tool-review-expiry`. No implementation is +claimed yet. Preserve the other three duties while migrating the first, then +retire them individually. Keep the public/manual recovery entry point compatible +or update all callers and tests explicitly; tests currently call the combined +method to cause expiry. + +Producer locations found by the audit: + +- `tool-access-policy.ts`: creates pending requests with null signature/expiry. +- `tool-gateway.ts`: signs pending requests and assigns their one-hour expiry; + handles competing-call invalidation, approval/execution transitions, provider + outcomes, and sweep settlement. Audit all writes, not just initial insertion. +- `tool-action-review.ts`: owns a transaction for human resolution. +- `tool-access/activity/review-queue.ts`: invalidates unsigned/unreadable requests. +- `issue-thread-interactions.ts`: resolves linked pending/approved requests when + their governing card is resolved administratively. + +The unsigned-row signing grace is distinct from the saved review expiry. Do not +invent a new expiry policy while removing the scan. A pending row can be observed +between insert and signing; expiry workers must not cancel an in-flight producer. +Keep provider execution outside database transactions. Signals must be registered +before writes in existing transaction ownership, without wrapping provider calls. + +Latest evidence: #17443 has all checks passed and both review threads resolved. +#17446 at `d41590ac0e` has Greptile 5/5, no review threads, and two outstanding +checks (Build and Paperclip Review) at the last inspection. #17450 at +`75332b9641` has local verification (8 expiry + 92 gateway acceptance + 39 startup +tests, workspace typecheck/build); CI and review are running. Recheck external +state before using these observations as readiness evidence.