Repository navigation
feat(members): export one crewmate as a .crewmate file from the profile card - #23223
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: export only adds owner-only routes and a module, and the preview and the download come from one fingerprinted plan. Notes
[DESIGN-REVIEWED] cb8dd9c Description read[DESCRIPTION-READ] 7ea0e69e9e85b95621cb1b54b32b33bcf0fbb1fd5b25f0d747fde86fb8ee2bb7 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Every item maps to Phase 2 of What this change shipsInventory (10 items) — 10 justifiedIntent: let an owner hand one crewmate to someone else as a
[FIRST-PRINCIPLES-REVIEWED] cb8dd9c Description read[DESCRIPTION-READ] 1746d81bd75efe252b0057e690f7e19990bacccf9892712f2ec8d4115f56134f That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)UX-level review of UX-Verdict: PASS cannot evaluate: missing the shipped lessons-discard confirm dialog. Shot-05/07 show older copy ("Discard the lessons text?" / "Discard", no body). The diff ships a different title, body and confirm label, so the dialog users will actually see has not been reviewed. Evidence gaps
Notes
[UX-REVIEWED] cb8dd9c Description read[DESCRIPTION-READ] 0f435c4d2d2f105bad1cfa7238a63535495bad1ff3b4839acf7ba2ea00e3424f That sha256 names everything this verdict read: the PR description, plus the 12 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 |
057df87 to
8999d32
Compare
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
8999d32 to
3877d39
Compare
|
|
|
3877d39 to
e5a5400
Compare
Sensitive Change ReviewSensitive files changed:
|
Sensitive change review
|
e5a5400 to
6a8e7e5
Compare
|
|
Sensitive change review
|
d00c8df to
aa81b49
Compare
Sensitive change review
|
Sensitive change review
(Replaces the previous form, which named this head with a wrong full SHA.) |
aa81b49 to
5275137
Compare
|
This replaces my previous reply, which named a wrong span. |
Sensitive change review
|
…akes Lessons draft (GPT 6.1 BLOCK on 2fa4f1d): the draft ran on the shared background one-liner, so on a backend whose background turns share one provider conversation a draft for one crewmate stayed there for the next crewmate's draft and every later background turn. Each draft now gets a fresh session key (kirocrew-lite, REJECT_ALL), released and destroyed after the turn, and its native transcript is removed. Import compatibility, after the rebase onto #23424: - crons.json carries cron_expr, an optional message and a bare <file>.py:<function> script; each cron runs the reader's own check, and crons past 16 or skills past 32 stay home as bundle full. - Every cap and name rule, and the avatar sniffer, come from the reader and the upload route instead of the writer's own copies. - A name the import card refuses stops the export; a description over 1,000 characters or with a carriage return, rules with one, and a skill or script name the reader refuses are left out and named. - A last check reads the planned file back through the reader. - Skills come from <the mate's own workspace>/.kiro/skills, never from workspace/skills or the shared default workspace. Also: typed lessons stay guarded when the toggle is off; a lessons refusal carries a lessons_ code so the view words only those as such; a skill file that vanishes mid-read is left out, not a 500; the preview and its fingerprint run off the event loop.
5275137 to
cb8dd9c
Compare
Sensitive change review
|
buluoray
left a comment
There was a problem hiding this comment.
Reviewed at cb8dd9ce5e0165556562ce89d39013975fc25873. Approve.
This adds the export half of crewmate share: the owner can now hand a crewmate to someone as a .crewmate file. I read the decisive paths against source and found no blocking issue:
- Nothing private leaves. Every carried text runs the
crewmate.createcredential and control-character checks, including a pass with invisible format characters removed. A failing part is left out and named, never written redacted.agent.jsonholds no MCP entry or grant. A skill folder holding anEXPORT_EXCLUDEname is refused before anything in it is opened. - Reads stay where they should. Every file read goes through
safe_read_file_bytes_nolinkagainst a resolved root. Cron scripts must sit directly incrons/. A linked skills root, skill folder, file, workspace or.kirois refused. The shared default workspace is never read. - Gating and isolation. Both routes use the shared owner gate. The lessons draft reads only this mate's own store through the identity-checked resolver. It runs one tool-less
kirocrew-liteturn in a throwaway session that is destroyed afterwards. A download bound to a preview is refused 409 when the plan changed.
Verified locally: test/test_crewmate_bundle_export.py 103 passed; the four touched frontend suites 306 passed; tsc clean; i18n:check clean, with all 60 new keys in every locale. I removed 16 guards one at a time (link checks, EXPORT_EXCLUDE, credential and zero-width checks, cron containment, image stripping, grant stripping, owner gate, fingerprint, store resolver, default-workspace skip, draft checks). Each one turned a named test red. CI and every AI lane on this head pass.
Non-blocking follow-ups:
docs/system-specs/modules/learn-cron-dashboard.mdlists the member rules routes but not the export or lessons-draft routes. The import routes are missing there too.- RFC §5.3 still says the crewmate itself drafts the lessons and that export never reads memory. It should record the separate
lessons-draftroute and thekirocrew-liteturn. - A cron whose
agent_sequenceincludes this mate is exported with a prompt written for the whole sequence. Consider listing it as not portable.
Problem / Motivation
Goal: An owner can export one crewmate as a
.crewmatefile from its profile card, seeing exactly what leaves, with nothing private in the file.A person who built a good crewmate cannot hand it to a teammate. Phase 1 (#21718) reads a
.crewmatefile, but nothing on main writes one. This is Phase 2 (Export) of the accepted RFCrfc-crewmate-share.md(§5.2, §5.3, §6 Phase 2, §8), accepted by the maintainer in #21746 (comment).Why it matters
Without export, sharing stays one-sided: the import card has nothing to read, and people keep hand-copying records and templates. Export runs where the secrets are, so it is the one place the redaction can be enforced.
Not a goal
CrewmateSwitcher.tsx.agent.json: they wait on the mate-owned per-mate file (feat(crew): give each crewmate its own config, a conductor and a worker #23010, feat(agents): mate-owned agent config #21420, feat(agents): give the mate conductor its own source-defined spec #21463; RFC §5.7).What changed (motivation → approach → change)
The owner opens the profile card, taps Export as file under Notes, reads the confirm view, and downloads one file. Both the view and the file come from one server plan, so the view lists exactly what the file holds.
crewmate_bundle_export.py(new writer)EXPORT_EXCLUDEname or follows a link. Strips picture metadata. Runs thecrewmate.createcredential and control checks on every carried text and filePOST /api/members/{slug}/export(dashboard/handlers/member_export.py, registered indashboard/routes/agents.py)crewmate.export). Withpreview: trueit answers the view's JSON; without, the zip as an attachment. Writes nothing on the server, so no change cardPOST /api/members/{slug}/export/lessons-draftrequire_member_memory_store. Runs one throwaway turn that refuses every tool and stores nothing. A draft over the 256 KiB file cap, or one the credential or control-character checks refuse, is answered 422 instead of returnedCrewExportView.tsx,CrewProfilePanel.tsxfingerprintasconfirm, and the server answers 409plan_changedinstead of writing a file whose content movedMembersPage.tsx,MembersPageProfile.tsxsecurity_posture.pyapi/client/agents.ts,api/client.ts,test/ApiClient.refactor.surface.test.tsi18n/locales/*.jsonen-XA.jsonParts that cannot travel are left out and named with a reason: a missing or refused script, a shell-command cron, a skill holding a credential, link or sub-folder, a custom dashboard, goals after the first, anything past the 64-entry or 8 MiB cap.
The lessons turn runs as
kirocrew-lite(tools: []) rather than under the crewmate's own spec. kiro-cli runs tools its spec grants without asking, so refusing approvals alone could not stop them (the reasonside.pyrecords). The crewmate's own lessons are handed to the turn as fenced data.Until the per-mate file lands,
agent.jsonholds an emptymcpServersandskills. The view still lists the template's servers and the keys a receiver fills in, marked not in this file yet. The reader on main still refuses rules and bundled skills; Phase 1 widens it (§5.2).Backwards compatibility
Compatible: two new owner-only routes, a new view and new strings; no existing route, record or format changes.
Removes nothing: the diff only adds routes, a module, a view and a row.
Tests
test/test_crewmate_bundle_export.py(61) andCrewExportView.test.tsx/CrewProfilePanel.test.tsx/MembersPage.schedules.test.tsx(112) lock in each §6 Phase 2 exit criterion and each nearby input:env,headers,oauth.clientSecrettest_mcp_secrets_in_env_headers_and_oauth_become_placeholders_and_grants_go,test_the_file_holds_no_secret_and_no_grant_and_no_mcp_entry_yet.., outsidecrons/, in a sub-folder, bad functiontest_a_script_path_outside_the_cron_folder_is_refused(5 cases)test_a_script_cron_travels_with_its_script_and_a_missing_one_is_left_outtest_a_linked_skill_folder_file_or_root_is_never_followed.env,.local_secrettest_a_skill_that_fails_a_check_is_left_out_with_its_reason(8 cases),test_an_export_exclude_name_is_never_openedtest_a_non_ascii_name_is_utf8_in_the_file_and_in_the_download_nametest_picture_metadata_never_travels,test_bytes_hidden_after_the_image_data_never_traveluser:dashboardtest_a_user_template_is_not_in_the_file_and_the_view_says_sotest_lessons_travel_only_as_the_text_left_in_the_editor,turning lessons on asks the crewmate for one draft…test_the_route_answers_403_to_everyone_but_the_owner,test_the_lessons_draft_is_owner_onlytest_the_owner_downloads_a_file_and_nothing_is_written_on_the_server,test_the_draft_runs_one_tool_less_turn_and_stores_nothingtest_a_download_bound_to_a_preview_is_refused_when_a_file_changed,binds the download to the checked plan…asks before a click beside the card or the identity pill drops typed Export lessonstest_a_record_naming_another_mates_private_store_gets_no_drafttest_a_draft_that_fails_the_skill_file_bar_is_refused(3 cases)test_the_written_file_is_accepted_by_the_phase_1_readerDeterminism: the backend file passed 3 runs under
-n 4and one run with all 55 node ids in reversed order. The image strippers took 30,000 random inputs with no exception or hang.Manual verification
CrewProfilePanelwas rendered in a browser (Vite, Playwright) in English and Chinese, with the export routes stubbed, for the shots below.semgrepdid not run locally: its wheel needs a newer glibc than the build host has. CI runs it.Screenshots / video
Plan changed (English) and discard question (Chinese)
Lessons drafted into the editor (English, Chinese)
Related Issues
Closes #23199
Refs #21718
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)