close-report.sh leaves agent-working (and ready-for-agent) on a closed issue — the claim labels are never released on success #22

Closed
opened 2026-08-22 15:42:44 +00:00 by ben · 2 comments
Owner

Symptom

#8 closed autonomously at 15:41 (first claim with a working agent-working label) and still carries agent-working + ready-for-agent after the close. claim-lib.sh adds agent-working on claim; close-report.sh's success path closes the issue but never removes the claim labels (the blocked path in prompt.md does, by hand).

Fix

  • In close-report.sh, after the verified close: remove agent-working and ready-for-agent (resolve ids by name via forgejo-lib.sh; GOTCHAS 2 — label endpoints, never issue-PATCH). Failure to remove is a warning line, not a refused close.
  • tests/close-report-test.sh: the shimmed success path issues the two label DELETEs; a 4xx on them does not change the exit code.

Acceptance

  • A shimmed successful close ends with neither label on the issue; the timeline shows the label removals by the bot.
## Symptom #8 closed autonomously at 15:41 (first claim with a working `agent-working` label) and still carries `agent-working` + `ready-for-agent` after the close. `claim-lib.sh` adds `agent-working` on claim; `close-report.sh`'s success path closes the issue but never removes the claim labels (the blocked path in `prompt.md` does, by hand). ## Fix - In `close-report.sh`, after the verified close: remove `agent-working` and `ready-for-agent` (resolve ids by name via `forgejo-lib.sh`; GOTCHAS 2 — label endpoints, never issue-PATCH). Failure to remove is a warning line, not a refused close. - `tests/close-report-test.sh`: the shimmed success path issues the two label DELETEs; a 4xx on them does not change the exit code. ## Acceptance - A shimmed successful close ends with neither label on the issue; the timeline shows the label removals by the bot.

swarm-claim host=elitebook-distributed-server-03 run=94
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=94 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #22 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 22,
  "status": "success",
  "commits": [
    "febadb62718478cd3aafecaa3a92e97e4111b32f"
  ],
  "changed_files": [
    "close-report.sh",
    "tests/close-report-test.sh",
    "tests/fakebin/curl",
    "STATUS.md",
    "docs/GOTCHAS.md"
  ],
  "tests": [
    {
      "command": "bash tests/close-report-test.sh",
      "exit_code": 0
    },
    {
      "command": "for t in tests/*.sh onboarding/tests/*.sh; do case \"$t\" in *fakebin*|*fixtures*) continue;; esac; bash \"$t\"; done",
      "exit_code": 0
    }
  ],
  "criteria": {
    "close-report.sh removes agent-working and ready-for-agent after the verified close (ids by name via forgejo-lib.sh, label endpoints)": "close-report.sh cr_release_claim_labels() called in both verified-close branches; resolves ids via forgejo_get /labels + forgejo_label_id, DELETEs via forgejo_remove_label",
    "Failure to remove is a warning line, not a refused close": "cr_release_claim_labels warns on empty id / non-2xx code to stderr and returns 0; T6 proves a 4xx keeps exit 0",
    "test: shimmed success path issues the two label DELETEs; a 4xx on them does not change the exit code": "close-report-test.sh T1 asserts removed_label 444 40 and 444 36; new T6 sets label-delete-fail=404 and asserts rc 0 with both DELETEs still attempted",
    "A shimmed successful close ends with neither label on the issue; the timeline shows the label removals by the bot": "T1 removed_label assertions verify both DELETE .../issues/444/labels/<id> calls landed on the closed issue"
  },
  "summary": "close-report.sh releases agent-working + ready-for-agent on a verified close, in both push and pr-agent-after-green paths, with a 4xx-tolerant warning.",
  "blockers": []
}
**close-report** for #22 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 22, "status": "success", "commits": [ "febadb62718478cd3aafecaa3a92e97e4111b32f" ], "changed_files": [ "close-report.sh", "tests/close-report-test.sh", "tests/fakebin/curl", "STATUS.md", "docs/GOTCHAS.md" ], "tests": [ { "command": "bash tests/close-report-test.sh", "exit_code": 0 }, { "command": "for t in tests/*.sh onboarding/tests/*.sh; do case \"$t\" in *fakebin*|*fixtures*) continue;; esac; bash \"$t\"; done", "exit_code": 0 } ], "criteria": { "close-report.sh removes agent-working and ready-for-agent after the verified close (ids by name via forgejo-lib.sh, label endpoints)": "close-report.sh cr_release_claim_labels() called in both verified-close branches; resolves ids via forgejo_get /labels + forgejo_label_id, DELETEs via forgejo_remove_label", "Failure to remove is a warning line, not a refused close": "cr_release_claim_labels warns on empty id / non-2xx code to stderr and returns 0; T6 proves a 4xx keeps exit 0", "test: shimmed success path issues the two label DELETEs; a 4xx on them does not change the exit code": "close-report-test.sh T1 asserts removed_label 444 40 and 444 36; new T6 sets label-delete-fail=404 and asserts rc 0 with both DELETEs still attempted", "A shimmed successful close ends with neither label on the issue; the timeline shows the label removals by the bot": "T1 removed_label assertions verify both DELETE .../issues/444/labels/<id> calls landed on the closed issue" }, "summary": "close-report.sh releases agent-working + ready-for-agent on a verified close, in both push and pr-agent-after-green paths, with a 4xx-tolerant warning.", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/dev-factory#22
No description provided.