Skip to content

feat(apps): declare design-tweak's chat path, show host paths at trust - #36342

Merged
bolichen97 merged 1 commit into
mainfrom
feat/w5-perm-parity
Nov 14, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
feat/w5-perm-parity

Conversation

@bolichen97

@bolichen97 bolichen97 commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

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/chat endpoints. 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 its permissions.api does not declare. The repository copy therefore declares /api/chat, and adoption's permission-parity check (E9) refused the move with permission_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

  • Narrowing /api/chat below a prefix: the slot routes carry the key as a path segment, so the grant needs the prefix.
  • Adding the adoption pin for Design Tweak (gaps 1 and 3 in the app repository's PORTING.md stay open).
  • Code Review Sage's and Dev Fleet's declarations, which get their own PRs.
  • Changing how any grant is approved or enforced.

What changed (motivation → approach → change)

Part Change
Wheel declaration apps/builtins/design_tweak/app.json adds =/api/chat and /api/chat/slots
Slot list an app token's GET /api/chat/slots shows only the slots its /api/ws snapshot shows it
Trust prompt a box names the host paths an app declares, in plain words first
  • Wheel declaration. A built-in approves what its wheel copy ships at every start (register_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 with permission_refusal(...) == None. =/api/chat admits that one path; the bare /api/chat/slots covers 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.ts in 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.
  • Slot list. The same prefix admits GET /api/chat/slots, which handed an app token every session's title, path and last message. chat_api/slot_detail.py:api_chat_slots now runs an app token's list through the socket's own filter (ws_event_scope.filter_slots_for_app, with the app's declared slots:* 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.
  • Trust prompt. appstore/TrustAppModal.tsx gets an api field (typed in appstore/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.ts carries 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 declared api list into its rows (_disclosed_permissions_manifest, non-empty strings only), as it does sessionApproval. Display only.
  • Catalog keys host_api_heading / host_api_chat / host_api_paths in all 12 catalogs (locales/en.manual.json and its translations) plus the regenerated pseudolocale (locales/en-XA.json); a Storybook story (stories/TrustAppModalHostApi.stories.tsx).
  • Spec: 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/slots list (fixture and PORTING.md gap 2 with it) before its adoption is no widening. Until it does, E9 keeps holding the record back with permission_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/slots no longer lists slots its /api/ws snapshot 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 only POST it); 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 declared slots:user adds 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/chat and /api/chat/slots; every host path the page calls matches; a registered built-in's approved set is the wheel's; permission_refusal is None for the repository's list and permission_widening with /api/sessions added; 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/chat grant restored (checked locally).
  • test/test_catalog_inventory.py: a declared api list reaches both catalog rows, blank and non-string entries dropped; a non-list discloses nothing.
  • website/src/test/TrustAppModalHostApi.test.tsx: hostApiPaths keeps only out-of-namespace entries, once each; callsChat reads /api/chat, a path below it and =/api/chat as chat and /api/chatx or /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; trustGrants and both Library trust-target builders carry the list.
  • Run: the new files plus 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); vitest catalogParity and TrustAppModal* (191 passed); tsc -p tsconfig.app.json, eslint on the touched files, i18n-check.mjs and check-source-strings.mjs clean.

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.py passed 20 times at -n0, 10 times at -n 4 beside test_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:

design-tweak wheel api: ['/apps/design-tweak/api', '/apps/design-tweak/api/*', '=/api/chat', '/api/chat/slots']
design-tweak same list as repo api -> permission_refusal None
design-tweak with /api/sessions added -> permission_widening

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/chat last and leaves out the two /apps/design-tweak/api entries.

Screenshots / video

Trust prompt, dark:

Trust prompt with the host endpoints box, dark

Trust prompt, light:

Trust prompt with the host endpoints box, light

Related Issues

Part of #26967

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributed under the project's Apache-2.0 license.

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 13, 2026 03:03
@bolichen97
bolichen97 enabled auto-merge (squash) November 13, 2026 03:05
KiroCrewCaptain added a commit to KiroCrewCaptain/kirocrew-app-design-tweak that referenced this pull request Nov 13, 2026
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>
@KiroCrewCaptain

KiroCrewCaptain commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: A person should decide

Why: 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 =/api/chat and /api/chat/slots. The = exact-match form already exists on main (token_auth_app_scope.py:190-213), so the grant is as narrow as the PR says, and the parity test checks it, including refusals for the rest of /api/chat/*. The app-token filter on GET /api/chat/slots reuses the WebSocket snapshot's filter_slots_for_app and load_declared_events_for_connect, with the same handling of an unreadable manifest. It skips internal-secret callers (MCP tools) and the person, and narrows the existing bare /api/chat grants of four other built-ins. No built-in backend reads the list with an app token. The handler's asyncio use resolves in the chat_handlers namespace. The trust-prompt box is display only and reaches every entry point through trustGrants; the existing toEqual assertions still pass. Tests would fail without the changes. Nothing blocks.

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 055e47294a · 644 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@github-actions github-actions Bot added the readiness: action required A blocking check or review needs attention label Nov 13, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in test/test_reply_format_once.py since this head was judged (4e4bba3 -> 510ba1b); CI re-running.

The red Backend Tests (3.12, 8) / Backend Tests (Windows) (8) / Coverage Gate on 2d901b9 was main's: test/test_reply_format_once.py::TestEveryMessageWhereTheBlockCannotBeTakenOut::test_the_table_names_every_selectable_harness broke on main with #24732 (mimocode backend) and was fixed by #36290, which landed after this head's base. It passes on the rebased head 57dc76d locally. Every other red on 2d901b9 (Design, First Principles, UX, GPT, Opus, PR Policy, Dependency License Gate, CodeQL actions, readiness) was the installation API rate limit; none produced a verdict, so there is nothing to dispose of on that head.

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 055e47294a94dac3dec373635b3a57a79733e0b0 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 055e472

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 055e47294a94dac3dec373635b3a57a79733e0b0 false-positive: <reason, 20 to 500 characters>

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 13, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased onto 6c8b798906f (carries the mypy fix #36457) to clear the conflict; both sides kept in AppDetailPage.tsx, useAppActions.ts, TrustAppModal.tsx and types.ts (main's desktop request and this PR's api field sit side by side). Range-diff against the previous head shows context-only changes.

Expected red on this head, not this PR's: scripts/check_file_line_cap.py in Backend Ratchets / Frontend Ratchets will fail website/src/pages/AppDetailPage.tsx at 2,005 lines. Main already has it at 2,003 (over the 2,000 cap since #36338), tracked by the ratchet-audit issue #36565, which is claimed for a split. This PR adds two lines there and does not split the file in parallel with that fix; it rebases onto the split once it lands.

@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 13, 2026
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 055e47294a94dac3dec373635b3a57a79733e0b0 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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

  • When an app's manifest can't be read, the code falls back to enabled=True with no declared scopes. A disabled app with a corrupt manifest would still list its own slots. That fails toward letting the call through, which is easy to reverse, so it isn't a blocker, but it is worth matching to whatever the socket does when the manifest can't be read.
  • Until the app repository switches from /api/chat to the =/api/chat + /api/chat/slots list, E9 keeps holding adoption back. The fix depends on that repository change, which is outside this PR.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 055e47294a94dac3dec373635b3a57a79733e0b0 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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 /api/chat prefix opens. The slot filter reuses ws_event_scope.filter_slots_for_app, and it also covers the four built-ins that already declare bare /api/chat.

What this change ships

Inventory (6 items) — 6 justified

Intent: 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.

  1. The Design Tweak wheel manifest now declares =/api/chat and /api/chat/slots, so adopting the repository copy is no longer a widening — justified
  2. An app token's GET /api/chat/slots now lists only the slots its socket snapshot shows; this also narrows the existing bare-/api/chat grants in design_critique, ops_mission_control, auto_improvement and spec_builder — justified
  3. The trust prompt has a new box listing the host paths an app declares outside its own namespace — justified
  4. That box adds a plain-words line when one of the paths is a chat path — justified
  5. Official catalog rows now include the declared api list, so every place that opens the prompt can show it — justified
  6. New catalog strings in 12 locales plus the pseudolocale, and a Storybook story — justified

[FIRST-PRINCIPLES-REVIEWED] 055e472

Description read

[DESCRIPTION-READ] 15b93209f2ad7bc419f7c0f863415369577c331d8af409065d86cf64c60ac15c

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of 055e47294a94dac3dec373635b3a57a79733e0b0 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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

  • The blind reader had "no idea what 'paths' means" for the "Paths it calls" list. Render it as <details> with the summary "Technical details", so the paths stay available without sitting in the cold read.
  • The screenshots show the story's /api/chat, but the shipped Design Tweak manifest declares =/api/chat and /api/chat/slots. Users would see the raw = matcher prefix. Strip it in hostApiPaths before display, or show it as "exactly /api/chat".
  • host_api_heading "It can also use parts of {{productName}} outside the app" sits under "Trusting the app grants all three". The reader asked "three or four?" and couldn't tell which "app" was meant. Use "Design Tweak can also use other parts of {{productName}}", with the app's own name in place of "the app".

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 055e47294a94dac3dec373635b3a57a79733e0b0 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 055e472

Verdict parsed from the review's SHA-scoped output markers for commit 055e47294a94dac3dec373635b3a57a79733e0b0.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 055e47294a94dac3dec373635b3a57a79733e0b0 false-positive: <reason, 20 to 500 characters>

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • Host-endpoints box reads as developer text span=f33a7019b73a

Rebutted: the box shows what the frozen goal promises, the Kiro Crew endpoints the app calls, listed exactly as the manifest declares them (hostApiPaths in TrustAppModal.tsx).
Naming each path by an outcome needs a core table describing host routes; an app may declare any path, so the table is new scope this PR does not need and would be wrong for every path it lacks.
The verdict is PASS; this is a wording preference on a display-only box, not a defect.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • Sibling boxes describe outcomes, this one lists paths span=8cd53edeb2b4

Rebutted: the sibling boxes describe fixed grants the gateway defines (run code, session reach), so their outcome text is known in advance.
permissions.api is an open list an app author writes; the only exact statement the dialog can make about an arbitrary entry is the entry itself, which is what it shows.
Per-path outcome wording is a new mechanism outside the frozen goal; display only, no consent step reads it.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • Blind reader cannot say what the box means span=ea671ae8abe3

Rebutted: the heading says in plain words that the app can call these {{productName}} endpoints, beside the provenance line; the path is the fact an operator or a reviewer checks against the app's repository.
Telling an operator whether a path is good or bad needs a per-path judgement table, which is new scope beyond the frozen goal ("sees which Kiro Crew endpoints it calls").

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • Box shows the path but not what it lets the app do span=76420eff0813

Rebutted: the frozen goal is that the operator sees which Kiro Crew endpoints an app calls, and the box lists exactly those (entries outside /apps/<name> and /api/apps/<name>).
Explaining what each path does is a separate feature (a maintained route-description table for open-ended manifest entries) that this PR does not need to meet its goal.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • Severity: disclosure fails its purpose on every trust span=ba3c543692fa

Rebutted: the disclosure's purpose in this PR is to name the declared host endpoints, and it names every one on every trust of a host-path app, pinned by website/src/test/TrustAppModalHostApi.test.tsx.
The lane's own verdict is PASS; the requested outcome wording is new scope, not a failure of this box.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • Chat prefix exposes unrelated session previews span=8b0a737c6c0f

fixed in 1055d81: api_chat_slots (chat_api/slot_detail.py) runs an app token's list through the socket's own filter, ws_event_scope.filter_slots_for_app, with the app's declared slots:* scopes, so it lists only what its /api/ws snapshot shows; a disabled app lists nothing.
Class swept: the only collection route under the /api/chat prefix that returned other slots to an app token; every per-slot route already goes through slot_ownership. The fix is in the handler, so it holds for every app granting the prefix, not only Design Tweak.
The person and internal-secret callers (dashboard MCP tools, which narrow by app in mcp_dashboard_caller_scope) keep the full list. Pinned by test/test_chat_slots_app_token_view.py (4 of 6 red with the filter reverted).

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • The host-endpoint disclosure is unreadable to the person it is meant to inform span=39c8e68063ec

fixed in 1055d81: 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 under a muted "Paths it calls"; the permissions.api note is gone. New screenshots are in the description.
The suggested "It cannot read your other chats" is left out on purpose: an app that declares slots:all events can still see other chats, and the prompt cannot tell, so that sentence would be false for some apps.

@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased onto main at a558571065 and pushed 1055d814aa. The base now carries #37063, which fixed the shard-6 red (Backend Tests 3.12 / Windows shard 6 and the Coverage Gate that waits on them) that main had. The same head fixes the GPT finding (the app-token slot list) and the UX blocker (the box's wording); one disposition each is posted above.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 14, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased onto main @ 66dc266 (was DIRTY): new head 4164d56.

  • Conflicts were only adjacency with feat(app-kit): let desktop windows use declared shell capabilities #36349 (desktopCapabilities): official_catalog._disclosed_permissions_manifest, trustGrants.ts, types.ts, TrustAppModal.tsx (the desktop-capabilities box and the host-API box now both render, desktop first) and the 13 locale files. Both sides kept; no behaviour of this PR changed.
  • The shard-2 / Windows shard-2 / Coverage Gate reds on the old head are the otlp wire-test break fixed on main by test: expect the kirocrew.step span in the otlp wire tests #37171, which this base carries. Analyze (python) failed on an installation API rate limit at SARIF upload (infra).
  • Writer sweep for the Breaking: line re-run on the new base and all 18 KiroCrewCaptain app repositories: still no app-token reader of GET /api/chat/slots (every app call is a POST or a per-key GET).
  • Round retrospective (due by round count): the four mechanisms (wheel /api/chat declaration, app-token slot-list filter, trust-prompt host-API box, catalog api projection) each trace to the goal or to the slot-list exposure the prefix grant opens; verdict keep, nothing removed. Self-run: no model-pinned subagent facility in this driver.

Gates on the rebased tree: black/isort/flake8/mypy on the touched Python, line cap, comment-history, brand; 334 related backend tests; tsc -p tsconfig.app.json, eslint on the touched files, vitest TrustAppModal* + AppDetailPage (106 passed).

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 14, 2026
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.
@bolichen97

Copy link
Copy Markdown
Contributor Author

self-added: no

  • Bare /api/chat grant reaches every /api/chat/* route span=034f72b8cd1b

fixed in 055e472: design-tweak's wheel copy declares =/api/chat (exact) and /api/chat/slots instead of the bare prefix, so the token no longer reaches folders, channel-targets, headroom or mode.
Every PAGE_CALLS path still matches; the parity test now asserts refusal at /api/chat/folders, /folders/reorder, /channel-targets, /headroom, /mode, /slotsx, and fails 4/6 with the bare grant restored.
Class sweep: this PR adds no other wheel-copy host entry; the other four built-ins' /api/chat grants predate it on main.
Spec paragraph, test HOST and the body updated; the app repository's list must follow before adoption is no widening (held back until then, the pre-PR state).

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 14, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

Green on 055e472 (readiness passed). green_age.py reports main +20 commits (8298ea2 -> 30f3498); the only same-file overlap is the spec app-kit-platform.md (separate sections), the rest is same-dir/import. Closure proved instead of a re-sync: this commit cherry-picks cleanly onto 30f3498, and the overlapping tests there (test_design_tweak_permission_parity, test_chat_slots_app_token_view, test_catalog_inventory, test_official_catalog, test_chat_slots_crew_view, test_core_design_tweak_decoupling, test_design_tweak_relay_paths, test_app_backend_composition_contract, test_builtin_adoption*) pass: 1198 passed, 1 skipped.

Follow-up outside this repository: KiroCrewCaptain/kirocrew-app-design-tweak still declares the bare /api/chat; it needs the same =/api/chat + /api/chat/slots list for its adoption to be no widening.

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  • callsChat skips 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 a Reader: 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/slots list. hostApiPaths also shows the raw = prefix.

@bolichen97
bolichen97 merged commit 0efa908 into main Nov 14, 2026
99 checks passed
@bolichen97
bolichen97 deleted the feat/w5-perm-parity branch November 14, 2026 21:00
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 14, 2026
KiroCrewCaptain added a commit to KiroCrewCaptain/kirocrew-app-design-tweak that referenced this pull request Nov 15, 2026
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.
KiroCrewCaptain added a commit to KiroCrewCaptain/kirocrew-app-design-tweak that referenced this pull request Nov 15, 2026
…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>
KiroCrewCaptain added a commit to KiroCrewCaptain/kirocrew-app-design-tweak that referenced this pull request Nov 15, 2026
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>
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.

2 participants