feat: close issues through a script #25
Reference in New Issue
Block a user
Delete Branch "feat/close-script"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #17.
Adds
skills/sync/scripts/close.py— the only regular tracker operation thathad no script behind it. Until now the only way to move
state:was a rawapi -X PATCHcall naming the owner, the repo and the request body by hand:everything the transport layer exists to hide, and a permission wide enough to
cover
-X DELETEon the repository.What it does
stateand nothing else. Closing is notan edit; editing stays
pull.py-> change ->push.py --update.--milestone, no--label: which issues arefinished is a judgement about content. Deleting an issue stays out of scope.
gitea:field while the file isthere and through
.remote.jsonafter push dropped it, so an issue with nolocal copy is still closeable by name. Keys take the same four forms
pull.pyaccepts.origin: localis refused — it is not in the tracker, so there is nostate there to change, and the error names the id.
whatever repo the CWD happens to be in.
Safety
The local file is written only after the tracker confirmed this write: an
object carrying the number that was PATCHed, in the state that was asked for
(
close.confirmed). A non-2xx, a transport that would not run, an answer foranother issue, a 200 that still says
open— the run stops and the file isbyte for byte what it was. Arguments are all resolved before anything is sent,
so a typo in the third id cannot leave the first two closed.
--dry-runmakesno request at all and needs no pinned login.
Layering
close.pylives in the bridge, goes through_gitea.py, and adds no secondtransport. Both domains are untouched and still stdlib-only.
Docs
skills/sync/SKILL.md— command table row plus a "Closing and reopening"section (what may be named, what happens to the local copy, what the
confirmation gate requires).
agents/tea-runner.md— rule 4 rewritten: closing was forbidden becausenothing but a raw call could do it, not because it is dangerous. The runner
may now close the ids the caller named and no others; deleting and retitling
stay forbidden.
AGENTS.md,skills/issue/SKILL.md— script list and the pointer forclosing a synced issue.
Tests
tests/test_close.py(54 cases) stubs the transport at_gitea.apiand, forthe non-2xx path, one layer lower at
_gitea.subprocessso a CLI exiting 1 isproved end to end. Every store is a
tempfile.TemporaryDirectory(); nothingtouches
tmp/issues/or a network.