Skip to content

docs(product): design scope-aware tier-3 command dispatch (RIG-2529) - #508

Draft
rigel-mintaka wants to merge 1 commit into
mainfrom
compass-ux/rig-2529-tier3-scope-gate
Draft

docs(product): design scope-aware tier-3 command dispatch (RIG-2529)#508
rigel-mintaka wants to merge 1 commit into
mainfrom
compass-ux/rig-2529-tier3-scope-gate

Conversation

@rigel-mintaka

Copy link
Copy Markdown
Contributor

Design record for making the keyboard dispatcher's tier 3 (window-global) scope-aware, closing the tier-3 focus-exclusivity hole RIG-2130 ratified as DEFER (RD-4/OQ-6).

What

Tier 3 today runs any registered command whose keymap entry has no when, regardless of the command's declared scope or where focus is (dispatch.ts:120-129). This record adds one conjunct — run the matched global entry only if command.scope === "global" or command.scope equals the active zone — reusing tier 2's already-computed zone (dispatch.ts:107). It turns the long-authored-but-unread Command.scope field (commands.ts:18,40) into the load-bearing gate.

Why now

This is the shared substrate for the RIG-2482 keyboard-shortcuts overlay and the RIG-2483 command palette: the discoverability net needs the eight group-relative list.* commands registered so they earn overlay/palette rows. Under today's tier 3, registering them would open eight new copies of the RD-4 leak. The scope gate is what makes register = safe.

Contract note

The safety proof rests on activeZone being derived from activeGroup (spine.ts:95-97), an invariant the codebase itself declares temporary. D5 names it as a contract: any future independent zone controller inherits the obligation to re-establish tier-3 safety. This closes RD-4/OQ-6 and flips the regression guard Bridge.test.tsx:537-572 that today asserts the hole stays open.

Design-critic verdict: GO (0 blockers). Ledger rows DL-227..229.

Spec-impact: none.
Ledger-impact: adds DL-227 (scope-gate predicate), DL-228 (RD-4/OQ-6 closure), DL-229 (shared commands-as-inventory rule).
Refs RIG-2529.

Co-authored-by: Matt Wilkinson matt@rigel.build

Design record for making the keyboard dispatcher's tier 3 (window-global) scope-aware, closing the tier-3 focus-exclusivity hole RIG-2130 ratified as DEFER (RD-4/OQ-6).

## What

Tier 3 today runs any registered command whose keymap entry has no `when`, regardless of the command's declared `scope` or where focus is (`dispatch.ts:120-129`). This record adds one conjunct — run the matched global entry only if `command.scope === "global"` or `command.scope` equals the active zone — reusing tier 2's already-computed `zone` (`dispatch.ts:107`). It turns the long-authored-but-unread `Command.scope` field (`commands.ts:18,40`) into the load-bearing gate.

## Why now

This is the shared substrate for the RIG-2482 keyboard-shortcuts overlay and the RIG-2483 command palette: the discoverability net needs the eight group-relative `list.*` commands registered so they earn overlay/palette rows. Under today's tier 3, registering them would open eight new copies of the RD-4 leak. The scope gate is what makes *register = safe*.

## Contract note

The safety proof rests on `activeZone` being derived from `activeGroup` (`spine.ts:95-97`), an invariant the codebase itself declares temporary. D5 names it as a contract: any future independent zone controller inherits the obligation to re-establish tier-3 safety. This closes RD-4/OQ-6 and flips the regression guard `Bridge.test.tsx:537-572` that today asserts the hole stays open.

Design-critic verdict: GO (0 blockers). Ledger rows DL-227..229.

Spec-impact: none.
Ledger-impact: adds DL-227 (scope-gate predicate), DL-228 (RD-4/OQ-6 closure), DL-229 (shared commands-as-inventory rule).
Refs RIG-2529.

Co-authored-by: Matt Wilkinson <matt@rigel.build>
@linear-code

linear-code Bot commented Aug 23, 2026

Copy link
Copy Markdown

RIG-2529

@github-actions

Copy link
Copy Markdown

Compass engineering docs preview: https://compass-ux-rig-2529-tier3-sc.compass-eng-docs.pages.dev

Deployed from compass-ux/rig-2529-tier3-scope-gate at b3665fd.

Changed pages:

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