Skip to content

fix(ticket-draft): never widen a ticket in work or change a closed one - #162

Merged
mmaclay merged 6 commits into
mainfrom
fix/ticket-draft-in-progress-scope
Dec 5, 2026
Merged

mmaclay merged 6 commits into
mainfrom
fix/ticket-draft-in-progress-scope

Conversation

@mmaclay

@mmaclay mmaclay commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

Origin: #152
Sandbox: Haiku, --check, tracker pack, runs at 5c17a19 scored with 145fbbb's check (only the check changed). tracker-ticket-draft-in-work: main 0/2, branch 3/3. Main rewrote PROJ-61 in one run and drafted nothing in the other; every branch run drafted the follow-up, its request verbatim as its original text, and left PROJ-61 alone. tracker-ticket-draft-closed: branch 2/2 (main 0/2 on the earlier round). tracker-ticket-draft-new (regression, earlier commit): main 2/2, branch 3/3. Four review rounds, the last clean.
Canary: none yet

Ticket: #152

Motivation

ticket-draft added scope to a ticket a developer was already working on, because its recommended answers led there. Each scope question recommended In scope, and a refine request that added to the goal was treated as the new goal. So a "take the recommended option" run rewrote the ticket under its developer, restarting their work and its review. The same path could rewrite a Done ticket's description. #152 asked that a ticket in work never be widened without the person choosing it, and that a finished or abandoned ticket never be updated.

Change Summary

  • In work: a Jira ticket whose status is the implementation status, or one of jira.pr_statuses, is in work. So is a GitHub issue that is open and has an assignee, or carries the implementation or a pr-status label. Its opening block reads in work: <assignee>.
  • A request that adds to a ticket in work is asked about at step 1, before any reader or the format question. The options are Draft a follow-up (recommended), Widen , in work with , or Stop. After that, every scope question on the ticket recommends a follow-up, and widening is never the recommended option.
  • Closed (finished, abandoned, or a closed GitHub issue): ticket-draft says its description is not changed and offers Draft a follow-up (recommended) or Stop. Reformat mode stops on a closed ticket too.
  • An overlap with a ticket in work or closed recommends Stop ("the work is ticketed in "), with Draft this ticket, linked, as the alternative. It never merges the ticket into the new draft.
  • settle mode is unchanged: it records what the work did, which is its job on a ticket in work or closed.

Used by: nothing outside this repository

Departures

  • The issue says "unless I explicitly approve". The rule leaves the decision to the person through an option that names the ticket as in work, never a recommended one. It does not try to detect whether the person is the assignee, because nothing the skill reads identifies them in Jira.

Details

Design decisions

  • The in-work question sits in step 1, ahead of the format question. In the first sandbox round, a ticket in work that predated the current format was routed to Reformat first, and one run planned a write replacing its description. Moving the question fixed that: 0 of 3 runs did it after the move.
  • In work is read from the profile's fields (jira.roles.implementation, jira.pr_statuses, and the issue_tracker.* equivalents), not from status names. When a Jira workflow is not recorded, the skill asks the person.

What changed

  • skills/ticket-draft/SKILL.md: step 1's rule, with a follow-up's original text being the person's request, step 3's overlap recommendation, step 6's In scope label on a ticket in work, and the Never list.
  • skills/ticket-draft/reformat.md: stops on a closed ticket.
  • skills/ticket-draft/github.md: the in work: text on the issue line.
  • sandbox/tracker: fixture ticket PROJ-61 (Under Development, Bob Example) and two scenarios.
  • Versions: ticket-draft 1.13.0.

Testing

Run: bash tests/checks.sh

  • tracker-ticket-draft-in-work refines PROJ-61 with an addition and the standing answer "take the recommended option". It must write a drafted ticket's paste file and none for PROJ-61, so a run that widens PROJ-61 or stalls fails.
  • tracker-ticket-draft-closed refines Done ticket PROJ-31. It must offer a follow-up, run no investigator and offer no reformat.
  • Downstream: none.

🤖 Generated with Claude Code. AI assistance level: 5/5 (not read by a person).

mmaclay and others added 6 commits December 4, 2026 08:33
- Read a ticket as in work from the implementation status and the
  pr_statuses, or a GitHub issue's assignee and labels, and show
  `in work: <assignee>` in the opening block
- Recommend a follow-up, never widening, at every scope question on a
  ticket in work; widen it only on an option that names it as in work
- Stop at a closed ticket: offer a follow-up or stopping, and never
  reformat it
- Never merge a ticket in work or closed into a new draft
- Add the tracker scenarios tracker-ticket-draft-closed and
  tracker-ticket-draft-in-work, with PROJ-61 Under Development

Closes #152

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Ask Draft a follow-up, Widen <key> or Stop at step 1 when the
  request adds to a ticket in work, ahead of the format question that
  would otherwise reformat the request into it
- Recommend Stop, not a new draft, on an overlap with a ticket in work
  or closed
- Let a GitHub issue's state and assignee decide when no label is
  recorded
- Give PROJ-61 a current-format description; hold the in-work
  scenario to writing no PROJ-61 paste file, and the closed one to
  never offering a reformat

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A run reads the ticket through jira_search as often as jira_get_issue.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…k check

- A follow-up drafted from a ticket in work or closed takes the
  person's request, verbatim, as its .original.txt, as a new ticket does
- The in-work and closed questions follow the opening block instead of
  showing it a second time
- The in-work scenario adds a third turn so the files are written and
  files_absent can catch a widened PROJ-61

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The final turn reports the files written, so a says check on its text
missed the follow-up; a drafted ticket's .jira.txt other than PROJ-61's
now stands for it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mmaclay
mmaclay marked this pull request as ready for review December 5, 2026 00:31
@mmaclay
mmaclay merged commit 3d9c08d into main Dec 5, 2026
1 check passed
@mmaclay
mmaclay deleted the fix/ticket-draft-in-progress-scope branch December 5, 2026 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant