<!-- XE-1795 · `push_labels` rebuilds the GitHub label set from stale stored labels, so a human-added label is silently deleted on the next status push · testnet -->
*Markdown view of <https://bounty.xe.network/XE-1795>. The page is the record; this is the same page for reading.*

XE-1795 · Bounty

# \`push\_labels\` rebuilds the GitHub label set from stale stored labels, so a human-added label is silently deleted on the next status push

Triaging
claimed Minor
web
filed 2026-11-09 04:33 UTC
by Darkarmy921

Verdict
:   published when the fix ships

Tier
:   published when the fix ships

Claimed
:   Minor

Area
:   Other

Duplicate of
:   —

Tracked
:   —

Updated
:   2026-11-14 22:57 UTC

Told
:   2026-11-10 14:00 UTC

### Patches

None linked.

### History

- [211839](https://bounty.xe.network/log/211839) 2026-11-14 22:57 UTC proposal.adopted
- [211838](https://bounty.xe.network/log/211838) 2026-11-14 22:57 UTC ticket.award
- [84126](https://bounty.xe.network/log/84126) 2026-11-10 14:00 UTC proposal.adopted
- [84125](https://bounty.xe.network/log/84125) 2026-11-10 14:00 UTC reply.sent
- [83988](https://bounty.xe.network/log/83988) 2026-11-10 14:00 UTC proposal.adopted
- [83987](https://bounty.xe.network/log/83987) 2026-11-10 14:00 UTC ticket.status new → triaging
- [83721](https://bounty.xe.network/log/83721) 2026-11-10 14:00 UTC proposal.adopted
- [83720](https://bounty.xe.network/log/83720) 2026-11-10 14:00 UTC proposal.adopted
- [83719](https://bounty.xe.network/log/83719) 2026-11-10 14:00 UTC ticket.facts
- [83718](https://bounty.xe.network/log/83718) 2026-11-10 14:00 UTC proposal.adopted
- [83717](https://bounty.xe.network/log/83717) 2026-11-10 14:00 UTC ticket.facts
- [83716](https://bounty.xe.network/log/83716) 2026-11-10 14:00 UTC proposal.adopted

[Full history](https://bounty.xe.network/log?ref=XE-1795) · [JSON](https://bounty.xe.network/v1/tickets/XE-1795) · [markdown](https://bounty.xe.network/XE-1795.md)

### Report

## Summary

`desk/services/sync.py:537-556` builds `keep` from stored
`t.github_labels` (refreshed only by poll/webhook `upsert_issue`),
then calls `client.set_labels(...)`; `desk/services/github.py:166-168`
`set_labels` is a PUT to `/repos/{repo}/issues/{number}/labels`,
which replaces the entire label set. A label a human adds on GitHub is
therefore silently deleted the next time the desk pushes a
status-label change. The docstring ("Other labels are left as they
are") is contradicted by the implementation.

## Impact

- **Silent deletion of human work.** A reviewer's label (e.g.
  `needs-repro`) vanishes without any log, event, or notice, the next
  time a status change pushes labels. The human has no signal their
  label was removed.
- **Scope limit (stated plainly).** Needs a status change inside the
  window between the human's label add and the next 120 s poll (push
  cycle is 60 s, `worker.py:90` `job_push`). The human label must not
  be a desk tool label. No attacker needed — ordinary maintainer \+
  reviewer interaction triggers it.

## Severity reasoning

- **Low, not Medium:** labels are metadata, not funds or access; the
  deletion is silent but recoverable (re-add the label) and needs a
  timing window.
- **Low, not Minor:** the docstring promises the opposite behavior, the
  deletion is silent, and it is triggered by ordinary use — a
  reviewer adding a label during triage will routinely lose it.

## Root cause

`push_labels` treats the desk's last-polled label list as the full
truth and PUTs it wholesale, instead of merging with the live GitHub
label set (or using add/remove endpoints for the delta).

## Reproduction

### A. Python harness (primary evidence — PASS)

Harness `/tmp/desk4/h2_sync.py` (real `push_labels`, fake GitHub
client). Stored labels `["bug"]`, human added `needs-repro` on GitHub,
ticket accepted → PUT payload was `['bug', 'accepted']`;
`needs-repro` dropped; `push_labels` returned True. Harness prints
`BUG CONFIRMED`.

## Dedup note

Checked against the live public report list at https://bounty.xe.network
(166 public tickets, checked 2026-11-09). No title or body match for
`push_labels`, `set_labels`, or label clobbering. No known report
covers this defect.

## Suggested fix direction

- Fetch the live label set before pushing and merge (keep labels the
  desk did not set), or use GitHub's add/remove label endpoints for
  the delta instead of a full-set PUT.

## References (file:line, desk @ 186af22)

| Location | What it shows |
| --- | --- |
| `desk/services/sync.py:537-556` | `keep` built from stored `t.github_labels`; then `set_labels` |
| `desk/services/github.py:166-168` | `set_labels` is a full-replacement PUT |
| `desk/worker.py:90` (`job_push`) | Push cycle is 60 s |
| `/tmp/desk4/h2_sync.py` | Verification harness (`BUG CONFIRMED`) |

## Payout address

```
052e33e0ed9c43e2bdf07faff9a90d25642b51d53d96f49f5d45b81f6584b3da
```

**NOTE — operator must confirm this payout address (or replace it with
their own) before submission.** This is the hunt testnet wallet generated
for faucet/PoC work; it is the address the reporter intends to receive
any award at, pending operator confirmation.

### Thread

**Joseph Denne**team2026-11-10 14:00 UTCdesk

Thank you for this report. We have read it against the code and it is being handled. The assessment and any award follow the fix. https://bounty.xe.network/XE-1795
