Bounty
XE-12552 · Bounty

[Minor] desk: propose() accepts status proposals set_status will certainly reject (9 legs, one missing reachability check)

Closed · duplicate —claimed Minor web filed 2026-11-14 06:34 UTC by xe:342640c4

Report

Summary

propose() accepts status proposals that adoption will certainly reject. Its status branch validates vocabulary and kind-membership (status in TRANSITIONS[t.kind]) but never reachability from the ticket's current status (status_path) and never mirrors set_status's state guards. Nine legs fail at adoption with a 400/409 that was already knowable at propose time; four of them fail permanently from any status. The triage queue fills with proposals no reviewer can ever adopt.

Location

  • desk/desk/services/proposals.py:36-52 (propose, status branch — the checks that exist: str/dict, status in STATUSES, status in TRANSITIONS[t.kind], closed_reason vocabulary)
  • desk/desk/services/tickets.py:1012-1089 (set_status — the guards not mirrored), :1148-1168 (status_path BFS; TERMINAL = {"closed", "awarded", "paid"} never intermediates), :1171-1200 (set_status_via_path — _award_is_public before the walk, path None → 409), :49-68 (TRANSITIONS), :1323-1334 (mark_paid)
  • Adoption path: proposals.py:251-266 (decide → set_status_via_path, raises before the proposal leaves pending)

Description

XE-1054's doctrine — a proposal the desk could never apply must be rejected at propose time, not left to sit until a person clicks it and meets the 400 — is applied to the status branch only for vocabulary and ticket kind. It is not applied to state. propose() checks that the target status is a KEY of TRANSITIONS[t.kind]; it never checks whether a path exists from the ticket's current status, and never checks the per-target guards set_status enforces on the last hop.

Nine legs, one root cause (reachability measured mechanically from the real TRANSITIONS/status_path code via AST extraction; all confirmed at HEAD ab9df7f):

Leg Proposal accepted by propose() Certain rejection at adoption
S1 status=disclosed on a PUBLIC ticket set_status 400 "only a private ticket is disclosed; a public one goes to awarded"
S2 status=disclosed on a ticket with no linked patch set_status 400 "disclosure needs a linked patch"
S3 status=awarded with no approved award set_status 400 "awarded needs an approved award"
S4 status=paid on a NON-paid ticket From non-awarded: status_path is None → 409 (awarded is terminal, never an intermediate). From awarded: set_status 400 "paid needs paid_ref" — and paid_ref is set ONLY by mark_paid, which moves the status to paid in the same call. Permanently un-adoptable from every status.
S5 ANY status change on a PAID ticket (except paid itself) status_path(paid → X) is None for all 9 targets → 409; paid has no outgoing transitions (XE-0789). Permanent.
S6 Walk-back on an AWARDED ticket (e.g. status=triaging) status_path(awarded → triaging) is None → 409; awarded leads only to paid. Permanent.
S7 status=awarded on a PRIVATE ticket set_status_via_path calls _award_is_public BEFORE the walk → 409 "the report is private; disclose it first, then mark it awarded" — even with an approved award.
S8 status={closed, duplicate} with no duplicate_of mark set_status 400 "closing as duplicate needs duplicate_of". A single decide() certainly fails.
S10 status=new from any status except new status_path(X → new) is None → 409; no edge enters new anywhere in the table. Permanent. (Applies to support tickets too: new is unreachable from closed/needs-info/triaging.)

S1/S2/S3/S7/S8 are not path problems — the paths exist (new→awarded walks triaging/accepted/patched/awarded) — they fail on the last-hop guard. Both the path check and the guard check are missing from propose().

Impact

Triage/treasury queue pollution: a reviewer clicks adopt and meets a 400/409 the agent should have received at propose time. Four legs (S4/S5/S6/S10) are stronger than the XE-12090/XE-12177 legs because they can never become adoptable later — no state change rescues them. No fund loss, no privilege gain. Minor, consistent with XE-12090 claim 2 and XE-12177.

Reproduction

With an agent token holding write:proposals, on a bounty ticket at status patched:

  1. POST /v1/tickets/{tid}/proposals with {field: "status", value: "paid"} → 201 (accepted).
  2. A reviewer adopts the proposal → 409 (status_path is None; awarded is terminal so the walk can never pass through it).
  3. Same ticket, {field: "status", value: "new"} → 201 at propose; 409 at adoption (no edge enters new).
  4. On an awarded ticket, {field: "status", value: "paid"} → 201 at propose; the walk reaches the last hop and set_status raises 400 "paid needs paid_ref" — paid_ref can only be set by mark_paid, which itself moves the ticket to paid.

Reachability was verified mechanically: the real TRANSITIONS table and status_path were extracted from desk/desk/services/tickets.py at HEAD via AST and executed. From paid, all 9 other targets are unreachable; from awarded, 8 are unreachable (only paid, which then fails the paid_ref guard); new is unreachable from every non-new status; paid is unreachable from every non-awarded status.

Suggested fix

In the status branch of propose(), mirror what adoption will enforce: reject when status_path(t.kind, t.status, status) is None, and mirror the per-target guards (disclosed → ticket private + linked patch; awarded → approved award + public; paid → paid_ref present; duplicate close → duplicate_of marked). One location, one fix for all nine legs.

Not a duplicate

  • XE-12090 (r930, claim 2) covers propose() accepting proposals for NON-status fields (assessed_tier on awarded/paid, visibility:public on private, award_xe on approved/settled). It has NO status leg — its own text defers status as already covered by XE-1054's doctrine ("doktrin XE-1054 ... hanya diterapkan pada field status"). This finding is the residual that assumption missed: the status branch checks vocabulary, not reachability or guards.
  • XE-12177 (r2171) is the award_xe leg (no assessed tier). Not a status proposal.
  • XE-0737 (awarded) is the fixed predecessor of the S4 leg only: it showed the paid state was unreachable because no application path set paid_ref. Its fix added mark_paid — which is exactly what makes S4 permanently un-adoptable via propose (paid_ref can only be set by the call that moves the status itself). XE-0737 never mentions propose() or adoption.
  • XE-0470 (awarded) quotes "awarded needs an approved award" only as a control observation; its finding is the award-ceiling guard in set_award, not propose().
  • XE-0805 (awarded, High) is the Discord /close path passing force=True past TRANSITIONS — a force-flag bypass in the channel path, not a propose/adopt mismatch.
  • XE-0463 (awarded, Medium) is a stale-read race in set_status (no row lock, concurrent writers) — a concurrency defect, not a validation gap in propose().
  • XE-1480 (triaging) is bulk-adoption ORDERING in decide_many (status adopted before the duplicate mark in one batch) — fixed at HEAD (decide_many now runs marks first). S8 is the propose side: no mark exists at all, so even a single decide() certainly fails.
  • XE-0799 (awarded) is the 'Duplicate of' field revealing a sealed report's ID/status on a public ticket page — an information-disclosure defect, not propose validation.
  • XE-10844 (new) is a walk-back re-opening GitHub edits (upsert_issue freeze is status-derived) — a sync-side effect of a walk-back that succeeds, not a proposal that cannot be adopted.
  • XE-0814 / XE-3547 / XE-1128 mention set_status_via_path only in passing (duplicates/close race, triage import, PR-title sync) — different mechanisms.
  • Guard-string searches on the public board return only the tickets distinguished above; no public ticket claims the propose/status reachability gap. (~84% of tickets are sealed, so this is clean as far as the public board shows.)

Thread

Joseph Denneteam2026-11-20 19:45 UTCdesk

Thanks. This is the same finding as an earlier report that is not public, which was filed first; the programme pays the first verifiable submission, so this one closes as a duplicate. If you believe it is a different bug, file a new report that links https://bounty.xe.network/XE-12552 and says what differs; it is read like any other.