Skip to content

feat(app-kit): offer the pull-request panel to apps through the sdk - #32665

Merged
bolichen97 merged 1 commit into
mainfrom
feat/app-seam-app-chat-panel
Nov 8, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
feat/app-seam-app-chat-panel

Conversation

@bolichen97

@bolichen97 bolichen97 commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

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 PullRequestPanel through 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

  • Opening a NEW chat session from an app (PORTING.md gap 1), or publishing a draft review from the page (gap 3): this PR offers the panel, not a provider-read or chat-launch seam. The public-core-apis lane in this batch owns the private-API gaps.
  • Changing Code Review Sage's manifest permissions.api, the adoption pins or the catalog. See "Needs a maintainer" below.
  • Exporting the panel's chat hand-off (onAddToChat), its tab close (onDismiss) or onReconcile to apps.
  • Moving or deleting the built-in.

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.ts row, and the coupling runs the other way, so the seam goes that way too.

  • One injected client. PullRequestPanel and its CommentThreads call the provider through components/pullRequestClient.tsx, whose members are all required. With no provider they use the dashboard's api, so every dashboard surface keeps today's behaviour.
  • The SDK export. @kirocrew/app-sdk gains PullRequestPanel (app-sdk/PullRequestPanel.tsx, exported from app-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 its permissions.api covers /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 an ErrorNotice that names the path, offers the agent hand-off and sends nothing. Its text is a new appSdk.pullRequestPanel.not_declared key in all 12 i18n/locales catalogs, with en-XA.json regenerated. A builtin page keeps the dashboard client, the same rule as its query client. With no identity, the panel fails closed. The matcher is useAppApi()'s, so this grants nothing an app's own fetch could not already reach.
  • Lazy panel. The SDK barrel is in the shell chunk every app loads, so the export loads the host panel through React.lazy. The App chunk stays within its bundle budget, and the panel ships in its own chunk.
  • Level 2. The panel is part of App Kit seam level 2, so an adopted app that needs it can pin minAppSdkLevel: 2. main already ships APP_SDK_LEVEL = 3 (level 3 is credentialMasks), 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.
  • Code Review Sage imports the panel from the SDK. It is a builtin, so it keeps the dashboard client and behaves the same. codeReviewSageBoundary.test.ts now also fails if any app file imports the host panel modules. Its shell test mounts the page under the builtin identity that BuiltinAppRoute publishes.
  • Docs. 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 seams main already 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-request until 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_LEVEL stays at the 3 main already 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. scopedPullRequestClient is 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).
  • Determinism: no timers, sleeps or clocks. Every wait is on a rendered element or a recorded call; the waits behind the lazy panel carry an explicit 5 s timeout named for that chunk load. Each external mount uses its own app id, so no query cache is shared between tests. Repeat and shuffle: the new file, 5 runs under --sequence.shuffle with seeds 1-5, 8/8 passed each run.
  • Ran locally on the rebased head: the new file, PullRequestPanel.test.tsx, CommentThreads.test.tsx, the appSdk* suites and all Code Review Sage suites (38 files, 673 tests), all green. Also tsc -p tsconfig.app.json, the i18n checks (i18n-check.mjs, check-i18n-strings.mjs, en-XA.json regenerated 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.
  • Proof: not provable -- frontend test (prove.py runs Python only)

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 a ContentSkeleton while 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 ContentSkeleton on 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

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • 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

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 7, 2026 22:42
@bolichen97
bolichen97 enabled auto-merge (squash) November 7, 2026 22:42
@bolichen97

Copy link
Copy Markdown
Contributor Author

needs-a-decision (for a maintainer): may the wheel built-in Code Review Sage declare the pull-request source paths in its manifest?

The seam in this PR grants nothing new: an external app's panel reaches only the /api/source/pull-request endpoints its own permissions.api covers, and a builtin page keeps the dashboard client.
Adoption's permission-parity check (E9, builtin_adoption_checks.permission_refusal) holds back an adopted manifest that declares more than the wheel built-in. So the external Sage copy can declare /api/source/pull-request (and use this panel) only once the built-in's app.json declares it too.
Declaring it widens what Code Review Sage's app token reaches (including the write endpoints under that prefix, since a bare path covers its children) and changes the permissions the app lists. That is outside the 2026-11-07 rulings, so this PR leaves the manifest unchanged.
Default if no ruling: the manifest stays as it is, and Sage's adoption pin keeps waiting on gaps 1-3.

Local gate notes (host reds, not this diff):

  • test_ci_pytest_progress.py::...test_worker_whose_channel_closed_records_it_at_session_end fails the same way on a pristine origin/main worktree with the borrowed venv (xdist "no active workers").
  • test_ci_file_shards.py::...test_reduced_backend_scope_populates_every_ci_shard failed only under the loaded xdist run and passes serially on this branch.
  • test_decisions_end_to_end.py errored with No module named 'h2', which the borrowed venv does not have.
  • 8 frontend files that render through @pierre/diffs (for example highlightLanguages.test.ts) fail on Vite's Denied ID .../node_modules/@pierre/diffs/dist/worker/.... That is because this worktree's node_modules is a symlink to a sibling checkout. None of them imports a module this PR changes.

The local review ran as self-review against the contracts, because this session had no model-pinned subagent facility.

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 7, 2026
@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)

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

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

  • Refusal notice (ErrorNotice with appSdk.pullRequestPanel.not_declared, which names {{path}} and offers the agent hand-off): no screenshot shows it, so nobody checked whether a first-time user understands it. To close: a still of an external app whose manifest does not declare /api/source/pull-request.
  • Loading state (<Suspense fallback={<ContentSkeleton rows={6} />}> on Sage's pull-request tab): no screenshot shows it, and no still shows the panel drawn once it has loaded. To close: a still of the skeleton and one of the loaded panel.

Notes

  • The notice puts a raw API path (/api/source/pull-request) in front of the user. Name what is missing in the user's words (e.g. "This app hasn't been given access to pull requests"), and leave the path to the developer docs.

[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 .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 7, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 0666c70214ac33e310d2f68e80b4e27cd9266da4 — 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. 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 ships

Inventory (8 items) — 8 justified

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

  1. An app can render the pull-request panel through @kirocrew/app-sdk, limited to the /api/source/pull-request paths its manifest declares — justified
  2. An external app that has not declared that path sees a refusal notice that names it (new i18n key in all 12 catalogs) — justified
  3. Code Review Sage's PR tab gets the panel from the SDK and shows a short skeleton while the panel chunk loads — justified
  4. The panel and its comment threads call the provider through one injectable client; with no client provided they use the dashboard's api as before — justified
  5. The vendor SDK stub re-exports PullRequestPanel — justified
  6. A boundary test fails if any Sage file imports the host panel modules directly — justified
  7. The PullRequestLink type is exported for the panel's sources prop — justified
  8. The App Kit spec §18g/§32, the API reference and the feature-map row describe the panel as a level-2 seam — justified

[FIRST-PRINCIPLES-REVIEWED] 0666c70

Description read

[DESCRIPTION-READ] e5d545d99cde012419a5e557251a8f59e2d51f2fdffbf2858be81948796fbf26

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 7, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

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

  • The only way to reach the panel through the SDK also unlocks mark-ready, auto-merge and thread writes. Declaring /api/source/pull-request hands an app all of the panel's write endpoints along with the read. A sanctioned panel seam makes it more likely that apps will declare this path. Once they do, adding a read-only mode later means splitting their declarations, which is hard to walk back.
  • The no-screenshot claim rests on the description's maintainer waiver. The workflow's evidence list has no images. The new refusal notice and the loading skeleton reuse existing components, so I did not treat them as a reshaped surface.

[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 .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 7, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 0666c70214ac33e310d2f68e80b4e27cd9266da4 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 0666c70

Verdict parsed from the review's SHA-scoped output markers for commit 0666c70214ac33e310d2f68e80b4e27cd9266da4.

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

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 0666c70214ac33e310d2f68e80b4e27cd9266da4 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 0666c70

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

@bolichen97
bolichen97 force-pushed the feat/app-seam-app-chat-panel branch from 5e5f742 to 1dfd3bf Compare November 7, 2026 22:55
@bolichen97

Copy link
Copy Markdown
Contributor Author

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 /api/source/pull-request, and a bare path covers its children. That is the same prefix rule the gateway's token check uses, so changing it is outside this PR. I fixed the description instead of the matcher. docs/app-kit/api-reference.md drops the "Without it" column. It now says that declaring the read declares the whole family, writes included, that there is no read-only panel, and that an app that must not hold those writes should link out to the PR. The header comment in app-sdk/PullRequestPanel.tsx, spec §18g, the feature-map row and the test names now say the same. The per-member check in scopedPullRequestClient stays because it mirrors the matcher. The spec now states that the export never builds a partial client today.

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 pull-request-checks and pull-request-statuses queries exist with fetchFailureCount 0 and dataUpdateCount 0, and that no query is in error. I removed each guard in turn: client.checks && in enabled, Boolean(client.statuses) && in enabled, and if (client.statuses) before the Refresh refetch. Each removal fails the test. §18g now names what is pinned.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 7, 2026
@bolichen97
bolichen97 force-pushed the feat/app-seam-app-chat-panel branch from 1dfd3bf to 61b9b16 Compare November 7, 2026 23:23
@bolichen97

Copy link
Copy Markdown
Contributor Author

self-added: no
mechanism: per-member optional PullRequestClient gating
resolution: removed

  • Partial-client gating that nothing can reach — zero consumers span=4b95a96718e7

fixed in 61b9b16: every PullRequestClient member is required; the eight member-level declared() checks in scopedPullRequestClient, the Boolean(client.*) terms in CommentThreads.tsx / PullRequestPanel.tsx, the Refresh if (client.statuses) guard and the read-only-client test are deleted.
No guard is lost: the scoped transport still refuses any undeclared path per request, and the read's declaration covers every child endpoint, so no manifest could reach the removed branches.
§18g, the API reference and the test header now describe one shape: the read admits the whole family, there is no read-only panel.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • Permission refusal uses the agent-unavailable exemption span=c37af6eddfc7

fixed in 61b9b16: the refusal ErrorNotice in app-sdk/PullRequestPanel.tsx drops noHandoffReason and turns on askAgent.
The notice replaces the panel and holds no draft of its own, and the agent can run (the failure is the app's manifest, not the agent's sign-in or backend), so the hand-off is the rule's required state.
Class sweep: this is the only noHandoffReason the diff adds (git diff origin/main...HEAD | grep noHandoffReason is empty).

@bolichen97

Copy link
Copy Markdown
Contributor Author

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 PullRequestPanel into App (2,316 kB against a 2,272 kB main build, 31.1 KB over budget). The export now loads the host panel through React.lazy behind a ContentSkeleton fallback. A local analyze-mode build on the rebased head gives App 2,276.63 kB and PullRequestPanel its own 43.6 kB chunk. check-bundle-size.mjs passes (1010 chunks within budget) and check-chunk-cycles.mjs finds no cycles. No budget was raised.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 7, 2026
@bolichen97
bolichen97 force-pushed the feat/app-seam-app-chat-panel branch from 61b9b16 to 1774e3d Compare November 8, 2026 01:00
@bolichen97

Copy link
Copy Markdown
Contributor Author

self-added: no

  • Surface failures from both polling queries span=a90063dba74f

Rebutted: not applicable. The diff changes only WHICH client each poll calls (api.pullRequestChecks -> client.checks, api.pullRequestStatuses -> client.statuses); on the dashboard usePullRequestClient() returns DASHBOARD_PULL_REQUEST_CLIENT, which forwards to those same api methods, so error handling is the same as origin/main.
errors-use-error-notice applies to an error SURFACE the diff adds or touches ("a diff that edits one (its message, styling, or condition) migrates it"). This diff does not add, edit or restyle any surface: the "Checks unavailable" label, the checksPollingPaused condition, the status-chip backoff and retry: false are unchanged lines.
Adding two new notices to the chat window's Changes panel is a new user-visible behaviour on a dashboard surface. The frozen goal does not cover it, and the campaign rules out changing what existing users see. The status poll is also built to back off and never stop on a transient error, so a banner on every failed chip refresh is a UX decision for its own PR.
Scope class: every call this PR moves onto the client (source, checks, statuses, markReady, enableAutoMerge, reply, comment, resolve, unresolve) keeps the same error path it had on main; the source read and the mutations already reach ErrorNotice there.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 8, 2026
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Nov 8, 2026
KiroCrewCaptain
KiroCrewCaptain previously approved these changes Nov 8, 2026

@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.

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.

@github-actions github-actions Bot added merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running and removed readiness: passed Eligible automated validation passed for the current revision labels Nov 8, 2026
@bolichen97
bolichen97 force-pushed the feat/app-seam-app-chat-panel branch from 44f16e8 to 3f59436 Compare November 8, 2026 09:25
@bolichen97

Copy link
Copy Markdown
Contributor Author

Conflict-only rebase onto main (1929944186 -> 6d07df11cf) after #32660 and #32667 merged; no other change.

Range-diff (44f16e8292 -> 3f59436287): the single commit is identical except the one conflicted paragraph, docs/app-kit/api-reference.md § App Kit seam level. Both sides are kept, main's first: level 2 now reads ctx.lifecycle, agent turns (ctx.turns), the untrusted-text controls (ctx.untrusted), the manifest's agentTools block, and then this PR's PullRequestPanel. APP_SDK_LEVEL follows main (2 on both surfaces; this PR does not change it). Every other file auto-merged with no textual change to this PR's hunks.

Gates re-run on the rebased tree: tsc -p tsconfig.app.json, eslint on the touched files, vitest (45 related files, 796 tests), check-i18n-keys, scripts/docs-lint.sh, the brand and comment-history gates, and the backend tests that read the API reference or the SDK level (272 passed). The PR body's seam-level sentence was reworded to match the merged paragraph. Auto-merge re-armed.

@github-actions github-actions Bot added 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 merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Nov 8, 2026
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
@bolichen97
bolichen97 force-pushed the feat/app-seam-app-chat-panel branch from 3f59436 to 0666c70 Compare November 8, 2026 15:32
@bolichen97

Copy link
Copy Markdown
Contributor Author

Conflict-only rebase onto main 5c0feb8 (3f594362873a -> 0666c70214ac). The PR was DIRTY after #32652 (credentialMasks, APP_SDK_LEVEL 3) and #33088/#33135 merged. No other changes.

Range-diff summary (git range-diff, 1 commit, 1: 3f59436287 ! 1: 0666c70214): one hunk differs, in docs/app-kit/api-reference.md's "App Kit seam level" paragraph. That was the only conflicted file. Both sides are kept: level 2 lists PullRequestPanel after ctx.untrusted and agentTools, and then main's sentence "level 3 adds the manifest's credentialMasks" follows unchanged. Every other file in the diff is byte-identical to the previous head. APP_SDK_LEVEL follows main (3) and the panel stays a level-2 seam.

PR body: I rewrote two lower-section lines so they say main ships APP_SDK_LEVEL = 3; before, they said 2. The frozen Goal, Why it matters and Not a goal are untouched.

Local gates on the rebased tree: docs-lint.sh 0, tsc -p tsconfig.app.json 0, vitest on the 53 test files that reference the panel, CommentThreads, the client or the SDK barrel: 819/819 pass. i18n:check 0, lint:i18n 0, check_brand_name.py 0, check_file_line_cap.py 0, diff_signals.py --check-body 0, push_guard.py --require-single-on-base 0. Auto-merge is still armed (squash).

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision 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 readiness: checking Automated validation is still running labels Nov 8, 2026

@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.

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.
  • ScopedApiError keeps .body, so the auto-merge confirmation step still works through the app transport.
  • apiPathAllowed matches the gateway's slash-boundary rule in token_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:

  1. 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.
  2. 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_status pushes 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 to recoverableQueryClients() the way invalidateChatPins does, 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-review and /status/refresh. You could say that it covers every subpath, and name submit-review.

@bolichen97
bolichen97 merged commit af9ae5f into main Nov 8, 2026
99 checks passed
@bolichen97
bolichen97 deleted the feat/app-seam-app-chat-panel branch November 8, 2026 16:59
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 8, 2026
KiroCrewCaptain added a commit to KiroCrewCaptain/kirocrew-app-code-review-sage that referenced this pull request Nov 15, 2026
…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>
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