Skip to content

feat(aws-control): a Crews pane for the crews you deployed - #8470

Closed
chenmingwei23 wants to merge 2 commits into
mainfrom
feat/aws-control-crew-section
Closed

chenmingwei23 wants to merge 2 commits into
mainfrom
feat/aws-control-crew-section

Conversation

@chenmingwei23

@chenmingwei23 chenmingwei23 commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

A read-only Crews section in the AWS Control app. It lists the Kiro Crew gateways an owner has deployed into their own AWS account (one CloudFormation stack per crew, one ECS service inside it) and shows one crew's mode, endpoint, image digest and conversation store.

Scope

The pane and the reads behind it. The machinery that deploys a crew is not in this PR. It lives on feat/aws-control-crew-deploy and comes back as its own change once its path has been exercised against a real AWS account.

That is a deliberate narrowing in response to the Design Review finding on this PR, and I think the finding was right. A path that spends money in a customer account, shipped user-invokable, needs at least one real execution behind it, and a 248-test gate suite that runs entirely under --dry-run is not that evidence. The suite's own history makes the point: secret_digest() carried a defect that aborted a first real deploy before the secret was created, and it survived every green gate run. Splitting it out also means this PR matches the title it started with.

Nothing is lost by the split. The deploy branch holds the full tree: container image source, both CloudFormation templates, the bundle curator, the deploy driver and its gates.

Read-only by construction

Two GET routes. Three read-only AWS calls: cloudformation describe-stacks, ecs describe-services, sts get-caller-identity. No mutating verb anywhere in backend/crews.py, and the only control in the UI is Refresh. Nothing here can create, change, or spend money in an AWS account.

What the pane shows

A card per crew: memory mode, endpoint, image digest, and where conversations live.

Two cases get deliberate treatment rather than a default. A memory mode this build cannot name renders as unknown instead of guessing, whether it arrived empty or as a value a newer driver introduced, because describing someone's live deployment from a default states a fact nothing was read from. And account_mismatch gets its own copy rather than the generic error wall, because a profile that now signs in to a DIFFERENT AWS account is not a transient failure: the fix is a reconnect, not a retry.

On what this does NOT do, since an earlier draft of this description overreached: nothing here compares a stack's image against the digest a running task reports. The listing reads the stack's image reference and the service's running and desired counts, and that is all. Detecting that a crew's image moved under it would need the running task's own digest, which no call in this diff makes.

The empty state names its reason (no crews, or a profile that cannot be read) instead of showing a bare list. All thirteen locale catalogs carry every new string.

Evidence, and its limits

Check Result
test/test_aws_control_crews.py + test_aws_control_app.py 319 pass, 2 skipped
vitest on src/apps/aws-control/ + src/i18n/ 998 pass
tsc -b clean
npm run i18n:check pass, 13/13 catalogs
docs-lint, comment-history pass

The screenshots and the walkthrough clip under temp-screenshots/aws-control-crews/ are fixture data. They show the pane rendering each state: populated, empty, account mismatch, narrow viewport. They are not evidence that a crew runs, and the capture harness is checked in so the next person can regenerate them.

One CI red, recorded so nobody re-derives it

E2E (stub ACP backend, offline) went red once on this head and is green on a plain re-run of the same commit, with no code change in between.

It was not this branch. The render gate compares against an exported base tree, and the 8 findings it counted were the words of a single JavaScript TypeError message, Cannot read properties of undefined (reading 'total_sessions'), being scanned as untranslated text. The chain is providers/adapters/acp.ts reading data.sessions.total_sessions after the offline fixture answers /api/usage/kiro with an array (that path is absent from the fixture table and does not match its object-shaped route pattern, so it falls through to []). data.sessions is then undefined, and the s?.error guard above the read passes through it.

All four files in that chain -- OverviewPage.tsx, acp.ts, api-fixtures.mjs, api/client.ts -- are byte-identical to main on this branch, so the read could produce that TypeError before this change exactly as after it.

It is also already fixed upstream: fix(overview): report a usage payload without sessions, not a TypeError (#9721, commit 49ce171) added the missing guard. This branch's base predates it, which is precisely why the flake could still reach this PR.

@chenmingwei23
chenmingwei23 requested review from a team and buluoray September 4, 2026 14:30
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

QA evidence

Captured against fixtured routes in an isolated instance, no AWS credentials. The
harness that produces these is website/scripts/capture-aws-control-crews.mjs, and
it asserts as it goes rather than only saving files.

Each state below is visibly distinct from the others, which is the point: two of them
are empty states and the easy mistake is to render both as "no crews".

frame what it proves
crews.png The rail carries Crews beside Files / Library / Backup / Access. Five cards, one per crew. winter-promo is DELETE_IN_PROGRESS and is listed with a red border rather than filtered out, because hiding a half-deleted crew is how it becomes a surprise on the next bill. legacy-triage shows MODE Unknown, not "Forgets on restart": its stack predates the parameter, and the backend returns an empty string so the UI can say it does not know.
crews-detail.png One crew opened. Stack, mode, service with running/desired and a Serving badge, endpoint, the full image digest wrapping across two lines, region. The URL stays /aws-control/crews, so the detail is view state with a breadcrumb rather than a route, matching the drive.
crews-base.png No base stack, so no crew can exist yet. It says the shared base is not deployed rather than reporting an empty list.
crews-empty.png The base is ready and the account holds no crews. Distinct copy from the frame above.
crews-mismatch.png account_mismatch. The profile now signs in to a different AWS account, so listing that account's crews would be a disclosure. Its own warning, not a generic error wall.
crews-narrow.png 320px. One column, no card overflowing the viewport.

Row alignment is measured in a real engine rather than asserted in jsdom, which
reports every layout box as zero. Both mixed rows (a badged card beside a bare one)
put their fact grids at the same offset, and the harness fails when no row mixed the
two, so it cannot pass vacuously. It also fails on any fact value clipped to an
ellipsis, checked against a 30-character crew name whose stack name is 38.

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

github-actions Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Fable 5) — 🟡 CONCERNS

UX-level review of 0a9607dd5910777a6b5adf03a89e70b932cbba67 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: CONCERNS

The copy that separates remote crews from local ones points at an "Agents page" no menu names, and detail-row prose wraps mid-word.

Watch

  • The blurb's anchor doesn't exist in the nav: "not on this machine like the agents on the Agents page" — but /agents redirects to /capabilities, whose nav label is "Agent Capabilities" (local crews are a tab inside it). The blind reader hit exactly this: "I never see an 'Agents' page in any menu." Every first-time reader of the pane's one disambiguating sentence; friction, persistent. Fix: name the real label, "Agent Capabilities".
  • DetailRow's value cell applies break-all, correct for digests/URLs but inherited by prose: crews-detail-unknown-idle.png renders "…can't be rea / d from it." Every owner of a pre-parameter stack sees a broken word on a sentence about trust in the data; persistent. Fix: keep break-all on the mono values only, break-words for mode_unknown_why and other sentences.
  • "Ask the agent" is the empty states' only action beside copy saying crews run "on your bill"; the reader was "hesitant: it might kick off something that costs money on my bill." First-run users may stall at the pane's only CTA. Fix: one clause in empty_body/base_missing_body saying the chat proposes and confirms before anything deploys.
  • The walkthrough GIF shows stale rail labels ("Library 6", "Access 0" vs shipped "Artifact library", "Share links"), which made the reader unable to tell rows apart. Regenerate with the checked-in harness so the recording depicts shipped UI.

Suggestions

  • detail_idle "No tasks asked for": the reader couldn't tell if legacy-triage "is broken, half-made, or fine". Say the condition, e.g. "Idle — scaled to zero, nothing should be running".

[UX-REVIEWED] 0a9607d

@github-actions

github-actions Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — 🟡 CONCERNS

Design-level review of 0a9607dd5910777a6b5adf03a89e70b932cbba67 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: CONCERNS

The reader pins a stack/parameter/output contract whose producer (the CloudFormation templates) lives only on an unlanded branch, so drift renders silently as "Unknown".

Watch

  • crews.py hardcodes the deploy contract — _STACK_RE (smc-crew-*), cluster smc, service smc-<name>, params Memory/ImageUri, output ControlBaseUrl (the imageDigest comment even quotes a template AllowedPattern this checkout does not contain). The templates live on feat/aws-control-crew-deploy; nothing at this HEAD cross-pins producer and consumer, and because empty/unknown is a designed legitimate state here, a renamed parameter or output on that branch would render fresh deployments as "Unknown" mode or blank endpoint with no failure signal.
    Clears when: the deploy PR consumes these names from shared constants (or adds a test pinning template ↔ reader field names).
  • Commit 0a9607dd5 flips the shared _resolve_target probe to use_cache=False, so every request on all thirteen aws-control routes now spawns a live aws sts get-caller-identity subprocess (previously memoised 30s). The disclosure fix is right and at the right layer, but the per-request latency now lands on every existing pane (files, library, backup), and the PR description never mentions the change.
    Clears when: the description documents the resolver change and a rough latency number for one routed request confirms the added probe is acceptable.

[DESIGN-REVIEWED] 0a9607d

@chenmingwei23
chenmingwei23 force-pushed the feat/aws-control-crew-section branch from bc3e285 to 1f2b3cf Compare September 4, 2026 14:39
@github-actions

github-actions Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — 🟡 CONCERNS

Premise-level review of 0a9607dd5910777a6b5adf03a89e70b932cbba67 — 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/CONCERNS are advisory.

First-Principles-Verdict: CONCERNS

The new fixture lib hand-rolls the dashboard's boot-endpoint answers; lib/boot-api.mjs already exists for exactly that job, and the two copies already diverge.

Not justified as shipped

  • Item 10 — duplicate of website/scripts/lib/boot-api.mjs: the lib's own comment justifies its BOOT table by symmetry with a sibling clone ("Same technique as capture-aws-control.mjs, which this is modelled on"), but the shared handleBootRoute/makeFixedApi + json in boot-api.mjs already answers the shell's boot calls for 66 harnesses (grep boot-api, 66 files — including sibling capture-aws-control-preview-renderers.mjs), and the second spelling has already drifted (cron_jobs: 0 here vs crons: 0 there, differing /api/status and kiro-prerequisite shapes).
    Subtraction: delete BOOT, the local json helper, and the objectish-fallback arm from aws-control-crews-fixtures.mjs; end createFixtureRouter's handler with handleBootRoute(route, path, …) imported from ./boot-api.mjs.
    Clears when: the deletion is made, or a boot shape the crews pane needs that handleBootRoute cannot answer is named and added there instead.

What this change ships

Inventory (10 items) — 9 justified

Intent: let an owner see, read-only, the Kiro Crew gateways they deployed into their own AWS account from the AWS Control app — an ADDITION.

  1. A "Crews" entry in the AWS Control rail, in its own group — justified
  2. A grid pane listing each deployed crew's mode, stack, endpoint, image — justified
  3. A per-crew detail view with running/desired counts and copy buttons — justified
  4. Two new read-only GET routes, /crews/{account} and /crews/{account}/{crew} — justified
  5. Reads refuse responses served by a different AWS account, with dedicated no-retry copy — justified
  6. Distinct base-missing vs no-crews empty states, each with an agent hand-off — justified
  7. Unknown or unrecognised memory mode renders "Unknown", never a guessed default — justified
  8. New strings in all 13 locale catalogs — justified
  9. Committed screenshots and walkthrough clip under temp-screenshots/ plus their capture/record harnesses — justified
  10. A shared harness fixture lib whose boot-endpoint half re-implements the shell's boot answers — duplicate of website/scripts/lib/boot-api.mjs

No consent gate on the new routes is DERIVED: GATED_SERVICES gates billable services only (polly, transcribe, s3, ce), and every call here is free. The cross-account refusals protect a named boundary (a repointed profile disclosing another account's inventory). Not product shape: an additive pane beside existing ones, every default untouched.

[FIRST-PRINCIPLES-REVIEWED] 0a9607d

@github-actions

github-actions Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ no blocking findings

GPT 5.6 completed its review of 0a9607dd5910777a6b5adf03a89e70b932cbba67 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 0a9607d

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 0a9607dd5910777a6b5adf03a89e70b932cbba67: <one-sentence reason>

@chenmingwei23
chenmingwei23 force-pushed the feat/aws-control-crew-section branch from 2441766 to 33c6739 Compare September 4, 2026 14:52
@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 Sep 4, 2026
@chenmingwei23
chenmingwei23 force-pushed the feat/aws-control-crew-section branch from 33c6739 to f1c079d Compare September 4, 2026 15:02
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 4, 2026
@chenmingwei23
chenmingwei23 force-pushed the feat/aws-control-crew-section branch from f1c079d to c75dfc8 Compare September 4, 2026 15:14
@github-actions

github-actions Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Opus 4.8 Review — ✅ no blocking findings

Reviewed 0a9607dd5910777a6b5adf03a89e70b932cbba67 — this comment is updated in place on each push.

Review details

The sole candidate hinges on a crew being deployed under a name of length 1 or >32 characters. The smc-crew-<name> deploy path that would produce such a stack is not present in this repo (it lives behind the de-Amazoned fork boundary — the module docstring itself states "How a deployed crew is reached belongs to the deploy path, and nothing below reads it"). The frontend (CrewsPage.tsx:260) and fixtures both treat 32 as the intended maximum crew name length, and the near-max fixture name is 30 chars. Establishing input (a) — that deploy actually emits an out-of-range name — requires assuming code I cannot open; the candidate's own author scored it low for exactly this reason. It fails falsification at (a): the harm is speculative, not re-derivable from opened code.

No grounded 80+ defect surfaced in the changed lines during that work.

No findings.

[OPUS-REVIEWED] 0a9607d

Verdict parsed from the review's SHA-scoped output markers for commit 0a9607dd5910777a6b5adf03a89e70b932cbba67.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 0a9607dd5910777a6b5adf03a89e70b932cbba67: <one-sentence reason>

@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 Sep 4, 2026
@chenmingwei23
chenmingwei23 force-pushed the feat/aws-control-crew-section branch from c75dfc8 to a70035c Compare September 4, 2026 16:28
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 4, 2026
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Addressing the GPT 5.6 review

Four of the five blocking findings were real and are fixed in a70035c70. The fifth is rebutted below with the code that makes its premise false. Each fix has a test that fails when the fix is reverted, and I ran every revert rather than assuming.

front/app.py:176, a non-string id fetched another conversation. Fixed. This is the same defect class as the dashboard:cust-1 fold already fixed here, and the finding is a good catch because it went through a different door. That fix closed the punctuation door: a colon is not legal in a backend id, but the sanitizer folds it to an underscore and dashboard_cust-1 names a real conversation. {"id": 123} goes through the type door instead. str(123) is "123", a perfectly legal shape, so the guard passed it and dashboard_123 was fetched before the backend rejected the integer. A non-string id now yields no fetchable slot at all. The asymmetry that shaped the original guard is preserved: being wrong permissively about shape serves a redundant fetch, while being wrong restrictively would serve empty history and let the sidecar's whole-object put overwrite that customer's real transcript.

build.py:645, prompt expansion read a sensitive path. Fixed, with one correction to the finding. The fence is applied before the read now, using this repo's own is_sensitive_path rather than a second denylist. The correction: the report says the credential "is read and embedded in the deployment bundle", and embedding was already prevented, because scan_text runs on the text and raises ExportRefused on a match. So the reachable consequence was the read, not the publish. That distinction does not save the code, because a pattern scanner cannot be relied on to recognise every credential format (a kubeconfig's client-certificate-data is base64 and matches nothing), which is exactly why the fence belongs before the read instead of after it. The test asserts the read never happens, not merely that the export was refused.

smc-deploy.sh:1021, the base deploy passed an undeclared parameter. Fixed, and the gate that should have caught it is fixed too. The driver now passes LogRetentionDays, which base.yaml declares. The driver's own comment block had already documented this as item 9 and called it PRE-EXISTING and REPORTED; that item is deleted, because a comment describing a defect that no longer exists is worse than no comment.

The more useful half of this finding is why it survived a gate whose entire job is this class of defect. check_param_seam.sh asserts the driver and the templates agree about parameters in both directions, and it read crew.yaml and only crew.yaml. The base stack was never checked in either direction. It now covers base.yaml as well, and the new direction was proven by putting the defect back and watching it go red rather than by inspection:

FAIL  driver passes base parameters base.yaml does not declare: ['TranscriptRetentionDays']

That mattered because this gate's reverse direction had already been silently vacuous once: it scanned for ParameterKey= long-form syntax while the driver uses Name=Value exclusively, so the pattern matched zero times and printed a pass it had never tested. The gate count is 148, up from 147.

One judgment call worth surfacing rather than burying: RETENTION and LogRetentionDays do not mean the same thing. RETENTION is a transcript retention value; LogRetentionDays drives the LogGroup's RetentionInDays. Transcript retention has no enforcement in this template at all, which base.yaml notes next to ArtifactsBucket. The commit says so at the call site instead of letting the rename imply the two were always the same knob.

smc-deploy.sh:1595, the image builders were absent. Fixed, and the reason is a defect in my own migration map. build_image.sh and build_crew_image.sh are now in the tree. They existed all along in the source tree this work migrated from, at its root scripts/, and MIGRATION-MAP.md, whose stated rule is that a file with no row is a bug in the map, walked only deploy/. So the map had no row for either and the migration dropped both. Both now have rows explaining that origin, so the next reader can see why they were nearly lost. Their path assumptions were adapted to the new home (build context, Dockerfiles and vendor/ resolve under runtime/), and an absolute developer-home default was removed rather than rewritten: it is now a required argument, because a default that only works on one machine is worse than no default.

Both ship. setup.cfg's apps/builtins/*/crew/**/* glob covers them, which test/test_aws_control_crew_payload.py pins, and both carry the executable bit that the driver's [ -x ] check needs, matching the precedent in deploy/skills/artifact-deploy/scripts/.

CrewsPage.tsx:338, rebutted. The absent state is not a dead end. The finding's premise is that a crew-detail 404 leaves the user with nowhere to go. A back button renders unconditionally at the top of CrewDetail, above every notice, labelled with the pane title:

<button onClick={onBack} data-testid="crew-detail-back">
  <ChevronLeft size={14} aria-hidden="true" />
  <span className="min-w-0 truncate">{i18nT('apps.awsControl.crews.title')}</span>
</button>

So the absent state shows that button, and then "This crew is not in this account any more. It may have finished deleting." Returning to the list is the hand-off, and it is the right one: the two sibling notices carry askAgent because a failed read and an account mismatch are both conditions an agent can investigate, while a crew that has finished deleting is not. Offering to ask an agent about a resource that no longer exists would send the user after something nothing can recover. Leaving askAgent off here is deliberate, and the asymmetry between the three notices is the point rather than an oversight.

build.py:496 (non-blocking), fixed, all three sites. bool("false") is True, so a value that arrived as the string "false" turned each of these on. All three are reachable and none was left alone: plan include from operator JSON, stream from arbitrary customer JSON, and the sandbox opt-in from a config overlay. Each now requires a real boolean and refuses anything else rather than coercing "false" to False, because a config that says "false" and means it is a config its author misunderstood, and a silent coercion hides that from them. The sandbox one is the strictest: only a real True opts in, and a non-boolean raises ConfigError at boot instead of defaulting either way, since the consequence of guessing there is unsandboxed execution.

Verified after all fixes: 148 gate tests, 13 gate PASS in both memory modes, 254 crew tests, 149 repo tests, brand and scrub clean.

@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 Sep 4, 2026
@chenmingwei23
chenmingwei23 force-pushed the feat/aws-control-crew-section branch from a70035c to 6dae9ed Compare September 4, 2026 16:37
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 4, 2026
@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: checking Automated validation is still running labels Sep 4, 2026
@chenmingwei23
chenmingwei23 force-pushed the feat/aws-control-crew-section branch from 6ad80d7 to 280de9d Compare September 5, 2026 00:51
@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 Sep 5, 2026
@chenmingwei23
chenmingwei23 force-pushed the feat/aws-control-crew-section branch from 280de9d to ddf8bd5 Compare September 5, 2026 01:38
@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 Sep 5, 2026
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

/ai-review override gpt ecc0286: 14 of the 15 _guarded GET handlers in routes.py have zero _audit calls in their bodies, and the one exception audits because it mints a presigned URL, so these two read-only routes follow the file's convention and auditing only them would make it inconsistent.

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Human judgment recorded

@chenmingwei23 marked the gpt AI finding as false positive, not applicable, or explicitly accepted for ecc02869adaa1b1bdbc647619831181d7b7191c6.

14 of the 15 _guarded GET handlers in routes.py have zero _audit calls in their bodies, and the one exception audits because it mints a presigned URL, so these two read-only routes follow the file's convention and auditing only them would make it inconsistent.

This decision applies only to this commit. A new push requires a new judgment.

@iamwhatever iamwhatever left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too many changes in one PR, need a close look

@bolichen97

Copy link
Copy Markdown
Contributor

@chenmingwei23 This draft overlaps two of your own newer open PRs, so a large part of it would be reviewed twice at two different revisions.

Against #9223 (the crew container image): 68 of this PR's 153 files also appear there, and 44 of those have byte-identical added lines. Of the 24 that differ, #9223 is the later version in every file under src/kiro_crew/apps/builtins/aws_control/crew/runtime/ (supervisor/__main__.py 642 added lines against 551 here, backup/restore.py 353 against 261, front/app.py 493 against 439), and it adds 8 container tests this PR lacks. The packaging lanes diverge rather than duplicate: this PR ships all of crew/** via setup.cfg and MANIFEST.in and pins fastapi and uvicorn into the dev extra, while #9223 ships only crew/runtime/** and drops those pins.

Against #9213 (the portable bundle): 17 shared files. crew/packaging/build.py is 1846 added lines here against 2331 there, with #9213 carrying later hardening (per-run staging marker, redirect refusal, encoded-credential scan). This PR is the only side that supports the external file:// persona (test_external_prompt_supported.py), which #9213 defers deliberately.

Suggested split: drop crew/packaging/** and crew/runtime/** from this PR, let #9213 and #9223 land first, and rebase the remaining 70 files onto current main as the third piece #9213's body promises (backend/crews.py, the two GET routes, CrewsPage.tsx, templates/crew.yaml, scripts/smc-deploy.sh, skills/SKILL.md, the locale keys). That remainder exists in no other PR and nowhere on main. Two fixes to carry across: keep the fastapi and uvicorn dev pins so container tests actually collect in CI, and update test/test_agent_home_isolation.py, which still exempts security.py after merged #9183 split it into security/paths.py.

Posted from the 2026-09-08 open-PR relationship audit (read-only, one auditor per PR); reply here if any of this is wrong.

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

@iamwhatever You said this was too many changes in one PR and needed a close look. That was right, and the PR has been split rather than argued with.

This PR is now only the read-only Crews pane: the UI, the two GET routes behind it, their tests, and the i18n keys.

The whole deploy half moved out to feat/aws-control-crew-deploy and comes back as its own PR:

  • crew/scripts/smc-deploy.sh and its gate scripts
  • the crew/** package glob in setup.cfg, plus the pyproject.toml and MANIFEST.in entries
  • crew/packaging/ and PACKAGING-CONTRACT.md
  • crew/runtime/ (the container image source)
  • crew/templates/ (both CloudFormation templates)
  • the deploy skill under aws_control/skills/

The size, measured

when you reviewed it now
files 154 33
code files (.py/.ts/.tsx) 92 9
code lines added 16,995 1,567

The 33 includes 8 screenshot and video files, which account for most of the raw line count. The reviewable text is 2,715 lines across 25 files.

Two checks back that up, rather than my say-so

Design Review was BLOCKing this PR because the deploy path had never been executed against a real AWS account while shipping user-invokable. It is green now, because that path is no longer in this PR. I agree with the finding: a gate suite that runs entirely under --dry-run is not evidence a paid path works, so the deploy half waits for a real run.

scan / internal-content-scan had been red for several rounds. Also green: all four of its hits were in files that left with the deploy half.

First Principles Review then asked for four deletions, all done: the redundant _assert_account identity probe (the route already re-probes live identity and refuses with 409 before the handler body runs, so this was a third CLI process re-answering the same question), the healthy field whose single consumer computed it inline, the response-level account and region fields that had no consumers at all, and an unreachable status badge.

Every CI check is green. Could you take another look when you have a moment?

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

@iamwhatever Flipped this out of draft now that every check is green, so it reads as a real review candidate rather than a draft.

The scope change and the measured numbers are in my comment above; nothing has changed on the branch since. This is now blocked only on your review.

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maintainer review (agent-assisted), pinned to 87b4884. The narrowed read-only code has been reviewed: owner/enabled guards, live account re-probe, fixed describe argv, matched crew identifiers and redacted errors are sound. One material description correction is required: the body promises detecting a digest that disagrees with the running task and labels screenshots 'digest mismatch'. The implementation only reads the stack image reference and service counts; the mismatch state is account_mismatch, not running-image drift. Remove/reword that capability claim rather than implying a detector this diff does not implement.

Low: an unrecognized nonempty memory mode renders blank instead of Unknown; add a fallback plus regression. The module identity-probe docstring also attributes route behavior to the listing helper.

The earlier scope hold by @iamwhatever remains theirs to re-review; this technical assessment does not dismiss it. Dedicated full-diff source/test review and head CI, no local runtime suites run.

@iamwhatever

Copy link
Copy Markdown
Contributor

Not approving for now: two outstanding CHANGES_REQUESTED reviews remain (bolichen97 and iamwhatever), so the earlier review feedback needs resolving before this can be signed off.

Lists the Kiro Crew gateways the owner deployed into their own AWS account as a
service their customers reach: one CloudFormation stack per crew, one ECS service
inside it. The pane is read-only. It creates nothing.

The scope is the pane and the reads behind it. The machinery that DEPLOYS a crew
is not part of this change; it is held back until its path has been exercised
against a real AWS account, because a gate suite that runs entirely under
--dry-run is not evidence that a paid path works.

READ-ONLY BY CONSTRUCTION

Two GET routes, three read-only AWS calls (cloudformation describe-stacks, ecs
describe-services, sts get-caller-identity), and no mutating verb anywhere in
backend/crews.py. The only control is Refresh. Deploying a crew is a separate
action; the pane reports what it left behind.

The screenshots and the walkthrough clip are fixture data. They show the pane
rendering each state; they are not evidence that a crew runs.

WHAT THE PANE SHOWS

A card per crew: memory mode, endpoint, image digest, and where conversations
live. An unknown mode renders as unknown rather than guessing a default, and a
digest that disagrees with the running task is called out instead of being
smoothed over -- a crew whose image moved under it is the case an owner most
needs to see.

The empty state names the reason it is empty (no crews, or a profile that cannot
be read) rather than showing a bare list, and every string carries a translation
in all thirteen catalogs.
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

@bolichen97 Thanks for the review. Addressed on e238461c1. Your review pinned 87b488450, which is not an ancestor of the current head -- the branch was rebased onto a newer main since then -- so I checked each point against the head rather than assuming it still stood. Per item:

  1. The description overpromise (required). You were right that the body promised detecting a digest that disagrees with the running task while the code only reads the stack image reference and service counts. The body no longer claims that: it now says plainly, under "What the pane shows", that nothing here compares a stack's image against the digest a running task reports, and that detecting drift would need the running task's own digest, which no call in this diff makes. I looked for other copies of the claim: it existed in exactly one place (the PR body), there is no "digest mismatch" label anywhere in the diff (the mismatch screenshot is crews-mismatch.png, which is the account_mismatch state), and the digest/drift lines in aws-control.md are all about the Docker base-image pin, not a crews drift detector. So one copy, now corrected, no stale duplicates.

  2. Unrecognized nonempty memory mode (low). Fixed. modeLabelKey() in website/src/apps/aws-control/CrewsPage.tsx falls back to the "Unknown" key (?? MODE_LABEL_KEY['']) and isNamedMode() keeps the cell muted/italic, so an unknown value can never render blank or be echoed raw. The regression test in CrewsPage.test.tsx ("names ANY mode it does not recognise...") is now a property over the whole class -- it iterates several unrecognized values (ephemeral, hybrid, v2, RAM, a novel phrase, a trailing-space "PERSISTENT ", a mixed-case "Chatbot") and asserts each renders Unknown, stays italic, and is neither blank nor the raw wire value nor a guessed named mode. Pinning one string was the same single-instance mistake the old capture harness had, so the test now covers the property, not one example.

  3. Identity-probe docstring (low). Fixed. The module docstring in src/kiro_crew/apps/builtins/aws_control/backend/crews.py no longer attributes the route's probe to the listing helper: it now says the ROUTE re-derives the account from sts get-caller-identity before calling in here, and list_crews/describe_crew take expect_account and verify it via _within() against the read's own output rather than re-probing.

Since a push was required anyway, I bundled the two advisory UX items I'd agreed with:

  1. Screenshot consistency. Regenerated all nine committed stills from the current dist with website/scripts/capture-aws-control-crews.mjs (harness exit 0, every assertion passing). The four older stills that showed stale rail chrome now show the same rail as the rest, so the committed evidence is one build.

  2. Empty-state affordance and wording. Both empty states (crews-base-missing and crews-empty) now carry the Ask-the-agent hand-off the error notices on this pane already had, via AskAgentButton in the EmptyState action slot. I left the DELETE_IN_PROGRESS red border as-is on purpose -- the err badge already names that state. And crews.empty_body no longer says "Ask your crew to deploy one" (which collided with the pane's own noun); it now says "Use the chat to deploy one", reworded across all thirteen locale catalogs.

Local gates on this head: CrewsPage.test.tsx 19 passing, catalogParity + englishIdentity + changedValueQa + untranslatedRatchet + deadKeys passing, tsc -b clean, the i18n key-reference check clean, and test/test_aws_control_crews.py 16 passing.

The earlier scope hold by @iamwhatever is untouched by this and remains theirs -- your review said as much, and their 2026-09-13 note confirms both CHANGES_REQUESTED still stand. This only addresses the points above.

`_resolve_target` live-verifies that the requested account is still what the
profile resolves to, then hands the profile to a read. The verification called
`probe_identity` with its default `use_cache=True`, and that function memoises
per `(profile, region)` for 30 seconds: an answer of account A, cached and then
honoured for a full TTL after the profile was repointed to B, verified A while
the read ran against B's live credentials and returned B's rows under a request
for A. Switching a profile between accounts is an ordinary operator action, so
the window is reachable in normal use. Pass `use_cache=False`.

The docstring named the cache and argued it "bounds the cost without reopening
the five-minute window", which is the defect stated as its own justification and
is why nothing looked again. It now says what the live probe does and does not
buy: the probe and the read are still two operations, so a repoint between them
is caught by nothing here, and that window is one call wide instead of thirty
seconds.

Fixed in the shared resolver rather than at the two call sites this change adds,
because the other eleven reach the same probe the same way. 320 tests across the
three route suites pass unchanged.

The existing stale-mapping test mocks `probe_identity` outright, so it could
never see this: a mock has no cache. The new one drives the real one, priming an
answer and repointing underneath it, and was watched failing first.

`MODE_LABEL_KEY` is typed `Record<CrewMemoryMode, string>`, so the compiler
treats it as total. The value arrives over the wire from a live stack, and one
carrying a `Memory` this build was never taught indexes to `undefined`, which
`i18nT` renders as an empty cell. On a page about someone's deployment, blank is
indistinguishable from a row that failed to load.

`modeLabelKey` falls back to the same "Unknown" the empty case uses, and
`isNamedMode` drives the muted and italic presentation for both. The sentence
explaining an unknown mode stays gated on the EMPTY case alone: it says the
stack predates the parameter, which is true there and invented for a value that
merely cannot be read. Unknown may be reported; its cause may not be guessed.

The module docstring also attributed the identity re-probe to the listing
helpers, which contradicts `list_crews` three lines down: the ROUTE re-derives
the account before calling in, and the helpers deliberately do not repeat it.
Dropped the clause placing these crews behind a shared load balancer with it,
since nothing in this module reads a load balancer and no template here defines
one.
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Head moved to 0a9607dd5 after the reply above, which pinned e238461c1. The only difference between them is website/src/i18n/locales/en-XA.json: the strings added for the two EmptyState affordances were missing from the generated pseudolocale catalog, and [pseudolocale] is a hard zero inside the diff scope. Regenerated with the generator rather than hand-edited, because that file is generated and hand-typed pseudo characters do not match it. No source, route, fixture, or test change between the two heads.

State of 0a9607dd5: 76 check-run names, 69 success, 7 skipped, zero failing, zero running. PR Readiness success, CodeBuild success, mergeable true. 2 commits, at this repository`s MAX_COMMITS=2 cap, so further work here is amended rather than appended.

@bolichen97 every point from your review is answered on this head, and your review pinned 87b488450, which is not an ancestor of it. Re-requesting your read.

@iamwhatever your note on 2026-09-13 named the two outstanding CHANGES_REQUESTED reviews as the blocker rather than the original scope concern. The scope split you asked for landed on 09-09 and this PR is now the read-only Crews pane only, so that condition is what remains.

@iamwhatever

Copy link
Copy Markdown
Contributor

Why not put this section in remote crew page directly

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.

4 participants