Skip to content

feat(aws-control): carry transcripts in the nightly under their own consent bit - #12190

Merged
iamwhatever merged 1 commit into
mainfrom
fix/nightly-transcript-backup-11560
Sep 21, 2026
Merged

iamwhatever merged 1 commit into
mainfrom
fix/nightly-transcript-backup-11560

Conversation

@chenmingwei23

@chenmingwei23 chenmingwei23 commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

The nightly backup loop (aws_control/hooks.py, _run_once) pushed the memory
and workspace snapshot and nothing else. Conversation transcripts -- the data
home's sessions/ tree and the kiro-cli session store -- were never scheduled.
The archive that carries them, backup.run_sessions_backup, was already complete
and already shipping; it just had no caller but an owner pressing a button. So an
install with nightly backups enabled woke every day, uploaded 22 MB of memory,
and left the work itself unprotected.

Issue #11560 deferred this behind three prerequisites. Each was measured against
current main (e8b94aaef) before any code was written, and each is settled
here without inventing policy:

  1. A separate consent bit. Required, and the issue already prescribes it.
    nightly authorizes uploading memory; asking it to also authorize uploading
    every conversation the agent was ever shown would mean an operator who
    answered one question had silently answered a different one. This adds
    nightly_sessions, default off, read fail-closed, never inferred from
    nightly in either direction.
  2. A size strategy. The scheduled path calls run_sessions_backup with the
    same arguments the owner-triggered job passes, so the payload and the
    _PUSH_TIMEOUT_SECS budget are byte-for-byte the ones that already ship.
    Scheduling introduces no new size exposure, and adding a ceiling here would be
    a NEW refusal on an existing path -- a changed default, and the wrong change to
    fold into this one.
  3. A redaction posture, declared. Stated explicitly in the module spec: the
    nightly carries both session halves exactly as the owner-triggered archive
    carries them, byte-exact and unredacted, because it IS that function. Whether
    that posture is right for the archive is a question about the archive, tracked
    on Sessions archive carries Layer B with no opt-in gate (asymmetry with file-export triple gate) #11559; the scheduler inherits whatever that path decides, automatically,
    because there is no second copy of the logic to drift.

So this change decides one thing -- that a second, narrower grant exists -- and
deliberately decides nothing about what the archive contains.

Why it matters

Losing a host loses the conversations. That is the incident the off-host backup
exists for, and it was the one part a schedule never covered: protection depended
on somebody remembering to press a button, which is exactly the dependency a
nightly removes for memory.

The consent shape is what makes it safe to schedule. The new bit is strictly
narrower than the owner-triggered route's gate, never wider: an operator who
wants nightly transcripts has to say so, on its own switch, and every existing
install stays off after upgrading.

What changed

The grant. backup.nightly_sessions_enabled / set_nightly_sessions read
and write their own key. An absent key answers False, and an unreadable state
file answers False, for the reason nightly_enabled already gives: a corrupt
file must never be the reason an unattended upload starts.

The window. backup.due_for_sessions_nightly keys due-ness on the
KIND_SESSIONS run stamp, so a snapshot that ran an hour ago does not make the
transcripts look backed up. The 23-hour stamp reasoning moved into
_a_day_since_last_run, shared by both kinds and byte-identical to what
due_for_nightly did before; the consent question stays at each call site, so a
future kind cannot inherit another kind's grant by calling a helper that already
answered it. A platform without descriptor-pinned traversal is never due:
run_sessions_backup refuses there, so scheduling it would record a failed run
and audit a failure every half hour for a payload that platform cannot produce.

The loop. _run_once reads both due-checks and proceeds when EITHER is due,
so a snapshot that already ran today no longer swallows the transcript window.
Each kind is pushed through _push_nightly with its own try/except and its own
audit subject (backup/snapshots, backup/sessions): one kind failing costs the
other nothing, and an incident review can tell which bytes left the host. The
pre-push failure audit is unchanged, subject and message included.

The surface. POST /backup/{account}/nightly-sessions and a
nightlySessions field on the status payload. Its own route, not a second field
on the snapshot toggle's body, so one request can never carry both grants. Both
toggles now share one validated implementation (_toggle_nightly), since the
non-boolean refusal and the persist-failure posture are the same decision and
must not drift. The console renders a second switch under the first, off by
default, with a hint that says what the archive carries.

The shared-drive notice still costs exactly one paid LIST: one prefix answers
"does another install write here", however many kinds the nightly pushes. That
test's rationale was reworded where the change falsified it.

The grant is settable on every registered account while the nightly loop runs for
the one the registry default names, so "granted" and "will run" are separate
answers and the console now carries both. The status route compares its target
against accounts.default_account_id -- the account half of the loop's own
resolution, so the two cannot disagree about which account is scheduled -- and
reports other_account; the panel says so beside the switch, which keeps reading
back exactly as the owner set it. Without it a grant recorded on a second account
is authorized and unreachable at once, and the operator finds out at the host loss
this feature exists to survive. A host that cannot produce the archive outranks
the account, because naming the account would send them to a page carrying the
same notice. The next-step sentence is dropped for that host condition: the manual
run answers the capability question the same way and refuses, so offering it there
names a click that fails.

Tests

test/test_aws_control_nightly_sessions.py is new: 15 tests over the grant, the
window and the loop. Route and payload cases were added to
test_aws_control_routes.py, the new route to the pinned inventory in
test_aws_control_app.py, and four frontend cases to DrivePage.test.tsx plus
one to api.test.ts.

Eleven mutations were applied and each was killed by its named test:

mutation test that reddened
the transcript grant reads the snapshot bit test_the_snapshot_grant_does_not_authorize_transcripts
the window is keyed on the snapshot stamp test_a_snapshot_run_does_not_close_the_transcript_window
the capability guard is dropped test_a_platform_that_cannot_pin_the_traversal_is_never_due
the wake proceeds on the snapshot window alone test_a_due_transcript_window_pushes_the_sessions_archive
the transcript push is dropped from the loop test_a_due_transcript_window_pushes_the_sessions_archive
both kinds audit under one subject test_the_transcript_push_is_audited_under_its_own_subject
the route answers under the snapshot field test_the_transcript_toggle_flips_only_the_transcript_bit
the status payload folds both grants into one read test_the_status_payload_reports_the_transcript_grant_separately
the switch reads the snapshot grant the transcript switch is its own grant
the row's mutation calls the snapshot endpoint the transcript switch is its own grant
the api call posts to /nightly backupNightlySessions POSTs to its own endpoint

Run locally: the four aws-control backend files (454 passed) plus the new file
(15 passed), then 473 passed together; DrivePage.test.tsx + api.test.ts (241
passed); the whole src/i18n/ suite (692) after regenerating en-XA.json;
tsc -b clean; check-i18n-keys.mjs clean. Repo gates run green: black,
isort, flake8, mypy, subprocess-encoding, comment-history, brand-name,
harness-parity, feature-map, changelog-history, focus-cue, memory-store-seam,
loop-bound-locks, sync-io-in-async, acp-frame-host-data, lockdown-before-publish,
builtin-skill-scope, testpaths-coverage, vendor-manifest, docs-lint, eslint,
phantom-classes, i18n:check, i18n:render, jscpd, bundle-size, chunk-cycles.

Two measurements need their base stated. The backend runs above were taken at
e8b94aaef, the tip when this branch was cut. Current main cannot COLLECT the
Python suite at all -- sandbox.py's module-level leaf-set assertion fails on
import under the test harness, so every backend shard exits 4 before running a
test. That is reported three times already (#12182, #12183, #12186) and is
attributed to #11556; reproduced here on a detached worktree at main with none
of this branch present, byte-identical traceback. So a red backend lane on this
PR is that break, not this diff, and it clears when main heals. test:electron
is red the same way: 17 failures (mochi pet overlays plus the MacUpdater
contract block), the identical node ids on a pristine main worktree at the same
sha, and this diff touches neither.

Pattern harvest

A grant is a question, and two questions need two bits. The cheap move is to
widen an existing authorization's meaning, because the code is already wired. But
consent is not a capability -- it is a record of what somebody was asked, and
widening it silently rewrites the question they answered.

Scheduling an existing mechanism decides nothing about the mechanism. Three
policy questions looked like blockers for this change and two of them dissolved
once the scheduled path was required to call the existing function unchanged:
the payload, the redaction posture and the timeout budget stay properties of that
function, so they cannot drift from the owner-triggered path and they cannot be
quietly re-decided by a caller. The only real decision left was the one the issue
had already made.

Closes #11560

Screenshots, all five shot from a build of the current head.

Backup panel: the snapshot switch is on and the new sessions switch is off by default, each with its own hint naming where the archive goes

The sessions grant accepted: only its own switch moved, the snapshot switch is untouched

A refused write: the notice names the switch it failed to change and the switch stays where the backend left it

Granted and not running: the switch reads back as the owner set it, the notice says outbound redaction is withholding the upload, and the manual run it offers says in the same sentence that it uploads the archive without redaction

The same shape for an account the nightly does not visit: the grant is on, the notice says only the default account is scheduled, and the manual run is still offered

The one notice variant with no next step: on a host that cannot make the archive the manual run refuses too, so none is offered

@chenmingwei23
chenmingwei23 requested review from a team and smeyffret September 20, 2026 04:57
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Sep 20, 2026
@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Fable 5) — 🟡 CONCERNS

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

UX-Verdict: CONCERNS

Blocked-state notices name causes the reader can't locate — "outbound redaction", "default account" — under a switch that stays ON while nothing uploads.

Watch

  • backup_nightly_sessions_blocked_redaction and _blocked_other_account surface a blocker with no pointer to it: the reader said "no idea what 'outbound redaction' is or where I'd turn it on or off" and "no idea which account is the default or how I'd switch". Hits every visit while blocked, unresolvable from this screen, every time. Fix: name where each blocking setting lives (or link it) in the notice.
  • Across shots 04–06 the reader found the ON-but-inert switch "genuinely confusing… feels misleading". The grant-vs-schedule split is deliberate (PR states it), but the notice never says the setting itself is still on; open it with that ("'Back up sessions every night' is on, but…").
  • "Back up every night" vs "Back up sessions every night": the reader kept them apart "only by reading the small print — at a glance they look like the same thing in two places". One-word differentiation in the first label (e.g. name the snapshot) would separate them.

Suggestions

  • backup_nightly_failed ends "It is unchanged." while data.nightlySessions is in hand at the render site — the reader "cannot tell the true state of the setting from this screen". Interpolate the state: "It is still off."

[UX-REVIEWED] 234997e

@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — ✅ PASS

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

Design-Verdict: PASS

Verify the red backend/Electron lanes match the pre-existing main collection break (#12182/#11556), since this PR's tests only ran green at base e8b94aaef.

[DESIGN-REVIEWED] 234997e

@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 20, 2026
@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ no blocking findings

GPT 5.6 completed its review of 234997e1c4b3a0311317a871480f2835e658d26e and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 234997e

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

@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — 🟡 CONCERNS

Premise-level review of 234997e1c4b3a0311317a871480f2835e658d26e — 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 granted-but-idle notice fixes only the transcript switch while the snapshot switch has the identical silent condition, and the scheduler-only redaction refusal is new policy framed as none.

Not justified as shipped

  • Item 4 — symptom-level (point patch): other_account reporting ships only as nightlySessionsBlocked, but the root cause — set_nightly is per-account while _run_once runs only resolve_default_account_profile (hooks.py:120) — leaves the snapshot grant granted-and-idle in exactly the same way. Counted: 1 unfixed sibling (nightly); grep for nightlyBlocked|scheduled_snapshot_blocked finds no reporting for it.
    Clears when: the snapshot grant's identical condition is covered, or a linked issue records it as deferred.
  • Item 5 — inherited: description says "settled here without inventing policy" and "the scheduler inherits whatever that path decides", yet the diff adds BLOCK_REDACTION_ON, a redaction-conditional refusal the owner-triggered path deliberately lacks; its support is _redacted_upload_copy's rule (snapshot.py:1200), which governs the snapshot's redaction seam, not this archive.
    Clears when: the description states this withholding as this PR's own decision (or Sessions archive carries Layer B with no opt-in gate (asymmetry with file-export triple gate) #11559 records it), rather than as inherited posture.
  • Item 7 — rides along: the existing nightly bit now requires a literal True (_granted); the diff's own docstring concedes "nothing this package produces is rejected", so no observed defect motivates changing the shipped reader.
  • Item 9 — rides along: a Playwright capture script (capture-nightly-sessions-consent.mjs) the visible description never mentions.

What this change ships

Inventory (10 items) — 6 justified

Intent: let an operator get their conversation transcripts backed up off-host automatically, behind a separate opt-in. ADDITION.

  1. Nightly loop now also uploads the sessions archive when its own switch is on, default off — justified
  2. Second console switch with hint naming payload and destination — justified
  3. New route POST /backup/{account}/nightly-sessions plus client method — justified
  4. Console explains why a granted transcript nightly is not running (host/redaction/other account) — symptom-level: identical snapshot-grant condition left silent, 1 sibling
  5. Redaction-on now withholds the scheduled transcript upload entirely — inherited: scheduler-only policy framed as "no policy invented"
  6. Upload gate re-reads the per-kind grant and blocked predicate mid-build — justified
  7. Existing snapshot consent bit now rejects truthy non-bool stored values — rides along, no observed defect
  8. Loop setup failures audited under the kinds actually due, not always snapshots — justified
  9. New screenshot-evidence script — rides along, undeclared
  10. Toggle-failure copy names which setting failed; sessions "Run now" disabled on incapable hosts — justified

[FIRST-PRINCIPLES-REVIEWED] 234997e

@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Opus 4.8 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] 234997e

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

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

@chenmingwei23
chenmingwei23 force-pushed the fix/nightly-transcript-backup-11560 branch from 6c883b5 to 560de74 Compare September 20, 2026 06:08
@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 20, 2026
@chenmingwei23
chenmingwei23 force-pushed the fix/nightly-transcript-backup-11560 branch from 560de74 to 52eadc8 Compare September 20, 2026 08:26
@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 20, 2026
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Both GPT findings are fixed on 52eadc8

Both were real and reachable, and the adjudicator's reasoning is what settled each
one. Neither is overridden.

F1, the consent bit read as truthy rather than as a grant.
nightly_sessions_enabled returned bool(state.get("nightly_sessions")), so a
stored string "false" read as consent GRANTED and transcripts would upload
unattended. The sole writer stores a real bool, so the product cannot produce
this itself, but this file already treats a corrupt state file as something to
survive rather than something that cannot happen: _account_view flattens a
corrupt level to empty and _a_day_since_last_run catches a non-string stamp.
Inside that recognized corruption class a truthy non-bool flips a bit documented
as fail-closed into a fail-open one.

Both bits now read through one helper that requires the value to be exactly
True. Deliberately shared: one strict reader and one loose reader of the same
kind of answer is the shape that drifts, and whichever stays loose becomes the
way in.

F2, the unattended grant was not re-read before the bytes left.
_authorize_upload already re-read the live account, the app's enabled state,
the S3 consent and that consent's account across the minutes-long archive build.
The per-kind grant was the one omission, and it is the only one whose withdrawal
cannot be undone afterwards: transcripts on S3 cannot be recalled. The gate
re-checking every OTHER authorization in exactly that window is the evidence the
window is real and known.

The gate now takes a required payload_kind and, for scheduled callers,
re-reads that kind's grant immediately before the PUT. Notes on the shape:

  • Required with no default, for the same reason caller is: the value that would
    make a sensible default is the one that checks nothing.
  • None is a real answer, not an opt-out. The label sidecar is one document
    published under both prefixes on purpose, so no per-kind grant governs it;
    keying it to a prefix would cost an install with one kind off that prefix's
    caption, which is a rename going unseen rather than a transcript leaving.
  • Scheduled callers only. An owner who pressed the button authorized the run by
    pressing it; the nightly bit stands in for a person who is not there.
  • An unregistered kind is REFUSED, not waved through, and a test derives the
    table from JOB_KINDS so a kind added without a grant reddens in CI instead of
    being refused at 03:00 with nobody reading the log.
  • Both bits, not just the transcript one. The snapshot payload sits in the same
    window under its own grant, and fixing one would only move the asymmetry.

Mutation evidence. Five mutations, each reddening its own path, baseline green
before and the tree green after:

mutation tests reddened
consent read falls back to bool() 6 truthy-non-bool cases
the whole per-kind re-check removed 5
unregistered kind falls through 1
gate stops being scheduled-only 4, including two pre-existing owner-path tests
transcript PUT stops naming its kind 1

The third and fifth killing exactly one test each is what shows those two
decisions carry their own assertions rather than riding another's. The fourth
reddening the owner-path tests is what shows the condition is a fence and not a
blanket break.

351 related tests pass; the black gate, flake8, isort and mypy are clean on the
changed files.

The two UX copy suggestions, and why the strings stand

Both are fair readings of the label text alone. The catalog answers each one
without a change, so I am recording the reasoning rather than editing 13
translation catalogs.

"Back up every night" reading as if it covered everything. The hint directly
beneath it is backup_nightly_hint: "Runs a memory & workspace snapshot once a
day." The section heading two lines above it is backup_kind_snapshot: "Memory &
workspace". So the payload is named twice, above and below, before the ambiguity
could arise. The attached first frame shows both together at the crop size.

The shared failure string saying "the nightly backup setting" when there are
now two.
True of the string in isolation. It renders in its own element beside
the switch that failed (backup-nightly-sessions-error), so which setting is
meant is carried by where the notice appears, and the attached third frame shows
that placement. A dedicated key would add 13 new translations for a distinction
the layout already draws.

If a reviewer would rather have the wording changed anyway, say so and I will
derive each language's phrasing from that catalog's own backup_nightly_hint
value rather than inventing translations.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Sep 20, 2026
@chenmingwei23
chenmingwei23 force-pushed the fix/nightly-transcript-backup-11560 branch from d32ab80 to eac0f4e Compare September 20, 2026 09:40
@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Sep 20, 2026
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Preserved at ef773e4673 and blocked on #12309

This branch is untouched and stays that way until the unblocking PR lands. The shard-7
work happened in a separate worktree on its own branch off main, so this PR's head,
diff and clean review verdicts are exactly as they were.

Blocked on: #12309, which makes the shard-7 timeout self-describing. Tracked by
#12308.

Reversed, and I was wrong to propose it. I had offered to open a PR rebalancing the
backend shard split. There is nothing to rebalance. Within this branch's own run the
shards carry 14166, 14105, 14315 and 16112 tests, and the lower counts I had quoted
came from the reduced-scope runs ci.yml substitutes for narrow diffs. #12292 settled
it as a genuine like-for-like control: full sharded suite, 14316 tests, runs the
failing test, passes. So that PR would have changed something that is not broken, and
the issue would have asserted something untrue.

What #12309 does instead. It names the operation tasks by store, kind and index and
reports what the 45-second budget caught before re-raising unchanged. It reports the
cancelled tasks, not the unfinished ones: wait_for cancels the gather before it
raises, so an unfinished count is always zero. I had that backwards first and the report
came out empty, which is the kind of thing that only shows up if you actually run it.
No workload, budget, scheduling or assertion change, and a passing run never enters the
path.

Then the sequence here is: #12309 lands, this branch rebases once, and the next
natural run carries the diagnostics. If shard 7 fails again it will name the store, the
operation kind, the queue depth and the completed count instead of a bare
TimeoutError. No re-run, no waiver, no timeout change.

Unchanged and still true on this head: 80 lanes green, every review lane green, and
Coverage Gate red only at step 2, "Require upstream coverage jobs to have succeeded",
with all twelve of its coverage steps skipped -- so it clears when shard 7 does, with no
separate work.

The four capture frames above answer the UX evidence gap, and the tooling that produced
them is confined to this worktree: website/node_modules is now a real install from the
committed lockfile, the shared install is still on 3.4.19 and was never written to, and
the original symlink is saved and restorable in one step.

@chenmingwei23
chenmingwei23 force-pushed the fix/nightly-transcript-backup-11560 branch from ef773e4 to 3c05bde Compare September 20, 2026 16:14
@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 20, 2026
@chenmingwei23
chenmingwei23 force-pushed the fix/nightly-transcript-backup-11560 branch from 3c05bde to e8249b5 Compare September 20, 2026 16:47
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Round 8: both blocking items answered, three Watch items dispositioned

UX blocker, informed consent on the primary toggle. Taken, and taken as stated: the
hint said the upload carries "your conversations as they are, with nothing removed"
while the archive row it schedules says it includes the CLI replay logs for every
session under this Kiro home, not only chats started here. That asks for a yes to a
wider payload than the sentence states, at the one decision this feature exists for.

The hint now renders the archive row's OWN string (backup_sessions_scope) after its
own, rather than a paraphrase of it. Two consequences worth naming: there is no new
translation to get wrong in thirteen catalogs, and the two sentences cannot drift,
because they are one string. Frame 01 shows the result. Pinned by a test asserting the
row's text contains both, mutation-verified -- wrapping the scope call reddens exactly
that test and nothing else.

I did not add a concrete destination beyond "this account's drive". The drive's bucket
name is discovered by find_drive at run time and is not in the status payload, so
naming it in a static hint would either be a second source of truth or a new field. The
scope half is the part that was actually understating the payload.

Windows shard 4. Mine, and the test was wrong rather than the code. The status
payload answers with the capability condition before the account one, deliberately --
a host that cannot produce the archive cannot produce it for the scheduled account
either, so naming the account would send the reader to a page carrying the same notice.
Both new route tests now pin a supported host so the account branch is reachable on
every platform, and the assertion stays universal; no platform skip was added, since an
assertion that used to run everywhere gated behind a platform check is a ratchet
loosening. Verified under an emulated Windows run with the capability flag forced off.

The negative control was weaker than it looked, and the same platform difference is why:
it asserted "not the account code", which passes on any platform answering with a
different code. It now asserts the field is empty.

Evidence gap, the host_unsupported variant. Closed. Frame 06 shows it, and shows
what the frame exists to show: it is the only variant rendered WITHOUT "You can still
start the backup yourself", because the manual run answers the capability question the
same way and refuses with 501, so offering it would name a click that fails.

Watch items, deliberately not implemented

Three are real and none is a defect in this change. Recorded here rather than folded in,
because each needs something this PR does not have.

"No idea what outbound redaction is or where I would turn it off" -- a link needs a
route to the setting from this panel, which does not exist today; adding one is a
navigation change to a different surface.

"No idea how to find out which account is the default" -- naming it in the notice needs
the default account id in the status payload. It is deliberately not there: the payload
is per-account and scoped to the account in the path, and the console would then render
one account's identifier on another account's page.

"Couldn't tell whether ON is the value that survived" on the failure notice -- the
message says the setting is unchanged, and stating the surviving value instead means
interpolating it into a string that thirteen catalogs share with the snapshot toggle.
Worth doing, and worth doing to both switches at once rather than to one.

Backend 733 across eight aws_control files, frontend 364, i18n 692 including the German
and Hindi formal-address ratchets, mypy clean across 1654 files, plus comment-history,
focus-cue, black, flake8, docs-lint, jscpd and the i18n key gate at its 115 dynamic-site
baseline.

@github-actions

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — 🔴 changes requested (blocking)

GPT 5.6 found at least one blocking issue that must be resolved before merging f3744240831a5204710d7a6c331906ac3615267a. Adjudication produced no [GPT-ADJUDICATED] marker for f374424: the adjudication stage FAILED TO RUN (its raw output is in the Adjudication details block -- typically an API or setup error), so no proportionality review took place and GPT's blocking verdict stands unreviewed.

This comment is updated in place on each push.

BLOCKING -- src/kiro_crew/apps/builtins/aws_control/hooks.py:223 -- Nightly uploads unredacted transcripts
else backup_mod.run_sessions_backup
Redaction absent by default -> nightly loop -> raw transcript archive uploaded to S3 with embedded credentials.
Anchor: backend-security-controls
Fix: Redact scheduled session archives with both required redactors, failing closed on errors.
[BLOCK-MERGE] f374424
[GPT-REVIEWED] f374424
False positive or not applicable? A repository writer can comment:
/ai-review override gpt f3744240831a5204710d7a6c331906ac3615267a: <one-sentence reason>

…onsent bit

The nightly loop pushed the memory snapshot and nothing else, so conversation
transcripts were only ever backed up by an owner pressing a button. The archive
that carries them was already complete; it had no scheduled caller.

Adds nightly_sessions, a separate default-off grant, and schedules
run_sessions_backup unchanged behind it. The grant is never inferred from the
snapshot bit in either direction, due-ness is keyed on the sessions run stamp so
a snapshot that ran an hour ago does not make the transcripts look backed up,
and a platform that cannot pin the traversal is never due rather than failing
every wake. Each kind pushes inside its own try/except with its own audit
subject, so one failing costs the other nothing.

Because the scheduled path calls the same function with the same arguments, the
archive's contents, redaction posture and push budget are unchanged by
scheduling and stay properties of that path. The module spec states that
posture. What scheduling adds is one consent bit strictly narrower than the
owner-triggered route's gate.

Closes #11560

fix(aws-control): read the unattended grant strictly, and re-read it before the bytes leave

A consent bit now answers True only for the real bool the product writes: a corrupt state file holding a truthy non-bool no longer reads as a grant the owner never gave.

The pre-upload gate now also re-reads the unattended grant for the payload it is about to send. It already re-read the live account, the app's enabled state and the S3 consent across the minutes-long archive build; the per-kind grant was the omission, and it is the only one whose withdrawal cannot be undone afterwards.

test(aws-control): stop the nightly-sessions capture duplicating its sibling

jscpd runs at a 0% threshold and flagged two clones against capture-drive-restore-overwritten.mjs, the script this one was modelled on: 34 lines across the fixture block and the route dispatcher. The fixtures now derive from the five values they share instead of repeating them, and the read-only routes are a table rather than a chain of comparisons. Re-ran the script against a stub dev server: all three frames still come out, and the refusal frame is still taller because the notice renders.

fix(aws-control): address the Bengali reader as tumi, and pin the traversal capability in the window tests

bnStyle.test.ts's [changed-values] gate holds every value a branch writes to style/bn.md section 5 at zero tolerance, and both values this branch added to bn.json used the honorific register: 'korun' in the label and 'apnar' in the hint. Replaced with the tumi forms the doc names and the catalog already uses in 745 and 209 other values respectively; the sibling's spelling of 'backup' is adopted too.

The three window tests asserted due_for_sessions_nightly is True on a platform where it is unconditionally False: descriptor-pinned traversal needs os.supports_dir_fd and os.supports_fd, which Windows does not provide, so the archive cannot be produced there and answering 'not due' is correct. The class now holds the capability True while the window is under test, because the property these tests exist for is which stamp the window reads. Skipping would have scored as a pass on the one platform where the interaction is real. Reproduced on a simulated no-pin session: the same three tests fail with the fixture neutered and pass with it.

The file-wide state fixture replaces two identical per-class copies and covers two classes that had none. It is a consolidation, not a fix: mutating it away reddens nothing, and its docstring says so.

fix(aws-control): decline the unattended transcript upload when redaction is opted in

GPT flagged the scheduled sessions push as uploading unredacted transcripts while the snapshot path redacts. Measured: redaction is opt-IN and off by default, so on a default install neither payload is redacted and there is no asymmetry. For an operator who DID opt in there is one: run_snapshot_backup routes its payload through snapshot.prepare_redacted_copy, and the sessions archive cannot use that seam because it refuses more than one root and this archive has crew and cli. The scheduled path now declines rather than sending unredacted, matching _redacted_upload_copy's own rule that could-not-redact never falls through to send-it-anyway. Owner-triggered archives are untouched: somebody is present to choose them.
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

UX BLOCK on 3cbff9534c is fixed in 234997e1c4; the three Watch items and the Suggestion are answered here rather than implemented.

Blocker (fixed). The reader was right, and the backend agrees with them in writing. run_sessions_backup uploads the sessions archive unredacted, deliberately, and scheduled_sessions_blocked_code's docstring justifies that by saying an owner pressing the button "is present and is choosing this archive knowingly". That is only true if the page says what the choice is. It did not: the redaction hold shared the generic next step. There is now a redaction-specific one -- "You can still start the backup yourself, but it uploads the sessions archive without redaction." -- in all 12 source catalogues, built from each catalogue's own attested words and audited token by token, plus a test that fails if that state falls back to the generic line.

Watch: say the switch position after a failed toggle. Not taken in this PR. The mutation error path is main's, shared by every row on the page; giving one row a position-aware failure string would make the sessions row disagree with its neighbours about what a failed toggle says. It is a real improvement and belongs where all rows get it at once.

Watch: name where "outbound redaction" lives. Not taken. The setting has no console surface at all in this repo -- it is read from the snapshot module's own switch -- so the honest version of this sentence would name a place the console cannot link to, and inventing a plausible path is worse than the current silence. Worth doing WITH that surface, not before it.

Watch: name the default account in the other-account notice. Not taken. The status route knows the default account id, not its alias or display name, so the sentence this asks for would interpolate an opaque identifier next to the one already on screen. The notice's job is to say the schedule does not visit the account being viewed, which it does without the comparison.

Suggestion: the hint's duplicated scope line. Not taken, and deliberately so. The hint renders the archive row's OWN backup_sessions_scope string precisely so the consent sentence cannot drift from the row it describes; de-duplicating it means either a second string that can drift or a layered disclosure this PR does not have a pattern for.

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

@chenmingwei23

Copy link
Copy Markdown
Contributor Author
  • Item 5 (span=f97a5f08ec74) -- accepted, and the framing was mine to fix. The review is right that BLOCK_REDACTION_ON is a refusal this PR introduces and that the owner-triggered path deliberately lacks, so calling it inherited posture understated it. Stating it plainly here rather than in the description, because on this repo a body edit fires pull_request: edited and re-rolls the review lanes, and the record belongs on the head anyway: THIS PR decides that an operator who asked for outbound redaction gets no UNATTENDED transcript upload. The reasoning, which is the PR's own and not _redacted_upload_copy's: the sessions archive has two bundle roots so it cannot use the snapshot's single-root redaction seam, and for an operator who did ask, an unattended upload would send exactly the bytes they asked to have rewritten with nobody present to notice. The owner-triggered path keeps working because that owner is present and, as of this head, is told in the same sentence that the manual run uploads the archive unredacted. Sessions archive carries Layer B with no opt-in gate (asymmetry with file-export triple gate) #11559 tracks the wider asymmetry.

@chenmingwei23

Copy link
Copy Markdown
Contributor Author
  • Item 7 (span=ab10ae58a90a) -- kept deliberately, on consent-bit grounds rather than defect grounds. The observation is accurate: nothing this package writes is rejected by the stricter read, so no failure motivates it. It stays because of what the bit MEANS. It is a consent record for sending a user's data off the host, and it is read to decide an unattended upload. Under the old truthy read, any non-bool that survived into the store -- a JSON string, a legacy 1 -- would answer "granted" for a grant nobody gave, and the failure mode is an irreversible upload rather than a visible error. _granted requiring a literal True makes the unparseable case read as no consent, which is the fail-closed direction. The docstring line quoted is the honest statement that this is defence against a state this package cannot currently produce, not a fix for one it does.

@chenmingwei23

Copy link
Copy Markdown
Contributor Author
  • Item 9 (span=df052f8a605f) -- accepted as an omission in the description, and here is what it is. website/scripts/capture-nightly-sessions-consent.mjs is a Playwright script that drives the Backup panel through the six states this PR adds -- both switches, the grant accepted, a refused write, and the three blocked notices -- and writes one PNG per state. It exists because the Design and UX lanes only count evidence attached to the PR, and hand-shot frames drift from the copy they illustrate; regenerating them from a build of the head is what let shot-04 be corrected within minutes when the redaction next-step changed on this head. It ships rather than staying local so the next person changing this panel can reproduce the same six frames instead of composing them by hand. Not added to the description for the same reason as item 5: a body edit re-rolls the review lanes.

@chenmingwei23

Copy link
Copy Markdown
Contributor Author
  • span=c95efdea3837 -- not taken, because the honest version of each pointer does not exist yet. The reader is right that both notices name something and then leave them stranded. Neither has a place to point at. "Outbound redaction" has no console surface in this repo at all -- it is read from the snapshot module's own switch -- so a sentence saying where to turn it on would name a screen that is not there, and a plausible-looking path is worse than silence. The other account is known to the status route only as an id, not an alias or display name, so interpolating it puts an opaque identifier beside the one already on screen. Both become cheap the moment either surface exists; until then the notices say the true and useful half, which is why the schedule is not visiting this account.

@chenmingwei23

Copy link
Copy Markdown
Contributor Author
  • span=6366dd9745b0 -- not taken in this PR, and worth doing. The reader's confusion is real and the diagnosis is right: the switch reads on, nothing happens, and the notice never says the setting itself is still on. Opening with the position would fix it. It is not in this head because the sentence the reviewer proposes quotes the switch label, which means either a second copy of that label that can drift from the row above it or a new interpolation into three separate blocked strings across 12 catalogues -- a copy change wide enough to want its own review rather than a rider on a security fix. What this head does instead is remove the worst instance: the redaction notice now states the consequence of the one action it offers.

@chenmingwei23

Copy link
Copy Markdown
Contributor Author
  • span=16880d01df0f -- not taken: the label it asks me to change is not this PR's. "Back up every night" is the shipped snapshot switch, and the reader is right that the two labels are separated only by small print. Renaming the shipped one is a change to an existing control every current user already reads, with its own 12-catalogue copy round, and it would land inside a PR about the transcript consent bit where nobody reviewing this diff expects it. The new switch is the one that had to be distinguishable and it names its payload in both its label and its hint. If the pair stays confusing, the fix is to rename the snapshot switch deliberately, on its own.

@chenmingwei23

Copy link
Copy Markdown
Contributor Author
  • span=09219b9838fb -- not taken here, because backup_nightly_failed is shared by every row on the page. The reader's complaint is fair: after a refused write the notice says "It is unchanged" without saying what it is unchanged AT, and data.nightlySessions is indeed in hand at the render site. Interpolating the position for this row alone would make the sessions row's failure read differently from the snapshot row's next to it, and the string is main's, shared by both. It is a real improvement that belongs where all rows get it at once rather than as a divergence introduced by the row that happens to be under review.

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

Verified at 234997e1c4. Scope of what I checked: the path that decides whether an unredacted transcript can leave the machine, plus the two advisory CONCERNS. I did not read all 30 files; everything outside that path I am taking from the six green review lanes.

The consent path holds.

  • _granted (backup.py:2962) requires is True, so the stored-"false" fail-open is closed, and the absent key answers False. nightly_sessions_enabled (:3064) is a separate key from nightly and never reads it.
  • The TOCTOU window is closed on both preconditions, not one. Inside _authorize_upload, a CALLER_SCHEDULED call re-reads the per-kind grant through _NIGHTLY_CONSENT_READERS, and separately re-reads scheduled_sessions_blocked_reason() for KIND_SESSIONS (:1300-1340). An unregistered payload_kind is refused rather than allowed through for not being listed, and _STOP is checked last.
  • The gate sits immediately before the PUT with nothing between it and storage.put_file at run_sessions_backup (:2417-2419) -- no second network call, no intervening upload. The redaction re-read derives from the same predicate the due-check reads, so a cause added there is refused here too.

Both CONCERNS are real and both are non-blocking.

  • First Principles is right that the reporting is asymmetric: scheduled_sessions_blocked_code / _reason (:3211, :3242) exist only for KIND_SESSIONS, and BLOCK_OTHER_ACCOUNT applies identically to the snapshot nightly bit, which still reports nothing. That is a pre-existing reporting gap for snapshot, not something this PR introduces, and it is a disclosure gap rather than a consent one.
  • UX is right that redaction_on / other_account name causes with no in-product pointer to the switch or the account. Worth a follow-up; it does not gate a change whose default is off.

CI. Backend Tests (3.12, 7) -- the test_private_store_mixed_load[8] shard you corrected yourself about -- is green on this head (completed 21:05:07Z), so that one is resolved rather than un-rerun.

Merge-order note, not a finding. This branch and #12178 both rewrite backup.py and routes.py and conflict with each other (backup.py, routes.py, test/test_aws_control_app.py). Whichever lands second needs a rebase.

No blocking findings.

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.

Nightly backup carrying transcripts: deferred, three prerequisites before code

3 participants