dev: enable default ticket tools and workdir helpers

This commit is contained in:
2026-07-18 17:32:46 +09:00
parent 60410f29a1
commit 5e91f98ae0
18 changed files with 713 additions and 11 deletions
+31
View File
@@ -0,0 +1,31 @@
---
title: 'Enable Ticket tools in default profile'
state: 'closed'
created_at: '2026-07-18T03:04:36Z'
updated_at: '2026-07-18T08:32:27Z'
assignee: null
queued_by: 'yoi ticket'
queued_at: '2026-07-18T03:05:10Z'
---
## 背景
通常の `builtin:default` Worker では Ticket feature が無効で、`TicketList` / `TicketShow` などの typed Ticket tools が露出しない。実装作業では Ticket の前提・受け入れ条件・thread を読めないと正しく作業できないため、default profile でも Ticket tools を有効化する。
Orchestrator 固有の relation / orchestration plan tools は引き続き `ticket_orchestration` で分離し、default profile では有効化しない。
## 要件
- `resources/profiles/default.dcdl` の Ticket feature を有効化する。
- builtin default profile artifact の Ticket feature も同じ既定にする。
- setup wizard が生成する `user:default` profile でも Ticket feature を有効化する。
- `ticket_orchestration` は default では無効のままにする。
- 裸の `WorkerManifestConfig::builtin_defaults()` の feature default は profile 既定とは別なので変更しない。
## 受け入れ条件
- `builtin:default` profile resolution で `feature.ticket.enabled == true` になる。
- `builtin:default` profile resolution で `feature.ticket.access == lifecycle` になる。
- `builtin:default` profile resolution で `feature.ticket_orchestration.enabled == false` のままになる。
- setup model が生成する default profile に `[feature.ticket] enabled = true` が含まれる。
- 関連する profile/setup focused tests が通る。
+1
View File
@@ -0,0 +1 @@
Default profile now enables Ticket lifecycle tools by default while keeping ticket orchestration disabled. Builtin default profile and setup-generated user default profile were updated, with focused tests covering the new expectations.
+85
View File
@@ -0,0 +1,85 @@
<!-- event: create author: "yoi ticket" at: 2026-07-18T03:04:36Z -->
## 作成
LocalTicketBackend によって作成されました。
---
<!-- event: intake_summary author: hare at: 2026-07-18T03:05:10Z -->
## Intake summary
Marked ready by `yoi ticket state`.
---
<!-- event: state_changed author: "yoi ticket" at: 2026-07-18T03:05:10Z from: planning to: ready reason: cli_state field: state -->
## State changed
Marked ready by `yoi ticket state`.
---
<!-- event: state_changed author: "yoi ticket" at: 2026-07-18T03:05:10Z from: ready to: queued reason: queued field: state -->
## State changed
Ticket を `yoi ticket` が queued にしました。
---
<!-- event: state_changed author: "yoi ticket" at: 2026-07-18T03:05:10Z from: queued to: inprogress reason: cli_state field: state -->
## State changed
State changed to `inprogress`.
---
<!-- event: implementation_report author: hare at: 2026-07-18T03:07:25Z -->
## Implementation report
`builtin:default` profile と setup wizard 生成の `user:default` profile で Ticket feature を有効化した。
変更点:
- `resources/profiles/default.dcdl``feature.ticket.enabled``true` に変更。
- builtin default profile artifact の `feature.ticket.enabled``true` に変更。
- setup wizard が生成する default profile の `[feature.ticket] enabled``true` に変更。
- builtin default profile resolution / setup profile generation のテスト期待値を追加。
- `ticket_orchestration` は default では無効のまま維持。
- `WorkerManifestConfig::builtin_defaults()` の裸の feature default は変更していない。
検証:
- `cargo test -p manifest builtin_default_resolves_without_external_evaluator --quiet`
- `cargo test -p manifest builtin_role_profiles_preserve_role_tool_policy --quiet`
- `cargo test -p tui write_default_profile_config_creates_registry_and_profile --quiet`
- `cargo test -p worker installs_ticket_tools_when_default_root_is_usable --quiet`
- `cargo fmt --check`
- `git diff --check`
---
<!-- event: state_changed author: hare at: 2026-07-18T08:32:27Z from: inprogress to: closed reason: closed field: state -->
## State changed
Ticket を closed にしました。
---
<!-- event: close author: hare at: 2026-07-18T08:32:27Z status: closed -->
## 完了
Default profile now enables Ticket lifecycle tools by default while keeping ticket orchestration disabled. Builtin default profile and setup-generated user default profile were updated, with focused tests covering the new expectations.
---
+33
View File
@@ -0,0 +1,33 @@
---
title: 'Add development process switch script'
state: 'closed'
created_at: '2026-07-18T03:17:55Z'
updated_at: '2026-07-18T08:32:27Z'
assignee: null
queued_by: 'yoi ticket'
queued_at: '2026-07-18T03:18:16Z'
---
## 背景
開発中の backend / runtime / workspace frontend は、手動で `cargo run``deno` task を main worktree から起動している。作業ブランチを切った worktree に付け替える時、既存 process を安全に止めて同じ port で起動し直す手順が必要になる。
この worker 自体が同じ開発 process 群に依存している可能性があるため、実装時には stop/restart/start の実行は行わず、静的検証に留める。
## 要件
- `scripts/dev-workspace.sh` を追加する。
- 引数で `start` / `stop` / `restart` を選べる。
- `start` は runtime / backend / frontend をこの checkout から起動する。
- `stop` は runtime / backend / frontend を停止する。
- `restart` は frontend を触らず、runtime / backend だけ停止・起動する。
- frontend は `0.0.0.0` bind で起動する。
- pid/log は repository-local な runtime directory に保存し、生成物は git 管理対象外にする。
- port listener の付け替えに対応する。
## 受け入れ条件
- `bash -n scripts/dev-workspace.sh` が通る。
- `scripts/dev-workspace.sh --help` が安全に使い方を表示する。
- start/stop/restart は実装するが、この作業中には実行しない。
- runtime/backend/frontend の command と default bind/port が script 内で確認できる。
+1
View File
@@ -0,0 +1 @@
Added `scripts/dev-workspace.sh` with start/stop/restart/status. Start moves runtime/backend/frontend to this checkout, frontend binds `0.0.0.0`, restart intentionally leaves frontend untouched. Runtime files are kept under ignored `.yoi/dev/`.
+98
View File
@@ -0,0 +1,98 @@
<!-- event: create author: "yoi ticket" at: 2026-07-18T03:17:55Z -->
## 作成
LocalTicketBackend によって作成されました。
---
<!-- event: intake_summary author: hare at: 2026-07-18T03:18:16Z -->
## Intake summary
Marked ready by `yoi ticket state`.
---
<!-- event: state_changed author: "yoi ticket" at: 2026-07-18T03:18:16Z from: planning to: ready reason: cli_state field: state -->
## State changed
Marked ready by `yoi ticket state`.
---
<!-- event: state_changed author: "yoi ticket" at: 2026-07-18T03:18:16Z from: ready to: queued reason: queued field: state -->
## State changed
Ticket を `yoi ticket` が queued にしました。
---
<!-- event: state_changed author: "yoi ticket" at: 2026-07-18T03:18:16Z from: queued to: inprogress reason: cli_state field: state -->
## State changed
State changed to `inprogress`.
---
<!-- event: implementation_report author: hare at: 2026-07-18T03:20:37Z -->
## Implementation report
`script/dev-workspace.sh` ではなく repository root の `scripts/dev-workspace.sh` として開発 process 管理 script を追加した。
実装内容:
- `start` / `stop` / `restart` / `status` action を追加。
- `start` は runtime, backend, frontend をこの checkout から起動する。
- `stop` は runtime, backend, frontend を止める。
- `restart` は frontend を触らず、runtime/backend だけ止めて起動し直す。
- frontend は既定で `0.0.0.0:5173` bind。
- backend は既定で `127.0.0.1:8787`、runtime は `127.0.0.1:38800`
- pid/log は `.yoi/dev/{pids,logs}` に保存し、`.gitignore``/.yoi/dev` を追加。
- 既存 listener がいる場合、port listener PID を止めてからこの checkout の process を起動する。
- managed process は pidfile の pid/process group を使って止める。pidfile 管理外の既存 listener は、caller の process group を巻き込まないよう PID 単位で止める。
確認:
- `bash -n scripts/dev-workspace.sh`
- `scripts/dev-workspace.sh --help`
- `scripts/dev-workspace.sh status`
- `git diff --check`
実行しなかったこと:
- `scripts/dev-workspace.sh start`
- `scripts/dev-workspace.sh stop`
- `scripts/dev-workspace.sh restart`
理由:
- 現在の worker 自体が既存 backend/runtime/frontend process 群に依存している可能性があり、停止・再起動するとこのセッションが落ちるため。
現状確認:
- frontend listener pid は `/home/hare/Projects/yoi/web/workspace` 由来。
- backend/runtime listener pid は `/home/hare/Projects/yoi` 由来。
---
<!-- event: state_changed author: hare at: 2026-07-18T08:32:27Z from: inprogress to: closed reason: closed field: state -->
## State changed
Ticket を closed にしました。
---
<!-- event: close author: hare at: 2026-07-18T08:32:27Z status: closed -->
## 完了
Added `scripts/dev-workspace.sh` with start/stop/restart/status. Start moves runtime/backend/frontend to this checkout, frontend binds `0.0.0.0`, restart intentionally leaves frontend untouched. Runtime files are kept under ignored `.yoi/dev/`.
---
+28
View File
@@ -0,0 +1,28 @@
---
title: 'Limit workdir dirty source check to HEAD selector'
state: 'closed'
created_at: '2026-07-18T08:28:54Z'
updated_at: '2026-07-18T08:32:27Z'
assignee: null
queued_by: 'yoi ticket'
queued_at: '2026-07-18T08:29:31Z'
---
## 背景
Runtime workdir materializer は `selector``git rev-parse <selector>^{commit}` で commit に解決し、`git worktree add --detach` で detached worktree を作る。明示 branch / tag / commit selector の場合、source worktree の未コミット変更は生成される detached worktree には入らないため、dirty source を理由に拒否する必要はない。
一方で `HEAD` selector は現在の source worktree の状態を暗黙に参照する導線なので、既存の dirty source safety check を維持する。
## 要件
- workdir materialization の dirty source check は実質 selector が `HEAD` の時だけ行う。
- 明示 branch selector では source repository が dirty でも commit 解決と detached worktree 作成を許す。
- `HEAD` selector の dirty source rejection は維持する。
## 受け入れ条件
- `selector = HEAD` で source repository が dirty の場合、`working_directory_dirty_source_rejected` になる。
- `selector = <branch>` で source repository が dirty の場合、workdir materialization が成功する。
- 明示 branch selector で作った workdir は dirty source の未コミットファイルを含まない。
- focused worker-runtime tests が通る。
+1
View File
@@ -0,0 +1 @@
Workdir dirty source rejection is now scoped to the `HEAD` selector. Explicit branch selectors can materialize detached workdirs from their resolved commit even when the source worktree has uncommitted changes.
+82
View File
@@ -0,0 +1,82 @@
<!-- event: create author: "yoi ticket" at: 2026-07-18T08:28:54Z -->
## 作成
LocalTicketBackend によって作成されました。
---
<!-- event: intake_summary author: hare at: 2026-07-18T08:29:31Z -->
## Intake summary
Marked ready by `yoi ticket state`.
---
<!-- event: state_changed author: "yoi ticket" at: 2026-07-18T08:29:31Z from: planning to: ready reason: cli_state field: state -->
## State changed
Marked ready by `yoi ticket state`.
---
<!-- event: state_changed author: "yoi ticket" at: 2026-07-18T08:29:31Z from: ready to: queued reason: queued field: state -->
## State changed
Ticket を `yoi ticket` が queued にしました。
---
<!-- event: state_changed author: "yoi ticket" at: 2026-07-18T08:29:31Z from: queued to: inprogress reason: cli_state field: state -->
## State changed
State changed to `inprogress`.
---
<!-- event: implementation_report author: hare at: 2026-07-18T08:32:27Z -->
## Implementation report
workdir materialization の dirty source check を `selector == "HEAD"` の場合だけ実行するようにした。
変更点:
- `LocalGitWorktreeMaterializer::materialize` で selector を先に確定。
- selector が `HEAD` の時だけ `git status --porcelain` による dirty source rejection を行う。
- 明示 branch selector では source worktree が dirty でも `git rev-parse <selector>^{commit}` で commit 解決し、detached worktree を作る。
- branch selector + dirty source の回帰テストを追加し、未コミットファイルが materialized worktree に入らないことを確認。
検証:
- `cargo test -p worker-runtime --features ws-server,fs-store branch_selector_allows_dirty_source_materialization --quiet`
- `cargo test -p worker-runtime --features ws-server,fs-store dirty_source_is_rejected_by_materialization --quiet`
- `cargo test -p worker-runtime --features ws-server,fs-store local_git_repo_materializes_detached_worktree_under_runtime_root --quiet`
- `cargo fmt --check`
- `git diff --check`
---
<!-- event: state_changed author: hare at: 2026-07-18T08:32:27Z from: inprogress to: closed reason: closed field: state -->
## State changed
Ticket を closed にしました。
---
<!-- event: close author: hare at: 2026-07-18T08:32:27Z status: closed -->
## 完了
Workdir dirty source rejection is now scoped to the `HEAD` selector. Explicit branch selectors can materialize detached workdirs from their resolved commit even when the source worktree has uncommitted changes.
---