From 3efda33812079c218fdcc7d1e40ddd81136264a4 Mon Sep 17 00:00:00 2001 From: Dotta Date: Tue, 27 Oct 2026 18:45:56 -0500 Subject: [PATCH] Document bounded approval wakes and complete consumer verification Co-Authored-By: Paperclip --- doc/idle-approval-retention.md | 38 ++++++++++++++++++- ...2026-10-24-recurring-server-sleep-stack.md | 11 ++++++ 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/doc/idle-approval-retention.md b/doc/idle-approval-retention.md index a3d4835c116..0675d22be09 100644 --- a/doc/idle-approval-retention.md +++ b/doc/idle-approval-retention.md @@ -95,7 +95,7 @@ compute, and this approval deadline has not been added to Cloud's durable wake contract. This proves only the named worker's quiet/reactivation behavior. -## Review repair and current verification +## Initial review repair verification The feed and retention worker now share `approval-visibility.ts` for the first linked issue and its execution visibility. The feed still applies actor-specific @@ -126,3 +126,39 @@ snapshots remain (0388–0392). Schema drift, safety/numbering and actual fresh migration apply/replay on five isolated PostgreSQL databases pass. Earlier transaction-stub, budget-import, query-probe and CI failures remain recorded in the stack ledger. Fresh current-head CI and both reviews are required. + + +## Wake amplification repair + +Ordinary creation, links, revision requests and resubmission signal retention +only. Tool-review queues are notified by the actual terminal transition owners: +approve/reject in approval resolution, and cancel in the approval service. These +are the same terminal transitions that notified tool reviews before this PR. +Cancellation must remain a producer because it settles parked tool actions as +unavailable. No extra wrapper or scope argument is threaded through those calls. + +The aggregate retention worker now coalesces sequential notifications for thirty +seconds after a successful reconciliation. This is a single instance-wide read +budget, stricter than granting each company an independent thirty-second budget, +and matches the former default maintenance cadence. Known business deadlines +still preempt the coalescing window. The window schedules no work on its own; +without a notification or saved deadline the worker remains quiet. Newly changed +eligibility can wait up to that window, as under the old default maintenance. + +Three new real regressions failed before repair: approve and reject cases +observed unwanted tool-review signals from ordinary mutations, and four +sequential tenant writes caused eight global reads rather than one two-read +reconciliation. Terminal approve/reject/cancel signals are now tested explicitly. +With another company's pending approval present, sequential writes cause no extra +SQL within the window and one reconciliation when the window ends. + +The first coalescing fixture incorrectly expected the pending-work hold to clear +before the requested reconciliation; it now lets the deferred wake remain owed +and measures SQL directly. The first broad repair passed 313 cases and failed +the existing parked-review cancellation case. Restoring the original cancel +producer fixed that regression without weakening its outcome assertion. All +315 cases in eight full suites now pass at `dd844f4e8c`, including 30 approval +worker cases; server types/build pass. The earlier security check at `5991f257bb` +was action-required and Greptile reported service error reference +`8fb1835c-e564-476b-b802-d5be164ea915`. Neither is claimed as passing; the repaired +head requires fresh security, CI and both bot reviews. 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 c47c86b12fe..4807126b273 100644 --- a/doc/plans/2026-10-24-recurring-server-sleep-stack.md +++ b/doc/plans/2026-10-24-recurring-server-sleep-stack.md @@ -988,3 +988,14 @@ All 26 lifecycle cases and all 311 cases across eight complete consumer suites, server types/build, schema drift, migration safety and fresh apply/replay pass. Index 0392 is generated after all 390 unchanged parent journal entries; five snapshots remain. Current parent is `679f523d78`; fresh head gates remain required. + + +Slice 14 wake-amplification follow-up: ordinary approval/link/revision/resubmit +writes no longer notify tool reviews. Approve/reject/cancel retain their existing +terminal wake contract. Retention uses a thirty-second aggregate notification +budget, with known deadlines preempting and no idle recurring scan. Three real +regressions failed before repair. A broad run also caught a removed cancellation +producer (313 pass/1 fail); it is restored. All 315 cases in eight complete suites, +including 30 worker cases, and server types/build pass at `dd844f4e8c`. Prior +coalescing-fixture, security and Greptile service failures remain in the owning +audit. Fresh exact-head checks and reviews are required on publication.