runtime: remove runtime-owned id

This commit is contained in:
2026-07-13 17:38:09 +09:00
parent 6fedf81785
commit 49f085916e
17 changed files with 268 additions and 496 deletions
+2 -2
View File
@@ -1,8 +1,8 @@
---
title: 'Remove Runtime-owned runtime_id'
state: 'inprogress'
state: 'done'
created_at: '2026-07-13T07:42:49Z'
updated_at: '2026-07-13T07:43:36Z'
updated_at: '2026-07-13T08:37:44Z'
assignee: null
queued_by: 'yoi ticket'
queued_at: '2026-07-13T07:43:36Z'
+38
View File
@@ -39,4 +39,42 @@ Ticket を `yoi ticket` が queued にしました。
State changed to `inprogress`.
---
<!-- event: implementation_report author: hare at: 2026-07-13T08:37:44Z -->
## Implementation report
Implemented removal of Runtime-owned runtime_id from worker-runtime.
- Removed `RuntimeId` and made worker-runtime Worker authority Runtime-local (`WorkerRef { worker_id }`).
- Removed `runtime_id` from Runtime options, summaries, event cursors/subscriptions, Worker summaries/details, Runtime errors, persisted Runtime state, and Worker snapshots.
- Removed REST server `--runtime-id`; the process exposes a single Runtime identified externally by URL/backend alias only.
- Changed REST server default store selection to durable fs-store with a default user data root, keeping `--store memory` as the explicit throwaway mode.
- Changed fs-store layout so the supplied root is the Runtime store, not `root/runtimes/<runtime-id>`.
- Added legacy single-runtime layout migration from the old `runtimes/<encoded-runtime-id>/` layout into the root store when exactly one legacy Runtime directory exists.
- Changed deterministic Worker runtime names from `runtime-<runtime_id>-<worker_id>` to Runtime-local `worker-runtime-<worker_id>`.
- Kept workspace-server runtime ids as backend/endpoint aliases and adapted embedded/remote projections to attach those aliases at the workspace boundary instead of passing them into worker-runtime.
Validation:
- `cargo fmt --check`
- `git diff --check`
- `cargo check -q`
- `cargo test -q -p worker-runtime --features fs-store,ws-server`
- `cargo test -q -p yoi-workspace-server`
- `cargo run -q -p worker-runtime --features ws-server,fs-store --bin worker-runtime-rest-server -- --help`
- `cargo run -q -p worker-runtime --features ws-server,fs-store --bin worker-runtime-rest-server -- --runtime-id arc` rejects the removed option
- started `worker-runtime-rest-server` with `--fs-root /tmp/yoi-runtime-idless-test` and verified `/v1/runtime` reports `backend: fs_store` without runtime_id
- `nix build .#yoi --no-link`
---
<!-- event: state_changed author: "yoi ticket" at: 2026-07-13T08:37:44Z from: inprogress to: done reason: cli_state field: state -->
## State changed
State changed to `done`.
---