Compare commits
2 Commits
5fa060a748
...
043c2e862c
| Author | SHA1 | Date | |
|---|---|---|---|
| 043c2e862c | |||
| 27e5074450 |
1
TODO.md
1
TODO.md
|
|
@ -5,7 +5,6 @@
|
|||
- [ ] Pod CLI: マニフェスト関連フラグの整理 → [tickets/pod-cli-manifest-flags.md](tickets/pod-cli-manifest-flags.md)
|
||||
- [ ] Pod オーケストレーション
|
||||
- [ ] 動的 Scope 変更 → [tickets/dynamic-scope.md](tickets/dynamic-scope.md)
|
||||
- [ ] `scope-lock` → `pod-registry` リネーム → [tickets/pod-registry-rename.md](tickets/pod-registry-rename.md)
|
||||
- [ ] ネイティブ GUI クライアント MVP → [tickets/native-gui-mvp.md](tickets/native-gui-mvp.md)
|
||||
- [ ] TUI 拡充
|
||||
- [ ] フルスクリーン化によるオーバーホール → [tickets/tui-fullscreen-overhaul.md](tickets/tui-fullscreen-overhaul.md)
|
||||
|
|
|
|||
|
|
@ -168,13 +168,13 @@ impl Tool for SpawnPodTool {
|
|||
|
||||
let predicted_socket = self.runtime_base.join(&input.name).join("sock");
|
||||
let lock_path = pod_registry::default_registry_path()
|
||||
.map_err(|e| ToolError::ExecutionFailed(format!("scope lock path: {e}")))?;
|
||||
.map_err(|e| ToolError::ExecutionFailed(format!("pod-registry path: {e}")))?;
|
||||
|
||||
// Reserve the allocation up front. Spawner's pid is a live
|
||||
// placeholder; the child will rewrite it via `adopt_allocation`.
|
||||
{
|
||||
let mut guard = LockFileGuard::open(&lock_path)
|
||||
.map_err(|e| ToolError::ExecutionFailed(format!("scope lock open: {e}")))?;
|
||||
.map_err(|e| ToolError::ExecutionFailed(format!("pod-registry open: {e}")))?;
|
||||
pod_registry::delegate_scope(
|
||||
&mut guard,
|
||||
&self.spawner_name,
|
||||
|
|
|
|||
|
|
@ -385,7 +385,7 @@ async fn shutdown_releases_scope_allocation_when_present() {
|
|||
)
|
||||
.await;
|
||||
|
||||
// Allocation is gone from the scope lock.
|
||||
// Allocation is gone from the pod-registry.
|
||||
let g = LockFileGuard::open(&lock_path).unwrap();
|
||||
assert!(
|
||||
g.data().find("kid").is_none(),
|
||||
|
|
|
|||
|
|
@ -1,35 +0,0 @@
|
|||
# `scope-lock` → `pod-registry` リネーム
|
||||
|
||||
## 背景
|
||||
|
||||
`crates/scope-lock` は元々 `crates/pod/src/runtime/scope_lock.rs` にあった機能を、TUI picker から live セッション判定 (`lookup_session`) のために参照したいという理由で独立クレートに切り出したもの。実体は「マシン全体で生きている Pod の allocation テーブル」であり、scope 衝突判定はその一機能にすぎない(session_id 衝突防止・delegation tree の reparent・stale 回収などは scope と独立に効いている)。
|
||||
|
||||
加えて、永続化先のファイル名 `scope.lock` も実態と合っていない:
|
||||
|
||||
- 中身は `flock(2)` で保護された JSON ステート。`Cargo.lock` のようなバージョン固定ファイルではない
|
||||
- `flock` は read-modify-write のトランザクションを直列化するためだけに保持しており、Pod の生存期間ずっとロックを保持しているわけでもない
|
||||
- 拡張子で `.lock` を名乗っていることで「触るな」という誤った印象を与える
|
||||
|
||||
## ゴール
|
||||
|
||||
クレート名とファイル名を実態に合わせる:
|
||||
|
||||
- crate `scope-lock` → `pod-registry`
|
||||
- ファイル `<runtime_dir>/scope.lock` → `<runtime_dir>/pods.json`
|
||||
- `manifest::paths::scope_lock_path` → `manifest::paths::pod_registry_path`
|
||||
- インポート `scope_lock::...` / `crate::runtime::scope_lock::...` → `pod_registry::...`
|
||||
- `crates/pod/src/runtime/mod.rs` の `pub use ::scope_lock` → `pub use ::pod_registry`
|
||||
- ドキュメンテーション・コメント中の "scope.lock" / "scope-lock registry" の言い換え
|
||||
|
||||
## 範囲外
|
||||
|
||||
- 内部型名のリネーム(`LockFile` / `LockFileGuard` / `ScopeAllocationGuard` / `ScopeLockError` 等)。これらは内部 API でリネームしても挙動は変わらず、必要が生じた時に別途整理する。
|
||||
- `ScopeRule` / `scope_allow` / `delegate_scope` 等、scope そのものを扱うシンボル名は据え置き(クレートが何かではなく、何を扱うかなので)。
|
||||
- 既存の `scope.lock` ファイルが残っている環境での互換性(dev 期間中の互換不要、必要なら手で消す)。
|
||||
|
||||
## 完了条件
|
||||
|
||||
- `crates/pod-registry` として独立クレートが存在し、`pod`/`tui` の依存もこの名前を指している
|
||||
- `<runtime_dir>/pods.json` が新しいレジストリの保存先として使われる
|
||||
- 既存テスト(pod / pod-registry / tui 関連)がすべて緑
|
||||
- ドキュメンテーション・チケット本文中の参照(`tickets/dynamic-scope.md` 等)が新名に揃っている
|
||||
Loading…
Reference in New Issue
Block a user