You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fleet-paperwork: cmd_close can close a pull request — no pull_request check on the close path #6900
fleet-paperwork close can close a pull request. GitHub's issues API returns pull requests as issues, and cmd_close never checks whether the target number is a PR — it GETs the item, PATCHes state: closed, and the readback "verifies" success, so closing a live PR by number is reported as a verified issue close.
infra/fleet-paperwork/fleet_paperwork.py on current main (4cd2927643453bee47a0f764de534e229220cf88, verified twice via the contents API): cmd_close at line 454 GETs /repos/{repo}/issues/{n}, checks only state == "closed", PATCHes closed, and verifies only the returned state. No pull_request check anywhere in the function.
The sibling path proves the hazard was known: find_by_exact_title (line 282) was later fixed to skip items carrying a pull_request key (its docstring says why) and to paginate — cmd_close never got the same treatment.
Why it matters
This tool exists for unattended bulk bookkeeping under the developing.today App, and the outbox/rate-limit workflow (Drew's 2026-11-05 rule) routes real closes through it. Issue and PR numbers share one sequence, so a transposed or stale number closes a live PR instead of an issue — and the tool reports it as a verified success, the failure mode the tool was built to eliminate.
Acceptance criteria
cmd_close refuses (nonzero exit, clear message) when the target item carries a pull_request key, before any PATCH — including under --dry-run semantics (dry-run should surface it too).
A unit test with a PR-shaped GET payload proves the refusal; an issue-shaped payload still closes and verifies.
🤖 Agent note · triaged (verified) — Agent: queue worker (repo-worker-code), lane code-h — Session/ID: task 11299, repo-queue-worker-shift-h 2026-11-09 run. Task 11299 (triage) for issue #6900: fleet-paperwork cmd_close can close a pull request — no pull_request check on the close path.
Triage verdict: CONFIRMED on fresh origin/main (f00f023, fetched 2026-11-09). cmd_close in infra/fleet-paperwork/fleet_paperwork.py (now at line 557; the issue cited line 454 on an older main — the function is unchanged in substance) GETs /repos/{repo}/issues/{n}, checks only state == "closed", PATCHes state: closed, and verifies only the returned state. No pull_request key check anywhere in the function — the only pull_request guard in the file is in the search/filter path (line ~403), exactly the sibling-path asymmetry the issue describes. Existing tests live in infra/fleet-paperwork/tests/test_fleet_paperwork.py (with fake_github.py), so the acceptance test (PR-shaped GET payload refuses; issue-shaped payload still closes+verifies) has a home.
Routing: enqueued as a small_fix follow-up task for the queue (guard in cmd_close before any PATCH, including --dry-run surfacing it, plus the unit test). No held/user/owned/do-not-merge/do-not-auto-edit labels on issue #6900. This triage task completes as triaged; the fix itself is the follow-up task's scope.
🤖 Agent note · parked (CI pending) — Agent: queue worker (repo-worker-code), lane code-h — Session/ID: task 14410, repo-queue-worker-shift-h 2026-11-09 run. Task 14410 (small_fix) for issue #6900: PR #8055 opened and targeted tests pass (32/32 fleet-paperwork suite); basic CI still pending after the 5-minute poll window (scripts-test 3.12/3.14 pass; fleet-search parity + proxy port fallbacks + security still running/queued at park time). Parking task 14410 for 20 minutes; resume condition: re-check PR #8055 checks fresh, disposition any Codex findings, merge when green under the standing criteria.
agent-note:v1 agent=repo-worker-code lane=code-k state=done task=14410 - Resumed from prior checkpoint (PR #8055 open, tests green). Fresh verification by this lane: PR #8055 MERGEABLE, diff exactly infra/fleet-paperwork/fleet_paperwork.py + its tests, unittest discover in the laptop worktree at head 3c385e8: 32 tests OK. Codex review failed to run (usage limits, no findings); CodeRabbit rate-limited (no findings) - disposition posted on PR #8055. Merged PR #8055 as c052ccf; issue #6900 closed by the merge. Task 14410 completing as fixed_merged.
Activity
developing-today commentedon Nov 7, 2026
CODE-2161
dezren39 commentedon Nov 9, 2026
🤖 Agent note · triaged (verified) — Agent: queue worker (repo-worker-code), lane code-h — Session/ID: task 11299, repo-queue-worker-shift-h 2026-11-09 run. Task 11299 (triage) for issue #6900: fleet-paperwork cmd_close can close a pull request — no pull_request check on the close path.
Triage verdict: CONFIRMED on fresh origin/main (f00f023, fetched 2026-11-09).
cmd_closeininfra/fleet-paperwork/fleet_paperwork.py(now at line 557; the issue cited line 454 on an older main — the function is unchanged in substance) GETs/repos/{repo}/issues/{n}, checks onlystate == "closed", PATCHesstate: closed, and verifies only the returned state. Nopull_requestkey check anywhere in the function — the onlypull_requestguard in the file is in the search/filter path (line ~403), exactly the sibling-path asymmetry the issue describes. Existing tests live ininfra/fleet-paperwork/tests/test_fleet_paperwork.py(withfake_github.py), so the acceptance test (PR-shaped GET payload refuses; issue-shaped payload still closes+verifies) has a home.Routing: enqueued as a small_fix follow-up task for the queue (guard in cmd_close before any PATCH, including --dry-run surfacing it, plus the unit test). No held/user/owned/do-not-merge/do-not-auto-edit labels on issue #6900. This triage task completes as triaged; the fix itself is the follow-up task's scope.
dezren39 commentedon Nov 9, 2026
🤖 Agent note · PR opened — Agent: queue worker (repo-worker-code), lane code-h — Session/ID: task 14410, repo-queue-worker-shift-h 2026-11-09 run. Task 14410 (small_fix, direct lane) for issue #6900: implemented the cmd_close pull_request guard verified in triage task 11299. PR #8055 (branch queue/14410-6900-close-guard, commit 3c385e8): cmd_close refuses PR-shaped targets before any PATCH, including under --dry-run; new TestCmdClosePullRequestGuard (3 tests). Full fleet-paperwork suite: 32 tests OK; git diff --check clean. Awaiting CI on PR #8055.
dezren39 commentedon Nov 9, 2026
🤖 Agent note · parked (CI pending) — Agent: queue worker (repo-worker-code), lane code-h — Session/ID: task 14410, repo-queue-worker-shift-h 2026-11-09 run. Task 14410 (small_fix) for issue #6900: PR #8055 opened and targeted tests pass (32/32 fleet-paperwork suite); basic CI still pending after the 5-minute poll window (scripts-test 3.12/3.14 pass; fleet-search parity + proxy port fallbacks + security still running/queued at park time). Parking task 14410 for 20 minutes; resume condition: re-check PR #8055 checks fresh, disposition any Codex findings, merge when green under the standing criteria.
Merge pull request #8055 from developing-today/queue/14410-6900-close…
dezren39 commentedon Nov 9, 2026
agent-note:v1 agent=repo-worker-code lane=code-k state=done task=14410 - Resumed from prior checkpoint (PR #8055 open, tests green). Fresh verification by this lane: PR #8055 MERGEABLE, diff exactly infra/fleet-paperwork/fleet_paperwork.py + its tests, unittest discover in the laptop worktree at head 3c385e8: 32 tests OK. Codex review failed to run (usage limits, no findings); CodeRabbit rate-limited (no findings) - disposition posted on PR #8055. Merged PR #8055 as c052ccf; issue #6900 closed by the merge. Task 14410 completing as fixed_merged.