ticket: remove worker lifecycle state

This commit is contained in:
Keisuke Hirata 2026-07-11 13:09:06 +09:00
parent a98e25eda8
commit 13f9e0fab8
No known key found for this signature in database
3 changed files with 72 additions and 0 deletions

View File

@ -0,0 +1,30 @@
---
title: 'Remove durable worker lifecycle_state'
state: 'inprogress'
created_at: '2026-07-11T04:08:12Z'
updated_at: '2026-07-11T04:09:06Z'
assignee: null
queued_by: 'yoi ticket'
queued_at: '2026-07-11T04:09:06Z'
---
## 背景
Backend worker registry は `lifecycle_state` を永続化しているが、`running` / `idle` / `stopped` などの Worker lifecycle は Runtime が authority を持つ live state であり、Backend DB に保存すると Runtime 再起動後に stale な state が Workers list に残る。Registry は Worker identity / refs / retention を保存し、live state は Runtime 問い合わせまたは短命 cache に限定する。
## 要件
- `WorkerRegistryRecord``worker_registry` schema から `lifecycle_state` を削除する。
- worker registry upsert/select/read の SQL から `lifecycle_state` を削除する。
- registry-only Worker projection は過去の lifecycle state を status/state として返さず、`archived` / `registry_only` 等の live ではない状態として表現する。
- live Worker が存在する場合は Runtime 由来の status/state をそのまま使い、registry metadata は label/profile/retention/working-directory refs などに限定して merge する。
- 既存 DB に `lifecycle_state` column が残っていても読み書きが壊れないよう、active schema/access path はその column に依存しない。
## 受け入れ条件
- `WorkerRegistryRecord``lifecycle_state` field が存在しない。
- `worker_registry` の active CREATE TABLE / INSERT / SELECT / read path に `lifecycle_state` が存在しない。
- `merge_worker_registry_projection(Some(live), ...)` が live status/state を registry value で上書きしない。
- `worker_summary_from_registry()``idle` / `running` / `stopped` など過去の live lifecycle を返さない。
- Workspace server tests が registry-only Worker と live Worker merge の両方を検証する。
- `cargo test``nix build .#yoi` が通る。

View File

@ -0,0 +1,42 @@
<!-- event: create author: "yoi ticket" at: 2026-07-11T04:08:12Z -->
## 作成
LocalTicketBackend によって作成されました。
---
<!-- event: intake_summary author: hare at: 2026-07-11T04:09:06Z -->
## Intake summary
Marked ready by `yoi ticket state`.
---
<!-- event: state_changed author: "yoi ticket" at: 2026-07-11T04:09:06Z 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-11T04:09:06Z from: ready to: queued reason: queued field: state -->
## State changed
Ticket を `yoi ticket` が queued にしました。
---
<!-- event: state_changed author: "yoi ticket" at: 2026-07-11T04:09:06Z from: queued to: inprogress reason: cli_state field: state -->
## State changed
State changed to `inprogress`.
---