-
Notifications
You must be signed in to change notification settings - Fork 0
Workspaces 6/10: Rust Workspace registry and stable dor refs #619
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
66be240
a1fa36a
0c45f54
f45818c
38c9905
354be87
fcc9595
cfbbf9c
e1bf9d0
75b3e86
4dbf472
400a743
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -332,6 +332,41 @@ which structurally enforces that the install runs in the window the walk tears | |||||||||||||||
| down last (`docs/specs/auto-update.md`). Custom commands need no capability | ||||||||||||||||
| entry. `standalone/scripts/tauri-conf.test.mjs` pins both. | ||||||||||||||||
|
|
||||||||||||||||
| ### Workspace registry | ||||||||||||||||
|
|
||||||||||||||||
| **Rust holds the union of every window's Workspaces**, since each webview's | ||||||||||||||||
| store (`lib/src/lib/workspace-store.ts`) sees only its own. Each window reports | ||||||||||||||||
| its list on every change, coalesced per microtask, and the union is broadcast as | ||||||||||||||||
| `dormouse://workspaces` with a monotonic `revision`; a webview drops a snapshot | ||||||||||||||||
| behind the one it holds. | ||||||||||||||||
|
|
||||||||||||||||
| - **Must mint numbered ids only in Rust**, `workspace-<n>` off one counter, handed to a | ||||||||||||||||
| webview in blocks (`workspace_reserve_ids`) so a create mints synchronously. | ||||||||||||||||
| The ref `workspace:<n>` is the id's number, so it never renumbers and never | ||||||||||||||||
| collides across windows; an unused reservation is a gap, nothing more. | ||||||||||||||||
| - **Must allow boot and creation when reservation fails**, using opaque UUID | ||||||||||||||||
| ids until the pool recovers; log the failure. Canonical refs follow | ||||||||||||||||
| `docs/specs/dor-cli.md` → "Handle Model" (`workspace-store.test.ts`). | ||||||||||||||||
|
Comment on lines
+347
to
+349
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "until the pool recovers" reads as if the id recovers; it never does. A refilled pool numbers later creates, while the Workspace minted during the outage keeps its UUID — and so its The pointer is also a bare file name, which
Suggested change
|
||||||||||||||||
| - **The counter is seeded above every id any snapshot on disk names**, and | ||||||||||||||||
| above every id a window reports, so a fresh id never meets a restored one. | ||||||||||||||||
| Never below 2: `workspace-1` is a bare Wall's only Workspace. | ||||||||||||||||
| - **A `dor` request naming a Workspace or Window routes to the window holding | ||||||||||||||||
| it** (§Routing precedence). A target the registry cannot place — one no | ||||||||||||||||
| window reports, or a name two windows carry — falls through to the caller's | ||||||||||||||||
| window, which refuses a name duplicated there and otherwise resolves its own, | ||||||||||||||||
| so a local Workspace wins. **A target routes as a number only when it reads | ||||||||||||||||
| as `POSITIONAL_WORKSPACE_REF`** (`dor/src/protocol.ts`); `007` and `0` are | ||||||||||||||||
| names (`a_number_with_a_leading_zero_is_a_name`). | ||||||||||||||||
| - **`Destroyed` forgets the window's entries** and broadcasts. | ||||||||||||||||
|
|
||||||||||||||||
| Source of truth: `standalone/src-tauri/src/workspaces.rs`; | ||||||||||||||||
| `workspace_reserve_ids` / `workspace_report` / `workspace_registry` in | ||||||||||||||||
| `standalone/src-tauri/src/lib.rs`; `installWorkspaceRegistry` in | ||||||||||||||||
| `standalone/src/workspace-registry.ts`; `installWorkspaceIdPool` / | ||||||||||||||||
| `workspaceRefFor` in `lib/src/lib/workspace-store.ts`. Pinned by the tests in | ||||||||||||||||
| `standalone/src-tauri/src/workspaces.rs` and | ||||||||||||||||
| `an_explicit_target_routes_to_the_window_holding_it`. | ||||||||||||||||
|
|
||||||||||||||||
| ### Routing | ||||||||||||||||
|
|
||||||||||||||||
| Source of truth: `route` in `standalone/src-tauri/src/routing.rs`, | ||||||||||||||||
|
|
@@ -345,7 +380,7 @@ Source of truth: `route` in `standalone/src-tauri/src/routing.rs`, | |||||||||||||||
| | `pty:exit`, `pty:replay` | `data.id` | its owner, never suppressed | | ||||||||||||||||
| | `pty:list` | `data.forWindow` | the window that asked | | ||||||||||||||||
| | `alert:*` carrying `data.id` | `data.id` | its owner | | ||||||||||||||||
| | `dor:controlRequest` | `data.surfaceId` | its owner; no Surface named → the focused window | | ||||||||||||||||
| | `dor:controlRequest` | `params.workspace`, `params.window`, `data.surfaceId` | in that precedence: the window holding the named Workspace (§Workspace registry), the named window, the caller's Surface's owner; none → the focused window | | ||||||||||||||||
| | `dor:controlCancel` | `data.requestId` | the window its request went to; unknown → every window | | ||||||||||||||||
| | `burrow:ask` | `data.params.surfaceId` | its owner; a Surface with no PTY here, or an ask naming none, → every window (§Burrow service) | | ||||||||||||||||
| | everything else | — | every window | | ||||||||||||||||
|
|
||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Both" counted the two forms that existed before this commit;
workspace:<id>is now a third, and it is the one a reader is least likely to guess is accepted bare.