Skip to content

fix(aws-control): name the region searched when no drive is found - #24892

Merged
KiroCrewCaptain merged 1 commit into
mainfrom
crew/issue-triage/fix-24887-drive-region-notice
Oct 27, 2026
Merged

KiroCrewCaptain merged 1 commit into
mainfrom
crew/issue-triage/fix-24887-drive-region-notice

Conversation

@iamwhatever

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: When AWS Control finds no drive, it tells the owner which AWS region it searched, so a drive created from a profile in another region is not mistaken for "no drive".

The AWS Control drive is one per account, but find_drive asks the tagging API in one region only: the profile's region. A second install whose profile points at another region sees "no drive yet", and its setup card offers to create a second drive in the same account. Nothing in the status or the refusal says that only one region was searched.

Why it matters

An owner with two installs in one account can end up with two drives without knowing it, and backups then land in different buckets depending on which install ran them. Today the "no drive" state gives them no hint that a drive may exist in another region.

Not a goal

What changed (motivation → approach → change)

The decision on #24887 was option C: keep the one-region lookup and say which region it covered.

Where "No drive" result
Drive status (routes_parts/drive.py) {"exists": false, "searched_region": "<region>"}
_require_drive refusal (drive_missing) message names the region
Library and share listings (routes_parts/library.py, routes_parts/drive_writes.py) message names the region
Backup runner (backup.py) error names the region

storage_drive.py gains searched_region(region), which find_drive uses for its --region argument, so the region reported is always the one queried (the default region when the profile has none). no_drive_message(region) builds the text, keeping the existing "no drive yet" phrase that other readers match. The storage.py facade serves both names. Error codes and the frontend are unchanged.

The full fix is still open: option A on #24887 (one s3api list-buckets --prefix kirocrew-drive- call, adding s3:ListAllMyBuckets to the drive policy) would find the drive in any region. That is the maintainer's call.

Backwards compatibility

Compatible: the status payload gains one field and the refusal messages gain words; every code, status and existing field is unchanged, and the "no drive yet" phrase readers match is kept.

Removes nothing: no route, field, code or check is removed.

Tests

  • test_no_bucket_reports_exists_false: the status payload is {"exists": False, "searched_region": "us-west-2"}.
  • test_an_empty_profile_region_reports_the_region_discovery_used: an empty profile region reports the default region discovery queried.
  • test_list_refuses_when_no_drive_exists: the drive_missing refusal names us-west-2.

Proof: not provable -- other: prove.py's throwaway tree errored at collection on this host for a sibling PR, so I ran two hand mutants instead. Dropping the region from no_drive_message turns test_list_refuses_when_no_drive_exists red; dropping searched_region from the status payload turns test_no_bucket_reports_exists_false red.

Scoped runs: test/test_aws_control_routes.py, test/test_aws_control_app.py, test/test_aws_control_backup_job.py, test/test_aws_control_hooks.py, test/test_campaign_facades_base_public_names.py (403 passed) and test/test_aws_control_routes_*.py (121 passed). flake8, isort, black, mypy, comment-history and brand checks are clean on the changed files.

Manual verification

N/A — unit coverage sufficient: the change is message text and one payload field on paths fully driven through stubbed discovery; no AWS call or UI changed.

Related Issues

Closes #24887

Related: #24820 / PR #24866 (the same one-region lookup in the personal publish drive).

Sibling sweep

Swept: git grep -n "no drive yet" -- src/kiro_crew/apps/builtins/aws_control
Sibling: src/kiro_crew/apps/builtins/aws_control/backend/routes_parts/drive.py -- changed here
Sibling: src/kiro_crew/apps/builtins/aws_control/backend/routes_parts/drive_writes.py -- changed here
Sibling: src/kiro_crew/apps/builtins/aws_control/backend/routes_parts/library.py -- changed here
Sibling: src/kiro_crew/apps/builtins/aws_control/backend/backup.py -- changed here
Sibling: src/kiro_crew/apps/builtins/aws_control/hooks.py -- not affected -- a log line for the nightly skip, never shown to the owner

Pattern harvest

Rule candidate: review-prompt
Pattern: an account-scoped resource discovered through a region-scoped API without saying which region was searched.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title
  • 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

@iamwhatever
iamwhatever requested review from a team and KiroCrewCaptain as code owners October 27, 2026 14:24
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision bceed17fbd6c1605046386e4d85684e49f37bfde touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of bceed17fbd6c1605046386e4d85684e49f37bfde — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: the change only adds a payload field and longer messages, and it can be reverted cleanly.

Notes

  • The setup card can still lead an owner to create a second drive, and this PR does not change what it shows. searched_region is added to the status payload, but website/src/apps/aws-control/types.ts:164 still types that case as { exists: false }, and the PR excludes frontend changes. So the card that offers "create" says nothing about the region, and only the refusal messages from list, library and backup name it. Showing the region on the setup card, or on the create confirmation, is the follow-up that actually prevents the duplicate.

[DESIGN-REVIEWED] bceed17

Description read

[DESCRIPTION-READ] c35a10fb312c8cd86acd03bfa45f5041f8182e5709c01d409190204476d3dd3d

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

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of bceed17fbd6c1605046386e4d85684e49f37bfde — 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 does not.

First-Principles-Verdict: PASS

The new status field has no reader. The setup card, which the description names as where the harm happens, still renders from { exists: false } and shows no region.

Notes

  • Item 1 — zero consumers: "searched_region": storage_mod.searched_region(region) is never read by the website. website/src/apps/aws-control/types.ts:164 types the arm as { exists: false }, and the PR declares "Not a goal: … any frontend or i18n change". So the "setup card offers to create a second drive" path still tells the owner nothing (0 of 0 frontend reads of searched_region). Subtraction: delete the field from _handle_drive_status and its test until a reader ships.
  • Item 2 — symptom-level: the frontend replaces the drive_missing text with an i18n string (DrivePageBackup.tsx:43 → backup_start_no_drive), so the owner never sees the region-bearing 409 text. Only the listing, share and backup-runner error strings can reach a person. Subtraction: none smaller.

What this change ships

Inventory (5 items) — 3 justified

Intent: stop an owner from creating a second drive because "no drive" did not say only one region was searched. FIX.

  1. Drive status payload gains searched_region when no drive exists — zero consumers
  2. drive_missing 409 refusal names the searched region — symptom-level (frontend shows its own i18n text)
  3. Library and share listing errors name the searched region — justified
  4. Backup runner's "no drive" error names the region — justified
  5. New searched_region/no_drive_message helpers; find_drive queries through searched_region — justified

[FIRST-PRINCIPLES-REVIEWED] bceed17

Description read

[DESCRIPTION-READ] e147b43a3fb679f15f961d51a029b5b86e003b1249fb7c13e9eca5a582da9813

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

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] bceed17

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

False positive or not applicable? A repository writer can comment:
/ai-review override fable bceed17fbd6c1605046386e4d85684e49f37bfde false-positive: <reason, 20 to 500 characters>

@github-actions

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] bceed17

False positive or not applicable? A repository writer can comment:
/ai-review override gpt bceed17fbd6c1605046386e4d85684e49f37bfde false-positive: <reason, 20 to 500 characters>

@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 27, 2026

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

Approving bceed17.

The region reported is the region actually queried: searched_region() is the same expression find_drive passes to --region, and the empty-profile case resolves to DEFAULT_REGION. Error codes and statuses are unchanged; only the advisory error prose and one status field change, which matches the error-handling spec's code-plus-advisory-text contract. No new catalog strings are needed: the dashboard branches on code (drive_missing → backup_start_no_drive), and the places that render the prose verbatim (remoteError, the backup_failed reason) already passed the old English text through.

Verified locally: aws_control routes, backup job, hooks and facade tests pass (337). Removing the region from the message, dropping searched_region from the status payload, or dropping the default-region fallback each turns a test red. CI is green on this head (92 pass, 14 skipped).

Non-blocking follow-ups:

  • No UI reads searched_region yet. The no-drive setup card is where an owner would create a second drive, and it still doesn't say only one region was searched; rendering the field there (with catalog keys in every locale) would finish option C from the user's side.
  • Closes #24887 closes the issue while account-scoped discovery (option A) is still open. Consider Refs #24887 or a follow-up issue for option A.
  • docs/system-specs/modules/aws-control.md § "Several installs, one drive" says every install pointed at the account finds the same bucket; that is only true within one region.
  • The backup runner's new message isn't pinned by a test; reverting it to the old text keeps the suite green.

@KiroCrewCaptain
KiroCrewCaptain merged commit f6e1322 into main Oct 27, 2026
107 checks passed
@KiroCrewCaptain
KiroCrewCaptain deleted the crew/issue-triage/fix-24887-drive-region-notice branch October 27, 2026 16:08

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Tier 1 auto-approve: fix (7 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: names the one region drive discovery searched when no drive is found, in the status reply and every drive-missing message; with tests.

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.

AWS Control drive: one per account, but its bucket is found per region, so a second install in another region creates a second drive

3 participants