Skip to content

fix(cloud): make two AWS pre-flight rows name the real cause - #19960

Merged
cruisercohen merged 2 commits into
mainfrom
fix/19457-aws-preflight-messages
Oct 16, 2026
Merged

cruisercohen merged 2 commits into
mainfrom
fix/19457-aws-preflight-messages

Conversation

@cruisercohen

@cruisercohen cruisercohen commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: The Remote Crew set-up pre-flight tells the user what is actually wrong when the AWS credentials row or the Session Manager plugin row fails on a GUI-launched gateway, and what to do about it.

Two rows of the "Before you start - your AWS setup" pre-flight report a failure the user cannot act on:

  • The AWS credentials row shows only the AWS CLI's raw [Errno 2] No such file or directory: '<name>' when the profile's credential_process runs a helper by bare name and that helper is not on the gateway's PATH (a Dock/Finder launch hands the gateway a minimal PATH). Nothing says the missing file is the profile's credential helper, or that giving it a full path fixes it.
  • The Session Manager plugin row says "Not installed" and offers the install command when the plugin IS installed but the resolver's provenance check refused it (for example AWS's macOS package leaves its install tree owned by the packager's account). The install command reinstalls the same refused file, so it can never fix the row.

Why it matters

A user whose profile works in a terminal is stopped at the first step of setting up a Remote Crew with an error that points nowhere, and a user with an installed plugin is sent round a reinstall loop. Both rows need to say what is wrong and what fixes it.

Not a goal

  • Changing which directories the AWS CLI child's PATH holds, or which binaries the resolver accepts. That question stays open separately; this PR only reports what the existing checks already decided.
  • Changing the launch wizard's install offer for the plugin.

What changed (motivation → approach → change)

Symptom: two pre-flight rows that report the wrong cause. Cause: the backend returned only the raw CLI error for the credentials row, and only a boolean for the plugin, so a refused candidate and an absent one looked the same.

  • deploy/engine.py: resolve_aws_tool_bin_with_refusals(name) runs the same walk as resolve_aws_tool_bin (which now delegates to it) and also returns the candidates THIS walk refused, each with the provenance check's own reason. Same search order, same validation, same refused-set updates; the list is read from the walk, not from the shared set, so a candidate deleted since an earlier walk is not reported.
  • cloud/ssm.py: session_manager_plugin_refusal() returns the first refused candidate (path, reason, remedy) when no plugin was accepted, else None. The remedy is a copyable sudo chown -R root:<group> /usr/local/sessionmanagerplugin only when the provenance check's refusal is its third-account ownership refusal ("owned by another user (uid N)"), the candidate resolves inside AWS's package prefix, and some component there is owned by an account that is neither root nor the gateway user; otherwise it is empty. A root gateway, the strict policy and permission refusals are not cleared by a root-owned tree, so they get the reason alone. The trust check itself is unchanged.
  • cloud/iam.py: reachability_check detects a bare program name in the CLI's [Errno 2] No such file or directory: '<name>' and returns it as credential_helper_missing, with a note naming credential_process and the full-path fix. A name with a path separator is not matched, because it was never looked up on PATH.
  • handlers_cloud.py: GET /api/cloud/preflight adds session_manager_plugin_refused_path / _reason; for a refused plugin session_manager_plugin_command carries the remedy (or "") instead of the install command.
  • RemoteCrewPanel.tsx: the credentials row leads with the localized helper sentence and puts the CLI's own error under it as a smaller monospace line (ErrorNotice's existing title + messagePlacement="below", so the hand-off still carries the CLI's words); the plugin row shows "Found at , but Kiro Crew will not run it: " with the fix command when one is known. Both failure diagnostics, and the credentials row's other CLI failures, render through ErrorNotice with the agent hand-off (a new failure slot on the row) instead of muted status text; "Not installed" stays status text. The row's own warning circle is its one triangle: ErrorNotice gains a showIcon opt-out (on by default, so every other notice is unchanged) for a notice nested in such a row. Four new catalog keys in all 12 languages, pseudolocale regenerated, translator context added.
  • kirocrew cloud doctor prints the same refusal and remedy.
  • Before the ownership command, the plugin row, kirocrew cloud doctor and the guide ask the user to reinstall the plugin from AWS first unless they installed it from AWS themselves. Making the tree root-owned makes whatever binary is in it an accepted receiver of AWS credentials, and the third account that owns the tree could have replaced that binary. The plugin row links AWS's Session Manager plugin install page under that sentence: the same page the guide and the gateway's not-installed message link.
  • remote-crew-on-ec2.md: a short troubleshooting entry for both rows.

Alternatives considered and not taken:

  • Matching the raw error text in the browser: the browser cannot tell a bare helper name from a path, and the CLI doctor would not benefit.
  • Reusing the shared refused set to report reasons: it can hold a stale pair for a file that has since been removed, so the row could report a refusal for nothing.
  • Offering the chown command for every ownership refusal: for a Homebrew prefix managed by another account it would hand that tree to root and break the package manager, so it is offered only for AWS's own package prefix.

Backwards compatibility

Compatible: the pre-flight response gains three fields and reachability_check gains one key; every existing field keeps its meaning, except that session_manager_plugin_command for a refused plugin is the fix rather than an install command that cannot fix it.

Removes nothing: no field, key, function or accepted input is removed or renamed; resolve_aws_tool_bin keeps its signature and result.

Tests

  • test_deploy_web_engine.py: the resolver reports this walk's refusals with their reason (and still returns a later accepted candidate); a refused pair left in the shared set for a removed file is not reported.
  • test_cloud_ssm.py: a refused plugin reports its path and reason; an absent or accepted plugin has no refusal; AWS's package tree owned by a third account gets the chown remedy; a trusted tree or a file outside the prefix gets none; a root-gateway, strict-policy, permission or unreadable-hierarchy refusal gets none even when the tree is third-account owned, with the root-gateway, strict and third-account cases driven through the real provenance check so its wording and the remedy's category cannot drift apart.
  • test_cloud_iam.py: an ENOENT for a bare helper sets credential_helper_missing and a note naming credential_process; an absolute path does not; both quote styles parse.
  • test_cloud_handlers.py: the pre-flight route returns the refusal and its remedy and never asks for the install command for a refused plugin.
  • test_cloud_cli.py: the doctor prints "found at ... but refused" with the fix, not "not found", and asks for an AWS reinstall before the command.
  • RemoteCrewPanel.test.tsx: the plugin row renders the refusal, the reinstall-from-AWS sentence before the fix command, a link to AWS's install page (href, new tab), and the fix command, and not "Not installed"; the credentials row names the helper and credential_process, with the CLI's error as a separate monospace line; each failure renders in an alert carrying the "Ask the agent" hand-off, and each failed row draws exactly one warning triangle.
  • ErrorNotice.showIcon.test.tsx: both variants draw the triangle by default; showIcon={false} drops it and keeps role="alert".

Red without the fix: reverting the source files leaves 14 of the new backend tests and the new frontend tests failing (reverting only the last round's dashboard change fails 4: both showIcon cases and both row tests); removing only the refusal-category guard leaves the 7 non-ownership refusal tests failing. Locally green: the five backend test files (250 passed), the wider cloud/deploy suites (416 passed), every website test file that renders RemoteCrewPanel or ErrorNotice (139 files, 5,058 passed), the i18n vitest suite against origin/main (776 passed), npm run i18n:check, typecheck, eslint, flake8, isort, mypy on the touched modules, the black gate, the comment-history gate, docs lint and the fast-gate scripts.

Manual verification

Rendered against the built SPA with fixture answers (website/scripts/capture-aws-preflight-honest.mjs, which asserts each claim before it writes a frame). Not exercised against a real macOS install of AWS's package; no Mac with that package is available here. The evidence for the third-account state is a user's report of a stock install refused as "owned by another user (uid 1501)". The command is offered only when the check on the user's own machine reports that same refusal and the tree's owners show it. The opt-in macOS test suite did not run on this pull request; the unit tests above ran on Linux.

Screenshots / video

Credentials row, helper not on the gateway's PATH:

credential helper missing, dark

Plugin installed but refused, with the known fix:

plugin refused with fix, light

Plugin refused, no known command:

plugin refused, no fix, dark

Other themes

credential helper missing, light

plugin refused with fix, dark

plugin refused, no fix, light

Related Issues

Part of a reported Remote Crew pre-flight gap: this covers the two misleading messages. Whether the AWS child should search more install directories is a separate decision and is not changed here.

Follow-ups: #20238 (the AWS CLI row reports a found but declined CLI as missing), #20239 (two wording changes that need fresh translations), #20389 (the refusal reason stays English in every locale), #20390 (say where the ownership command runs, that it asks for the administrator password, and that it changes only the plugin folder) and #20563 ("Ask the agent" drops an unsaved subnet or Identity Center entry).

Closes #20545 (link AWS's install page from the "reinstall it from AWS first" step), which this pull request now does.

Pattern harvest

Rule candidate: review-prompt
Pattern: a probe that collapses "found but refused by a check" into "not installed", so the remedy it offers cannot fix the state it reports.

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

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 13, 2026
@cruisercohen
cruisercohen force-pushed the fix/19457-aws-preflight-messages branch from df07c23 to 5607a02 Compare October 13, 2026 21:48
@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 0647b7a38cea7ed87248ae5f3b2aa602d29bf91f and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 0647b7a

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

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 0647b7a38cea7ed87248ae5f3b2aa602d29bf91f — 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: PASS

Before merge, confirm on a real macOS install that AWS's .pkg leaves /usr/local/sessionmanagerplugin owned by a non-root uid. The offered chown rests entirely on that claim.

What this change ships

Inventory (9 items) — 9 justified

Intent: a user setting up a Remote Crew gets told the real cause, and the fix, when the credentials row or the plugin row fails on a GUI-launched gateway. FIX.

  1. Credentials row names the missing credential_process helper and says to give it a full path — justified
  2. Plugin row says "Found at , but … will not run it: " instead of "Not installed" — justified
  3. For a refused plugin, the copyable command becomes the chown remedy (AWS package prefix only) or nothing, never the install command — justified
  4. Plugin row asks for a reinstall from AWS before the chown and links AWS's install page — justified
  5. All credentials-row failures, not just the helper case, now render through ErrorNotice with "Ask the agent" instead of muted text — justified
  6. ErrorNotice showIcon opt-out; it defaults on, and its only consumer (PrereqRow, two call sites) passes false — justified
  7. kirocrew cloud doctor prints the same refusal, reason and remedy — justified
  8. New resolve_aws_tool_bin_with_refusals / AwsToolRefusal; resolve_aws_tool_bin now delegates to it; ssm.py is its only caller — justified
  9. Guide troubleshooting entry, four catalog keys in 12 languages, a screenshot harness (757 sibling capture-*.mjs scripts) — justified

[FIRST-PRINCIPLES-REVIEWED] 0647b7a

Description read

[DESCRIPTION-READ] 5d24a40e0d1d50a0b3cb33d0c442ce839e3938141eb425e5ee7bcc0ea0b6ee3f

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

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 0647b7a38cea7ed87248ae5f3b2aa602d29bf91f — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 0647b7a

Verdict parsed from the review's SHA-scoped output markers for commit 0647b7a38cea7ed87248ae5f3b2aa602d29bf91f.

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

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Check whether a "reinstall from AWS first" sentence is enough warning before a sudo chown that makes a binary owned by a third account a trusted receiver of AWS credentials.

[DESIGN-REVIEWED] 0647b7a

Description read

[DESCRIPTION-READ] 1cdb90601444534314c96c6850c1f60837e96212a53d9574e5484fb75a95d256

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

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — 🟡 CONCERNS

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

UX-Verdict: CONCERNS

The no-fix plugin refusal ends at "Fix the file's ownership or permissions" with no way to do it, and both plugin variants paste the backend's raw reason mid-sentence.

Watch

  • The refusal without a command is a dead end. plugin_refused says "Fix the file's ownership or permissions, then re-check." but gives no command and no link (shots 03/06). The blind reader: "It tells me to fix something but doesn't say how… Here it's my only real way forward" (meaning "Ask the agent"). Every user who gets a root-gateway, strict-policy or permission refusal hits this, and nothing changes until they find the fix somewhere else. Fix: link the troubleshooting entry this PR adds to remote-crew-on-ec2.md, through the same failureLink slot.
  • The two plugin variants can't be told apart. Both splice the provenance check's raw {{reason}} into the sentence: "executable parent is owned by another user (uid 1501)" in one, "executable is owned by another user (uid 502)" in the other. The reader "can't tell whether these are two different problems or two stages of the same one" and flagged "uid" and "executable parent" as unknown words. The cause is the only thing that tells the user which variant they have, so it has to be readable. Fix: give each refusal category its own localized clause, such as "its install folder is owned by another account", and keep the raw reason as failureDetail the way the credentials row already does.
  • The whole instruction is set in danger red. The plugin row is a four-sentence red paragraph that mixes the diagnosis, a safety warning and the next steps (shot 02). The reader said it "makes me nervous". The reinstall caution is the decision-critical part, and it is buried in the middle. Fix: keep only the "Found at… will not run it" sentence as the alert. Render the reinstall-first sentence and the chown step as normal-weight text above the link and the command.

Suggestions

  • In credentials_helper_missing, cut the hedge "It is usually the program your profile's credential_process runs." so it reads "Replace {{name}} in your AWS config's credential_process line with its full path (for example, the output of which {{name}}), then re-check."

[UX-REVIEWED] 0647b7a

Description read

[DESCRIPTION-READ] 97fdc6456491eac28b6476393692e5cd1d0e37c104b9b7450f3fb190214a4c67

That sha256 names everything this verdict read: the PR description, plus the 9 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.

@cruisercohen
cruisercohen force-pushed the fix/19457-aws-preflight-messages branch from 5607a02 to 3289fc1 Compare October 13, 2026 22:20
@cruisercohen

Copy link
Copy Markdown
Contributor Author

Folded into the single commit (head 3289fc1):

  • Test fixtures, the capture script, a code comment and the guide example now use a generic placeholder helper name. Screenshots are recaptured to match.
  • UX review, path mismatch: when the ownership fix applies, the plugin row now names the resolved file inside the folder the command changes. Before, it named the bin-directory link. There is a new test, and it fails without the change.
  • First Principles review, remedy evidence: the description now cites the user-reported refusal on a stock AWS package install (executable is owned by another user (uid 1501)).

Not changed: naming the AWS config file in the credentials sentence, and more guidance for the no-command refusal. Both are advisory, and each needs a catalog string change in all 12 languages, so they are left for a follow-up.

@cruisercohen
cruisercohen force-pushed the fix/19457-aws-preflight-messages branch from 3289fc1 to 34eb80d Compare October 13, 2026 22:53
@cruisercohen

Copy link
Copy Markdown
Contributor Author

Folded into the single commit (head 34eb80d), answering the GPT 6.1 errors-use-error-notice finding:

  • The pre-flight row gains a failure slot that renders through ErrorNotice (inline, with the agent hand-off; the launch form on this tab persists its inputs, so the navigation loses nothing). It replaces the muted detail line when set.
  • The credentials row's failures (the missing-helper sentence with the CLI error under it, and any other CLI failure) and the plugin row's refusal now use that slot. "Not installed" stays status text, and the plugin row's clipboard-error notice is unchanged.
  • The two frontend tests now also assert each failure sits in an alert with the "Ask the agent" button; both fail against the previous head's component.
  • Screenshots in the description are recaptured to show the new rendering.

@cruisercohen

Copy link
Copy Markdown
Contributor Author

Notes on the advisory UX and First Principles concerns on 34eb80d (no code change in this reply):

  • The aws CLI row still reports a refused CLI as not found. Reading that refusal the way the plugin row now does is left for a follow-up, so this change stays on the two rows it fixes.
  • Saying which owner and permissions a refused plugin needs when no copyable fix is known, a "run this in Terminal" cue for the ownership command, and leading the credentials message with the fix each change a translated string in every locale, so they go in the same follow-up.
  • Every credentials-row CLI failure renders through the shared error notice because the repo's error-notice rule covers each reachable error branch of that row, not only the new one.
  • The ownership command is offered only for AWS's own install prefix. The evidence for that package's ownership is the stock-install refusal quoted in the description.

@cruisercohen
cruisercohen marked this pull request as ready for review October 13, 2026 23:48
@cruisercohen
cruisercohen requested review from a team and KiroCrewCaptain as code owners October 13, 2026 23:48
@cruisercohen
cruisercohen enabled auto-merge (squash) October 13, 2026 23:48
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Oct 14, 2026
bolichen97
bolichen97 previously approved these changes Oct 14, 2026

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

Readiness sweep: full diff read, PR Readiness success on this head, no live change requests.

Sensitive change review
Rule changed: none in acceptance. deploy/engine.py resolve_aws_tool_bin now delegates to resolve_aws_tool_bin_with_refusals, which runs the identical walk (same PATH-first lookup, same validate_provider_executable, same _REFUSED_AWS_BIN_DIRS add/discard) and only additionally returns this walk's refused (path, reason) pairs. Before->after: refused plugin reported as 'not installed' + install command -> reported as 'found at X but refused: reason' + (only when the realpath is under /usr/local/sessionmanagerplugin and some component is owned by a uid that is neither root nor the gateway euid) a displayed-but-never-executed 'sudo chown -R root:<wheel|root> /usr/local/sessionmanagerplugin'. Worst case if wrong: user is advised to root-own AWS's plugin tree so the provenance check then accepts a binary that a third account had placed; limited to AWS's own fixed package prefix, and requires the user's own sudo. Evidence checked: whole diff incl. engine.py refactor (return values only, delegating wrapper keeps signature/result), ssm._plugin_ownership_remedy chain check, handler never calls install command for a refused plugin, tests in test_deploy_web_engine/test_cloud_ssm/test_cloud_handlers/test_cloud_iam; the credential_process regex only extracts a bare name from stderr and adds no execution. No secret exposure: detail was already returned (truncated 300). Undo: revert the squash commit.

Undo: revert the squash commit.

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

REQUEST_CHANGES at 34eb80d. The proposed privileged remedy can leave the actual refusal unchanged. session_manager_plugin_refusal selects an ownership remedy without passing the refusal reason. The helper then decides only from the package path's owners. But root-gateway execution is refused before ownership checks. An ownership change cannot clear that refusal. Offer a remedy only for the matching, actionable refusal category. Keep the trust validator intact and test unrelated root/strict-policy refusals. Also link the accepted CLI-row and translated-copy follow-ups. The packaged-macOS verification question still needs evidence. Credential and executable-trust changes require human review. No ownership command, AWS operation or tests were executed locally. — crew-pr-reviewer (r99)

@cruisercohen

cruisercohen commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks. Your 09:26 review on 34eb80d is addressed on 0673078. That is a second commit on top, with no force-push.

  1. The remedy only follows the matching refusal. session_manager_plugin_refusal now passes the check's reason to _plugin_ownership_remedy. The command is offered only when the reason is the check's third-account ownership refusal ("... is owned by another user (uid N)") and the tree's owners show that state. For any other reason, the row shows the reason and no command. Covered cases: a root gateway, the strict policy ("not root-owned", "writable by the gateway user"), a world-writable component and an unreadable hierarchy. The trust check itself is unchanged.

  2. Root and strict-policy tests. New tests in test_cloud_ssm.py:

    • five parametrized refusal reasons, each with the tree in the third-account state, each expecting no command;
    • three tests that run the real provenance check: a root gateway gets no command, the strict policy gets no command, and the third-account refusal still gets the command. Because they use the check's own wording, a wording change that broke the match would fail here.

    With only the new guard removed, the 7 non-ownership tests fail. With it restored, test_cloud_ssm.py, test_cloud_handlers.py, test_cloud_cli.py and test_source_providers.py pass (839).

  3. Follow-ups are linked in the description: Remote Crew AWS pre-flight: report a found but declined AWS CLI instead of not installed #20238 (the AWS CLI row still reports a found but declined CLI as missing) and Remote Crew AWS pre-flight: name the AWS config file and point to the guide in two messages #20239 (the two wording changes that need fresh translations).

  4. macOS: I have no Mac with AWS's package to run on. The opt-in macOS suite did not run on this pull request, so there is no macOS run to cite. The evidence for the ownership state is a user's report of a stock install refused as "owned by another user (uid 1501)". The description now says this plainly. The narrower condition in point 1 means the command appears only when the user's own machine reports that refusal.

No copy changed in this commit, so no translations moved.

CI: the Frontend Tests (2) failure on 0673078 came from main (ChatEmbed.optimisticSend.test.tsx; this pull request touches no ChatEmbed file). After #20212 merged, I rebased onto main with no change to either commit (range-diff identical); the new head is 0aa99ce, and Frontend Tests (2) passes on it. GPT 6.1 Review passed with no blocking findings.

@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 Oct 14, 2026
@cruisercohen
cruisercohen force-pushed the fix/19457-aws-preflight-messages branch from 5014bfc to 0647b7a Compare October 15, 2026 00:27
@cruisercohen

Copy link
Copy Markdown
Contributor Author

@iamwhatever your r101 hold on 5014bfc65d, point by point. The new head is 0647b7a38c; the change is folded into the second commit (still two commits).

  1. UX Review CONCERNS:
    • "Reinstall it from AWS first" has no link: fixed. The plugin row now links AWS's Session Manager plugin install page under that sentence, the same page the guide and the gateway's not-installed message link. The label is a new catalog key in all 12 languages (pseudolocale and translator context updated). The panel test checks the link's href and that it opens in a new tab. That makes Remote Crew AWS pre-flight: link AWS's plugin install page from the reinstall step #20545 redundant: this pull request now closes it.
    • Two alarm icons and an all-red wall of text: fixed, not rebutted. My earlier reply was wrong: the inline notice in these rows is new in this pull request, not an existing pattern. Each failed row now draws one warning triangle, its own status circle. ErrorNotice gains a showIcon opt-out, on by default so no other notice changes. The credentials row leads with the sentence and puts the AWS CLI's own error under it as a smaller monospace line, using ErrorNotice's existing title with messagePlacement="below", so "Ask the agent" still carries the CLI's words. Tests pin one triangle per failed row and the separate monospace line, and a new ErrorNotice test covers showIcon in both variants. The three screenshot pairs in the description are re-captured from this head. The harness now also asserts the link and the single triangle.
    • The other three UX items stay deferred to Remote Crew AWS pre-flight: name the AWS config file and point to the guide in two messages #20239 and Remote Crew AWS pre-flight: show the plugin refusal reason in the dashboard's language #20389, as in my earlier dispositions. UX Review re-runs on this head, and I'll post a target=ux disposition for each item it raises there.
  2. Packaged-macOS verification stays with a maintainer who has a Mac.
  3. A maintainer still needs to review the credential and executable-trust change.

Local checks on this head:

  • The 139 website test files that render RemoteCrewPanel or ErrorNotice pass (5,058 tests).
  • The i18n suite passes against origin/main (776 tests), as do i18n:check, typecheck, eslint and the comment-history gate.
  • The new assertions fail on 5014bfc65d.

Your r99 change request on 34eb80da03 is still this pull request's review decision. Your r101 note says its asks are met, so could you dismiss it?

@cruisercohen

Copy link
Copy Markdown
Contributor Author

For refusal reasons other than a third-account owner of AWS's folder, no single command is known to be safe, so the row names the reason and stops. "Ask the agent" stays on that row as the way forward.
A pointer from that row to the guide's troubleshooting entry is item 2 of #20239 (deferred-finding, owned, dated). It changes a translated string in every locale.

@cruisercohen

Copy link
Copy Markdown
Contributor Author

The reason is the gateway's provenance check text, in English. #20389 (deferred-finding, owned, dated) returns a stable code with it and renders each code from a translated key, with the owning account's name where the gateway can resolve it.
The two variants already differ in their remedy: the fix variant offers the copyable command and the install-page link, the other does not.

@cruisercohen

Copy link
Copy Markdown
Contributor Author

This head already takes the second triangle out of the row and moves the AWS CLI's raw error to its own monospace line. Splitting the plugin row's sentence into a diagnosis in the alert and plain instructions beside the command changes the translated sentence in every locale.
#20390 (deferred-finding, owned, dated), which already adds a line beside the command, now carries that split, so the caution and the steps change together.

@cruisercohen

Copy link
Copy Markdown
Contributor Author

Rewording that message is item 1 of #20239 (deferred-finding, owned, dated), which now also asks to drop the hedge and to offer a way to find the full path.
It changes a translated string in every locale, so it lands with the other wording change there.

@cruisercohen

Copy link
Copy Markdown
Contributor Author

Correct: the subnet and Identity Center drafts are component-local state, and the row's existing action-failure notice on main already hands off the same way. Removing the hand-off from the new notices would leave a refusal with no command without its only way forward.
#20563 (deferred-finding, owned, dated) proposes persisting those drafts like the profile and region, which fixes every hand-off in the panel at once, and correcting the comments.

@cruisercohen

Copy link
Copy Markdown
Contributor Author

Notes on the two PASS punchlines on 0647b7a38c (no code change):

  • Design asks whether "reinstall it from AWS first" is enough warning before a sudo chown that makes a third-account-owned binary a trusted receiver of AWS credentials. The command is offered only for the provenance check's third-account refusal, for a file inside AWS's own package prefix, and the trust check itself is unchanged. The sentence now links AWS's install page, so the reinstall is one click away. Whether a stronger gate is needed (no command at all, or a reinstall-only remedy) is a maintainer call, and it goes with the human review this change is held for.
  • First Principles asks to confirm on a real macOS install that AWS's .pkg leaves /usr/local/sessionmanagerplugin owned by a non-root uid. That is the packaged-macOS check: it stays with a maintainer who has a Mac.

The four UX items and the GPT 6.1 finding on this head each have their own disposition, deferred to #20239, #20389, #20390 and #20563.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Oct 15, 2026

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

Checks green and readiness passed at 0647b7a; no behavior change.

@iamwhatever

Copy link
Copy Markdown
Contributor

HOLD at 0647b7a. Reserved for human review: this changes executable-trust and credential diagnostics (cloud/ssm.py, deploy/engine.py, cloud/iam.py).

The r101 items are addressed. The plugin row now links AWS's install page under "reinstall it from AWS first", each failed row draws one icon, and every current-head UX and GPT 6.1 item has its own disposition. The chown remedy is still offered only for the third-account ownership refusal inside AWS's package prefix (ssm.py L296-L329). #20239, #20389 and #20390 are linked in the description and match their items. CI is green.

Still open:

  1. The GPT 6.1 finding ("Ask the agent" drops an unsaved subnet or Identity Center draft) is deferred to Remote Crew set-up: Ask the agent drops an unsaved subnet or Identity Center entry #20563, which matches it, but Remote Crew set-up: Ask the agent drops an unsaved subnet or Identity Center entry #20563 is not linked in the PR description. Please add it to the Follow-ups line.
  2. A maintainer needs to review the credential and executable-trust change, including the Design question of whether a reinstall sentence is enough warning before the sudo chown.
  3. Packaged-macOS behavior (AWS's .pkg leaves the tree owned by a non-root uid) is still unverified.

Auto-merge is armed. Our r99 change request (on 34eb80d) is what blocks it today. The existing approval says "no behavior change", which does not describe this diff, so it should not stand in for the security review.

— crew-pr-reviewer (r103)

@cruisercohen

Copy link
Copy Markdown
Contributor Author

Follow-ups now lists #20563 for the "Ask the agent" finding. The maintainer review of the credential and executable-trust change and the packaged-macOS check stay with a maintainer.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: passed Eligible automated validation passed for the current revision and removed readiness: passed Eligible automated validation passed for the current revision readiness: action required A blocking check or review needs attention labels Oct 15, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor

Still holding at 0647b7a for a maintainer: this changes executable-trust and credential diagnostics (cloud/ssm.py, deploy/engine.py, cloud/iam.py).

The last open author item from r103 is done: #20563 is now on the Follow-ups line, and #20238, #20239, #20389, #20390 and #20563 are all open and match their deferred items. Every current-head AI item has a disposition.

What is left is for a maintainer:

  1. Review the credential and executable-trust change, including the Design question of whether "reinstall it from AWS first" is enough warning before the sudo chown (
    def _plugin_ownership_remedy(candidate: str, reason: str) -> str:
    """``sudo chown -R root:<group> <prefix>`` when a third account owns AWS's install tree.
    Offered only when *reason* is the provenance check's third-account ownership
    refusal, the candidate resolves inside :data:`_AWS_PKG_PLUGIN_PREFIX`, and some
    directory or file on the way from that prefix to the binary is owned by an
    account that is neither root nor the gateway user: exactly the state a stock
    AWS ``.pkg`` install leaves, and one that making the tree root-owned clears.
    Anything else returns "" and the caller shows only the reason, rather than a
    command that would not fix it.
    """
    if not _THIRD_ACCOUNT_OWNER_REFUSAL.search(reason):
    return ""
    geteuid = getattr(os, "geteuid", None)
    if geteuid is None:
    return ""
    try:
    prefix = Path(os.path.realpath(_AWS_PKG_PLUGIN_PREFIX))
    real = Path(os.path.realpath(candidate))
    except OSError:
    return ""
    if prefix not in real.parents:
    return ""
    allowed = {0, geteuid()}
    chain = [prefix, *[p for p in reversed(real.parents) if prefix in p.parents], real]
    for component in chain:
    try:
    owner = component.stat().st_uid
    except OSError:
    return ""
    if owner not in allowed:
    group = "wheel" if platform.system() == "Darwin" else "root"
    return f"sudo chown -R root:{group} {_AWS_PKG_PLUGIN_PREFIX}"
    return ""
    ).
  2. Confirm on a real macOS install that AWS's .pkg leaves /usr/local/sessionmanagerplugin owned by a non-root uid.

Auto-merge is armed. The current approval says "no behavior change", which does not describe this diff, so it should not count as that security review. Our earlier r99 change request on 34eb80d is still the active review decision; its asks are met, and it is the only thing stopping auto-merge today.

Reviewed head: 0647b7a

— crew-pr-reviewer (r104)

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.

Remote Crew AWS pre-flight: link AWS's plugin install page from the reinstall step

4 participants