Repository navigation
feat(app-kit): let an app's manifest declare its webhook source - #36359
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the source id is fixed to the app's install name, policies that name Notes
[DESIGN-REVIEWED] 2824f07 Description read[DESCRIPTION-READ] 0562e495dd63d27aab39ae4b17ec26a48f9f4ce0adef5b2a9e3fa7409009a78b 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: deleting Not checked: owner ruling #26967 comment 6841699202 (not readable from the repository) Notes
What this change shipsInventory (8 items) — 7 justifiedIntent: let an app declare that it takes inbound webhooks and be governed under its own name, so Ops Mission Control can leave core. This is an ADDITION.
[FIRST-PRINCIPLES-REVIEWED] 2824f07 Description read[DESCRIPTION-READ] 4a6e8abfc1ee0746f36c99e31e232433b32bbb99224d51c066fd8b4adb00e555 That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks: the new disclosure boxes appear in all four screenshots, in both themes, and the new wording drops the terms the blind reader stumbled on ("webhook", "route", "delivery"). Notes
[UX-REVIEWED] 2824f07 Description read[DESCRIPTION-READ] ee360a2a5ef8a02bfa61217966b64d81c210f509da004ced24cda6097a2af508 That sha256 names everything this verdict read: the PR description, plus the 7 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: |
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 729 lines, more than the 400 it may approve on its own. No blocking findings. The PR adds a 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 |
1cc0592 to
f1b3bac
Compare
|
Rebased: main moved in src/kiro_crew/cli_server.py, src/kiro_crew/cli_server_restart.py, src/kiro_crew/cli_server_stop.py since this head went green (27e9359 -> 510ba1b); CI re-running. The old head 1cc0592 also had two CodeQL Analyze jobs red on an installation API rate limit during SARIF upload (not a finding) and two Windows jobs starved in the queue for over an hour; the new head re-runs both. |
f1b3bac to
1bdec3f
Compare
|
Rebased onto main after #36338 to clear the merge conflict (head |
|
Head |
1bdec3f to
47f6921
Compare
|
Rebased onto main 6d61070 for the red Coverage Gate on 1bdec3fb: it flagged |
6f70c0e to
42e70b5
Compare
|
Conflict rebase onto main |
42e70b5 to
ea57108
Compare
|
self-added: no
|
ea57108 to
cc4b339
Compare
|
self-added: no
|
cc4b339 to
fdcafe1
Compare
|
Conflict rebase onto main |
An app that takes inbound deliveries on its own routes declares permissions.webhookSource in app.json. Core then answers the webhooks governance scope for it under the app's own name (webhook_sources.app_source_refusal) and hands its hook context ctx.webhook_source, a level-7 App Kit seam shared with the rest of the open seam batch (driver decision of 2026-11-13 on #26967), so an app feature-detects it. The trust prompt, the app detail page and the CLI install summary show the declaration with the source id. Ops Mission Control's wheel copy declares the key and asks the seam under ops-mission-control, the id every existing policy names, so its behaviour is unchanged. The hard-coded SOURCE_OPS_MISSION_CONTROL constant is deleted, so adoption's E10 check no longer refuses the app. The trust prompt's grants are read from a manifest by one helper (trustGrantsOf), so the detail page stays under the file line cap. Part of #26967
fdcafe1 to
2824f07
Compare
|
Conflict rebase onto main |
|
Green at |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
The review checked head 2824f07 and found nothing that blocks. It traced enqueue in the Ops Mission Control webhook provider to app_source_refusal. That function refuses a core source id first, then refuses an app whose live manifest does not declare webhookSource, and only then asks the policy under the app's installed name. A test turns red for each step: the core-id refusal, the refusal order (the policy is never asked for an undeclared app), the live re-read, the fallback to the shipped manifest, and the built-in record keeping the key. SOURCE_OPS_MISSION_CONTROL has no reader left on this head, and its allowlist row is removed in the same commit. The extra manifest read still runs through asyncio.to_thread, and the new refusals return the same 401 as before.
Done well: the source id always comes from the installed app name, never from the app. Every existing policy that names ops-mission-control keeps working, and an app named agent cannot use the core webhook's permit.
Security: this touches manifest parsing and the webhooks governance answer, but it only adds refusals. An unreadable manifest declares nothing, so the new check fails closed. On every host Ops Mission Control declares the key, because its record is rewritten from the wheel at start and the check falls back to the shipped manifest, so OSS and LTS behave as they do today. The policy is still asked under the same id, so no gate lets through anything main refuses.
Optional:
- The trust prompt and the detail page word the webhook box differently. The PR body says they match, and the detail page's "Policy name" caption has no condition. Either share the trust prompt's sentence or correct the body.
- The screenshots were taken before the reword. Re-shooting the trust prompt and detail page in dark and light would show the strings this head ships.
- The section 42 Writers list in
app-kit-platform.mdnamesapp_sdk_level.pyandsdkLevel.ts, which this diff does not edit. Also,ctx.webhook_source.sourcehas no in-tree reader and could be dropped.
Problem / Motivation
Goal: An app declares in its manifest that it takes inbound webhooks, and Kiro Crew governs that webhook under the app's own name, so Ops Mission Control no longer needs a core constant and can be adopted from its own repository with no change for its users.
The
webhooksgovernance scope names the sources that may start work from an inbound request. Its only app source was a hard-coded constant,webhook_sources.SOURCE_OPS_MISSION_CONTROL. Adoption's E10 check (builtin_adoption_checks.core_named_apps) refuses any app that a core table names, so that constant kept Ops Mission Control from being adopted onto its own repository (#26967). The owner ruling of 2026-11-13 on #26967 (comment 6841699202, item 2) asks for a generic, app-keyed webhook source seam, declared in the manifest, with the app moved onto it.Why it matters
Ops Mission Control cannot leave core while core names it as a webhook source. Moving it carelessly would break the webhook for operators whose security policy names
ops-mission-control, or let an app pick the source id a policy governs it under.Not a goal
credentialMasks. That is fix: move ops secret store under its data dir and declare its mask #34296 (with fix(sandbox): pin a credential-masking app's folder after the masks on the namespace backend #34339), open and owned by another author; this PR does not duplicate it.adoption-pins.jsonor the catalog.What changed (motivation → approach → change)
Goal: an app-keyed source, with no app id in core and no choice of id by the app. Approach: the source id is always the name the app is installed under, so existing policies naming
ops-mission-controlkeep working, and the declaration only lets the policy answer for the app. It reaches nothing new (an app's routes could already take a request), so it is disclosed but not a staged grant.permissions.webhookSource(literaltrueonly). Validated, kept into_dict, the built-in snapshot and the signing payload only when true.webhook_sources.app_source_refusal(name)(src/kiro_crew/webhook_sources.py) refuses a name that is a core source id (CORE_SOURCES, todayagent), then an app whose live manifest does not declare the key, then asks the same policy question as the core webhook.SOURCE_OPS_MISSION_CONTROLis deleted, and thewebhooksscope comment inplatform/governance_parts/catalog.pynames app sources generically.ctx.webhook_source(apps/webhook_source_sdk.py), present only when declared, App Kit seam level 7 (apps/app_sdk_level.py,website/src/app-sdk/sdkLevel.ts, already 7 on main).scripts/adoption_pin.pyderives level 7 for the key and the seam.app_source_refusal("ops-mission-control").website/src/components/appstore/TrustAppModal.tsx,types.ts; every entry point that opens it reads the flag through the sharedcomponents/appstore/trustGrants.tshelper), the app detail page's permissions card (website/src/pages/AppDetailGrantBoxes.tsx,AppDetailPage.tsx,appDetailPageTypes.ts), the catalog's pre-install projection andkirocrew app installshow it with the source id. The wording follows the sibling grant boxes ("This app also accepts requests from outside services"), is the same on the prompt and the detail page, and states the policy name as a condition ("If you set up a security policy, it controls this app under the name ..."), because an install may have no policy; strings in every catalog underwebsite/src/i18n/locales/.app-kit-platform.mdsection 42 (after the chat-slot seam's section 41),governance.md,platform-context.md,ops-mission-control.md, App Kit manifest and API references.Seam level: per the driver decision of 2026-11-13 on #26967, every seam in the open batch shares level 7 (main is already at 7), so this adds its row to the level-7 list and an app feature-detects
ctx.webhook_source. The app repository mirror is merged: KiroCrewCaptain/kirocrew-app-ops-mission-control#2.Backwards compatibility
Compatible: the built-in asks the same policy under the same id, and its recorded
app.jsonis rewritten from the wheel (now carrying the key) at every start; before that copy exists the shipped manifest answers. No policy, setting or route changes shape.The diff removes one public constant:
Reader: src/kiro_crew/apps/builtins/ops_mission_control/backend/providers/webhook.py:enqueue -- app -- now asks app_source_refusal under its own APP_NAME (test_the_webhook_asks_its_own_source, test_the_manifest_declares_the_webhook_source_under_the_app_name)
Reader: src/kiro_crew/apps/builtin_adoption_checks.py:core_named_apps -- release -- reads SOURCE_* constants generically, now only CORE_SOURCES (test_an_app_keyed_webhook_source_names_no_app_in_core)
Reader: test/test_governance_webhooks_hook_events.py:TestWebhookSources -- release -- uses a fixture id instead of the constant (test_no_policy_refuses_only_in_lts)
Reader: KiroCrewCaptain/kirocrew-app-ops-mission-control:backend/providers/webhook.py -- app -- imported its own APP_NAME, never the constant; now asks ctx.webhook_source first and source_refusal by name on an older host (tests/test_webhook_governance.py)
Tests
test/test_app_webhook_source.py: only literaltruedeclares; an undeclared or absent app is refused before the policy is asked; a declared app is asked under its own name; LTS and OSS policy naming the app permits it; an app named like a core source is refused; the context carries the seam only when declared; the seam re-reads the live manifest; the async answer; the install summary line; the shipped-manifest fallback; the built-in record and the catalog projection keep the key.test/test_builtin_adoption_release.py: E10 still refuses aSOURCE_*constant naming an app, andcore_named_apps()is exactlyCORE_SOURCES.test/test_builtin_adoption_pins.py: the pin tool finds the key and the seam at level 7.apps/builtins/ops_mission_control/tests/test_webhook_governance.py: the wheel manifest declares the key under the app's name.website/src/test/TrustAppModalWebhookSource.test.tsx: the trust prompt box with the source id, the detail-page box, and the Library's trust target from a registry row and an installed app, literaltrueonly.website/src/test/TrustAppModalChatSlots.test.tsx: the sharedtrustGrantshelper's exact output carrieswebhookSourcebeside the other flags.Determinism: the new and changed Python tests passed 20 times at
-n0, 10 times at-n 4 --dist loadgroupbesidetest_governance_webhooks_hook_events.pyandtest_app_context.py, and in a shuffled order (seed 17604, 96 passed). Local, rebased onorigin/main(02bad16, and 92d3216 for the webhook, adoption and chat-slot suites): 3332 related backend tests (every test file naming the catalog, permissions summary, manifest sections, webhook sources, app context or pin tool) and the ops-mission-control suite green; vitest for the trust prompt, detail page and apps pages (41 files, 443 tests) andtsc -p tsconfig.app.jsongreen.Manual verification
Rendered the real built dashboard with a stubbed app that declares the key (Playwright, dark and light): the trust prompt shows the webhook box with the source id, and the detail page's permissions card shows the box. An app without the key shows neither (unit tests). The screenshots below were taken before the box's text was reworded; placement and styling are unchanged, and the heading now reads "This app also accepts requests from outside services" and the detail line "Policy name: ".
Screenshots / video
Trust prompt, dark:
Permissions card on the app detail page, dark:
Light theme
Related Issues
Part of #26967
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license.