Repository navigation
feat(apps): declare design-tweak's chat path, show host paths at trust - #36342
Conversation
The built-in's manifest declares /api/chat since kirodotdev/KiroCrew#36342, so adoption carries this copy's identical list with no widening. The fixture records the built-in's new list, the parity test asserts equal grants, and PORTING.md closes gap 2. Co-authored-by: KiroCrewCaptain <312312717+KiroCrewCaptain@users.noreply.github.com>
Code change approver recommendation: A person should decideWhy: the decider estimates a 12% chance that this change introduces a defect, within the 12% limit for approving on its own, but it changes 644 lines, more than the 400 it may approve on its own. The Design Tweak wheel manifest adds An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
2d901b9 to
57dc76d
Compare
|
Rebased: main moved in test/test_reply_format_once.py since this head was judged (4e4bba3 -> 510ba1b); CI re-running. The red |
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: |
57dc76d to
065e84c
Compare
|
Rebased onto Expected red on this head, not this PR's: |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. The wheel copy now declares exactly the chat paths the app uses, and the slot-list filter keeps the new prefix grant from becoming a way to read every session. Notes
[DESIGN-REVIEWED] 055e472 Description read[DESCRIPTION-READ] cdd2aaba52dc6b0b579b06a419e232b76ec6a3a15633c0070adff7ae0e15b1f3 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. Each item has a named cause: the owner ruling on #26967, permission-parity check E9, and the slot-list leak that a What this change shipsInventory (6 items) — 6 justifiedIntent: let Design Tweak keep sending edit batches to the agent after it moves to its own repository, and show operators which host endpoints an app calls when they trust it. This is an ADDITION.
[FIRST-PRINCIPLES-REVIEWED] 055e472 Description read[DESCRIPTION-READ] 15b93209f2ad7bc419f7c0f863415369577c331d8af409065d86cf64c60ac15c That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS No blocker: the reader understood the new box's plain-words lines ("start its own chats… send messages") correctly. The raw path list is secondary, non-interactive detail. Notes
[UX-REVIEWED] 055e472 Description read[DESCRIPTION-READ] 58d51be60350433ec8500e136fc45f2da952645d5dcc33889401b90ffae4e419 That sha256 names everything this verdict read: the PR description, plus the 5 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: |
|
|
|
|
|
|
|
|
Rebased onto main at |
1055d81 to
4164d56
Compare
|
Rebased onto
Gates on the rebased tree: black/isort/flake8/mypy on the touched Python, line cap, comment-history, brand; 334 related backend tests; |
Owner ruling on #26967 (comment 6841699202): an app gets what its built-in already uses, declared in the wheel copy first so adoption is not a widening, and shown on the trust prompt. Design Tweak's page sends its batch and creates, binds, resumes and reads its own chat slot on the host's /api/chat endpoints. The compiled built-in reaches them as dashboard code; the app repository's bundle reaches them through the scoped client, which refuses an undeclared path, so adoption held the record back with permission_widening. The wheel copy now declares =/api/chat (that path exactly) and /api/chat/slots, which a built-in approves at every start, so a repository copy with the identical list adopts with permission_refusal None. The rest of /api/chat/* (folders, channel targets, headroom) stays undeclared. The /api/chat/slots prefix also admits GET /api/chat/slots, which returned every session's title, path and last message to an app token. The list now shows an app token only the slots its /api/ws snapshot shows it (filter_slots_for_app with its declared slots:* scopes); the person and internal-secret callers keep the full list. The trust prompt lists the permissions.api entries outside the app's own namespace in a box of their own, says in plain words what a chat path lets the app do, and the official catalog projects a declared api list into its rows as it does sessionApproval.
4164d56 to
055e472
Compare
|
self-added: no
|
|
Green on 055e472 (readiness passed). Follow-up outside this repository: KiroCrewCaptain/kirocrew-app-design-tweak still declares the bare |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Review on head 055e472: the Design Tweak grant uses the narrowest entries the matcher allows. =/api/chat matches POST /api/chat exactly, and /api/chat/slots admits the slot family. Per-slot routes go through slot_ownership. The literal bulk routes (cleanup, model, import, resume-all, unrestored) scope an app caller in their handlers or are owner-only. The new trust-prompt box renders paths as React text, wraps at narrow widths, and its tests use no timers or network.
Security: the change does not widen app reach. The grant is narrower than the bare /api/chat four other built-ins already hold. The parity test refuses the neighbouring routes (/api/chat/folders, /headroom, /mode, /api/chatx, /api/chat/slotsx). The new slot-list branch narrows GET /api/chat/slots for app tokens. It reuses the WebSocket path's load_declared_events_for_connect and filter_slots_for_app, runs off the event loop, and logs each decision to the audit log. The disabled-app and internal-caller cases each have a test that fails if its guard is removed.
Done well: the REST slot list and the socket snapshot share one filter, so they cannot drift apart.
Optional:
callsChatskips the plain-words chat sentence for wildcard grants that cover chat (/api/*,/api,*), and TrustAppModalHostApi.test.tsx:70 pins that. The gateway matcher counts these as chat access.- The narrowed list also changes
list_slots()in the Python client when it runs with an app token. Consider adding it as aReader:line, and update docs/app-kit/api-reference.md, which still says "List all active sessions". - The story and screenshots show a bare
/api/chat, not the shipped=/api/chat+/api/chat/slotslist.hostApiPathsalso shows the raw=prefix.
kirodotdev/KiroCrew#36342 landed with the built-in's manifest declaring =/api/chat (that one path) and /api/chat/slots, not the bare /api/chat prefix this copy declared. Adoption's permission parity check (E9) holds back every entry the built-in did not approve, so the bare prefix would have refused the move with permission_widening and reached every other /api/chat route besides. This copy now declares the same two entries. The fixture is the built-in's manifest from Kiro Crew main, the contract tests pin every host path the page calls and the chat routes it must not reach, and the UI stub reads the exact mark as the host does. The exact entry is App Kit seam level 7, so the pin's minAppSdkLevel is 7.
…es (#2) kirodotdev/KiroCrew#36342 landed with the built-in's manifest declaring =/api/chat (that one path) and /api/chat/slots, not the bare /api/chat prefix this copy declared. Adoption's permission parity check (E9) holds back every entry the built-in did not approve, so the bare prefix would have refused the move with permission_widening and reached every other /api/chat route besides. This copy now declares the same two entries. The fixture is the built-in's manifest from Kiro Crew main, the contract tests pin every host path the page calls and the chat routes it must not reach, and the UI stub reads the exact mark as the host does. The exact entry is App Kit seam level 7, so the pin's minAppSdkLevel is 7. Co-authored-by: KiroCrewCaptain <312312717+KiroCrewCaptain@users.noreply.github.com>
The fixes carried in #3 and the exact chat entries of #2 ship as 0.10.1. A first adoption pin's version equals the wheel copy's, so the Kiro Crew change that pins this commit sets the wheel copy to 0.10.1 with it; the manifest contract test now holds the version at or above the built-in's. PORTING.md records that nothing here blocks the pin: gap 2 is closed by kirodotdev/KiroCrew#36342, gap 3 by kirodotdev/KiroCrew#33141, and gap 1 blocks deleting the wheel copy only. The pin's minAppSdkLevel is 8, the first level that always reads the exact =/api/chat entry. The README says which copy hands the agent its progress tool. Co-authored-by: KiroCrewCaptain <312312717+KiroCrewCaptain@users.noreply.github.com>
Problem / Motivation
Goal: An existing Design Tweak user keeps sending edit batches to the agent after the app moves to its own repository, and anyone trusting an app sees which Kiro Crew endpoints it calls.
Design Tweak's page sends its batch and creates, binds, resumes and reads its own chat slot on the host's
/api/chatendpoints. The compiled built-in reaches them as dashboard code, but the app repository's bundle reaches them through the scoped client, which refuses a path itspermissions.apidoes not declare. The repository copy therefore declares/api/chat, and adoption's permission-parity check (E9) refused the move withpermission_widening, because the built-in's manifest never declared it. The trust prompt also never named a declared host path, so an operator trusting an app could not see this reach.Owner ruling on #26967, comment 6841699202 (2026-11-13): decide directly, users' normal use must not be affected, grant what is needed. Its decision 1: an app gets exactly what its built-in already uses, declared in its manifest (wheel copy first, so adoption is not a widening), and shown on the install/trust prompt.
Why it matters
Without the wheel declaration no existing Design Tweak record can adopt its repository copy, and with the declaration dropped from the repository copy every adopted user would lose delivery of edit batches to the agent. Without the trust-prompt box an operator grants host reach they were never shown.
Not a goal
/api/chatbelow a prefix: the slot routes carry the key as a path segment, so the grant needs the prefix.What changed (motivation → approach → change)
apps/builtins/design_tweak/app.jsonadds=/api/chatand/api/chat/slotsGET /api/chat/slotsshows only the slots its/api/wssnapshot shows itregister_builtin_apps), so the release carrying this grants the entry to every existing record before any pin, and a repository copy with the identical list adopts withpermission_refusal(...) == None.=/api/chatadmits that one path; the bare/api/chat/slotscovers every path below it, which the slot routes need; on those routes an app caller reaches only its own slots (dashboard/slot_ownership.py). The rest of/api/chat/*(folders, channel targets, headroom, mode) stays undeclared, so the token is refused there. Measured from the bundle sources (ui/src/api.tsin the app repository):POST /api/chat?ws=1,POST /api/chat/slots,POST /api/chat/slots/{key}/project,POST /api/chat/slots/{key}/resume,GET /api/chat/slots/{key}. The backend calls no host path.GET /api/chat/slots, which handed an app token every session's title, path and last message.chat_api/slot_detail.py:api_chat_slotsnow runs an app token's list through the socket's own filter (ws_event_scope.filter_slots_for_app, with the app's declaredslots:*scopes): its own slots plus what it declared, nothing for a disabled app. The person and internal-secret callers (the dashboard MCP tools, which narrow by app themselves) keep the full list.appstore/TrustAppModal.tsxgets anapifield (typed inappstore/types.ts) and lists the entries outside the app's own/apps/<name>/and/api/apps/<name>/namespace (hostApiPaths, the namespace the gateway admits without a declaration,_app_owns_path). The box opens with "It can also use parts of Kiro Crew outside the app", adds "It can start its own chats with the agent and send messages in them." when a chat path is listed (callsChat), and shows the paths last.appstore/trustGrants.tscarries the list, so every path that opens the prompt (Library, detail page install / update / enable, the local-source switch) shows it. The official catalog projects a declaredapilist into its rows (_disclosed_permissions_manifest, non-empty strings only), as it doessessionApproval. Display only.host_api_heading/host_api_chat/host_api_pathsin all 12 catalogs (locales/en.manual.jsonand its translations) plus the regenerated pseudolocale (locales/en-XA.json); a Storybook story (stories/TrustAppModalHostApi.stories.tsx).app-kit-platform.md§ 33, "Permission parity of the wheel copies" and "The trust prompt names the host paths".App repo: KiroCrewCaptain/kirocrew-app-design-tweak@f1bdad9 declares the broader
/api/chat; it must switch to the same=/api/chat+/api/chat/slotslist (fixture and PORTING.md gap 2 with it) before its adoption is no widening. Until it does, E9 keeps holding the record back withpermission_widening, the state before this PR.Merge order: none required. #36343 and #36344 touch other sections of the same spec file. #36344 adds the exact
=entry at seam level 7; the trust prompt lists such an entry as declared.Backwards compatibility
Breaking: an app token's
GET /api/chat/slotsno longer lists slots its/api/wssnapshot does not show it. Writer sweep on origin/main @ 8298ea2 and the 18 KiroCrewCaptain app repositories (re-run 2026-11-14): no app bundle or backend reads this list with an app token (Issue Radar answers from its own/pipeline/live-slots; Design Critique, Design Tweak, Auto Improvement, Code Review Sage and Ops Mission Control onlyPOSTit); the built-in pages that read it (Mochi's panel) run as dashboard code.Reader: src/kiro_crew/dashboard/chat_api/slot_detail.py:api_chat_slots -- app -- test_an_app_token_lists_only_its_own_slots, test_a_declared_slots_scope_widens_the_list_as_on_the_socket
Reader: src/kiro_crew/mcp_dashboard_caller_scope.py:_caller_app_scope -- chat -- test_an_internal_caller_with_a_derived_app_keeps_the_full_list
Reader: website/src/apps/mochi/panel/panelBridge.ts:getMochiTrustLevel -- crew page -- runs on the dashboard cookie, test_the_person_keeps_the_full_list
Reader: website/src/apps/mochi/panel/panelBridge.ts:getSlotModel -- crew page -- runs on the dashboard cookie, test_the_person_keeps_the_full_list
Tests
test/test_chat_slots_app_token_view.py: an app token lists only its own slots; a declaredslots:useradds the person's; a disabled app lists nothing; an unreadable manifest keeps its own; the person and an internal-secret caller with a derived app keep the full list. Four of the six fail with the filter reverted (checked locally).test/test_design_tweak_permission_parity.py: the wheel copy declares exactly its own paths plus=/api/chatand/api/chat/slots; every host path the page calls matches; a registered built-in's approved set is the wheel's;permission_refusalisNonefor the repository's list andpermission_wideningwith/api/sessionsadded; the app token reaches the chat paths and is refused at/api/chatx,/api/chat/folders,/api/chat/folders/reorder,/api/chat/channel-targets,/api/chat/headroom,/api/chat/mode,/api/chat/slotsx,/api/sessions,/api/source/pull-request,/api/apps. Four of its six fail with the old bare/api/chatgrant restored (checked locally).test/test_catalog_inventory.py: a declaredapilist reaches both catalog rows, blank and non-string entries dropped; a non-list discloses nothing.website/src/test/TrustAppModalHostApi.test.tsx:hostApiPathskeeps only out-of-namespace entries, once each;callsChatreads/api/chat, a path below it and=/api/chatas chat and/api/chatxor/api/*as not; the box shows the heading, the chat sentence only for a chat path, and the paths, and is absent when nothing is outside;trustGrantsand both Library trust-target builders carry the list.test_chat_slots_crew_view,test_slot_list_rebuild,test_chat_handlers_composition_contract,test_dashboard_chat_slot,test_ws_event_scoping,test_app_slot_push_frames,test_slot_ownership_checkpoint,test_member_memory_api,test_flake_pattern_ratchet(1266 passed); vitestcatalogParityandTrustAppModal*(191 passed);tsc -p tsconfig.app.json, eslint on the touched files,i18n-check.mjsandcheck-source-strings.mjsclean.Proof: not provable -- frontend test (prove.py runs Python only); the Python half was reverted by hand above.
Determinism:
test_chat_slots_app_token_view.pypassed 20 times at-n0, 10 times at-n 4besidetest_chat_slots_crew_view.py, and in 3 shuffled orders; it reads in-memory state only, with no clock, port or ordering it does not define.The wheel list as a repository manifest, against this branch with the built-in registered in a scratch data home:
Manual verification
Rendered the Storybook story (
App Store/Trust prompt: host endpoints) in Chromium in dark and light: the box opens with the plain sentence, adds the chat sentence, lists/api/chatlast and leaves out the two/apps/design-tweak/apientries.Screenshots / video
Trust prompt, dark:
Trust prompt, light:
Related Issues
Part of #26967
Checklist
Contribution License Agreement
Contributed under the project's Apache-2.0 license.