5.7 KiB
Delegation intent: explicit Ticket workflow state
Classification
implementation-ready after typed-ticket-thread-event-log.
The typed thread event foundation is complete. This ticket should add explicit durable workflow state to Ticket records and update the panel/queue action to use it instead of inferred phase/action/status heuristics.
Intent
Replace inferred panel Ticket state with explicit Ticket workflow fields and simplify the panel main list to display durable state directly.
Durable workflow state:
intake -> ready -> queued -> inprogress -> done
The only normal human gate is ready -> queued, exposed as Queue in the panel. Review/rework/validation remain within inprogress; transient activity should not be stored in Ticket frontmatter.
Worktree / branch
- worktree:
/home/hare/Projects/yoi/.worktree/explicit-ticket-workflow-state - branch:
work/explicit-ticket-workflow-state
This ticket may read tracked .yoi/tickets records/design artifacts. Do not read or edit .yoi/memory/.
Requirements
- Add typed workflow fields to Ticket frontmatter/model parsing/writing:
workflow_state: intake | ready | queued | inprogress | done;attention_required: null | "..."or compatible optional string overlay;queued_by: null | "user"or compatible optional string;queued_at: null | timestampor compatible optional timestamp/string.
- Preserve existing Tickets through safe defaults/migration behavior.
- Existing open Tickets without
workflow_stateshould not be guessed from title/labels/thread as authoritative state. - Use a conservative default such as
intakeorreadyonly if documented and tested; if the current status is closed, map todonewhere appropriate.
- Existing open Tickets without
- Use the typed thread event APIs from
typed-ticket-thread-event-logfor state changes where practical:ready -> queuedshould update frontmatter and appendstate_changedas one logical mutation;- the event should record actor/reason and remain concise.
- Update
yoi panelto display workflow state directly. - Simplify panel main-list rows:
- Ticket rows:
<sel> <state> <slug-or-id> <title>; - Pod rows:
<sel> <pod-state> <pod-name>; - remove permanent priority/action/status/phase columns from main rows.
- Ticket rows:
- Move row-specific operations such as Queue/Defer/Open/Send to selected-row actionbar/key hints instead of always-visible row columns.
- Keep composer/status bar concise and stable; move verbose target/help/diagnostics to actionbar/detail/diagnostic area.
- Remove or demote heuristics that infer phase/action from labels, title text,
readiness,needs_preflight, or thread event presence. - Rename panel
Go/ApproveIntakequeue-like behavior toQueue. - Queue action semantics:
- only valid when current
workflow_state == ready; - re-check state before mutation;
- transition to
queued; - set
queued_by/queued_atif adopted; - append typed
state_changedevent; - notify Orchestrator if reachable, but notification failure must not roll back a successful Ticket transition.
- only valid when current
Defermay remain as a safe status/pending action if currently useful, but it should not pretend to be workflow state unless explicitly modeled.- Intake readiness:
- add API/tool/helper path for Intake/Orchestrator to mark a Ticket
readyusing explicit state and, where practical, anintake_summary/state_changedevent; - do not dump full Intake transcripts into Ticket thread.
- add API/tool/helper path for Intake/Orchestrator to mark a Ticket
- Done/close flow should set or derive
workflow_state = doneconsistently. - No-Ticket workspace Pod-centric panel behavior must remain unchanged.
- Do not store transient
activityin frontmatter. - Do not reintroduce
--multior:ticket.
Current code map
crates/ticket/src/lib.rs- Ticket item/frontmatter parsing/writing,
Ticketmodel, backend APIs. - Newly available typed event APIs:
TicketStateChange,TicketIntakeSummary,add_state_changed,add_intake_summary,set_state_field.
- Ticket item/frontmatter parsing/writing,
crates/ticket/src/tool.rs- Built-in Ticket tool behavior. Add workflow state support only if needed for Intake/Orchestrator/Panel flows.
crates/yoi/src/ticket_cli.rs- Direct CLI. Update display/create behavior only if needed; keep CLI stable.
crates/tui/src/workspace_panel.rs- Current inferred
TicketPanelPhase,NextUserAction, row derivation heuristics.
- Current inferred
crates/tui/src/multi_pod.rs- Panel row rendering, Queue/Defer action dispatch, status/action bar text, Orchestrator notification.
crates/client/src/ticket_role.rs- Intake/Orchestrator role launch context if state-ready/intake-summary integration needs launch-prompt changes.
Non-goals
- Scheduler/lease/queue system.
- Persisting live Pod activity into Tickets.
- Reintroducing human approve/reject gates for every review loop.
- Reintroducing
--multior:ticket. - Broad layout redesign beyond the required state-only row/statusbar simplification.
Validation
Run at least:
cargo test -p ticket workflowor targeted workflow-state tests;cargo test -p ticket;cargo test -p tui workspace_panel;cargo test -p tui multi_pod;cargo test -p yoi panel;cargo test -p yoi ticketif CLI behavior changes;cargo test -p pod ticket --libif tools change;cargo check --workspace --all-targets;cargo fmt --check;git diff --check;cargo build -p yoi;target/debug/yoi ticket doctor.
Run nix build .#yoi --no-link if feasible.
Completion report
Report:
- worktree path / branch;
- commit hash;
- final frontmatter fields and default/migration behavior;
- state transition API usage;
- Queue semantics and Orchestrator notification behavior;
- panel row/statusbar simplification;
- heuristics removed/demoted;
- tests updated/added;
- validation results;
- remaining follow-up items, if any.