Skip to content

dor v2 8/8: make references explicit - #1745

Open
nedtwigg wants to merge 5 commits into
dor-v2-07-placementfrom
dor-v2-08-explicit-refs
Open

nedtwigg wants to merge 5 commits into
dor-v2-07-placementfrom
dor-v2-08-explicit-refs

Conversation

@nedtwigg

@nedtwigg nedtwigg commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Workspace references now choose one interpretation explicitly. workspace:<id> resolves only an id. workspace-name:<exact name> resolves only a name, and keeps numeric names and whitespace. Bare Workspace and Window references are refused before any host request. Window destinations require window:<label>, and every --window synopsis reads [--window ref].

Creating a destination now has its own flag on both move commands:

  • dor workspace move --new-window replaces --window new.
  • dor move <surface> --new-workspace replaces --new. The private surface.move wire field stays { new: true }.

dor move checks its destination reference before it contacts the host.

The CLI, renderer, VS Code guard, and Rust router share one reference contract. Shared JSON cases (dor/test/reference-cases.json) check TypeScript/Rust parity. The browser providers validate an intercepted --workspace before running the provider. send --stdin=true keeps its position among ordered events. The website help-parser test finds the split-direction row by name.

docs/dor-v2-migration.md covers the whole stack:

  • literal values, and the empty --cwd refusal
  • -- required only by dor split; browser providers stay drop-in, and named Tools are unchanged
  • ordered send events
  • the focus default: agents and scripts preserve focus, a command typed alone at a prompt focuses its result
  • the JSON error codes
  • command_state and exit 4
  • --from
  • explicit references, --new-window, and --new-workspace

Help, skill, fixtures, and specs are updated.

Stack: 8/8, based on #1744. Breaking change for Dormouse 2.0.

Validation on the complete stack:

  • Full root pnpm test passed:
    • spec, Markdown, public-docs, and security lints, with their self-tests
    • dor: 361 tests (354 passed, 7 platform skips)
    • lib: 367 files, 7,388 tests (7,363 passed, 1 expected failure, 24 skipped)
    • website: 486
    • vscode-ext: 279
    • standalone: tsc --noEmit, 404 vitest (401 passed, 3 expected failures), and 48 script tests
    • standalone sidecar: 115 and 270 (all passed apart from 12 platform skips)
    • relay: 320
    • dor-tools-builtin: 251 (247 passed, 4 skips)
    • Hosted and the remaining package suites
  • Full pnpm build passed.
  • Rust: all 185 library tests passed, run through pnpm with the pinned Node.

Mutation checks:

  • Dropping dor move's early reference check lets a bare destination reach the host, which fails the move test.
  • Restoring the --new flag name fails both move tests.
  • Dropping --stdin=true from the ordered-event scan fails the send test.
  • Dropping the browser --workspace validation fails the reference-prefix test, for agent-browser and for playwright.
  • A bare-name fallback in parseWorkspaceRef fails the shared grammar test and three CLI tests.

Windows-specific executable tests remain skipped on this macOS host. Native multi-window behavior is covered by the existing routing and transfer tests, not by a manual Windows run.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Deploying mouseterm with  Cloudflare Pages  Cloudflare Pages

Latest commit: c6297cf
Status: ✅  Deploy successful!
Preview URL: https://36bafeb1.mouseterm.pages.dev
Branch Preview URL: https://dor-v2-08-explicit-refs.mouseterm.pages.dev

View logs

@dormouse-bot dormouse-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The --window synopses and placeholders still read label (dor list [--window label], dor list --workspaces [--window label], dor workspace [--window label]), but windowRefParser now refuses a bare label. An agent working from the synopsis will try --window ws-2 and be refused. The suggestions below fix the placeholders in the diff; list.ts's LIST_USAGE lines ([--window label], outside the diff) and the help snapshots need the same edit.

Comment thread dor/src/commands/workspace.ts Resolved
Comment thread dor/src/commands/workspace.ts Resolved
Comment thread dor/src/commands/list.ts Resolved
@nedtwigg
nedtwigg force-pushed the dor-v2-07-placement branch from 1f590c2 to d566214 Compare November 12, 2026 03:31
@nedtwigg
nedtwigg force-pushed the dor-v2-08-explicit-refs branch from ab182bf to 5637b43 Compare November 12, 2026 03:31
@nedtwigg

Copy link
Copy Markdown
Member Author

Re: dormouse-bot review —

--window synopses and placeholders still read label

Fixed everywhere. Every --window synopsis and placeholder now reads ref:

  • dor/src/commands/list.ts:85-86: both LIST_USAGE lines, which sat outside the diff
  • list.ts:157-159: the flag's placeholder, with its brief now naming the window:<label> form
  • list.ts:69: the description's --window <label>, now --window <ref>
  • dor/src/commands/workspace.ts:118: the root-help patch
  • workspace.ts:161: the flag's placeholder

The list, workspace, and root dor help snapshots are regenerated.

@dormouse-bot

Copy link
Copy Markdown
Collaborator

Confirmed at 5637b43. Nothing under dor/src or the help snapshots says --window label anymore. One mention is left, in prose: the "Cross-Window --all" item under ## Future in docs/specs/dor-cli.md still says dor list --window <label>, which now reads as a bare label that the CLI refuses. If you want it consistent, it could be --window window:<label> or --window <ref>.

@nedtwigg
nedtwigg force-pushed the dor-v2-07-placement branch from d566214 to 289f592 Compare November 12, 2026 05:10
@nedtwigg
nedtwigg force-pushed the dor-v2-08-explicit-refs branch from 5637b43 to 33ef1b0 Compare November 12, 2026 05:10

@dormouse-bot dormouse-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One spec sentence overstates what the Rust side shares (inline).

Comment thread docs/specs/dor-cli.md Resolved
@nedtwigg
nedtwigg marked this pull request as ready for review November 12, 2026 07:07

@dormouse-bot dormouse-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One stale contract comment outside the diff: MoveWorkspaceRequest in dor/src/commands/types.ts still says toWindow is "a label or new for a torn-out one". The renderer's workspace.move handler now refuses anything but window:<label> or new, so the comment should say window:<label>.

nedtwigg and others added 4 commits November 11, 2026 23:27
`workspace:<id>` resolves only an id and `workspace-name:<exact name>` only
a name; bare Workspace and Window references are refused before any host
request, and Window destinations require `window:<label>` (`[--window ref]`
in every synopsis). `dor workspace move --new-window` replaces
`--window new`, and `dor move <surface> --new-workspace` replaces `--new`.
The CLI, renderer, VS Code guard, and Rust router share one grammar, with
JSON cases checking TypeScript/Rust parity. `docs/dor-v2-migration.md`
covers the whole dor 2.0 stack.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nedtwigg
nedtwigg force-pushed the dor-v2-07-placement branch from 289f592 to 8bbfa0d Compare November 12, 2026 07:31
@nedtwigg
nedtwigg force-pushed the dor-v2-08-explicit-refs branch from 6120d45 to 34e382f Compare November 12, 2026 07:31

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants