Repository navigation
feat(app-kit): offer the pull-request panel to apps through the sdk - #32665
Conversation
|
needs-a-decision (for a maintainer): may the wheel built-in Code Review Sage declare the pull-request source paths in its manifest?
Local gate notes (host reds, not this diff):
The local review ran as self-review against the contracts, because this session had no model-pinned subagent facility. |
UX Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)UX-level review of UX-Verdict: PASS cannot evaluate: missing screenshots of the new refusal notice and of the Code Review Sage pull-request tab while it loads. The PR supplies no image, so the blind read was not performed. The maintainer's waiver is a human override of this check, not evidence for it. Evidence gaps
Notes
[UX-REVIEWED] 0666c70 Description read[DESCRIPTION-READ] c514846539c65307d9de8ceee0e82a2b3f9d63f214d3ffc5c2af02a1c770d701 That sha256 names everything this verdict read: the PR description, plus the 3 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. The change adds one SDK export beside the existing panel, and every dashboard surface keeps the dashboard client by default. Code Review Sage is an in-repo consumer, and the export unblocks its move out of core (#26967). What this change shipsInventory (8 items) — 8 justifiedIntent: an app outside this repo can show a pull request using the dashboard's own panel, so Code Review Sage can leave core without losing its PR tab. This is an ADDITION.
[FIRST-PRINCIPLES-REVIEWED] 0666c70 Description read[DESCRIPTION-READ] e5d545d99cde012419a5e557251a8f59e2d51f2fdffbf2858be81948796fbf26 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS No design-level concerns. The new client context is injected, so every dashboard surface still uses its current client. External apps go through the existing scoped matcher and fail closed when they haven't declared the path. Notes
[DESIGN-REVIEWED] 0666c70 Description read[DESCRIPTION-READ] c9999fea7ba627b819969548fb3f1b44cce532672077e0520660b7f81484545a 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: |
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: |
5e5f742 to
1dfd3bf
Compare
|
Addressed in 1dfd3bf (amended). 1. Per-member write gating can't be reached by an external app. Agreed. Every member's endpoint is a child of 2. Three missing-member guards were not pinned. The read-only-client test now uses a draft with a pending check, so the checks poll would otherwise be enabled. After Refresh it waits until the refreshed source settles and every query is idle. It then asserts that the |
1dfd3bf to
61b9b16
Compare
|
self-added: no
|
|
|
Bundle Size Gate (red on 1dfd3bf): fixed in 61b9b16. The SDK barrel is part of the shell chunk every app loads, so exporting the panel pulled the host |
61b9b16 to
1774e3d
Compare
|
self-added: no
|
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved at the author's request: PR Readiness passed on 44f16e8, all five review lanes report no blocking finding on this head, no deep review of this head found a code defect, and no one else has an open change request.
44f16e8 to
3f59436
Compare
|
Conflict-only rebase onto Range-diff ( Gates re-run on the rebased tree: |
Code Review Sage's pull-request tab renders the chat window's own PullRequestPanel through a direct import of the host module, which no app outside this repository can make, so its external copy lost the tab (PORTING.md gap 2). The panel and its CommentThreads now call the provider through one injected client. @kirocrew/app-sdk exports PullRequestPanel: an external app gets a client over its scoped transport. The read /api/source/pull-request is required and its absence is a refusal, with the agent hand-off, and no request; since a bare path covers its children, declaring it declares every pull-request endpoint, writes included, and the docs say there is no read-only panel. A builtin page keeps the dashboard client, and no app identity fails closed. The export loads the host panel lazily, so the shell chunk every app loads does not carry it. The seam is App Kit level 2. Code Review Sage imports the panel from the SDK, with identical behaviour, and a boundary test pins that it no longer imports the host module. Part of #26967
3f59436 to
0666c70
Compare
|
Conflict-only rebase onto Range-diff summary ( PR body: I rewrote two lower-section lines so they say Local gates on the rebased tree: |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved. The review of 0666c70 found no code defect. Checks on this head:
- Each scoped client call posts the same path and body as
api/client/sourceControl.ts. ScopedApiErrorkeeps.body, so the auto-merge confirmation step still works through the app transport.apiPathAllowedmatches the gateway's slash-boundary rule intoken_auth_app_scope.py.- A nested provider cannot forge the builtin identity, and a surface with no provider shows the refusal and sends nothing.
- Dashboard surfaces keep the dashboard client.
Done well: every client member is required, and the dashboard api is the default. That keeps the dashboard's behaviour unchanged by construction.
Security: the new client choice is a frontend guardrail only. Every pull-request handler on the gateway already refuses app tokens, and the scoped transport sends the user's own session. So this PR adds no new server-side authority.
Earlier change request:
- Screenshots of the refusal notice and of Sage's loading tab: still missing on this head. The maintainer waives this evidence item on their own PRs, so it does not block.
- The no-visual-delta wording: partly fixed. The body now says Sage's tab gains a loading state, but the
<!-- no-visual-delta -->marker is still there.
Optional:
- An external app's panel runs on its own query client, so
source_statuspushes and turn-boundary refreshes never reach it. The open panel can keep offering "Ready for review" on a PR that has already moved. You could fan out those invalidations torecoverableQueryClients()the wayinvalidateChatPinsdoes, or state the gap in the docs. - Six of the nine rewired calls (reply, comment, resolve, unresolve, enableAutoMerge, the checks poll) can go back to
api.*without any test failing. You could click them in the external-app test, with a non-draft fixture that has a pending check. - The api-reference table lists nine endpoints, but the declaration also admits
/api/source/pull-request/submit-review,/pending-reviewand/status/refresh. You could say that it covers every subpath, and name submit-review.
…9.4 (#4) * feat: bring back the pull-request tab and the publish bar The built-in's detail pane has a "Pull request" tab (the dashboard's PullRequestPanel: description, checks, review threads, the file diff, commits), header chips drawn from the same payload, and a publish bar that releases the draft review as Submit as comment, Request changes or Approve. This copy had dropped all three because the endpoints were outside its grant. kirodotdev/KiroCrew#36343 declares /api/source/pull-request in the built-in's own manifest under the owner ruling on kirodotdev/KiroCrew#26967, and this app.json declares the same list, so they come back unchanged: - the tab renders the App SDK's PullRequestPanel (kirodotdev/KiroCrew#32665, seam level 2), feature-detected in hostSdk.ts; on a host without it the pane shows the review alone, as before; - the payload, the pending review and the submit go through the host's scoped client (sourceApi in api.ts) with the dashboard client's bodies; every path is the declared entry or a child of it; - the publish bar is the built-in's, with every guard it had (delivery evidence, superseded draft, redacted content, stale head, Approve withheld under auto-merge or kept stale approvals) and the two-click confirm bound to the content digest. The built-in's tests for the bar, the payload and the tab are ported over sourceApi; a stand-in for the SDK panel pins that it gets the one pull request and shares the payload's query entry. PORTING.md marks gaps 2 and 3 closed; gap 1 (opening a new follow-up chat) remains. Part of kirodotdev/KiroCrew#26967. * chore: release 0.9.4 Bump the version once for the release that carries the wheel fixes (#3) and the pull-request tab and publish bar, so Kiro Crew can pin this commit: a first-adoption pin's version equals the wheel built-in's, which the pin release moves to 0.9.4. The built-in manifest fixture is the current wheel manifest at that version. The README shows the new Pull request tab, captured with capture.py on an isolated Kiro Crew main gateway running this repository's copy. The capture's gh stand-in now answers the dashboard's own pull-request read (the pr view fields and the two GraphQL reads), and KIROCREW_GH_BIN points that read at it. Part of kirodotdev/KiroCrew#26967. * fix: ship .kiro so adoption can replace a reviewed install's folder A built-in Code Review Sage that ran a review has .kiro/settings/cli.json in its record's folder: the review worker's Kiro CLI workspace settings, which the review pool writes into the worker's working directory, the app's folder. Kiro Crew's adoption refuses to swap a record whose folder holds an entry beside app.json that nothing rebuilds and the pinned tree does not ship, so every user who had ever run a review would have stayed on the built-in ("Adoption of code-review-sage skipped: the swap would delete .kiro beside app.json"), as the adoption smoke showed. The tree now ships .kiro/ (a README saying what is written there), so the swap replaces the folder as an update does, and the next review writes the settings again. .kiro/settings/ is ignored so a dev clone never commits them. tests/test_adoptable_root.py runs Kiro Crew's own check against a record a review left behind: it passes with this tree and fails without the folder. Part of kirodotdev/KiroCrew#26967. --------- Co-authored-by: Bolin Chen <bolichen@amazon.com>
Problem / Motivation
Goal: An app outside this repository can show a pull request with the same panel the chat window's Changes side panel draws, reaching only the source endpoints its manifest declares.
Code Review Sage's pull-request tab renders the dashboard's
PullRequestPanelthrough a direct import of the host module (components/PrReviewDetail.tsx). No app outside this repository can make that import, so the app's external copy lost the tab and its status chips (PORTING.md gap 2), and its adoption pin waits on a seam for it.Why it matters
Code Review Sage cannot leave core (#26967) without a user-visible regression until an app can reach this panel through App Kit. Any other app that shows pull requests would otherwise restate the panel (diff, checks, threads, commits) or go without it.
Not a goal
public-core-apislane in this batch owns the private-API gaps.permissions.api, the adoption pins or the catalog. See "Needs a maintainer" below.onAddToChat), its tab close (onDismiss) oronReconcileto apps.What changed (motivation → approach → change)
The owner rulings of 2026-11-07 (#26967 (comment)) cover the security-boundary seams. This one grants no new reach, so it stays inside them. The task named a slot an app registers into core's chat UI. No such import exists: core reaches the Sage UI only through its
builtinRegistry.tsrow, and the coupling runs the other way, so the seam goes that way too.PullRequestPaneland itsCommentThreadscall the provider throughcomponents/pullRequestClient.tsx, whose members are all required. With no provider they use the dashboard'sapi, so every dashboard surface keeps today's behaviour.@kirocrew/app-sdkgainsPullRequestPanel(app-sdk/PullRequestPanel.tsx, exported fromapp-sdk/index.ts, with its vendor stub row). The client comes from the identity the host published. An external app gets a client over its scoped transport once itspermissions.apicovers/api/source/pull-request. Every other panel endpoint is a child of that path, and a bare path covers its children, so the read brings the writes with it: there is no read-only panel. Without the read, the panel shows anErrorNoticethat names the path, offers the agent hand-off and sends nothing. Its text is a newappSdk.pullRequestPanel.not_declaredkey in all 12i18n/localescatalogs, withen-XA.jsonregenerated. A builtin page keeps the dashboard client, the same rule as its query client. With no identity, the panel fails closed. The matcher isuseAppApi()'s, so this grants nothing an app's own fetch could not already reach.React.lazy. TheAppchunk stays within its bundle budget, and the panel ships in its own chunk.minAppSdkLevel: 2.mainalready shipsAPP_SDK_LEVEL = 3(level 3 iscredentialMasks), and every level includes the ones below it, so the diff changes no level constant; the docs list the panel among the level-2 seams.codeReviewSageBoundary.test.tsnow also fails if any app file imports the host panel modules. Its shell test mounts the page under the builtin identity thatBuiltinAppRoutepublishes.app-kit-platform.md§18g (new) and §32, the API reference's "Pull Request Panel" and seam-level entry (level 2 lists the panel after the seamsmainalready names there), and the feature-map row.Needs a maintainer: adoption's permission-parity check (E9) holds back a manifest that declares more than the built-in. So the external Sage copy cannot declare
/api/source/pull-requestuntil the wheel built-in's manifest declares it too. That would widen what Code Review Sage's app token can reach and change the permissions it lists, so this PR leaves the manifest alone.Backwards compatibility
Compatible: the panel's props and behaviour on every dashboard surface are unchanged (no provider means the dashboard client), and the SDK only gains an export.
APP_SDK_LEVELstays at the 3mainalready ships.Removes nothing: no path, row, key or export is removed or narrowed.
Tests
website/src/test/AppSdkPullRequestPanel.test.tsx(new). The negative cases: an external app that declares no source read (only a write, a sibling read and its own path) gets the refusal and sends no request through either transport, and a surface with no identity fails the same way. An external app declaring the read draws every write and posts through its own transport, never the dashboard's. A builtin page uses the dashboard client.scopedPullRequestClientis a client under each declaration that covers the read, the read's declaration alone covers every endpoint the panel calls, and the client posts the dashboard's exact request bodies.codeReviewSageBoundary.test.ts: the new pin, mutation-checked (restoring the direct import fails it).--sequence.shufflewith seeds 1-5, 8/8 passed each run.PullRequestPanel.test.tsx,CommentThreads.test.tsx, theappSdk*suites and all Code Review Sage suites (38 files, 673 tests), all green. Alsotsc -p tsconfig.app.json, the i18n checks (i18n-check.mjs,check-i18n-strings.mjs,en-XA.jsonregenerated with no change),docs-lint.sh, and the comment-history, brand-name and file-line-cap gates. Semgrep is not installed on this host, so the SAST lane is CI's.Manual verification
N/A — unit coverage sufficient: the change is the panel's client, which the tests drive through the real panel, the real scoped transport and a stubbed
fetch. One shipped surface gains a loading state: Code Review Sage's pull-request tab shows aContentSkeletonwhile the lazily loaded panel chunk arrives, then draws the same panel as before.Screenshots / video
Why no screenshot: the maintainer waived the screenshot evidence item on this PR (KiroCrewCaptain's approval of 1774e3d). The visible changes are the brief
ContentSkeletonon Sage's pull-request tab while the panel chunk loads, and the new refusal notice, which renders only for an external app that has not declared the path, which no shipped app is.Related Issues
Part of #26967
Ruling: #26967 (comment)
Batch siblings (separate lanes, no shared files): app-mcp-tools, app-auto-approve, app-credential-masks, app-data-root, app-stdio-mcp, app-agent-turns, public-core-apis, desktop-window-host.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)