Repository navigation
feat(aws-control): report a snapshot nightly granted on a non-default account - #22660
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. The change adds a reporting field only. It applies the sessions-kind pattern that is already in place, has a safe default when the field is absent, and the screenshot shows the new notice. Notes
[DESIGN-REVIEWED] df41340 Description read[DESCRIPTION-READ] 1647105555d86d15d3c111df285f0038dc75b884f3d4f54d07a07f984431a93e That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. One small wrapper exists only to look like the sessions version. Notes
What this change shipsInventory (6 items) — 5 justifiedIntent: tell operators when a nightly snapshot they turned on can never run, because they turned it on for a non-default account. ADDITION (reporting only; which account the schedule visits does not change).
[FIRST-PRINCIPLES-REVIEWED] df41340 Description read[DESCRIPTION-READ] 0528aa503755665e64fb7d4d1633271be799ad3840c59c16de6c30d6327efb74 That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks. The blind reader read the new notice correctly: "the nightly switch, even though it's on, does nothing for the account I'm using." It says what is happening and offers a next step. Notes
[UX-REVIEWED] df41340 Description read[DESCRIPTION-READ] 014cf677dcdf9b7ada80aeab145c108ddd0a2151c8030b4a10908556c3f66240 That sha256 names everything this verdict read: the PR description, plus the 5 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
30e13d9 to
b5cafbd
Compare
|
self-added: no
|
|
|
|
b5cafbd to
60921ac
Compare
… account The nightly snapshot grant is recorded per account by set_nightly while the loop resolves one account, so switching it on while viewing a non-default account reads back on and never runs. The sessions kind already reports this; the snapshot kind had no equivalent, so a granted-and-idle snapshot nightly was silent. Mirror the sessions pattern for the snapshot kind: scheduled_snapshot_blocked_code (its one condition is other_account; due_for_nightly is unchanged), a nightlyBlocked status field computed with the same scheduled_account comparison, and a notice rendered under the snapshot switch with its own console string across the locale catalogues. Closes #12374
60921ac to
df41340
Compare
buluoray
left a comment
There was a problem hiding this comment.
🤖 Kiro Crew Auto-Pipeline [operator: buluoray]:
Approving at df41340.
This closes a silent gap: a nightly snapshot switched on while viewing a non-default account read back as on, but the nightly loop only ever visits the default account, so nothing was backed up. The status route now reports nightlyBlocked: other_account beside the grant using the same default-account comparison as nightlySessionsBlocked, and the panel shows a warn line under the snapshot switch. Main does not have this yet, and #12374 is still open.
Checked: flipping the snapshot scheduled_account comparison in routes_parts/backups.py reddens test_the_scheduled_account_gets_no_snapshot_account_notice and test_the_status_payload_says_when_the_snapshot_grant_is_on_the_wrong_account. The frontend test was not run locally; CI frontend shards are green on this head.
Non-blocking follow-up: in DrivePageBackup.tsx, an unrecognised nightlyBlocked code makes nightlyBlockedText return null, but the generic "You can still start the backup yourself." line still renders on its own. The description says an unknown code shows nothing. Gating the whole block on a non-null nightlyBlockedText(...) would match that.
iamwhatever
left a comment
There was a problem hiding this comment.
Approve at df41340.
A nightly snapshot switched on while viewing a non-default account read back as on but never ran, because the nightly loop only visits the default account. The status route now returns nightlyBlocked: other_account using the same default-account comparison as nightlySessionsBlocked (backups.py#L146-L149), and the panel shows a warning under the snapshot switch only while that grant is on (DrivePageBackup.tsx#L609). The change is additive, an older backend reads as not blocked, all checks on this head are green, and the branch merges cleanly with current main.
AI findings judged non-blocking
- Design (note):
default_account_id()is awaited twice per request (L148, L175). A change between the two reads only shows a stale notice until the next refresh. - First Principles item 3: inline the one-line predicate. The author's rebuttal (unit-test seam, symmetry with the sessions predicate) holds; this is a size preference (nightly.py#L640).
- UX notes: name the default account and tighten the spacing. Both are copy/layout choices shared with the existing sessions notice on the same panel (DrivePageBackup.tsx#L609).
Minor, non-blocking: an unrecognised nightlyBlocked code would still render the generic next-step line on its own (DrivePageBackup.tsx#L96). No backend sends another code today.
I read the diff, the tests and CI results; I did not run anything locally.
— crew-pr-reviewer (r138)
Problem / Motivation
Goal: Tell the operator when a nightly snapshot they switched on will never run because it is granted on an account the schedule does not visit.
Turning on the nightly snapshot records the grant per account, but the nightly loop only ever runs against the resolved default account. So an operator who turns it on while viewing a non-default account gets a switch that reads back on and a schedule that never visits it. The sessions kind already explains this silence; the snapshot kind had no equivalent, so a granted-and-idle snapshot nightly said nothing.
Why it matters
The loss only surfaces at the one event the backup exists to survive: the operator believes nightly snapshots are protecting the account, the host is lost, and there is no archive. A console that can only show the grant as "on" is making a promise the schedule never keeps.
Not a goal
other_accountcondition.What changed (motivation → approach → change)
The sessions kind solved this exact silence (#12190): a blocked-code predicate, a status field beside the grant, and a console string. The snapshot kind is the one surface that pattern was not extended to, and every shape question was already settled there, so this mirrors it.
In
src/kiro_crew/apps/builtins/aws_control/backend,backup_parts/nightly.pygainsscheduled_snapshot_blocked_code(*, scheduled_account)returningother_accountorNone— its one condition, since no capability or redaction gate applies to the snapshot kind — re-exported throughbackup.py.scheduled_accountis required with no default:due_for_nightlyreads nothing here and is unchanged, so the only caller is the per-account status route, which always answers explicitly.routes_parts/backups.pyadds anightlyBlockedstatus field computed with the samescheduled_account == defaultcomparison the sessions field uses. Inwebsite/src/apps/aws-control,DrivePageBackup.tsxrenders the notice under the snapshot switch andtypes.tscarries the new field; the switch maps only the oneother_accountcode and shows nothing for an unknown one, so no unused fallback string is added. The console string goes into every catalogue underwebsite/src/i18n/locales(en-XA regenerated), anddocs/system-specs/modules/aws-control.mddocuments the snapshot mirror.Backwards compatibility
Compatible: the new backend function and the
nightlyBlockedstatus field are additive;due_for_nightlyand every existing field are untouched. An older frontend ignores the new field, and an older backend omits it — the panel reads an absentnightlyBlockedas "not blocked", the safe direction.Removes nothing: no path, record, key or function is removed, renamed or narrowed.
Tests
test_aws_control_nightly_snapshot_blocked.py: the blocked code answersNonefor the default account andother_accountfor a non-default one; the code carries no prose; the snapshot kind reports neither the host nor the redaction block even when both would block the sessions kind; anddue_for_nightlyis unaffected by the account condition.test_aws_control_routes_backup.py: the status payload carriesnightlyBlocked: other_accountfor a grant on a non-default account andnullfor the default one, each beside an unchanged grant.DrivePage.errorSurfaces.test.tsx: the notice renders under the snapshot switch only when the grant is on andnightlyBlockedis set, stays absent when the grant is off or nothing is in the way, and an older backend omitting the field shows no block.test_aws_control_backup_composition_contract.py: the new export is added to the facade's frozen inventory.Manual verification
Captured the backup panel in both states against a Vite dev server with the API stubbed (no gateway, no credentials, no real AWS). See Screenshots.
Screenshots / video
The snapshot switch granted on the default account — no notice, the healthy baseline:
The same switch granted on an account the schedule does not visit — the new notice renders in warn colour directly under it:
Related Issues
Closes #12374