Repository navigation
feat(relay): Remote Crews with no setting, team hosts on by default - #39394
bolichen97 wants to merge 1 commit into
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. Every Notes
[DESIGN-REVIEWED] 12ab428 Description read[DESCRIPTION-READ] 787bd3cd2bb54ac4017540f0a8216357438f5ffdbb692ddad14b2ff2b393e7cd 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) — 🔴 BLOCKPremise-level review of First-Principles-Verdict: BLOCK The PR changes two defaults: the relay viewer now lists Remote Crews with no setting, and an unset Notes
What this change shipsInventory (10 items) — 7 justifiedIntent: let a Kiro-signed-in person find and open Remote Crews, and let team Crews host by default with a readable lease refusal. ADDITION.
BlockersProduct-shape change without accepted RFC: Remote Crews viewer on by default (item 1) Product-shape change without accepted RFC: team hosts on the relay by default (item 4) [FIRST-PRINCIPLES-REVIEWED] 12ab428 Description read[DESCRIPTION-READ] 393cce63f56e2ce956b97b5fe685a49dd91c8382a4064e16596412e78d593dd5 That sha256 names the PR description this verdict read. Recompute it with |
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 "Couldn't load" state with rows kept, the read-only Remote Control card on a relayed page, and the default-hosting bell note. Shot-03 shows the signed-out notice this PR removes, so it is not this revision. Evidence gaps
Notes
[UX-REVIEWED] 12ab428 Description read[DESCRIPTION-READ] af8e41722002988a3ddccf26e8b6f2c63db33a45225ec46ce5954cebbff8c214 That sha256 names everything this verdict read: the PR description, plus the 8 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 — 🔴 changes requested (blocking)Reviewed A failed first read of the relay Crew list (a 5xx, a network failure or a throttle) now shows nothing at all, which breaks the blocking BLOCKING — website/src/hooks/useRelayViewerCrews.ts:256 BLOCKING — website/src/api/client.ts:1329 [BLOCK-MERGE] f281b4e 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 — 🔴 changes requested (blocking)GPT 6.1 found at least one blocking issue that must be resolved before merging This comment is updated in place on each push. BLOCKING -- src/kiro_crew/dashboard/handlers/relay_viewer.py:152 -- Workload hosts still consume a leftover personal sign-in
[BLOCK-MERGE] f281b4e Adjudication (Opus 5.5) — is blocking on each finding proportionate?F1 (fenced). The rung is UNBOUNDED as claimed, because the personal credential gets used and renewed on a host that is meant to run only under its workload identity. I checked each condition in the code:
This is not a FLAG. All it needs is a host that had a personal sign-in and was then switched to False positive or not applicable? A repository writer can comment: |
570322c to
f281b4e
Compare
|
self-added: yes
|
|
self-added: yes
|
|
|
AI-review override not recorded: |
Sensitive Change ReviewSensitive files changed:
|
Story 1. A signed-in person sees the Remote Crews they can open in the desktop app and in a browser tab with nothing to set; only an LTS build keeps the viewer off. tunnel.relay_viewer_enabled becomes a dev switch: the dev control plane URL, test credential and (with the URL) relay domain count only while it is on. With no dev domain a Crew is listed, and gets a token, only at <endpointId>.<one label>.relay.kiro.dev. The list hides quietly while signed out or refused, keeps a loaded list through a failed read, backs off 15 minutes after a refusal (a longer Retry-After wins), and its routine refusals are not journaled. Story 2. Behind KIROCREW_WORKLOAD_IDENTITY a team Crew signs in and leases with its own JWT-SVID, read from the file a sidecar such as spiffe-helper writes and refreshes. No path reads, renews or writes the person vault while the switch is set. Story 3. With tunnel.relay_enabled unset, a Crew hosts by default only when it has a team key or a workload identity; a personal sign-in stays off, and a stored value always wins. An older home with a team key and no stored value hosts after the upgrade; an explicit off stays off. Turning Remote Control off over the relay is refused; --test-mode and --seed imply --no-tunnel. Story 5. A refused lease shows the service's own message, kept only when it is plain ASCII words with no ARN or 12-digit number, redacted and cut to 200 characters. Closes #39384 Closes #39353 Closes #39357 Closes #39391 Based on a prototype by Sam.
f281b4e to
12ab428
Compare
|
self-added: yes
|
|
self-added: yes
|
|
self-added: yes
|
Sensitive change review
|
|
AI-review override not recorded: |
Problem / Motivation
Goal: A person signed in to Kiro sees the Remote Crews they can open with nothing to set, a team Crew hosts on the relay by default and can sign in with its own workload identity, and a refused lease shows the service's own reason.
Four relay gaps, one story each:
tunnel.relay_viewer_enabled trueis set by hand. A leftovertunnel.relay_viewer_relay_domainhides every Crew. Signed out, the switcher shows a red notice.kirocrew remote-control on, so teammates see it offline.Why it matters
Remote Crews is the way into a Shared Crew. Today nobody finds it without a config line, a leftover test value turns it off without a word, a team host stays offline until a manual
on, and a team host in a pod cannot host at all. When a lease is refused, the owner cannot tell a bad key from a policy.Not a goal
tunnel.relay_viewer_oidc_scope_prefix.kirocrew kas statusand whoami text for a workload host.What changed (motivation → approach → change)
tunnel.relay_viewer_enabledbecomes a dev switch: the dev control plane URL, the test credential and (with the URL) the relay domain count only while it is on, so a leftover value cannot hide every Crew or receive the person's sign-in. With no dev domain, a Crew is listed and gets a token only athttps://<endpointId>.<one label>.relay.kiro.dev. Every owner dashboard lists, desktop app and browser tab alike. The list hides quietly while signed out, refused or not the owner; a network or server failure shows a notice (with the rows it had, if any); and it reads again after 15 minutes on a refusal (a longer Retry-After wins), inside the existing poll; those routine refusals are not journaled.dashboard/handlers/relay_viewer.py,relay_viewer/cps.py,hooks/useRelayViewerCrews.ts,components/TeamCrewsGroup.tsx,components/SharedCrewsCards.tsx,api/client.ts,api/client/instances.ts,api/client/transport.ts,test/relayViewerCrewsApi.test.ts, i18n catalogsKIROCREW_WORKLOAD_IDENTITY, the Crew signs in with its own JWT-SVID, read from a file a sidecar such as spiffe-helper writes and refreshes. The KAS callback answers with it, the turn gate counts it for a turn on KAS (the kiro-cli probe stays kiro-cli's own answer), models come from the engine's recording, and the lease reads the same file through the existing file form oftunnel.relay_lease_credential. Nothing reads or writes the person vault while the switch is set, the relay viewer included. Based on a prototype by Sam.workload_identity.py,acp/kas_host_auth.py,acp/kas_route.py,agent_sdk/kas_model_catalog.py,auth/bridge.py,kiro_prerequisite_probe.py,relay_client/provider.py,dashboard/kiro_readiness.py,dashboard/sign_in_refresher.py,dashboard/handlers/agents.py,dashboard/handlers/models_kas_bundle.pytunnel.relay_enabledhas three stored values:truehosts,falsenever hosts, unset (the new default) hosts only when the Crew has a team key (API_KEY) or a workload identity. A personal sign-in stays off by default, and a stored value always wins. The first default connect says so once (a log line and a bell note). Builder ID and social sign-ins are held locally with no lease call. Turning Remote Control off over the relay itself is refused (403, audited; the read still answers and the card shows read-only).--test-modeand--seedimply--no-tunnel.remote_control/hosting.py,remote_control/default_notice.py,remote_control/guard.py,remote_control/setting.py,remote_control/cli.py,remote_control/defaults.py,edition_locks.py,config/validation.py,config/section_builders.py,config/integration_sections.py,relay_client/lease_signin.py,dashboard/handlers/remote_control.py,dashboard/kiro_relay/,dashboard/server_runtime/tunnel.py,src/kiro_crew/cli.py,cli_gateway_boot.py,pages/settings/RemoteControlCard.tsx,api/client/remoteAccess.ts,config-baseline.jsonThe service said: "<message>". The message is kept only when it is plain ASCII words with no ARN or 12-digit number, redacted and cut to 200 characters.relay_client/lease.py,security_posture_sinks_gateway.py(the status text is a registered redaction sink)Upgrade: an existing home that has a team key and stores no
tunnel.relay_enabledvalue starts hosting on the relay after this upgrade, with noon: setting the team key is the owner's choice to host. A home that storesfalse(anoff, a pod seed, a full settings save on an older build) stays off. A personal sign-in never starts hosting by itself.Docs:
remote-crew.md,configuration.md, the feature map and the specs (kas-auth.md,platform-context.md,config.md,cli.md,dashboard-token-auth.md,shared-crew.md) describe the new behaviour.Backwards compatibility
Breaking: (1) a stored
tunnel.relay_viewer_enabled: falseno longer hides the list, and a storedtunnel.relay_viewer_cps_url,tunnel.relay_viewer_credentialortunnel.relay_viewer_relay_domainis ignored unlesstunnel.relay_viewer_enabledistrue. Writer sweep on origin/main @ 99953f8: the only writers of these keys arekirocrew config setand hand edits (the settings page refusestunnel.relay_viewer_enabled); test setups that use the dev keys already settunnel.relay_viewer_enabled true(remote-crew.mdsays so). (2) An unsettunnel.relay_enabledwith a team key now hosts (see Upgrade above); writers oftunnel.relay_enabledarekirocrew remote-control on|off, the pod seed (writesfalse) and full settings saves, all of which keep their stored value. (3)PUT /api/remote-controlthrough the relay is refused; the only caller is the Remote Control card, which shows read-only there. (4)--test-modeand--seedno longer start a tunnel.Reader: website/src/components/TeamCrewsGroup.tsx:TeamCrewsSwitcher -- crew page -- reads
hidden,crews,account,refreshOnOpen; the list-refusal notice is gone, row refusals stay (TeamCrewsGroup.test.tsx)Reader: website/src/components/SharedCrewsCards.tsx:SharedCrewsCards -- crew page -- hidden until a list loads; row refusals and the Kiro account link stay (
SharedCrewsCards.test.tsx)Reader: website/src/hooks/useRelayViewerCrews.ts:relayRetryable -- crew page -- removed; its only reader was the list notice (
git grep relayRetryableis empty)Reader: website/src/i18n/locales/*.json:components.relayCrews.try_again, sign_in, request_id, components.sharedCrews.refusal_signed_out, refusal_not_configured, refusal_list_generic -- crew page -- no reference left (
deadKeys.test.ts)Reader: src/kiro_crew/dashboard/handlers/relay_viewer.py:_settings -- crew page -- every relay viewer route; dev values honoured only with the switch (
test_with_the_dev_switch_off_leftover_dev_settings_are_ignored)Reader: src/kiro_crew/dashboard/handlers/remote_control.py:PUT /api/remote-control -- crew page -- refused only through the relay; local Turn off unchanged (
test_off_over_the_relay_is_refused_and_audited_but_get_answers)Reader: src/kiro_crew/cli_gateway_boot.py:--test-mode, --seed -- release -- test and seed gateways start with no tunnel; the relay is never the point of either (
test_remote_control_hosting_default.py)Reader: src/kiro_crew/relay_viewer/cps.py:_crew_endpoint -- crew page -- list and mint, desktop and browser open; hosts outside Kiro's relay zone are left out (
test_with_no_setting_the_browser_opens_only_a_crew_in_kiros_relay_zone)Tests
POST /api/relay-viewer/browser-openopens only a zone Crew; hook tests for quiet hide, a list kept through a failed read with its notice on both surfaces, the 15-minute refusal back-off and Retry-After; the crews read does not journal its routine refusals.test/test_workload_identity.py(31 tests): settings, claims, fail-closed, the KAS answer, the lease credential, no vault use; the kiro-cli probe stays not ready on a usable JWT-SVID, and the turn gate admits only a turn on KAS.test/test_remote_control_hosting_default.py: the three stored values, the team key and workload cases, a personal sign-in, a quoted"false", the one-time notice, off over the relay,--test-mode; the leaf names pinned to the lease client andworkload_identity.test/test_relay_client_lease_refusal_message.py(22 tests) and two flipped pins intest_relay_client_lease.py.-n 4(373 passed each), and 254 node ids in a shuffled order with-n0(254 passed). The new tests use no clock; the hook tests use a fake clock moved by hand.Manual verification
See below; the UI was checked in the desktop app (Xvfb) and in a plain headless Chromium.
Real-machine verification
Machine: EC2 e2e-viewer, Ubuntu, x86_64, 8 vCPU; and a DevSpace host, Amazon Linux 2023, x86_64, 32 vCPU. Own home, gateway 6991, fake control plane on loopback 7991.
Before (main a4efe28 on EC2, dcc3121 on DevSpace): signed in, no setting ->
GET /api/relay-viewer/crews404RELAY_VIEWER_OFF, no Crew switcher in the app or a browser; a leftover relay domain -> 200 with 0 Crews; a dev control plane listing<id>.evil.example.test-> listed; signed out with the viewer on -> red "Sign in to Kiro to see your Shared Crews."After (head, same steps): 200 with the 4 Shared Crews in the app and a browser; Connect in a browser opens the Crew at
kcr-<sid>.localhost:6991; a leftovertunnel.relay_viewer_cps_urlalone gets 0 requests through sign-out, sign-in and list reads; the leftover domain is ignored (4 Crews); the evil host is left out; signed out -> hidden, no notice. Story 5RenewCrewLeasewith a junk key against the prod lease service ->The service said: "Invalid token"(and the two other token types). Story 2 with a fake sidecar and lease service -> models 200, the KAS callback and the lease carry the SVID, an empty credential is refused by name, the person vault is unchanged. Story 3 with a junk team key and noon-> main:requested:false, no lease call; head:requested:true, by_default:true, the prod lease service called; a personal sign-in and a storedfalsestay off;--test-modestarts no tunnel.Cleanup: own computers and an existing test box; every test gateway and fake stopped, the run homes with junk keys deleted. No machine stopped.
Screenshots / video
Before and after, desktop app and browser:
A browser tab's Connect opens the Crew on its own loopback site:
Related Issues
Closes #39384
Closes #39353
Closes #39357
Closes #39391
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...); PR Hygiene does not count commits