Repository navigation
feat(cloud): remote_provisioners CPP seam for the Set-up tab - #9654
Conversation
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsFINDING -- src/kiro_crew/dashboard/handlers_cloud.py:160 -- function-local imports here and in False positive or not applicable? A repository writer can comment: |
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS A faithful [DESIGN-REVIEWED] 85d57f6 |
UX Review (Fable 5) — 🟡 CONCERNSUX-level review of I have everything I need. Reconciling: the diff adds four user-visible surfaces — the provisioner selector cards ("Where should the new instance run?"), the stale-choice notice, the no-drawable-lane notice, and the list-fetch-failure notice — none appears in any committed screenshot, and the blind read could not run. The PR's stated reason covers the selector (unreachable on stock builds) but not the failure notice, which is reachable on a stock build under version skew. No block-exit predicate is met: no blind-reader words exist, the form change on picking a lane is a user-chosen mode switch rather than one element transformed, and each notice asserts what happened and what the system did. UX-Verdict: CONCERNS New selector and three notices shipped unseen — no screenshot, no blind read — and the stale-choice notice's wording points its label at the wrong lane. Watch
Evidence gaps
Suggestions
[UX-REVIEWED] 85d57f6 |
First Principles Review (Fable 5) — 🟡 CONCERNSPremise-level review of All verification is done. The seam follows the repo's recorded CPP pattern (the coverage gate requires core wiring, which this PR has), the Fargate RFC exists in-repo as provenance, the POSIX gate relocation preserves the exact stock error, and First-Principles-Verdict: CONCERNS The Not justified as shipped
What this change shipsInventory (10 items) — 8 justified; more than 10 exist (i18n keys, three new notices, preflight timing kept; description says "one new catalog key" where the diff adds four)Intent: let an edition add a machine-provisioning lane to the Remote Instances Set-up tab while the core keeps the durable launch loop — an ADDITION.
Watch
Subtractions
[FIRST-PRINCIPLES-REVIEWED] 85d57f6 |
Opus 4.8 Review — ✅ no blocking findingsReviewed Review detailsBased on my analysis of the diff and the single candidate: Candidate 1 ( No Step-2 finding reaches the 80+ bar: the degraded-seam fallbacks in No findings. [OPUS-REVIEWED] 85d57f6 Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
1ad587a to
039d31b
Compare
039d31b to
6760419
Compare
|
Round 2 (
Not changed: the UX evidence gap. The selector and the registered-form slot only render when a second renderer is registered, which no stock build can do; the |
|
Round 3 ( |
6760419 to
a033c31
Compare
|
Round 4 ( |
a033c31 to
ae26d84
Compare
…t-up tab
The Set-up tab under Settings > Remote Instances could only create an EC2
instance in the user's own AWS account: handlers_cloud._engine() constructed
RealLaunchEngine directly, and the SPA had no seam for a second form. An
edition whose machines come from a managed dev-environment service had no
way to add a lane short of shadowing the 1500-line panel.
Backend: a new PlatformContext slot, remote_provisioners
(RemoteProvisionerProvider), modeled on mobile_connect. A RemoteProvisioner
descriptor is {id, kind, label, posix_only, step_labels}; the provider hands
out a LaunchEngine per id. GET /api/cloud/provisioners lists the descriptors
and POST /api/cloud/launch accepts provider_id (default aws_ec2), resolves the
engine through the seam before any job file exists, and gates POSIX per
descriptor. LaunchJob persists provider_id (pre-seam files load as aws_ec2),
step labels come from the descriptor, and size_key is validated against the
EC2 ladder for the built-in only. The launch loop itself is not handed out:
run_launch drives every engine, so cancel, both rollback paths and orphan
reaping apply to every lane. Rollback and reap wording name what the lane
created instead of always saying "EC2 stack".
Frontend: registerRemoteProvisionerRenderer({kind, component}) in
components/remoteProvisionerRenderers.tsx (the fifteenth seam). The tab reads
the provisioner list, filters to kinds it can draw, shows a selector only when
more than one exists, keeps the built-in aws_ec2 form untouched, renders a
registered form inside an ErrorBoundary otherwise, and only probes AWS
preflight for the built-in lane. Stock behaviour is unchanged: one row, no
selector, same launch body.
Tests: handler listing/routing/POSIX/degraded-seam cases, job persistence and
label cases, descriptor and Default adapter cases, seam registration and panel
selector cases; the CPP seam-coverage test proves the slot is wired.
|
Round 5 ( |
ae26d84 to
85d57f6
Compare
…t-up tab (kirodotdev#9654) The Set-up tab under Settings > Remote Instances could only create an EC2 instance in the user's own AWS account: handlers_cloud._engine() constructed RealLaunchEngine directly, and the SPA had no seam for a second form. An edition whose machines come from a managed dev-environment service had no way to add a lane short of shadowing the 1500-line panel. Backend: a new PlatformContext slot, remote_provisioners (RemoteProvisionerProvider), modeled on mobile_connect. A RemoteProvisioner descriptor is {id, kind, label, posix_only, step_labels}; the provider hands out a LaunchEngine per id. GET /api/cloud/provisioners lists the descriptors and POST /api/cloud/launch accepts provider_id (default aws_ec2), resolves the engine through the seam before any job file exists, and gates POSIX per descriptor. LaunchJob persists provider_id (pre-seam files load as aws_ec2), step labels come from the descriptor, and size_key is validated against the EC2 ladder for the built-in only. The launch loop itself is not handed out: run_launch drives every engine, so cancel, both rollback paths and orphan reaping apply to every lane. Rollback and reap wording name what the lane created instead of always saying "EC2 stack". Frontend: registerRemoteProvisionerRenderer({kind, component}) in components/remoteProvisionerRenderers.tsx (the fifteenth seam). The tab reads the provisioner list, filters to kinds it can draw, shows a selector only when more than one exists, keeps the built-in aws_ec2 form untouched, renders a registered form inside an ErrorBoundary otherwise, and only probes AWS preflight for the built-in lane. Stock behaviour is unchanged: one row, no selector, same launch body. Tests: handler listing/routing/POSIX/degraded-seam cases, job persistence and label cases, descriptor and Default adapter cases, seam registration and panel selector cases; the CPP seam-coverage test proves the slot is wired.
Problem / Motivation
Settings > Remote Instances > Set up a new one can create exactly one kind of machine: an EC2 instance in the user's own AWS account.
handlers_cloud._engine()constructsRealLaunchEnginedirectly (thestate.cloud_launch_enginefield beside it is a test hook, not a contract),PlatformContexthas no slot for remote-instance creation, and the SPA has no registrar for a second form. A deployment whose users have no AWS account of their own, or whose machines come from a managed dev-environment service (an Amazon DevSpace, a Fargate task per the draft RFC indocs/request-for-change/rfc-remote-instance-on-fargate.md), has no way to add a lane short of shadowing the 1500-lineRemoteCrewPanel.tsx.The connect half already works for such machines: any SSH alias registers through
POST /api/instances, and mint, tunnel and self-heal carry no EC2 assumption. Only creation is closed.Why it matters
Enterprise editions compose the core through the CPP seam and must not edit it. Without this slot the only options are a separate page outside Remote Instances (the crew appears where it was not created) or a vendored-file patch (rots the update path). Both reimplement the launch job's durability, cancel and rollback, which is where a stranded billing machine comes from.
What changed (motivation -> approach -> change)
Goal: let an edition add a provisioning lane to the existing tab while the core keeps owning the launch loop.
Approach: mirror
mobile_connectexactly. The backend contributes descriptors, the frontend draws eachkind, the built-in kind cannot be claimed, and the core still runs the machinery behind the seam. Rejected alternative: makingLaunchEngine's method signatures generic. The five-method protocol is already the seam the Fargate RFC builds on, andprofile,region,size_keyare usable as generic wires (credential selector, placement, shape), so the protocol is unchanged.Backend:
platform/interfaces.py:RemoteProvisioner(frozen dataclass:id,kind,label,posix_only,step_labels),RemoteProvisionerProviderProtocol (provisioners(),engine_for(id)),BUILTIN_PROVISIONER_ID = "aws_ec2".platform/defaults.py:DefaultRemoteProvisionerProviderreturns the singleaws_ec2descriptor andRealLaunchEngine;platform/context.pyadds theremote_provisionersfield (v1 addition, noCONTRACT_VERSIONbump);platform/bootstrap.pywires it.cloud/launch_job.py:LaunchJob.provider_id(pre-seam job files load asaws_ec2),default_steps(step_labels)relabels the four fixed step keys (keys stay fixed because both rollback paths branch on them),LaunchJobStore.create()takesprovider_idandstep_labelsand validatessize_keyagainstsizes.pyfor the built-in only. Rollback and reap messages name what the lane created rather than always saying "EC2 stack".dashboard/handlers_cloud.py:GET /api/cloud/provisioners(owner-only, answers on every platform like the history routes),POST /api/cloud/launchacceptsprovider_id, resolves the engine throughcurrent_context().remote_provisionersbefore a job file exists (400unknown_provisionerotherwise), and applies the POSIX gate per descriptor. The test hook still outranks the seam. A degraded seam read falls back to the built-in lane only.platform-context.mdoverride table plus a rationale note;instances.mdroute table.Frontend:
components/remoteProvisionerRenderers.tsx:registerRemoteProvisionerRenderer({ kind, component }),getRemoteProvisionerRenderer,canRenderRemoteProvisionerKind;aws_ec2is a built-in kind and a collision.RemoteCrewPanel.tsx: reads the list on the setup tab, filters to drawable kinds, shows a selector only when more than one exists (persisted asmc-cloud-provisioner), keeps the built-in form untouched, renders a registered form in anErrorBoundaryotherwise, and enables the AWS preflight query only for the built-in lane. The launch mutation takes its body as variables so a registered form owns its inputs.api/client.ts:cloudProvisioners(),provider_idoncloudLaunchandLaunchJob.extension-seams.mdgains the fifteenth seam; one new catalog key in all 13 locales.Deliberately out of scope: a
capabilities.remote_provisionersgovernance scope (the EC2 lane carries none today; the row is the natural follow-up once a second lane exists), and lifecycle routes for non-EC2 lanes (/api/cloud/{tag}/stop|start|deletestay EC2-specific; a lane contributes its own throughdashboard.contribute_routes).Tests
Backend (
test_cloud_handlers.py::TestProvisionerSeam,test_cloud_launch_job.py::TestProvisionerOnTheJob, newtest_remote_provisioner_seam.py):aws_ec2row with the four step keys; listing answers on Windows; listing is owner-onlystep_labels, unknown keys ignored, other labels keptaws_ec2and every listed job carriesprovider_idprovider_idanswers 400 and leaves no job filesize_keyis not checked against the EC2 ladder, the job's steps carry the lane's labelssize_key; the POSIX gate is per descriptor; the test hook outranks the seamprovider_idround trips and a missing or empty key loads asaws_ec2; rollback and reap wording follow the laneRealLaunchEngine;build_default_contextcomposes the slot anddataclasses.replacestill workstest_platform_cpp_seam_coverage.pypasses with the new field, so the slot is wired rather than reservedFrontend (
extensionSeams.test.tsx,RemoteCrewPanel.test.tsx,SettingsRemoteCrewPanelCoverage.test.tsx): fresh registry is empty; registration makes a kind drawable;aws_ec2collision; blank kind; duplicate kind; EC2-only shows no selector; two rows of a registered kind both render and picking one posts itsprovider_id; a remembered non-AWS lane never fires the AWS preflight; a retired remembered id falls back; a kind without a renderer is dropped; a failing endpoint falls back to the built-in form.Local gates: 207 targeted backend tests plus the 1267-test cloud/platform/routes slice,
flake8,mypy,blackon new files (the four pre-existing files are onblack-baseline.txt);tsc --noEmit,npm run lint,lint:i18n,i18n:check, 164 vitest cases in the four touched suites.Manual verification
N/A. The stock build renders one provisioner and therefore no selector; the vitest DOM cases exercise the selector, the fallback and the registered-form path with a test renderer. A real second lane needs an edition build, which is the companion change that follows this PR.
Screenshots / video
Why no screenshot: the stock build has exactly one provisioner, so the selector never renders and the Set-up tab is pixel-identical to main; the only new surface appears when an edition registers a second renderer, which no stock build can do.
Related Issues
Companion to the draft Fargate RFC (
docs/request-for-change/rfc-remote-instance-on-fargate.md), which builds a second lane on the sameLaunchEngineprotocol.Checklist
feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)