Repository navigation
feat(aws-control): carry transcripts in the nightly under their own consent bit - #12190
Conversation
UX Review (Fable 5) — 🟡 CONCERNSUX-level review of 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
Suggestions
[UX-REVIEWED] 234997e |
Design Review (Fable 5) — ✅ PASSDesign-level review of 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 [DESIGN-REVIEWED] 234997e |
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 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: |
First Principles Review (Fable 5) — 🟡 CONCERNSPremise-level review of 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
What this change shipsInventory (10 items) — 6 justifiedIntent: let an operator get their conversation transcripts backed up off-host automatically, behind a separate opt-in. ADDITION.
[FIRST-PRINCIPLES-REVIEWED] 234997e |
Opus 4.8 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: |
6c883b5 to
560de74
Compare
560de74 to
52eadc8
Compare
Both GPT findings are fixed on 52eadc8Both were real and reachable, and the adjudicator's reasoning is what settled each F1, the consent bit read as truthy rather than as a grant. Both bits now read through one helper that requires the value to be exactly F2, the unattended grant was not re-read before the bytes left. The gate now takes a required
Mutation evidence. Five mutations, each reddening its own path, baseline green
The third and fifth killing exactly one test each is what shows those two 351 related tests pass; the black gate, flake8, isort and mypy are clean on the The two UX copy suggestions, and why the strings standBoth are fair readings of the label text alone. The catalog answers each one "Back up every night" reading as if it covered everything. The hint directly The shared failure string saying "the nightly backup setting" when there are If a reviewer would rather have the wording changed anyway, say so and I will |
d32ab80 to
eac0f4e
Compare
Preserved at
|
ef773e4 to
3c05bde
Compare
3c05bde to
e8249b5
Compare
Round 8: both blocking items answered, three Watch items dispositionedUX blocker, informed consent on the primary toggle. Taken, and taken as stated: the The hint now renders the archive row's OWN string ( I did not add a concrete destination beyond "this account's drive". The drive's bucket Windows shard 4. Mine, and the test was wrong rather than the code. The status The negative control was weaker than it looked, and the same platform difference is why: Evidence gap, the Watch items, deliberately not implementedThree are real and none is a defect in this change. Recorded here rather than folded in, "No idea what outbound redaction is or where I would turn it off" -- a link needs a "No idea how to find out which account is the default" -- naming it in the notice needs "Couldn't tell whether ON is the value that survived" on the failure notice -- the Backend 733 across eight aws_control files, frontend 364, i18n 692 including the German |
GPT 5.6 Review — 🔴 changes requested (blocking)GPT 5.6 found at least one blocking issue that must be resolved before merging This comment is updated in place on each push. BLOCKING -- src/kiro_crew/apps/builtins/aws_control/hooks.py:223 -- Nightly uploads unredacted transcripts |
…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.
|
UX BLOCK on Blocker (fixed). The reader was right, and the backend agrees with them in writing. 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 |
|
|
|
|
|
|
|
|
buluoray
left a comment
There was a problem hiding this comment.
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) requiresis True, so the stored-"false"fail-open is closed, and the absent key answers False.nightly_sessions_enabled(:3064) is a separate key fromnightlyand never reads it.- The TOCTOU window is closed on both preconditions, not one. Inside
_authorize_upload, aCALLER_SCHEDULEDcall re-reads the per-kind grant through_NIGHTLY_CONSENT_READERS, and separately re-readsscheduled_sessions_blocked_reason()forKIND_SESSIONS(:1300-1340). An unregisteredpayload_kindis refused rather than allowed through for not being listed, and_STOPis checked last. - The gate sits immediately before the PUT with nothing between it and
storage.put_fileatrun_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 forKIND_SESSIONS, andBLOCK_OTHER_ACCOUNTapplies identically to the snapshotnightlybit, 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_accountname 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.
Problem / Motivation
The nightly backup loop (
aws_control/hooks.py,_run_once) pushed the memoryand 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 completeand 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 settledhere without inventing policy:
nightlyauthorizes uploading memory; asking it to also authorize uploadingevery 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 fromnightlyin either direction.run_sessions_backupwith thesame arguments the owner-triggered job passes, so the payload and the
_PUSH_TIMEOUT_SECSbudget 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.
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_sessionsreadand write their own key. An absent key answers False, and an unreadable state
file answers False, for the reason
nightly_enabledalready gives: a corruptfile must never be the reason an unattended upload starts.
The window.
backup.due_for_sessions_nightlykeys due-ness on theKIND_SESSIONSrun stamp, so a snapshot that ran an hour ago does not make thetranscripts look backed up. The 23-hour stamp reasoning moved into
_a_day_since_last_run, shared by both kinds and byte-identical to whatdue_for_nightlydid before; the consent question stays at each call site, so afuture 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_backuprefuses there, so scheduling it would record a failed runand audit a failure every half hour for a payload that platform cannot produce.
The loop.
_run_oncereads 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_nightlywith its own try/except and its ownaudit subject (
backup/snapshots,backup/sessions): one kind failing costs theother 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-sessionsand anightlySessionsfield on the status payload. Its own route, not a second fieldon the snapshot toggle's body, so one request can never carry both grants. Both
toggles now share one validated implementation (
_toggle_nightly), since thenon-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 ownresolution, so the two cannot disagree about which account is scheduled -- and
reports
other_account; the panel says so beside the switch, which keeps readingback 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.pyis new: 15 tests over the grant, thewindow and the loop. Route and payload cases were added to
test_aws_control_routes.py, the new route to the pinned inventory intest_aws_control_app.py, and four frontend cases toDrivePage.test.tsxplusone to
api.test.ts.Eleven mutations were applied and each was killed by its named test:
test_the_snapshot_grant_does_not_authorize_transcriptstest_a_snapshot_run_does_not_close_the_transcript_windowtest_a_platform_that_cannot_pin_the_traversal_is_never_duetest_a_due_transcript_window_pushes_the_sessions_archivetest_a_due_transcript_window_pushes_the_sessions_archivetest_the_transcript_push_is_audited_under_its_own_subjecttest_the_transcript_toggle_flips_only_the_transcript_bittest_the_status_payload_reports_the_transcript_grant_separatelythe transcript switch is its own grantthe transcript switch is its own grant/nightlybackupNightlySessions POSTs to its own endpointRun 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(241passed); the whole
src/i18n/suite (692) after regeneratingen-XA.json;tsc -bclean;check-i18n-keys.mjsclean. 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. Currentmaincannot COLLECT thePython suite at all --
sandbox.py's module-level leaf-set assertion fails onimport 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
mainwith noneof 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:electronis red the same way: 17 failures (mochi pet overlays plus the MacUpdater
contract block), the identical node ids on a pristine
mainworktree at the samesha, 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.