Add draft status for tickets

Done Task High
Created: Dec 24, 2025
Updated: 7 days ago
PR: View

Description

Recent Comments

T
tinker-reviewer 7 days ago

## Code Review: PASS ### Changes Reviewed **app/models/ticket.rb:** - Added `draft` as the **initial state** (line 36) - changed from `backlog` - Added `draft` scope for querying draft tickets (line 23) - Added `confirm` event: draft → backlog (lines 48-53) with transition logging - Updated `block` event to allow from `draft` state - Updated `cancel` event to include `draft` state **app/controllers/api/v1/mcp_controller.rb:** - Added `include_drafts` parameter to `list_tickets` (default: false) - Draft tickets are **excluded by default** unless `include_drafts` is true (lines 344-347) - Added `confirm` to the valid transition events enum (line 112) - Updated `list_tickets` description to document draft filtering **spec/factories/tickets.rb:** - Changed default status from `backlog` to `draft` - Added `:backlog` trait for tests needing tickets in backlog state **spec/models/ticket_spec.rb:** - Updated initial state test to check `draft` instead of `backlog` - Added tests for `confirm` event (transition and agent log creation) - Updated `#start_work` test to use `:backlog` trait **spec/requests/api/v1/mcp_spec.rb:** - Added test for `confirm` transition via MCP - Updated existing tests to use `:backlog` trait where needed ### Acceptance Criteria Met - ✓ New tickets start in "draft" status (initial state) - ✓ Draft tickets don't appear in `list_tickets` by default - ✓ `confirm` event moves draft → backlog - ✓ Once confirmed, ticket behaves normally (backlog → todo → in_progress) - ✓ Tests cover draft state and confirm event (all 70 tests pass) ### Code Quality Notes - Clean state machine update with proper transition logging - Backward compatible - existing workflow unchanged for non-draft tickets - Draft filtering is opt-in via `include_drafts` parameter - Factory trait (`:backlog`) makes test migration clean

Ticket Stats

Status: Done
Priority: High
Type: Task

Comments

1 comments
T
tinker-reviewer Reviewer

Add a Comment

Supports Markdown. Use @agent-name to mention.

Quick reactions:

No Subtasks Yet

Break down this ticket into smaller, manageable subtasks

Activity Timeline

  • tinker-worker

    State transition

    7 days ago

  • tinker-orchestrator

    Transition approve

    7 days ago

  • tinker-worker

    State transition

    7 days ago

  • tinker-reviewer

    Transition pass audit

    7 days ago

  • tinker-reviewer

    Add comment

    7 days ago

  • tinker-worker

    State transition

    7 days ago

  • tinker-worker

    Transition submit review

    7 days ago

  • tinker-worker

    Update ticket

    7 days ago

  • tinker-worker

    State transition

    7 days ago

  • System

    State transition

    7 days ago

  • tinker-orchestrator

    Transition plan

    7 days ago

  • tinker-orchestrator

    Create ticket

    7 days ago