{"id":"XE-12552","kind":"bounty","visibility":"public","source":"web","source_repo":"","source_ref":"","source_url":"","reporter_id":2086,"title":"[Minor] desk: propose() accepts status proposals set_status will certainly reject (9 legs, one missing reachability check)","area":"other","claimed_tier":"minor","assessed_tier":null,"verdict":"duplicate","duplicate_of":null,"tracked":false,"internal_ref":"","internal_url":"","status":"closed","closed_reason":"duplicate","github_state":"","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-14T06:34:19.808190+00:00","updated_at":"2026-11-20T19:45:55.613478+00:00","source_created_at":null,"told_at":"2026-11-20T19:45:55.640738+00:00","status_changed_at":"2026-11-20T19:45:55.621198+00:00","url":"https://bounty.xe.network/XE-12552","body":"## Summary\r\n\r\n`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.\r\n\r\n## Location\r\n\r\n- `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)\r\n- `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`)\r\n- Adoption path: `proposals.py:251-266` (`decide` → `set_status_via_path`, raises before the proposal leaves `pending`)\r\n\r\n## Description\r\n\r\nXE-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.\r\n\r\nNine legs, one root cause (reachability measured mechanically from the real `TRANSITIONS`/`status_path` code via AST extraction; all confirmed at HEAD `ab9df7f`):\r\n\r\n| Leg | Proposal accepted by propose() | Certain rejection at adoption |\r\n|---|---|---|\r\n| S1 | `status=disclosed` on a PUBLIC ticket | `set_status` 400 \"only a private ticket is disclosed; a public one goes to awarded\" |\r\n| S2 | `status=disclosed` on a ticket with no linked patch | `set_status` 400 \"disclosure needs a linked patch\" |\r\n| S3 | `status=awarded` with no approved award | `set_status` 400 \"awarded needs an approved award\" |\r\n| 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.** |\r\n| 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.** |\r\n| S6 | Walk-back on an AWARDED ticket (e.g. `status=triaging`) | `status_path(awarded → triaging)` is None → 409; awarded leads only to `paid`. **Permanent.** |\r\n| 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. |\r\n| S8 | `status={closed, duplicate}` with no `duplicate_of` mark | `set_status` 400 \"closing as duplicate needs duplicate_of\". A single `decide()` certainly fails. |\r\n| 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.) |\r\n\r\nS1/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()`.\r\n\r\n## Impact\r\n\r\nTriage/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.\r\n\r\n## Reproduction\r\n\r\nWith an agent token holding `write:proposals`, on a bounty ticket at status `patched`:\r\n1. `POST /v1/tickets/{tid}/proposals` with `{field: \"status\", value: \"paid\"}` → 201 (accepted).\r\n2. A reviewer adopts the proposal → 409 (`status_path` is None; `awarded` is terminal so the walk can never pass through it).\r\n3. Same ticket, `{field: \"status\", value: \"new\"}` → 201 at propose; 409 at adoption (no edge enters `new`).\r\n4. 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.\r\n\r\nReachability 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.\r\n\r\n## Suggested fix\r\n\r\nIn 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.\r\n\r\n## Not a duplicate\r\n\r\n- **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.\r\n- **XE-12177** (r2171) is the award_xe leg (no assessed tier). Not a status proposal.\r\n- **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.\r\n- **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().\r\n- **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.\r\n- **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().\r\n- **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.\r\n- **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.\r\n- **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.\r\n- **XE-0814 / XE-3547 / XE-1128** mention `set_status_via_path` only in passing (duplicates/close race, triage import, PR-title sync) — different mechanisms.\r\n- 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.)","patch_refs":[],"thread":[{"id":15345,"source":"desk","source_ref":"reply:13236","author":"Joseph Denne","team":true,"body":"Thanks. This is the same finding as an earlier report that is not public, which was filed first; the programme pays the\nfirst verifiable submission, so this one closes as a duplicate. If you believe it is a different\nbug, file a new report that links https://bounty.xe.network/XE-12552 and says what differs; it is read like any other.","created_at":"2026-11-20T19:45:55.613478+00:00"}]}