Skip to content

desk: add the M1 command palette and reconnect receipts - #126

Merged
SSFSKIM merged 15 commits into
masterfrom
desk-ctl-m1
Oct 22, 2026
Merged

SSFSKIM merged 15 commits into
masterfrom
desk-ctl-m1

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 22, 2026

Copy link
Copy Markdown
Owner

What and why

Build M1 of the desk control-surface spec: a session-owned cached command palette, advertised form routing, exact MCP names, capability-aware refusals, independent command receipts, and reconnect recovery when a sleeping browser misses a command's end.

The bridge remains the classification authority. MAWS's browser-safe ranking implementation is now shared with the desk rather than copied. Model/Compact native controls preserve argument semantics, and unavailable/future forms stay explicit. The M0 live-walk display findings are fixed: completed confirmations visibly say Ran, and bridged missing usage says not reported yet. Production sidebar/title behavior is unchanged.

Storage/deployment note

This adds the owner-approved command-only op_outcomes SQLite table in the Project Durable Object. It is created in code; no wrangler migration is needed. It retains only command envelope/result fields, never transcript rows or side-question answers. Limits are 256 receipts, 24 hours and 4 MiB per project, with an alarm enforcing expiry even without traffic. Terminal outcomes remain sticky over late starts, and browser joins replay retained receipts without reissuing effects.

Validation Evidence

  • Task review and independent high branch review are clean through final head 6b4e8d5d9, including the final test-only Node typing correction and spec evidence updates.
  • Focused RED/GREEN regressions cover local palette/refusals, session-specific cache and resubscribe invalidation, back-to-back receipts, native-control arguments, real-hub missed-end replay, physical idle expiry through the Project alarm, and shared renderer/desk ranking.
  • Completed focused checks: web 62 tests; hub/fake/storage 13 tests; fix-specific storage/ranking/producer run 9 tests; renderer/desk consumer run 35 tests. These runs overlap and are not additive totals. Narrow TypeScript check for the hybrid Worker/SQLite test passed.
  • Focused local headless screenshot tests passed 2/2, and desktop/phone images were inspected by executor and controller. Evidence is recorded in the living spec; these fake-session images support, but do not replace, the deployed acceptance walk.
  • Provisional CI passed all unit shards, the macOS hub relay, and all 12 command browser scenarios. It exposed static-test typing and an old Info-copy expectation, both corrected on this branch.
  • Final-head gates are pending at PR creation. The combined run stopped in preflight before dispatch because the mini has an open runner alert (ci-kit-sandbox #27); no alert override or reroute was attempted. Unaffected Linux static/unit/e2e:desk-web are being queued separately; final-head e2e:desk-web-hub remains blocked pending runner clearance. Final evidence will be added before handoff/merge. The machine companion is already fully green: doperpowers #353, sminos 1.8.0.

Review

One task-review fix wave added traffic-independent retention, shared ranking and faithful fake capabilities; static gate diagnostics corrected the hybrid test's type environment. Independent high review found no material production issues, and the narrow final follow-up was accepted. No unresolved code-review findings remain. A Vitest transform-cache advisory was judged informational tool output, not a reason to change global test configuration.

Acceptance and rollout

Keep both PRs unmerged for the orchestrator. MAWS deploys before sminos rolls out. The spec records M0 accepted with exact live evidence and marks M1 built and reviewed, walk pending.

Still live-only: A10–A14 across mixed versions/stale sessions, terminal Esc versus desk Interrupt, command attribution, sleeping-phone reconnect, and A33's sample counts/latency comparison. Three M0 carryovers are explicit: visible Ran, a genuinely replaced bridge confirmed by effect during the 1.8.0 reload, and older/stale A1/A5. The RC baseline remains deferred; no comparative parity is claimed.

Residue

  • Desk exit remains disabled by the owner's M1 ruling. Re-enabling it needs an engine task/worktree API or a ledger whose completeness the bridge can prove.
  • Screenshot upload-path defect was fixed separately by CI-opt in MAWS gate.yml: upload desk-web's Playwright output with the e2e reports #125. This branch was not moved solely to import it; its local headless evidence stands, and the post-deploy live walk is the owner-facing visual check.

Sminos-Session: desk-sminos-orchestrator#b4948247 (doperpowers on macbook)

Sminos-Session: desk-sminos-orchestrator#b4948247 (doperpowers on macbook)
Sminos-Session: desk-sminos-orchestrator#b4948247 (doperpowers on macbook)
Sminos-Session: desk-sminos-orchestrator#b4948247 (doperpowers on macbook)
Sminos-Session: desk-sminos-orchestrator#b4948247 (doperpowers on macbook)
Sminos-Session: desk-sminos-orchestrator#b4948247 (doperpowers on macbook)
Sminos-Session: desk-sminos-orchestrator#b4948247 (doperpowers on macbook)
Cache pushed per-session catalogs, route listed command forms locally, retain independent command outcomes, and replay bounded command receipts on browser join. Keep native controls and mixed-version refusals explicit. Correct live-walk completion and missing-usage wording.

Sminos-Session: desk-sminos-orchestrator#b4948247 (doperpowers on macbook)
Sminos-Session: desk-sminos-orchestrator#b4948247 (doperpowers on macbook)
Schedule receipt retention alongside lease and request deadlines, verify alarm-only expiry against raw SQLite, share the browser-safe ranker with per-app recents, and correct fake capability fields and Worker-suite typing.

Sminos-Session: desk-sminos-orchestrator#b4948247 (doperpowers on macbook)
Sminos-Session: desk-sminos-orchestrator#b4948247 (doperpowers on macbook)
Update the existing browser regression to the corrected Info wording; the same scenario already confirms that its session is bridged.

Sminos-Session: desk-sminos-orchestrator#b4948247 (doperpowers on macbook)
Load Node declarations explicitly for node:sqlite while retaining the Worker typing lane for SessionStore.

Sminos-Session: desk-sminos-orchestrator#b4948247 (doperpowers on macbook)
Sminos-Session: desk-sminos-orchestrator#b4948247 (doperpowers on macbook)
Sminos-Session: desk-sminos-orchestrator#b4948247 (doperpowers on macbook)
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-22T12:53:13.665549Z 6b4e8d5 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6b4e8d5d9a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

const unavailable = !can.command.can ? can.command.reason : !can.catalog.can ? can.catalog.reason : null;
const query = /^\/([^\s/]*)$/.exec(text)?.[1] ?? null;
const paletteOpen = query !== null && !paletteHidden;
const ranked = rankItems(query ?? '', slashItems(cached.catalog, session.machine, unavailable)).slice(0, 40);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Respect native control capabilities in palette rows

When a session is offline, read-only, or otherwise has can.model/can.compact set to false, this passes only the command/catalog refusal into slashItems. Consequently, Model and Compact remain enabled, selectable palette options with no reason shown, even though the corresponding composer buttons are disabled and submitting the selection is later refused. Pass the native capabilities into the palette construction and emit unavailable rows with their capability reasons.

Useful? React with 👍 / 👎.

const unavailable = !can.command.can ? can.command.reason : !can.catalog.can ? can.catalog.reason : null;
const query = /^\/([^\s/]*)$/.exec(text)?.[1] ?? null;
const paletteOpen = query !== null && !paletteHidden;
const ranked = rankItems(query ?? '', slashItems(cached.catalog, session.machine, unavailable)).slice(0, 40);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep the full catalog visible on initial slash

When the query is empty, as it is immediately after typing /, every item has the same match tier and is ordered by origin and name before this slice discards everything after row 40. The measured catalog documented in docs/doperpowers/specs/2026-10-22-desk-control-surface-design.md contains 92 entries, so later engine commands and potentially every Skills, Plugins, and Custom group are absent from the initial palette; users cannot discover them unless they already know enough of the name to search. Avoid the hard truncation or provide pagination/virtualization that keeps the complete catalog browsable.

Useful? React with 👍 / 👎.

Comment on lines +251 to +255
if (rows.length && ['ArrowDown', 'ArrowUp', 'Enter', 'Tab'].includes(event.key) && !event.shiftKey) {
event.preventDefault();
if (event.key === 'ArrowDown') setActive((bounded + 1) % rows.length);
else if (event.key === 'ArrowUp') setActive((bounded - 1 + rows.length) % rows.length);
else choose(rows[bounded]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Allow Tab to leave a disabled palette option

When filtering leaves an unavailable command such as /exit or a terminal-only panel as the active row, this handler prevents the default Tab action and then calls choose, which immediately returns for unavailable items. With no other matching row, repeated Tab presses do nothing, trapping forward keyboard focus in the composer until the user knows to press Escape or Shift+Tab. Check the active item's availability before preventing Tab, and let the browser move focus when it cannot be chosen.

Useful? React with 👍 / 👎.

A14's catalog gate stands with no M0 fallback, so the web and machine halves ship back to back after cua's hold 3 on the mini releases; the walk order covers the older-plugin and stale-session refusals, the replaced-module reload (retained old tab first, CLI fallback) and the Ran label.

Sminos-Session: desk-sminos-orchestrator#b4948247 (doperpowers on macbook)
@SSFSKIM
SSFSKIM merged commit d399c1c into master Oct 22, 2026
@SSFSKIM

SSFSKIM commented Oct 22, 2026

Copy link
Copy Markdown
Owner Author

Merged at head c4503dc (merge d399c1c) after the full gate on the macOS runner. Run 39842811898 went green on attempt 2: static, unit 1–4/4, e2e:desk-web and e2e:desk-web-hub.

Attempt 1's unit 4/4 failure was src/main/sessions/pause-take-over.pty.test.ts's zsh emacs-mode case. That is the known job-control race in the tech-debt tracker (2026-10-21 row), and it passed on the rerun. Since the PR's base, master had gained only #125 (gate.yml's upload step and a plan line).

Deployed: hub@d399c1ca [email protected].

The live walk follows the order in the spec's last Decision Log entry. This PR was merged before doperpowers #353, so the MacBook was still on sminos 1.7.1 for the older-plugin check. Results so far:

  • On the 1.7.1 MacBook:
    • the typeahead showed only the Desk group (/compact, /model) and commands need sminos ≥ 1.8.0 on macbook · macbook's plugin (1.7.1) is older than the desk's controls: update doperpowers on macbook;
    • /list-agents and /rename were refused with that reason, offering Send as text anyway;
    • the Info tab still read its fields.
  • After the MacBook's roll (19:59:45Z), on a session loaded on 1.7.1: this session's plugin loaded before the update: run /reload-plugins in it, or restart it.

Sminos-Session: desk-sminos-orchestrator#b4948247 (doperpowers on macbook)

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.

1 participant