Skip to content

feat(shell): link to the grants page as Agent access - #98

Merged
bketelsen merged 3 commits into
mainfrom
irulan/shell-agent-access
Nov 17, 2026
Merged

bketelsen merged 3 commits into
mainfrom
irulan/shell-agent-access

Conversation

@frostyard-machines

@frostyard-machines frostyard-machines commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The shell gets an Agent access link to the grants page, /oauth/grants, where an admin reads and revokes agent grants (oauth.md, The grants page). Until now the page was reached only by its typed URL (runbook-pilot.md types it 4 times), which is slow on a phone. This is the smallest step of the roadmap's later idea "Settings in the shell", with no new route.

  • Where: a key icon at the foot of the rail (after the companion's button, before lodge's state), and an "Agent access" row in the switcher, under the app list and outside the listbox, so the list's keys do not change. The narrow bar has no link of its own; a tap on it opens the switcher.
  • How it opens: an <a href="/oauth/grants" target="_blank" rel="noopener noreferrer">: a new top-level page, never a frame. The consent routes answer frame-ancestors 'none' and X-Frame-Options: DENY (lodge-http.md, OAuth routes), and a same-tab navigation would unload every app frame, which shell.md's Rules forbid. A same-origin top-level navigation passes the consent routes' fetch-metadata check. A click in the switcher closes it.
  • Who sees it: every user. The rule, recorded in shell.md, Agent access: the link shows only to an admin when a route the shell already reads says who is one; /lodge/apps, the only route the shell reads, does not, so the link shows to all and the page enforces its own access (lodgectl allow admin LOGIN).
  • Docs: shell.md (new section Agent access, Layout, the switcher, Rules), oauth.md (back-link), design/overview.md, the roadmap's later line, and the site's configure guide.

runbook-pilot.md keeps the typed URL: its run needs lodge v0.5.0, which has no link.

Risk tier

Risk tier: 2 — a behaviour change in the shell's UI only: a link with no new route, fetch or write. No path in .github/risk-paths.json matches (shell/, docs/ and site/ are not listed).

At edb8e45 the PR got risk:high and level:L1 from the org floor of core's risk-paths spec: the correction record's first name, ...-takes-the-switcher-keys.json, holds the path word keys. That file is a JSON review record, not key material. 257502a renames it (content unchanged), and pr-triage at that head computes L3. By that spec's rules 1 and 6, the author lowers the labels by hand when the stricter change leaves the PR: risk:high and level:L1 are removed and level:L3 set.

Cross-review

  • Reviewer openai/gpt-6.1-sol; coder github-copilot/claude-sonnet-5.5 (shell code), docs by anthropic/claude-opus-5-5. Base 5a42da37d49c7939de409386c80c2423ec30583d.
  • Initial review at 00c9f05: Not ready, 1 blocking point: with the switcher link focused (Tab), Escape, the switcher's shortcut and the companion's chord did nothing.
  • Fix at edb8e45: 1 shared key handler for the filter and the link; Enter stays the link's own. Guard: test takes the switcher's Escape, shortcut and companion chord while the switcher link has focus; record .memory/corrections/2026-11-16-pr-98-switcher-link-takes-escape-and-chords.json; shell.md states the keys. Re-review 1 at edb8e45: Ready, Blocking: none.
  • Re-review 2 at 257502a (the record's rename only): Ready, Blocking: none.

Docs housekeeping

  • Cross-links added in both directions (shell.md ↔ oauth.md, overview.md, roadmap)

Verification

  • make ci green in the nsl machine before the first push (verify, race, cross, client-check, ui-check, shell-check: 56 shell tests).
  • Revert test: in a scratch worktree at the head, shell/src/lodge.ts and shell/src/style.css reverted to origin/main, tests kept; pnpm exec vitest run test/lodge.test.ts -t "agent access" (nsl) fails all 3 new tests on assertions: has one rail link, with and without a companion, has a switcher link outside the listbox, and a click closes the switcher, never frames the grants page or changes history.
  • Revert test of the blocking fix: shell/src/lodge.ts at 00c9f05, tests kept; pnpm exec vitest run test/lodge.test.ts -t "agent access" (nsl) fails takes the switcher's Escape, shortcut and companion chord while the switcher link has focus on an assertion (expected false to be true); the other 3 pass.
  • After the fix: make shell-check (nsl, 57 tests) and make check (host) green.

The rail's foot and the switcher get an Agent access link that opens
/oauth/grants in a new top-level page. The grants page cannot be framed
(frame-ancestors 'none'), and a same-tab navigation would unload every
app frame. /lodge/apps does not say who is an admin, so the link shows
to every user and the page enforces its own access. shell.md records
the rule; no route is added.
@github-actions github-actions Bot added the level:L3 Skim label Nov 17, 2026
Tab can focus the Agent access link in the open switcher, but only the
filter took Escape, the switcher's shortcut and the companion's chord.
One handler now serves both focus targets; Enter stays the link's own.
@github-actions github-actions Bot added level:L1 Read every line risk:high Touches a path in .github/risk-paths.json and removed level:L3 Skim labels Nov 17, 2026
Its name held the word "keys", which the org's risk-path floor reads
as key material (level L1). The record's content is unchanged.
@frostyard-machines frostyard-machines added level:L3 Skim and removed risk:high Touches a path in .github/risk-paths.json level:L1 Read every line labels Nov 17, 2026
@frostyard-machines

Copy link
Copy Markdown
Contributor Author

Labels lowered by the author: risk:high and level:L1 came from the org floor's path word keys in the correction record's first file name (2026-11-16-pr-98-switcher-link-takes-the-switcher-keys.json), a JSON review record and not key material. 257502a renames it with no content change, and pr-triage at that head computes L3 (no path of .github/risk-paths.json matches). Per core's risk-paths spec (rules 1 and 6), the stricter change has left the PR, so the labels are now level:L3 without risk:high.

@frostyard-machines frostyard-machines added the ready-for-human Reviewed, CI green: ready for Brian to review and merge label Nov 17, 2026
@bketelsen
bketelsen merged commit 338a708 into main Nov 17, 2026
14 checks passed
@bketelsen
bketelsen deleted the irulan/shell-agent-access branch November 17, 2026 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

level:L3 Skim ready-for-human Reviewed, CI green: ready for Brian to review and merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants