Skip to content

A redispatch after a spent ceiling gets one attempt, not one more set: its first send-back is closed as obsolete within the hour #1769

Closed

Description

@dmitrii-f-t27

What happens

After a spent send-back ceiling is handed back, the issue is supposed to get one more full set of attempts. The code gives it one attempt instead: the first send-back of the new attempt is closed as obsolete within the hour.

Read from the source on queen @ 82bcc93. Live queen_dispatch rows were not queried.

  1. On the hand-back, the redispatch upsert in queen-dispatch.ts (around line 5636) sets ceiling_releases to ceiling_releases + 1 (from 0 to 1) and resets send_backs to 0. The comment there reads "send_backs starts again with it: the new attempt is judged on its own work".
  2. The new attempt is sent back once, so send_backs becomes 1.
  3. In the next round, stateOfDispatch (The round's claim (stateOfDispatch) is decided by the claim card, proven equal to the hand-written rule first #1767; the claim card claim_of, spec(queen): claim.t27 - the round's stateOfDispatch as a card, the review valve imported, not restated t27#8765) gets sendBack with send_backs 1, which is under the ceiling of 2, and an idle time under 60 minutes. The send-back's own one-hour floor has not passed, so the row goes to the review valve as KIND_SEND_BACK_CEILING with releases = 1.
  4. next_step (review_valve.t27) answers STEP_CLOSE for any kind once releases >= MAX_RELEASES. The claim becomes cancelled, and closeObsolete writes obsolete. The issue is not taken again while the row stays in the 7-day window.

The comments describe a different contract. queen-tick.ts above MAX_CEILING_RELEASES says: "The bee gets maximumSendBacks attempts, then an hour, then one more set". The redispatch comment says the new attempt "is judged on its own work".

Reproduction

The claim card pins today's answer, so the behaviour is visible and checkable:

claim_of(true, V_SEND_BACK, 59, 1, 2, 1, true, 1, 0, 0) == CL_CANCELLED   // releases = 1, under the ceiling, inside the hour
claim_of(true, V_SEND_BACK, 59, 1, 2, 0, true, 1, 0, 0) == CL_REJECTED    // the same row before any hand-back

(specs/queen/claim.t27, test a_send_back_under_its_ceiling_goes_back_after_the_hour; #1768 proves the card equal to the hand-written rule, so this is the rule as it runs.)

Decision needed

The fix is a change of policy, so it needs a decision first:

  • (a) A send-back under the ceiling never asks the valve. It holds as rejected until its own one-hour floor and is then released. Only a send-back at the ceiling goes to the valve. This would change one branch of claim_of, plus its tests, the wasm and PIN.
  • (b) Keep it, and correct the two comments to "one more attempt".

Acceptance criteria

  • The decision is recorded on this issue.
  • For (a), the spec changes first (t27, specs/queen/claim.t27), and the card, its tests and the wasm follow. The tests show a redispatched issue getting maximumSendBacks counted send-backs before the valve closes it.
  • For (b), both comments state what the code does.

Dmitrii Fedorov (@dmitrii-f-t27)

Activity

  1. dmitrii-f-t27 commented on Oct 11, 2026

    @dmitrii-f-t27
    CollaboratorAuthor

    Decision: (b). The behaviour stays. A redispatch after a spent ceiling gets one more attempt, and its first send-back is closed as obsolete by the review valve.

    Both comments now state what the code does: #1807, merged into queen as 2d2802d (head 21642fe).

    • queen-tick.ts, above MAX_CEILING_RELEASES: "ONE more attempt - not one more set", with the mechanism.
    • queen-dispatch.ts, the redispatch upsert: send_backs restarts at 0, but ceiling_releases is already at MAX_RELEASES, so the first send-back reaches the valve and is closed.

    This meets the acceptance criterion for (b). Option (a), the policy change (a send-back under the ceiling never asks the valve), is tracked in #1806. It depends on gHashTag/t27#8768 and #1768.

    Dmitrii Fedorov (@dmitrii-f-t27)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions