Skip to content

feat(members): export one crewmate as a .crewmate file from the profile card - #23223

Merged
iamwhatever merged 2 commits into
mainfrom
feat/crewmate-share-export
Oct 26, 2026
Merged

iamwhatever merged 2 commits into
mainfrom
feat/crewmate-share-export

Conversation

@iamwhatever

@iamwhatever iamwhatever commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: An owner can export one crewmate as a .crewmate file 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 .crewmate file, but nothing on main writes one. This is Phase 2 (Export) of the accepted RFC rfc-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

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.

Part What it does
crewmate_bundle_export.py (new writer) Builds the §5.2 zip. Holds the caps and name rules. Uses MCP placeholders and drops grants. Never opens an EXPORT_EXCLUDE name or follows a link. Strips picture metadata. Runs the crewmate.create credential and control checks on every carried text and file
POST /api/members/{slug}/export (dashboard/handlers/member_export.py, registered in dashboard/routes/agents.py) Owner-only (crewmate.export). With preview: true it answers the view's JSON; without, the zip as an attachment. Writes nothing on the server, so no change card
POST /api/members/{slug}/export/lessons-draft The one seam beyond the RFC's two routes. Owner-only. Reads only the crewmate's own private lessons through require_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 returned
CrewExportView.tsx, CrewProfilePanel.tsx The confirm view, with the §5.3 rows and defaults (crons on, lessons off) and the "Not included" line. Every script, prompt and skill file is shown in full. The press re-reads the plan; when it changed, the view lists the new plan and the press stops. The download carries the checked plan's fingerprint as confirm, and the server answers 409 plan_changed instead of writing a file whose content moved
MembersPage.tsx, MembersPageProfile.tsx Typed lessons text joins the page's draft guards, so every exit that unmounts the card (back, close, backdrop, identity pill, crewmate switch, route, reload) asks first
security_posture.py The writer is listed as a rejection predicate: it uses the redactor only to refuse a part, never to emit redacted text
api/client/agents.ts, api/client.ts, test/ApiClient.refactor.surface.test.ts The three client calls and their types, recorded in the client's key-order list
i18n/locales/*.json Every string in all 12 shipped locales, plus the generated en-XA.json

Parts 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 reason side.py records). The crewmate's own lessons are handed to the turn as fenced data.

Until the per-mate file lands, agent.json holds an empty mcpServers and skills. 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) and CrewExportView.test.tsx / CrewProfilePanel.test.tsx / MembersPage.schedules.test.tsx (112) lock in each §6 Phase 2 exit criterion and each nearby input:

Input Test
MCP secret in env, headers, oauth.clientSecret test_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
Script path with .., outside crons/, in a sub-folder, bad function test_a_script_path_outside_the_cron_folder_is_refused (5 cases)
Missing cron script test_a_script_cron_travels_with_its_script_and_a_missing_one_is_left_out
Skill with a symlink (folder, file, root) test_a_linked_skill_folder_file_or_root_is_never_followed
Skill holding a credential (in a file or its name), control char, .env, .local_secret test_a_skill_that_fails_a_check_is_left_out_with_its_reason (8 cases), test_an_export_exclude_name_is_never_opened
Non-ASCII name on a Windows codepage test_a_non_ascii_name_is_utf8_in_the_file_and_in_the_download_name
Picture metadata (PNG text, JPEG EXIF, WEBP XMP/ICC, trailers) test_picture_metadata_never_travels, test_bytes_hidden_after_the_image_data_never_travel
user: dashboard test_a_user_template_is_not_in_the_file_and_the_view_says_so
Lessons: only editor text, no memory row test_lessons_travel_only_as_the_text_left_in_the_editor, turning lessons on asks the crewmate for one draft…
403 for app token, internal secret, agent, colleague test_the_route_answers_403_to_everyone_but_the_owner, test_the_lessons_draft_is_owner_only
Nothing written on the server test_the_owner_downloads_a_file_and_nothing_is_written_on_the_server, test_the_draft_runs_one_tool_less_turn_and_stores_nothing
A file edited between view and download test_a_download_bound_to_a_preview_is_refused_when_a_file_changed, binds the download to the checked plan…
Typed lessons on backdrop or pill close asks before a click beside the card or the identity pill drops typed Export lessons
Another mate's private store test_a_record_naming_another_mates_private_store_gets_no_draft
Draft holding a credential, a control character, or over 256 KiB test_a_draft_that_fails_the_skill_file_bar_is_refused (3 cases)
Phase 1's reader on main test_the_written_file_is_accepted_by_the_phase_1_reader

Determinism: the backend file passed 3 runs under -n 4 and 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

  • The real CrewProfilePanel was rendered in a browser (Vite, Playwright) in English and Chinese, with the export routes stubbed, for the shots below.
  • A fresh read-only subagent that saw only the diff made one attempt to leak a secret or grant through export. It found picture metadata, unchecked MCP names in the preview, and zero-width-split tokens; all three are fixed and tested.
  • semgrep did not run locally: its wheel needs a newer glibc than the build host has. CI runs it.

Screenshots / video

Profile tab with Export as file under Notes

Export confirm view

Export confirm view in Chinese

The press stopped: a skill file changed after the view loaded, and the view now lists the new text (Chinese)

Back with typed lessons asks first

Plan changed (English) and discard question (Chinese)

Plan changed

Discard question in Chinese

Lessons drafted into the editor (English, Chinese)

Lessons editor

Lessons editor in Chinese

Related Issues

Closes #23199

Refs #21718

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

@iamwhatever
iamwhatever requested review from a team and KiroCrewCaptain as code owners October 22, 2026 23:07
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 22, 2026
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of cb8dd9ce5e0165556562ce89d39013975fc25873 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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

  • The lessons-draft route is the one seam beyond the RFC's two routes, and it runs a model turn from an export request. If the turn's session cleanup in _draft_turn fails, it is the only part of export that leaves state behind on the server. That would contradict the PR's claim that export "writes nothing on the server", so it needs its own failure path.

[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 .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 22, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of cb8dd9ce5e0165556562ce89d39013975fc25873 — 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

Every item maps to Phase 2 of rfc-crewmate-share.md, which is accepted on the base. The writer reuses the existing checks (redactor, owner gate, kirocrew-lite one-shot turn) instead of adding second copies.

What this change ships

Inventory (10 items) — 10 justified

Intent: let an owner hand one crewmate to someone else as a .crewmate file, with nothing private inside — an ADDITION.

  1. The profile card gains an Export as file row under Notes — justified
  2. A confirm view lists every part that leaves, with crons on, lessons off and a "Not included" line — justified
  3. Owner-only POST /api/members/{slug}/export: preview JSON, or the zip as an attachment — justified
  4. Turning lessons on drafts one SKILL.md in a tool-less, storeless turn, through its own owner-only route — justified
  5. The download is refused (409 plan_changed) when the plan changed after the owner checked it — justified
  6. Typed lessons text makes every exit from the card ask before dropping it — justified
  7. Parts that cannot travel are left out and named with a reason — justified
  8. The writer is listed among the redaction-as-rejection modules in security_posture.py — justified
  9. The import's description cap becomes a shared DESCRIPTION_MAX_CHARS constant that the writer also reads — justified
  10. A feature-map row and strings in all shipped locales — justified

[FIRST-PRINCIPLES-REVIEWED] cb8dd9c

Description read

[DESCRIPTION-READ] 1746d81bd75efe252b0057e690f7e19990bacccf9892712f2ec8d4115f56134f

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 22, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)

UX-level review of cb8dd9ce5e0165556562ce89d39013975fc25873 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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

  • Lessons discard dialog (mayLeaveExport): the diff ships title "Discard the lessons written for this file?", body "The mate's memory is not changed." and the button "Discard text". Shot-05 and shot-07 show none of these strings. The fix is a fresh screenshot of the dialog in English and Chinese.
  • Lessons draft states: no screenshot shows export_lessons_drafting with the text box disabled, export_lessons_no_memory or export_lessons_draft_failed. The fix is one shot of the Lessons row in each state.
  • Export errors: no screenshot shows export_load_failed, export_failed, export_lessons_refused, export_lessons_exfil_url or export_lessons_too_large next to the Export file button. The fix is one shot of the load error and one of a refused-lessons error.

Notes

  • export_plan_changed ("What leaves changed since this view loaded…"): the reader first took "leaves" as tree leaves. export_lessons_hint and export_loading use the same verb. Suggested rewrite: "The export changed after this view opened. Check the list, then press Export file again."
  • export_intro "Nothing is saved on this machine": the reader saw it as contradicting the download. Suggested rewrite: "The file holds exactly what is listed here. Nothing on this machine changes."
  • export_mcp_placeholders "Values to fill in: GITHUB_TOKEN…" sits under a yellow warning, and the reader read the key names as a leaked password. Suggested rewrite: "The receiver fills in: {{keys}}".

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

@iamwhatever
iamwhatever force-pushed the feat/crewmate-share-export branch from 057df87 to 8999d32 Compare October 22, 2026 23:10
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of cb8dd9ce5e0165556562ce89d39013975fc25873 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] cb8dd9c

False positive or not applicable? A repository writer can comment:
/ai-review override gpt cb8dd9ce5e0165556562ce89d39013975fc25873 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] cb8dd9c

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

False positive or not applicable? A repository writer can comment:
/ai-review override fable cb8dd9ce5e0165556562ce89d39013975fc25873 false-positive: <reason, 20 to 500 characters>

@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 22, 2026
@iamwhatever
iamwhatever force-pushed the feat/crewmate-share-export branch from 8999d32 to 3877d39 Compare October 22, 2026 23:49
@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=bc7eee5840ec -- Credential-bearing skill filenames bypass redaction

fixed in 3877d39: _read_skill runs text_refusal on each file NAME after NAME_RE; a skill with a credential-shaped file name is left out as credential, and its rejected name is never shown.
test: test_a_skill_that_fails_a_check_is_left_out_with_its_reason case {TOKEN}.md.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=00f27e3e6ac0 -- External profile exits silently discard typed lessons

fixed in 3877d39: the Export view reports typed lessons through onExportDraftChange to MembersPage, which adds it to schedGuardRef, schedAtStakeRef, the route-leave guard and the publish/beforeunload stake, so backdrop, identity pill, switch, route and reload all ask.
test: asks before a click beside the card or the identity pill drops typed Export lessons (MembersPage.schedules.test.tsx).

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=54856d77b45a -- Download can contain contents changed after the confirmation check

fixed in 3877d39: the preview carries a fingerprint of everything it shows; the download sends it as confirm, and the server rebuilds the plan and answers 409 plan_changed instead of writing a file whose content differs. The view then lists the new plan.
test: test_a_download_bound_to_a_preview_is_refused_when_a_file_changed, binds the download to the checked plan and shows the new one when the server says it moved.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in website/src/i18n/locales/*.json since this head went green (d6b9dc9 -> d853b55); CI re-running.

@iamwhatever
iamwhatever force-pushed the feat/crewmate-share-export branch from 3877d39 to e5a5400 Compare October 23, 2026 00:15
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Sensitive Change Review

Sensitive files changed:

  • src/kiro_crew/security_posture.py

  • @iamwhatever posted a complete reasoning template for cb8dd9c.

@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 Oct 23, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: e5a5400
  • What rule changed: NON_EGRESS_REDACTION_MODULES in src/kiro_crew/security_posture.py gains one entry, crewmate_bundle_export.py (the new .crewmate writer), under the existing gate-side comment group beside guide_catalog.py.
  • Before -> after (what was allowed/blocked, now): before, the redactor-call-site drift guard (test_every_redactor_call_site_is_a_registered_sink_or_allowlisted) failed because the new module calls _redacts without being classified; after, it is classified as a rejection predicate. No redactor, sink, pattern or gate changes; no existing entry is touched.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): the posture panel would not count the writer as an egress sink. The writer itself never emits redacted text: a part the redactor would change is left out of the file (text_refusal in crewmate_bundle_export.py), so no secret path depends on this classification.
  • Evidence checked (which sandbox result proves it): test/test_security_posture.py (56 passed) and test/test_crewmate_bundle_export.py (61 passed, incl. test_a_credential_in_rules_description_or_a_cron_prompt_stays_home, test_a_skill_that_fails_a_check_is_left_out_with_its_reason) on this head.
  • No regression:
    • Tools still work (which tools/commands were run, result): the allowlist is read only by the posture drift test; no runtime caller reads it for a decision. pytest test/test_security_posture.py test/test_crewmate_bundle_export.py -> 117 passed.
    • Backward compatible (old config / old data / old callers still work, how checked): additive frozenset entry; every existing entry and the posture snapshot are unchanged (TestDisclosureContract, TestOmissionDetection green).
    • Existing tests (which suites passed on this head): test/test_security_posture.py, test/test_crewmate_bundle_export.py; Static Ratchet Gate re-running on this head.
  • How to undo: remove the "crewmate_bundle_export.py" line and its two-line comment from NON_EGRESS_REDACTION_MODULES.

@iamwhatever
iamwhatever force-pushed the feat/crewmate-share-export branch from e5a5400 to 6a8e7e5 Compare October 23, 2026 00:58
@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 23, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=bc7eee5840ec -- Excluded command crons expose unchecked credential-bearing names

fixed in 6a8e7e5: portable_crons runs text_refusal on the full cron name first, before the 80-char cut and before the command / not-portable branches; a refused name is listed with an empty name.
test: test_a_refused_cron_name_never_reaches_the_preview (command and not-portable crons, token at start and past the cut); fails with the fix reverted.

@iamwhatever

iamwhatever commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor Author
  • span=663c705e678c -- Download bypasses the shared downloadBlob helper

fixed in 6a8e7e5: the press calls downloadBlob(blob, ${view.name}.crewmate) from website/src/utils/download.ts, which announces the download to the desktop shell and delays the URL revoke.
test: CrewExportView.test.tsx asserts downloadBlob is called once with a Blob and Scout.crewmate.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 6a8e7e5
  • What rule changed: NON_EGRESS_REDACTION_MODULES in src/kiro_crew/security_posture.py gains one entry, crewmate_bundle_export.py (the new .crewmate writer), under the existing gate-side comment group beside guide_catalog.py.
  • Before -> after (what was allowed/blocked, now): before, the redactor-call-site drift guard (test_every_redactor_call_site_is_a_registered_sink_or_allowlisted) failed because the new module calls _redacts without being classified; after, it is classified as a rejection predicate. No redactor, sink, pattern or gate changes; no existing entry is touched.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): the posture panel would not count the writer as an egress sink. The writer itself never emits redacted text: a part the redactor would change is left out of the file (text_refusal in crewmate_bundle_export.py), so no secret path depends on this classification.
  • Evidence checked (which sandbox result proves it): test/test_security_posture.py (56 passed) and test/test_crewmate_bundle_export.py (61 passed, incl. test_a_credential_in_rules_description_or_a_cron_prompt_stays_home, test_a_skill_that_fails_a_check_is_left_out_with_its_reason) on this head.
  • No regression:
    • Tools still work (which tools/commands were run, result): the allowlist is read only by the posture drift test; no runtime caller reads it for a decision. pytest test/test_security_posture.py test/test_crewmate_bundle_export.py -> 117 passed.
    • Backward compatible (old config / old data / old callers still work, how checked): additive frozenset entry; every existing entry and the posture snapshot are unchanged (TestDisclosureContract, TestOmissionDetection green).
    • Existing tests (which suites passed on this head): test/test_security_posture.py, test/test_crewmate_bundle_export.py; Static Ratchet Gate re-running on this head.
  • How to undo: remove the "crewmate_bundle_export.py" line and its two-line comment from NON_EGRESS_REDACTION_MODULES.

@iamwhatever
iamwhatever force-pushed the feat/crewmate-share-export branch 2 times, most recently from d00c8df to aa81b49 Compare October 25, 2026 07:51
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: aa81b496b0c33d2cd5d5e9bd95553cdba9cf1d36
  • What rule changed: src/kiro_crew/security_posture.py adds crewmate_bundle_export.py to the list of modules that act as rejection predicates (a part whose text the redactor would change is left out and named, never written redacted), for the file and for its bundled_skills function.
  • Before -> after (what was allowed/blocked, now): Before, the posture inventory did not list the new writer. After, it does. No allow or deny decision changes for any existing caller; the entry describes the new writer's existing behaviour.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): the posture inventory test fails, or the writer is listed under the wrong role. It cannot unlock a path or leak a secret: the entry is inventory, and the writer's own checks (text_refusal, the canonical-root reads, the reader read-back) stay in force either way.
  • Evidence checked (which sandbox result proves it): test/test_security_posture*.py and test/test_crewmate_bundle_export.py pass on this head. The export tests assert that no token, grant key, secret placeholder value or text from outside the skill folder reaches the zip bytes.
  • No regression:
    • Tools still work (which tools/commands were run, result): the related backend suites (3,960 tests: security posture, feature map, crewmate bundle, export and import routes, background turns) and the member page and i18n web suites (1,974) pass.
    • Backward compatible (old config / old data / old callers still work, how checked): additive. Only one entry is added; no existing entry moved or changed. Checked by diffing the file against origin/main.
    • Existing tests (which suites passed on this head): the suites above; black, flake8, isort, mypy, tsc and eslint are clean.
  • How to undo: revert the three added lines in security_posture.py, or revert this PR.

@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 25, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: aa81b49
  • What rule changed: src/kiro_crew/security_posture.py adds crewmate_bundle_export.py to the list of modules that act as rejection predicates (a part whose text the redactor would change is left out and named, never written redacted), for the file and for its bundled_skills function.
  • Before -> after (what was allowed/blocked, now): Before, the posture inventory did not list the new writer. After, it does. No allow or deny decision changes for any existing caller; the entry describes the new writer's existing behaviour.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): the posture inventory test fails, or the writer is listed under the wrong role. It cannot unlock a path or leak a secret: the entry is inventory, and the writer's own checks (text_refusal, the canonical-root reads, the reader read-back) stay in force either way.
  • Evidence checked (which sandbox result proves it): test/test_security_posture*.py and test/test_crewmate_bundle_export.py pass on this head. The export tests assert that no token, grant key, secret placeholder value or text from outside the skill folder reaches the zip bytes.
  • No regression:
    • Tools still work (which tools/commands were run, result): the related backend suites (3,960 tests: security posture, feature map, crewmate bundle, export and import routes, background turns) and the member page and i18n web suites (1,974) pass.
    • Backward compatible (old config / old data / old callers still work, how checked): additive. Only one entry is added; no existing entry moved or changed. Checked by diffing the file against origin/main.
    • Existing tests (which suites passed on this head): the suites above; black, flake8, isort, mypy, tsc and eslint are clean.
  • How to undo: revert the three added lines in security_posture.py, or revert this PR.

(Replaces the previous form, which named this head with a wrong full SHA.)

@iamwhatever
iamwhatever force-pushed the feat/crewmate-share-export branch from aa81b49 to 5275137 Compare October 25, 2026 08:58
@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=f6e0d4a1b2c3 -- Discard dialog restores superseded "crewmate" terminology

fixed in 5275137

export_discard_lessons_body now reads "The mate's memory is not changed." in English, per docs/decisions/2026-10-15-the-standing-teammate-agent-is-called-a-mate.md. Each other locale uses the word that locale already uses for a mate elsewhere in the catalog, and en-XA is regenerated. No other new English string says "crewmate"; the only remaining match is the .crewmate file extension, which is the format's name.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=c915f006db31 -- Discard dialog restores superseded "crewmate" terminology

fixed in 5275137

This replaces my previous reply, which named a wrong span. export_discard_lessons_body now reads "The mate's memory is not changed." in English, per docs/decisions/2026-10-15-the-standing-teammate-agent-is-called-a-mate.md. Each other locale uses the word it already uses for a mate elsewhere in the catalog, and en-XA is regenerated. No other new English string says "crewmate"; the only remaining match is the .crewmate file extension, which is the format's name.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 5275137
  • What rule changed: src/kiro_crew/security_posture.py adds crewmate_bundle_export.py to the list of modules that act as rejection predicates (a part whose text the redactor would change is left out and named, never written redacted), for the file and for its bundled_skills function.
  • Before -> after (what was allowed/blocked, now): Before, the posture inventory did not list the new writer. After, it does. No allow or deny decision changes for any existing caller; the entry describes the new writer's existing behaviour.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): the posture inventory test fails, or the writer is listed under the wrong role. It cannot unlock a path or leak a secret: the entry is inventory, and the writer's own checks (text_refusal, the canonical-root reads, the reader read-back) stay in force either way.
  • Evidence checked (which sandbox result proves it): test/test_security_posture*.py and test/test_crewmate_bundle_export.py pass on this head. The export tests assert that no token, grant key, secret placeholder value or text from outside the skill folder reaches the zip bytes.
  • No regression:
    • Tools still work (which tools/commands were run, result): the related backend suites (3,960 tests: security posture, feature map, crewmate bundle, export and import routes, background turns) and the member page and i18n web suites (1,974) pass.
    • Backward compatible (old config / old data / old callers still work, how checked): additive. Only one entry is added; no existing entry moved or changed. Checked by diffing the file against origin/main.
    • Existing tests (which suites passed on this head): the suites above; black, flake8, isort, mypy, tsc and eslint are clean.
  • How to undo: revert the three added lines in security_posture.py, or revert this PR.

@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 Oct 25, 2026
Joe Guo added 2 commits October 25, 2026 10:10
…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.
@iamwhatever
iamwhatever force-pushed the feat/crewmate-share-export branch from 5275137 to cb8dd9c Compare October 25, 2026 10:20
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: cb8dd9c
  • What rule changed: src/kiro_crew/security_posture.py adds crewmate_bundle_export.py to the list of modules that act as rejection predicates (a part whose text the redactor would change is left out and named, never written redacted), for the file and for its bundled_skills function.
  • Before -> after (what was allowed/blocked, now): Before, the posture inventory did not list the new writer. After, it does. No allow or deny decision changes for any existing caller; the entry describes the new writer's existing behaviour.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): the posture inventory test fails, or the writer is listed under the wrong role. It cannot unlock a path or leak a secret: the entry is inventory, and the writer's own checks (text_refusal, the canonical-root reads, the reader read-back) stay in force either way.
  • Evidence checked (which sandbox result proves it): test/test_security_posture*.py and test/test_crewmate_bundle_export.py pass on this head. The export tests assert that no token, grant key, secret placeholder value or text from outside the skill folder reaches the zip bytes.
  • No regression:
    • Tools still work (which tools/commands were run, result): the related backend suites (3,993 tests: security posture, feature map, crewmate bundle, export and import routes, background turns, governance policy viewer) and the member page and i18n web suites (1,974) pass.
    • Backward compatible (old config / old data / old callers still work, how checked): additive. Only one entry is added; no existing entry moved or changed. Checked by diffing the file against origin/main.
    • Existing tests (which suites passed on this head): the suites above; tsc is clean.
  • How to undo: revert the three added lines in security_posture.py, or revert this PR.

@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 25, 2026
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Oct 25, 2026

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

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.create credential and control-character checks, including a pass with invisible format characters removed. A failing part is left out and named, never written redacted. agent.json holds no MCP entry or grant. A skill folder holding an EXPORT_EXCLUDE name is refused before anything in it is opened.
  • Reads stay where they should. Every file read goes through safe_read_file_bytes_nolink against a resolved root. Cron scripts must sit directly in crons/. A linked skills root, skill folder, file, workspace or .kiro is 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-lite turn 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:

  1. docs/system-specs/modules/learn-cron-dashboard.md lists the member rules routes but not the export or lessons-draft routes. The import routes are missing there too.
  2. RFC §5.3 still says the crewmate itself drafts the lessons and that export never reads memory. It should record the separate lessons-draft route and the kirocrew-lite turn.
  3. A cron whose agent_sequence includes this mate is exported with a prompt written for the whole sequence. Consider listing it as not portable.

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.

Mate sharing Phase 2: export one crewmate as a .crewmate file from the profile card

2 participants