From 21642fe7a642c2a3f9ca00d8426ee83e12c553da Mon Sep 17 00:00:00 2001 From: dmitrii-f-t27 Date: Sat, 10 Oct 2026 21:26:22 -0300 Subject: [PATCH] docs(queen): a redispatch after a spent ceiling gets one attempt, not one more set (#1769) The comments above MAX_CEILING_RELEASES (queen-tick.ts) and the redispatch upsert (queen-dispatch.ts) described one more full set of attempts. The code gives one: the redispatch carries ceiling_releases = 1, and its first send-back is closed as obsolete by the review valve (next_step answers STEP_CLOSE once releases >= MAX_RELEASES). Comments only; behaviour is unchanged. Option (a), the behaviour change, is tracked separately. Closes #1769 --- .../apps/server/src/api/services/queen-dispatch.ts | 5 ++++- .../apps/server/src/api/services/queen-tick.ts | 13 +++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/trios/agent-server/apps/server/src/api/services/queen-dispatch.ts b/trios/agent-server/apps/server/src/api/services/queen-dispatch.ts index 116fa17d80..cee7869c5a 100644 --- a/trios/agent-server/apps/server/src/api/services/queen-dispatch.ts +++ b/trios/agent-server/apps/server/src/api/services/queen-dispatch.ts @@ -5629,7 +5629,10 @@ export async function recordDispatch( -- the salvage committed already on the branch. That hand-back is -- counted here and bounded by MAX_CEILING_RELEASES, so the swarm -- cannot spend an issue's attempts twice over. send_backs starts - -- again with it: the new attempt is judged on its own work. + -- again at 0, but the hand-back is ONE attempt, not a new set: + -- with ceiling_releases now at MAX_RELEASES, its first send-back + -- reaches the review valve, which closes the issue as obsolete + -- (stateOfDispatch in queen-tick.ts; gHashTag/trios#1769). -- An escalation the review valve released is the same hand-back -- and spends the same count (specs/queen/review_valve.t27, -- MAX_RELEASES), so the two roads cannot each spend it. diff --git a/trios/agent-server/apps/server/src/api/services/queen-tick.ts b/trios/agent-server/apps/server/src/api/services/queen-tick.ts index f20201a199..6197d22b2d 100644 --- a/trios/agent-server/apps/server/src/api/services/queen-tick.ts +++ b/trios/agent-server/apps/server/src/api/services/queen-tick.ts @@ -781,10 +781,15 @@ export const CEILING_RELEASE_MS = CEILING_FLOOR_MINUTES * 60 * 1000 /** * How many times a spent ceiling may be handed back to the swarm. * - * One. The bee gets `maximumSendBacks` attempts, then an hour, then one more - * set - with the last review's findings in its brief and whatever the salvage - * committed already on the branch. After that the row stays rejected: a third - * identical failure is evidence about the issue, not about the attempt. + * One. The bee gets `maximumSendBacks` attempts, then an hour, then ONE more + * attempt - not one more set - with the last review's findings in its brief + * and whatever the salvage committed already on the branch. The redispatch + * resets `send_backs` but carries `ceiling_releases` = 1, so its first + * send-back goes to the review valve with `releases` at `MAX_RELEASES` and + * `next_step` answers STEP_CLOSE: the claim is `cancelled` in the next round + * and the row is closed as obsolete, inside the send-back's hour + * (gHashTag/trios#1769). A third identical failure is evidence about the + * issue, not about the attempt. */ export const MAX_CEILING_RELEASES = MAX_RELEASES