ticket: preflight ticket init scaffold

This commit is contained in:
Keisuke Hirata 2026-06-07 12:43:43 +09:00
parent 8f3f5bff2c
commit 716eb053d1
No known key found for this signature in database
2 changed files with 72 additions and 2 deletions

View File

@ -6,9 +6,9 @@ status: open
kind: task kind: task
priority: P1 priority: P1
labels: [ticket, config, init, profiles, panel] labels: [ticket, config, init, profiles, panel]
workflow_state: intake workflow_state: ready
created_at: 2026-06-07T03:14:39Z created_at: 2026-06-07T03:14:39Z
updated_at: 2026-06-07T03:14:39Z updated_at: 2026-06-07T03:43:38Z
assignee: null assignee: null
legacy_ticket: null legacy_ticket: null
--- ---

View File

@ -4,4 +4,74 @@
Created by LocalTicketBackend create. Created by LocalTicketBackend create.
---
<!-- event: plan author: hare at: 2026-06-07T03:43:33Z -->
## Plan
## Preflight / implementation intent
Classification: implementation-ready after `ticket-role-launch-config-strict-validation` landed.
Intent:
- Add a Ticket-focused scaffold/init path that writes an explicit `.yoi/ticket.config.toml` with concrete fixed role profiles.
- This is explicit config generation, not runtime fallback. The generated file may choose builtin presets, but the runtime must continue requiring explicit role config.
Current state:
- There is no top-level `yoi init` command in `crates/yoi/src/main.rs`.
- `yoi ticket` currently has no `init` command.
- `yoi ticket` already documents fallback backend behavior when config is absent, but role launch validation now requires explicit role config for Panel Intake/Orchestrator launches.
Implementation direction:
- Introduce a narrow `yoi ticket init` scaffold command rather than a broad product-level init redesign.
- The command should create `.yoi/ticket.config.toml` if missing, and optionally ensure the local Ticket root `.yoi/tickets` exists.
- Default generated config should explicitly include:
- `[backend] provider = "builtin:yoi_local"`, `root = ".yoi/tickets"`;
- fixed `[roles.*]` tables for intake, orchestrator, coder, reviewer, investigator;
- each role has a concrete `profile`, initially `builtin:default` unless role-specific builtin profiles are introduced in the same small diff;
- each role has explicit `workflow` matching the role defaults.
- Do not overwrite an existing `.yoi/ticket.config.toml` unless an explicit force flag is intentionally added and tested. A minimal first pass can fail with an actionable diagnostic when the config already exists.
- Generated config should pass the strict role launch validation added by the previous ticket.
Suggested command shape:
- `yoi ticket init`
- Optional flags only if small and useful:
- `--force` is not required for first pass;
- `--print`/dry-run is not required for first pass.
Code map:
- `crates/yoi/src/ticket_cli.rs`: add parse/run/help for `init` and tests.
- `crates/ticket/src/config.rs`: add reusable scaffold string/helper if that keeps config generation testable near config types.
- `crates/client/src/ticket_role.rs`: use existing launch validation tests to verify generated config is launch-ready.
- `.yoi/ticket.config.toml`: update this repository's config through the new intended shape or keep repository config update in main workspace if child worktree excludes `.yoi`; the implementation should at least make the scaffold generate that shape.
Non-goals:
- Do not loosen runtime validation.
- Do not add implicit builtin/default fallback.
- Do not implement broad global `yoi init` unless the existing CLI structure makes it clearly smaller than `yoi ticket init`.
- Do not design role-specific builtin profiles unless it is trivial and scoped; `builtin:default` as explicit scaffold output is acceptable for now.
Validation:
- Tests should cover generated config shape, refusal to overwrite existing config, and successful role launch validation against generated config.
- Run focused `cargo test -p ticket config --lib`, `cargo test -p client ticket_role --lib`, and `cargo test -p yoi ticket` or equivalent ticket CLI tests.
- Run `cargo fmt --check` and `git diff --check`.
---
<!-- event: intake_summary author: INSOMNIA at: 2026-06-07T03:43:38Z -->
## Intake summary
Implementation-ready after strict role launch validation: add a narrow `yoi ticket init` scaffold path that writes explicit backend and fixed role profile config to `.yoi/ticket.config.toml`, using concrete selectors such as explicit `builtin:default` for now, without adding runtime fallback.
---
<!-- event: state_changed author: INSOMNIA at: 2026-06-07T03:43:38Z from: intake to: ready reason: intake_ready field: workflow_state -->
## State changed
Ticket intake complete; workflow_state intake -> ready.
--- ---