Repository navigation
fix(apps): audit a denied browser media action; explain held slots - #38866
Conversation
Sensitive change review
|
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Both fixes sit at the mechanism: the media route makes its own audit choice per method, and the held-slot text is defined once. Nothing is duplicated and no default changes. Notes
What this change shipsInventory (7 items) — 6 justifiedIntent: when browsing is refused or an app's sites are withdrawn, the user gets an audit record and an error they can act on. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] f21d1fa Description read[DESCRIPTION-READ] 77d2db63e620b87c9f6e25eaa7e22e6af8afbf051ff0054f9196e8f98af00922 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Small, proportionate fix: one audit flag and one shared refusal string. It removes nothing and adds no new surface. [DESIGN-REVIEWED] f21d1fa Description read[DESCRIPTION-READ] 70c438123a2d6bfb7a707f6d8033c18330d18be64ae9382ffb337e41b3ce890c 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 |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
UX Review (Opus 5.5) — ⏭️ skippedRevision |
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: |
Follow-up to #38333 from the review on it (5947126093). A media POST refused by capabilities.browse now writes its audit row, like the sibling routes; the state poll (GET) still does not. A slot held to NO_PAGES after its app's sites were withdrawn now says so in its refusal, and how the hold ends: enable the app and approve its sites again. Behaviour is unchanged. The spec now says the media route cannot tell one app's page from another's: a page module runs with the owner's cookie, so that needs an app-scoped credential, which is out of scope here.
fa8e373 to
f21d1fa
Compare
Sensitive change review
|
|
Re First Principles on fa8e373: agreed. |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
This review checked head f21d1fa and found nothing blocking. Every allow and refuse decision is the same as on main, and so is every refusal code. A refused media POST now writes an audit row, the same way the sibling browse routes do, and a GET poll still writes none. The suite test/test_app_browser_sites.py passes at this head (92 passed), and reverting each of the five production hunks, one at a time, turns its own test red. One thing done well: the held-slot explanation is a single constant, SITES_REVOKED_TEXT, used at all three places a held slot is refused, so the three messages cannot drift apart.
Security: this adds no gate, sandbox or access change. The only security-relevant change is one more audit row on an existing capabilities.browse decision.
The design is signed off under the standing maintainer sign-off for changes by team members.
Optional:
- browser_ops.py:406: the held-slot text leaves out one cause: an app update or a manifest edit can remove
browserSitesor make it invalid. In that case, and for an uninstalled app, "approve its sites again on the app's page" cannot work. Wording that covers every cause would fix it. - browser_media.py:116:
useBrowserMediakeeps only the refusalcode, which is stillnot_app_browser, so an app page never shows the new text. A separate code would let it, in a follow-up. - app-kit-platform.md: with audit=True, every POST decision is audited, allowed ones too, as on the sibling routes. The parenthetical "an action's refusal is audited" says less than that.
Problem / Motivation
Goal: A browse-denied media action is audited, and a chat held after its app's sites are withdrawn says why and how to recover.
These come from bolichen97's review of #38333 (review 5947126093), raised there as non-blocking notes:
POSTrefused bycapabilities.browsewrote no audit row, unlike the sibling/api/browser/*routes.NO_PAGES(its app's sites were withdrawn after the gate approved a call) was refused with a message that did not say why, or how the hold ends.Why it matters
The first leaves a gap in the audit trail for an action the policy refused. The second leaves a user or agent with a refusal they cannot act on.
Not a goal
/api/browser/media. A page module runs in the dashboard document with the owner's cookie, the same authority as the dashboard itself, so the route cannot verify which app's page is calling. Doing that needs an app-scoped credential; it is out of scope here and recorded separately.app-browser-sitesgrant..localand internal host names inbrowserSitesentries): left as is.browserSiteswith RFC docs(rfc): app SDK browser, a permission-gated view, read and annotate surface #38322 (permissions.browser): the maintainers' call.What changed (motivation → approach → change)
browse_refusal(audit=request.method != "GET")inapi_browser_media: a refusedPOSTwrites its row as the sibling routes do; the state poll (GET) still writes none, so a player's poll does not fill the log.browser_ops.SITES_REVOKED_TEXT: the sites were withdrawn (app disabled or uninstalled, trust removed, or approval dropped), and enabling the app and approving its sites again ends the hold. It is theerrorof the op route'ssite_not_allowed, of a held slot's blanked page (redirect_refused), and of the media route'snot_app_browser. Codes are unchanged.Backwards compatibility
Compatible: no request is refused that was accepted before; only an audit row and refusal text are added.
Removes nothing: no route, key, row or behaviour is hidden, deleted or tightened.
Tests
test_a_browse_denied_media_action_is_audited_and_a_poll_is_not: a denied POST asks withaudit=True, a denied GET withaudit=False.test_a_held_slot_says_its_sites_were_withdrawn_and_how_to_recoverandtest_a_held_slots_blanked_page_names_the_withdrawal: the op route and the media route answer with the withdrawal text.Proof: PROVEN test/test_app_browser_sites.py::test_a_browse_denied_media_action_is_audited_and_a_poll_is_not (head f21d1fa)
Manual verification
N/A — unit coverage sufficient: the change is an audit flag and a refusal string, both exercised through the real route slice.
Related Issues
Follow-up to #38333 (review 5947126093). Part of #38306.
Sibling sweep
Swept: git grep -n "browse_refusal(audit=" -- src/kiro_crew/dashboard/handlers/
Sibling: src/kiro_crew/dashboard/handlers/browser_live.py -- not affected -- audits by route class (AUDITED, QUIET, UNGATED) already
Sibling: src/kiro_crew/dashboard/handlers/browser_recordings.py -- not affected -- passes its own audit flag per route already
Pattern harvest
Not generalizable: the missing audit flag was one route's own call; every sibling route already chose its flag.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license.