Repository navigation
feat(apps): permissions.browser grant, app_browser_sdk preview and ctx.browser (RFC #38322 step 1a) - #39018
feat(apps): permissions.browser grant, app_browser_sdk preview and ctx.browser (RFC #38322 step 1a)#39018chenmingwei23 wants to merge 1 commit into
Conversation
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS No blocker. The blind reader read both primary controls correctly: the "App browser access" switch and "Approve new permissions". The problems below are wording problems. Notes
[UX-REVIEWED] 2f98336 Description read[DESCRIPTION-READ] 67a6521bcbd0f136bc93a7a5e59e59f837f7fae57cd6984ffe0e0c1a8e916259 That sha256 names everything this verdict read: the PR description, plus the 9 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the change copies the existing staged, explicit-only grant pattern from Notes
[DESIGN-REVIEWED] 2f98336 Description read[DESCRIPTION-READ] 9541e45168073215849fa58c36012845945a4111efdf3002a10013fadac5cd54 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. Everything ships behind the Notes
What this change shipsInventory (9 items) — 6 justifiedIntent: let an app ask for browser verbs on its own slots and let the owner approve each one, behind a preview that is off by default. This is an ADDITION.
[FIRST-PRINCIPLES-REVIEWED] 2f98336 Description read[DESCRIPTION-READ] 308c4a0e622951ea73afc554211df21f35cc5eac1660dd820255bf67723f79cd That sha256 names the PR description this verdict read. Recompute it with |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Opus 5.5 Review — ✅ no blocking findingsReviewed Review detailsNo findings. Notes:
[OPUS-REVIEWED] 2f98336 Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
696ea95 to
331fb49
Compare
331fb49 to
1f0164a
Compare
|
|
|
1f0164a to
6ca9979
Compare
6ca9979 to
779cbbe
Compare
779cbbe to
0771309
Compare
|
…x.browser (RFC #38322 step 1a)
0771309 to
2f98336
Compare
|
Problem / Motivation
Goal: An app can declare
permissions.browserand the owner approves each verb on the app's page, behind a default-off preview, so step 1b of RFC #38322 can build the browser operations on a grant that already exists.Implements step 1a of RFC #38322 (
docs/request-for-change/rfc-app-sdk-browser.md, Migration plan row 1a). Today an app has no way to ask for the browser tabs of its own chats. Browser Collab gets them through out-of-tree patches, which every other app is denied.Why it matters
Steps 1b and 1c add the page operations and the
BrowserViewcomponent. Each of them needs a grant the owner can give and take back, and a switch that keeps the whole surface off until it is ready. Without this step they would each invent one.Not a goal
ctx.browserhas nopage(),slots(),navigate,clickorscreenshotyet. That is step 1b.APP_SDK_LEVELchange. That is step 1c.browsertool,permissions.browserSites, or any default.What changed (motivation -> approach -> change)
The RFC asks for a staged grant family like
permissions.apiandpermissions.events. So the new family copies the nearest existing ones:desktopCapabilitiesfor the verb list andbrowserSites(#38333) for "install approves nothing".permissions.browserview,read,act. Unknown entries are dropped, so a bad value grants less.browsergrant familyapps/point_grants.pyand added to_OWNER_APPROVED_FAMILIES. Install approves no verb. An update that adds a verb holds that one back, by the existing staged-family rule.app_browser_sdkpreviewedition_locks.feature_previews, so LTS reads it as off.ctx.browserapps/browser_sdk.BrowserSDK, kept on the context when the manifest declares the field. TheAppContext.browserproperty returns it only while the preview is on, read at each access, so turning the preview on needs no restart. Itsverbs()re-reads the preview, the manifest and the approved set on every call.Docs:
manifest-reference.md,api-reference.md(ctx.browser),configuration.md, the feature map and section 46 ofapp-kit-platform.md. Strings are in every locale anden-XAis regenerated; the settings registry, UI index andconfig-baseline.jsonare regenerated.Where: the preview name is in
config/sections_dashboard.pyandutils/previewFlags.ts, its switch inpages/settings/FeaturePreviewsSection.tsx; the verb words incomponents/appstore/browserVerbs.ts; the app page box inpages/AppDetailGrantBoxes.tsx; the approval call type inapi/client/apps.ts; the strings ini18n/locales/en.manual.jsonand the other locale files.Backwards compatibility
Compatible: a new optional manifest field and a new preview that is off. An app that does not declare
permissions.browsergets noctx.browserand its grants are unchanged.Removes nothing: the diff only adds a field, a grant family, a preview and their readers.
Tests
test/test_app_browser_sdk.py: the family is staged and explicit-only; only known verbs are declared; an install holds no verb until the owner approves one; an update that addsactholdsactback and keepsviewandread; preview off means noctx.browserand a kept SDK handle holds no verb; a preview turned on after the context was built givesctx.browserwith no restart; an app that is turned off holds no verb, and turning it on again restores the approved ones; an app without the field gets noctx.browser; the install prompts name each verb. Removing"browser"from_OWNER_APPROVED_FAMILIESturns the install test red.website/src/test/AppDetailPageCoverage.test.tsx: the app page lists only the held-back verb in the approval notice, tags it in the box, says the preview is off, and approves withbrowser: ['act']; a row with no browser grant (a store row) reads the App browser access switch itself.website/src/test/TrustAppModalWorkerAutoApprove.test.tsx: the trust prompt names each known verb, drops an unknown one, and says the preview is off.website/src/test/previewSurfaces.test.tsx: the new switch is drawn and is off by default.Each new test was run three times in a row, serially, with the same result.
Manual verification
Run in a pod on this head, with a local test app
page-palthat declares"browser": ["view", "read"], then an update to 1.1.0 that adds"act". The app row'sbrowserGrantat each step:browserGrant[], stagedview, read, previewfalse[], stagedview, read, previewtrueview, read, staged[]actview, read, stagedactScreenshots / video
A narrated walk through the whole flow on the pod: install, the switch, the trust prompt, approval, and an update that adds
act.app-browser-access-demo.mp4
The app page right after install, preview off: both verbs tagged not approved, and the note that the switch is off.
The new switch in Settings > Developer > Feature previews.
The trust prompt when the owner turns the app on: the verbs are listed, and install approves none.
The app is on and both verbs still wait: the notice says what Approve new permissions does, and that it applies at once.
After the owner approves, and after an update that adds
act: onlyactwaits.Related Issues
Part of #39017
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)