Skip to content

feat(instances): send a folder's sessions to a crew and recreate the folder there - #19859

Open
koenvincent wants to merge 2 commits into
kirodotdev:mainfrom
koenvincent:feat/send-folder-to-crew
Open

koenvincent wants to merge 2 commits into
kirodotdev:mainfrom
koenvincent:feat/send-folder-to-crew

Conversation

@koenvincent

@koenvincent koenvincent commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Let a person send a whole folder of sessions to a connected crew, and find them on the crew under Imported › from <this instance> › <folder>.

"Send a copy to ▸ <instance>" exists on every session menu, but not on a folder. Moving a project's worth of sessions to a crew means opening each session's menu in turn, and every copy then lands flat in Imported / from <sender> beside every other session that machine ever sent, so the grouping the person had is lost on arrival.

Why it matters

A folder is how people group a project's sessions, and handing a project to a crew is exactly when that grouping matters most. Today the copy works but the structure does not survive it, so the receiving sidebar has to be re-sorted by hand after every hand-off.

Not a goal

  • No folder sync and no move: these are copies, exactly like the session entry. The local folder and sessions are untouched, and a repeat click sends a second set.
  • Sub-folders are not walked. Only sessions filed directly in the folder are sent, and only the folder's NAME travels (not its id, colour, project directory or default agent).
  • No change to where an arrival is filed when the sender does not ask: a single-session send puts a byte-identical bundle on the wire and lands where it does today.
  • No new transport, route or token path: each session is one ordinary send-session call.

What changed (motivation → approach → change)

Sender. POST /api/instances/{id}/send-session accepts an optional with_folder: true (strictly the boolean). build_transfer_bundle_async(..., with_folder=True) then adds the session's folder name to the bundle as an optional folder field, read on the loop with the rest of the snapshot and egress-redacted like the title (credentials, exfiltration URLs, local paths). Off by default, like with_source, so existing callers emit exactly today's bundle.

Receiver. The importer reads folder as a filing hint and passes it to arrival_folder_id, which adds a third level: Imported / from <sender> / <folder>. It follows every rule of rfc-arrival-provenance-filing.md, amended in §4: a label from an untrusted bundle that names a row and confers nothing, redacted on both sides, clipped the way the store writes a name, never filed for an app-scoped arrival, and resolved in the same single mutate_folders transaction. It is optional in the ceiling, so a store with room for the provenance pair but not a third row files into from <sender>, and a folder-carrying arrival never lands less filed than one without. A non-string folder is dropped, not refused. The rollback already walks created rows in reverse, so a failed import unwinds all three.

Dashboard. The folder menu (⋯ and right-click, one renderer) gains "Send a copy to ▸ <instance>" (SendFolderToInstanceSubmenu). It reads the folder's membership rather than its filtered render, sends each LOCAL persistent session in turn with with_folder: true (sequential, so twenty sessions are not twenty simultaneous bundle builds against the peer's slot cap), and reports progress and the outcome on the row: 1 of 3, Sent: 3, or the transcript-only count. A partial send shows 2 of 3 sent and the first error through the shared ErrorNotice (under the crew name), with its agent hand-off as a sibling ErrorNoticeMenuItem; clicking the row again resends only the sessions that failed, so the copies that landed are not duplicated. A click calls startFolderSend directly, and the send's state lives in a module-level store outside the menu (useSyncExternalStore), keyed by folder and crew: closing the menu mid-send loses nothing, a reopened menu shows the running send (its row refuses a second, overlapping one) or its result. That store is per tab and in memory, so another tab, or this one after a reload, can start an overlapping set of copies; each copy is independent and the finished row warns that a click sends duplicates. Incognito and temporary sessions are left out and counted in a visible row, the same refusal send-session gives them. It hides itself without configured instances and lists a disconnected crew disabled, like the session entry.

Strings. Eight new keys under components.sendFolderToInstanceSubmenu in en, the 11 translated locales and the regenerated en-XA; the plural base is registered in pluralKeys.json.

Backwards compatibility

  • An older receiver ignores the unknown folder key and files the copy in from <sender> as today.
  • An older sender never sets it, so a newer receiver files exactly as today.
  • No change for any existing caller of send-session or the file export.

Tests

  • test/test_arrival_folders.py: 8 new cases (three-level create in one transaction, adopt, two senders with one folder name stay two rows, no sender, full store files one level up, clip, app arrival still unfiled, rollback unwinds all three).
  • test/test_session_transfer.py (sending side) and test/test_session_transfer_landing.py (arrival), the files test: split test_session_transfer.py and test_crew_log_emit.py by topic #22132 split the old suite into: 8 new cases (import files into the named folder, malformed hint dropped, byte-identical bundle without the field, egress redaction of the name, name read by id, and send-session carries the folder only for with_folder: true, not when absent or "yes").
  • website/src/test/SendFolderToInstanceSubmenu.test.tsx: 8 cases (self-hiding, connected vs disconnected rows, nothing to send, visible skipped row, progress/full/partial outcome with the ErrorNotice and its hand-off wired by aria-describedby, the send loop's order, flag and continue-on-error, retry of only the failed keys, and state that is recorded with no component mounted). Mutation check: retrying every key instead of the failed ones turns the retry test red.
  • Rebased onto main 453cc4b: test_session_transfer.py, test_session_transfer_landing.py and test_arrival_folders.py (153) pass, as do SendFolderToInstanceSubmenu.test.tsx (10), tsc, mypy, flake8, the i18n gate and docs lint. Earlier, on main 3f30a58: test_session_transfer.py, test_session_export.py and test_arrival_folders.py (376) passed; the two submenu files and 9 folder-menu sidebar files pass (108); black, isort, flake8, mypy, ESLint, the i18n key gate and the feature-map gate are clean. Mutation checks: disabling the folder level turns the three-level test red, and ignoring with_folder in the handler turns the handler test red.
  • Review round r115 (head b169b99725, rebased onto main 6fd7c1f): the sending-side folder tests moved to test/test_session_transfer_folder.py, so test_session_transfer.py is back to 1,549 lines (Opus, keep-modules-small). SendFolderToInstanceSubmenu.test.tsx (11) adds: a finished row shows the "send all again" line on screen, a transcript-only row shows what that means on screen, a sending row is not disabled (full contrast) and ignores a press. Reverting each of those four changes turns its test red. 153 backend tests in the transfer and arrival-folder files, mypy, tsc, ESLint, the i18n gate, the line cap, docs lint and the comment-history and feature-map gates pass.
  • Full typecheck and the rest of the suite are left to CI.

Manual verification

Not yet run end to end between two live gateways: it needs a build carrying this change on both the sending and the receiving instance. Planned before merge: send a folder of three sessions (one incognito) to a crew and confirm Imported / from <sender> / <folder> with two sessions on the crew and Sent: 2 with the skipped hint on the sender.

Screenshots / video

Taken by the committed website/scripts/capture-19859-send-folder.mjs, which checks each frame's claims in the page and fails otherwise. Opened from a folder row's ⋯ button in a real browser: the REAL SendFolderToInstanceSubmenu, Radix menu primitives, stylesheet and theme tokens, with only the two API calls stubbed (the send outcomes come from the real send loop). Committed in temp-screenshots/19859-send-folder/.

Outcomes, one crew per state: partly sent (4 of 5 sent, the error below it through ErrorNotice, the visible "Click to resend the 1 that failed" cue and the "Ask the agent" item), sent with a transcript-only fallback (Sent: 5 (2 transcript only)), all sent (Sent: 5), each finished row with its visible "Clicking again sends all 5 again (duplicates)" line and the transcript-only row with what that means, a disconnected crew, and the visible count of skipped incognito/temporary sessions.

Outcomes, dark theme

Outcomes, light theme

Sending: a send in flight on crew-docs (spinner, 1 of 3 at full contrast; a press while it runs is ignored), beside an idle connected crew that is ready to send.

Sending, dark theme

Sending, light theme

Nothing to send: every session in the folder is incognito or temporary, so each crew row is disabled and No sessions to send says why.

Nothing to send, dark theme

Nothing to send, light theme

Crew list unreadable: a failed /api/instances read shows its error through ErrorNotice with the "Ask the agent" item, instead of the action disappearing. Only the gateway's own instances_disabled 403 stays silent.

Crew list error, dark theme

Crew list error, light theme

Follow-up on 1ed2caee59 (r117)

  • One send-state channel (First Principles item 6): the submenu no longer wraps the send in a useMutation whose state nothing read. A click calls startFolderSend directly, and the module store (useSyncExternalStore) stays the only channel, because the send must outlive the menu closing.
  • Counted transcript-only hint (UX): the finished row now uses its own plural key, so "Sent: 5 (2 transcript only)" reads "...so 2 copies resume from the transcript alone." In all 12 languages, registered in pluralKeys.json.
  • Where the copies land (UX): the submenu now says "Copies land on the crew under Imported › from (this instance's name) › (this folder's name)." whenever there is something to send. The finished row's resend line reads "Clicking again sends all N again (duplicates)" in the warn tone (UX r127). The screenshots are re-captured with this text; the capture script checks it.
  • The frames above are re-taken on this head; the capture script checks the counted hint and the folder line, and that the empty frame shows no folder line.

Related Issues

Extends the session transfer of docs/system-specs/modules/instances.md §14 and the arrival filing of rfc-arrival-provenance-filing.md.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributed under the project's Apache-2.0 license.

Live run: the two-gateway run is tracked in #30231, so it can be deferred without holding this PR.

@koenvincent
koenvincent requested review from a team and KiroCrewCaptain as code owners October 13, 2026 18:04
@github-actions github-actions Bot added readiness: checking Automated validation is still running fork Pull request from a fork (external contributor) labels Oct 13, 2026
@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5, fork) — ✅ PASS

Design-level review of f134d64c6449a7ed9689db5da8d25793707f2ebf via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: the folder name is an opt-in field the receiver can ignore, and the client loop reuses the existing send-session path without adding a route.

Notes

  • Keeping the send loop and its state in the browser tab means a reload in the middle of a send loses the rest of it, and nothing on screen shows that the send stopped. A send-folder route on the gateway would fix this, but that belongs in a follow-up if it shows up in practice.

[DESIGN-REVIEWED] f134d64

Description read

[DESCRIPTION-READ] 8350c4c9a801431a62254a40294325a4e8957567e2ff270ed7a3878c1a507488

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5, fork) — ✅ PASS

Premise-level review of f134d64c6449a7ed9689db5da8d25793707f2ebf via the fork AI-review pipeline — 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

Nothing blocks. Each item answers the stated harm: you can't send a whole folder, and its grouping is lost when it arrives. The single-session default and its byte-identical bundle are unchanged, so this is a new capability beside the old one, not a product-shape change.

What this change ships

Inventory (9 items) — 8 justified

Intent: let a person hand a whole folder of sessions to a connected crew and find them grouped under that folder there. This is an ADDITION.

  1. The folder menu (⋯ and right-click) gains "Send a copy to ▸ <crew>" — justified
  2. Copies sent this way land in Imported › from <sender> › <folder> on the receiver — justified
  3. send-session accepts an optional with_folder: true body flag (one consumer, the folder submenu) — justified
  4. The bundle carries an optional folder name, redacted on both sides, omitted when empty — justified
  5. The folder row shows progress (1 of 3) and the outcome; after a partial send, a click resends only the failed sessions — justified
  6. A send's progress and result survive closing and reopening the menu (module-level store) — justified
  7. Incognito and temporary sessions are skipped, and a visible row counts them — justified
  8. A disabled hint row says where the copies will land — undeclared
  9. The arrival-provenance RFC §4 gets an amendment, and the instances spec is updated — justified

[FIRST-PRINCIPLES-REVIEWED] f134d64

Description read

[DESCRIPTION-READ] 582d67f79b97c37aff3f8d6a5c7656ce78d7578683f5392553760c1cb39afef1

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5, fork) — ✅ PASS

UX-level review of f134d64c6449a7ed9689db5da8d25793707f2ebf via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

The eight committed screenshots cover every state of the new submenu: sending, partial, done, transcript-only, disconnected, nothing to send, skipped sessions, and a failed list load. Nobody has done a first-time blind read, because this lane reviews forks without one.

Notes

  • lands_in_folder shows placeholder text, "(this instance's name) › (this folder's name)". The component already has the folder's name, so put that in instead, and the instance name too if it can be resolved. Users would then see the real place their copies end up.

[UX-REVIEWED] f134d64

Description read

[DESCRIPTION-READ] 78b6955dc812446c1cd41b72f1afa559282d534f9816744f485a2e1555e99090

That sha256 names everything this verdict read: the PR description, plus the 11 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 13, 2026
@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review (fork) — ✅ no blocking findings

Reviewed a46502a3d9262ee77459b30a04e87eb18aee0451 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings. None of the five candidates holds up when checked against the code. Two are documented or intended behaviour, one is already caught by the snapshot's re-check, one is an advisory docstring point, and one needs an unlikely sequence of user actions and does little harm.

[OPUS-REVIEWED] a46502a

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review (fork) — ✅ no blocking findings

Reviewed a46502a3d9262ee77459b30a04e87eb18aee0451 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] a46502a

@koenvincent
koenvincent force-pushed the feat/send-folder-to-crew branch from aa930b0 to 7011954 Compare October 13, 2026 19:28
@koenvincent

Copy link
Copy Markdown
Contributor Author

Addressed at 7011954 (2 commits: the feature, then the screenshots):

  • Opus / GPT, blocking (errors-use-error-notice): a partial send now shows its first error through ErrorNotice (variant="inline", with an id), and its agent hand-off is a sibling ErrorNoticeMenuItem with describedBy set to that id. The count is status text only. Same shape as ExportSessionItem.
  • GPT, use-react-query: the send loop runs through useMutation, which is declared before the early return.
  • Design / UX, menu lifetime: the send state lives outside the menu, keyed by folder and crew, so closing the menu mid-send loses nothing. A reopened menu shows the running send (its row refuses a second, overlapping send) or the result. A test records progress and the outcome with no component mounted.
  • UX, retry duplicates: after a partial send, clicking the row resends only the sessions that failed, and the row's title says so. Retrying every key instead turns the test red.
  • UX, hover-only: the error is now readable in the row, and the skipped incognito/temporary count is a visible row of its own.
  • Design / UX, evidence: screenshots of the sending, all-sent, partial-failure (with the hand-off), disconnected and skipped states, in both themes, are committed under temp-screenshots/19859-send-folder/ and linked in the description.

I kept the "transcript only" wording, because the session submenu already uses it for the same outcome. The two-gateway check is still open, as the description says.

@github-actions github-actions Bot added readiness: checking Automated validation is still running merge conflict Branch has merge conflicts with its base — author must resolve before merge 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 Oct 13, 2026
@koenvincent
koenvincent force-pushed the feat/send-folder-to-crew branch from 7011954 to f5fd8e8 Compare October 13, 2026 21:32
@koenvincent

Copy link
Copy Markdown
Contributor Author

CI follow-up at f5fd8e8 (still 2 commits):

  • Frontend Lint & Type Check: TS6133, an unused import type React left over from the rework, is removed. npm run typecheck is now clean locally. The desktop and wheel builds failed on the same type check.
  • Frontend Tests, the [changed-values] style tests: the new retry_failed string used the formal register in fr, ru, bn and hi. It now uses tu, ты, তুমি and तुम, and the two fr colon strings now take U+202F. All 12 style files pass with I18N_BASE_REF=origin/main (117 tests). Putting the vous form back turns the fr test red.

@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 Oct 13, 2026
@koenvincent
koenvincent force-pushed the feat/send-folder-to-crew branch from f5fd8e8 to 7469168 Compare October 14, 2026 05:55
@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 merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Oct 14, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor

HOLD at 93d77b80098ab93af77842019d650a14d5662cf8.

The code reads sound. The sender redacts and clips the folder name and only adds it when with_folder is exactly true. The receiver drops a malformed value, redacts it again, and files the third level in the same folder transaction, falling back one level when the store is full.

This still needs a human, for two reasons:

  1. Reserved change. It changes what the session-transfer bundle carries to a peer and what gets egress-redacted (session_transfer.py, session_transfer_install.py, arrival_folders.py). Changes like this go to a maintainer, not to an automated approval.
  2. AI review items on this head have no reply. Design CONCERNS: the live two-gateway run that the description plans before merge has not been posted, and instances.md does not say a renamed leaf is not reused. UX CONCERNS: the finished-row re-send warning and the transcript only meaning are tooltip-only, there is no blind read, and the sending-row contrast suggestion is open. Opus noted that test/test_session_transfer.py is at 1656 lines, past the 1600-line target. The author's earlier replies were for older heads.

What would clear it: post the two-gateway run, add one sentence to instances.md on leaf reuse, post one disposition per remaining UX item and the Opus file-size note, and have a maintainer review the transfer change.

folder, _ = redact_exfiltration_urls(folder)
folder, _ = redact_credentials(folder)
folder, _ = redact_local_paths(folder)
folder = store_folder_name(folder)
bundle: dict[str, Any] = {
"bundle_version": BUNDLE_VERSION,
"origin": origin,
"title": title,
# Hint only — the importer drops it unless the target has this agent.
"agent": agent,
"messages": messages,
}
# Omitted when empty, so a bundle built without *folder* stays byte-identical.
if folder:
bundle["folder"] = folder

— crew-pr-reviewer (r115)

@koenvincent

Copy link
Copy Markdown
Contributor Author
  • not run yet span=1865e68d99f8 — No live two-gateway run

Still not run, and I won't claim it. It needs this build on both a sending and a receiving gateway. No released build carries it, and a preview pod does not start on the author's host (launchd Bootstrap failed: 5). What covers the path today: the sender's bundle with the folder name (test_session_transfer_folder.py), the receiver's three-level filing in one transaction with the one-level fallback and rollback (test_arrival_folders.py, test_session_transfer_landing.py), and the real send loop driving the real menu in the capture script. The planned run (3 sessions, one incognito; expect Imported / from <sender> / <folder> with 2 on the receiver and Sent: 2 plus the skipped line on the sender) stays the merge condition in the description. A maintainer who can run two gateways can do it, or I post it once an insider build carries the change.

@koenvincent

Copy link
Copy Markdown
Contributor Author
  • fixed span=d6b7fc0b17f2 — Re-send and a renamed leaf

Fixed on b169b99725. instances.md §14 now says a repeat folder send reuses the leaf only by name: the receiver looks up <folder> under the same from <this instance>, case-insensitively on the stored name (arrival_folders._find), so fixing its capitalisation keeps it. A leaf renamed on the receiver is not reused, and the next send creates a new <folder> beside it. Every send makes new copies, with no dedupe against an earlier send (checked: the import path has none, and the suite pins that the target key is always new).

@koenvincent

Copy link
Copy Markdown
Contributor Author
  • fixed span=3c8a0f41a32a — A finished row's re-send warning

Fixed on b169b99725. A finished row now shows "Click to send another copy of all N" as a visible line under its name, not only in title=. A partial row keeps its own "Click to resend the N that failed" line instead. The outcome badge moved onto the name line so these lines get the row's full width. Tested (folder-send-resend-hint present when done, absent when partial; removing it turns the test red). The capture script checks it on folder-send-outcomes-*.png.

@koenvincent

Copy link
Copy Markdown
Contributor Author
  • fixed span=e913ef41cfca — "transcript only" explained on screen

Fixed on b169b99725. A row with transcript-only copies now shows what that means as a visible line under its name: "That crew could not restore the full conversation context, so this copy resumes from the transcript alone." It reuses the single-send key transcript_only_hint, so no new copy and all 12 catalogs already have it. Tested, mutation-checked, and checked in the outcomes frame.

@koenvincent

Copy link
Copy Markdown
Contributor Author
  • needs a maintainer span=725712f5cbd0 — No blind read

Not something the author can do: this lane's blind read runs only for a branch in the upstream repo, and this PR comes from a fork. A maintainer who pushes the branch upstream gets it. Until then, the frames show every state in both themes, and the capture script asserts each label the reader sees.

@koenvincent

Copy link
Copy Markdown
Contributor Author
  • declined span=f6b25120546d — Name the destination in "Sent: N"

Declined, with a reason. The sender cannot truthfully name the folder the copies land in: the receiver files them under Imported / from <sender> / <folder> only when its folder store has room, and falls back one level when it is full (arrival_folders.arrival_folder_id). The send response does not report which level it used. Printing the full path would be wrong in exactly the case a person most needs to find the copies. Where the copies go is documented in instances.md §14. If the import response grows the filed path later, the row can show it then.

@koenvincent

Copy link
Copy Markdown
Contributor Author
  • fixed span=e50e19223dbd — Sending row contrast

Fixed on b169b99725. The row is no longer Radix-disabled while it sends (that set data-disabled, which dims the whole row to 50%), so 1 of 3 keeps normal contrast. A press while it sends is ignored in onSelect, so a second send cannot start. Tested: the sending row is not disabled, a press calls nothing, and putting either back turns a test red. The capture script also asserts full opacity and that a press makes no second call.

@koenvincent

Copy link
Copy Markdown
Contributor Author
  • fixed span=df485f440dc7 — test_session_transfer.py past 1,600 lines

Fixed on b169b99725. The sending-side folder tests moved to test/test_session_transfer_folder.py (126 lines, its own docstring pointing at the landing-side tests), so test_session_transfer.py is back to 1,549 lines, its size before this PR. Its module docstring now names the new file. All 6 moved tests pass alone and with the rest (153 in the transfer and arrival-folder files).

@iamwhatever

Copy link
Copy Markdown
Contributor

HOLD at 1ed2cae. This still needs a maintainer.

The PR changes what the session-transfer bundle carries to a peer and how that field is redacted (session_transfer.py, session_transfer_install.py, arrival_folders.py). Policy reserves that for a human. I found no defect:

  • The sender redacts the folder name before clipping it, and omits the field when empty (session_transfer.py#L631-L647).
  • with_folder counts only as the boolean true.
  • The receiver redacts the name again and files the third level in the same folder transaction, falling back one level when the store is full (arrival_folders.py#L368-L411).

The r115 items have replies. All 88 checks pass with 12 skipped.

Open on this head:

  1. Two-gateway run. The description makes it a merge condition, and it has not been run. A maintainer who can run two gateways, or a later insider build, can close it.
  2. First Principles item 6. The send state lives in a module-level Map with useSyncExternalStore (SendFolderToInstanceSubmenu.tsx#L39) beside a useMutation whose state nothing reads. Please drop one channel, or post a reasoned disposition.
  3. UX notes on this head. The reused transcript_only_hint is singular under a plural count, and nothing on the submenu says the copies land in a folder of the same name. Each needs a disposition.

What would clear this: a maintainer reviews the transfer change and the two-gateway run is done, and items 2 and 3 have dispositions on this head.

Reviewed head: 1ed2cae

— crew-pr-reviewer (r117)

@koenvincent

Copy link
Copy Markdown
Contributor Author

@iamwhatever replies to the r117 items on 1ed2caee59, all fixed on 6fbef5d1f4 (still 2 commits, same base):

2. First Principles item 6 (two state channels): fixed by dropping the mutation. The send state has to outlive the menu closing, so the module-level store (useSyncExternalStore) is the channel that stays. The useMutation wrapper, whose state nothing read, is gone: a click now calls startFolderSend directly. startFolderSend never rejects (sendFolderSessions catches every per-session failure into the outcome), so nothing is left unhandled.

3. UX notes:

  • Singular hint under a plural count: fixed. The finished row no longer reuses the session menu's transcript_only_hint. It has its own plural key, sendFolderToInstanceSubmenu.transcript_only_hint, counted by the transcript-only copies: "Sent: 5 (2 transcript only)" now reads "...so 2 copies resume from the transcript alone." It is in all 12 languages with each language's plural forms, and registered in pluralKeys.json.
  • Nothing said the copies land in a folder of the same name: fixed. The submenu now shows "Copies are filed on the crew in a folder of the same name." whenever there is something to send. It is hidden when nothing can be sent.

Tests: the submenu suite pins the counted hint for 1 and 2 copies and the folder line (shown, and hidden with nothing to send). Putting back the singular key, or removing the line, each turns a test red. The 38 translation suites (906 tests), the typecheck, eslint, the plural codemod check and the line-cap, comment-history and feature-map gates pass. The capture script re-took all 8 frames on this head and checks both new texts; the description links them.

Item 1 (maintainer review of the transfer change and the two-gateway run) stays open; I can't run two gateways from here.

@koenvincent

Copy link
Copy Markdown
Contributor Author

Re-pushed as a89c96738f: the same two commits as 6fbef5d1f4, now signed (identical tree, git rev-parse HEAD^{tree} unchanged). The replies above still apply to this head.

@koenvincent

Copy link
Copy Markdown
Contributor Author

New head 7bce1cfb00, signed, still 2 commits. GPT 6.1 F1 (pixel cap overrides the viewport-height limit), fixed: the submenu's height class is now max-h-[min(420px,var(--radix-<family>-content-available-height))], chosen by variant (dropdown or context), the same form ArtifactSendToSession.tsx and ChatHeaderMenu.tsx use. A short window caps it at the available height again. The class lives in folderSubmenuContentClass() so it can be tested: a new test merges it through cn the way each wrapper does and checks that the family's available-height cap survives and the bare max-h-[420px] is gone. It fails for both families against the old class. The 14 submenu tests, typecheck, eslint and the comment-history and line-cap gates pass. The screenshots are unchanged: at their window height the cap is still 420px.

@koenvincent

Copy link
Copy Markdown
Contributor Author
  • fixed span=0b2a45705ffc — a retry after a partial folder send replaced the first pass's outcome instead of merging into it

Fixed on c9369c6613, as the finding suggests. startFolderSend now takes the row's state before the send, and mergeRetryState folds a retry into a partial done state: sent and transcriptOnly add up, total stays the first pass's, and failed/firstError are the retry's, since only those keys are still unsent. Retry progress counts on from the first pass too ("4 of 5", not "0 of 1"). A send after a full send starts a fresh count, as before. The partial row now also shows the counted transcript-only hint, so a person learns about degraded copies before retrying. New tests in SendFolderToInstanceSubmenu.test.tsx: the finding's exact trigger (5 sessions, 4 sent with 2 transcript-only, 1 failed, then a retry of that one) through the shared store, a fresh resend, and the hint on a partial row. Reverting the merge, or the partial-row hint, turns its test red. The file's 16 tests, eslint and typecheck pass.

@iamwhatever

Copy link
Copy Markdown
Contributor

HOLD at 75e840e. This needs a maintainer.

The PR changes what the session-transfer bundle carries to a peer and how that field is redacted (session_transfer.py#L631-L647), and the receiver files a name from an untrusted bundle. Policy reserves that for a human. I found no defect: the name is redacted and clipped on both sides, with_folder counts only as true, and the receiver falls back one level when the store is full.

Open on this head:

  1. Design and UX notes on 75e840e have no reply. The description still says the send runs through useMutation, which the code no longer uses. Send state is per tab, so a second tab can start an overlapping send while the code comment says the row refuses one. The lands_in_folder line says a folder of the same name, but copies land under Imported / from <sender> / <folder>. The resend line does not warn that it makes duplicates. Fix or post a disposition for each.
  2. The two-gateway run the description lists as a merge condition has not been done.

What would clear this: a maintainer reviews the transfer change and the two-gateway run, and item 1 has dispositions.

— crew-pr-reviewer (r127)

@koenvincent

Copy link
Copy Markdown
Contributor Author

Item 1 of the r127 HOLD is addressed on 3888638cc0 (rebased onto 20c46e97d9, still two commits):

  • Design, useMutation in the description: fixed in the description. It now says a click calls startFolderSend directly and the state lives in the module-level store (useSyncExternalStore), as the code does.
  • Design, per-tab send state: documented as a known limit. The store comment in SendFolderToInstanceSubmenu.tsx now says the store is per tab and in memory, so another tab or a reload can start an overlapping set of copies; the description says the same. Accepted because each copy is independent and the finished row now warns that a click sends duplicates (next item).
  • UX, the resend line: resend_all now reads "Clicking again sends all {{total}} again (duplicates)", in the warn tone (text-warn-text) instead of the muted info tone, on the row and in its title.
  • UX, lands_in_folder: now reads "Copies land on the crew under Imported › from (this instance's name) › (this folder's name).", matching where arrival_folders.py files them.

Both strings are updated in en.json and all 11 translated locales, and en-XA is regenerated. SendFolderToInstanceSubmenu.test.tsx (16 tests) and the capture script assert the new text. The committed screenshots predate these two text changes; the description says so.

Item 2, the two-gateway run, is still open.

@koenvincent

Copy link
Copy Markdown
Contributor Author

On item 2 of the HOLD, the two-gateway run: I tried it today on an isolated Linux host with this branch at 66e69b0cd4. It could not start: kirocrew pod needs a systemd user bus, and the only single-host transport is ssh to localhost, which that host's sandbox refuses.

The checks I would run are written down: three sessions with one incognito, arrival under Imported / from <sender> / <folder> with Sent: 2, unchanged message text, the duplicate warning on resend, and a 300-character folder name arriving redacted and clipped. Would a maintainer accept deferring that run to a linked issue? If so, I will open it. @mbriones98 could you take the human review this PR needs?

@koenvincent

Copy link
Copy Markdown
Contributor Author

Opened #30231 for the two-gateway run and linked it in the description, so a maintainer can defer it there. The rest of this PR waits only on human review.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor) merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: action required A blocking check or review needs attention

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants