Repository navigation
Conversation
|
Intent: Make |
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: |
1d36e3a to
125c0c1
Compare
UX Review (Fable 5) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS Icon-only ↺ "Clear Context" in the re-laid-out agent rail is unreadable: the blind reader called it "restart or refresh that helper? no idea." Watch
Suggestions
[UX-REVIEWED] a99af92 Description read[DESCRIPTION-READ] 520d17541e4639d8171f2a4ff421b8f8f547dc9092eacd5d6422b652138227a6 That sha256 names everything this verdict read: the PR description, plus the 9 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 |
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Verify one real upgrade: a pre-upgrade Suggestions
[DESIGN-REVIEWED] a99af92 Description read[DESCRIPTION-READ] 0efd8e1869e9cc91659b5f63cdd894f57424ff8762298605c80d8bd3bcb6e70e 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 (Fable 5) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS The create-collision check now lives in two divergent copies (CLI vs dashboard), and a channel-rail control re-layout rides along with no named failing user. Not justified as shipped
What this change shipsInventory (10 items, capped — the change has more) — 8 justifiedIntent: make a crew member's display name a pure label — rename freely, nothing the member owns moves — by keying
[FIRST-PRINCIPLES-REVIEWED] a99af92 Description read[DESCRIPTION-READ] c7386bec27ac5476a5ce4566adf4b2601e45ce568f54dffe8afd2e597ccfd687 That sha256 names the PR description this verdict read. Recompute it with |
Opus 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: |
125c0c1 to
926d188
Compare
|
|
|
|
926d188 to
96113de
Compare
|
|
|
|
|
8c3e478 to
cd8cf82
Compare
cd8cf82 to
0c6b439
Compare
0c6b439 to
b270cd6
Compare
b270cd6 to
b89c7e2
Compare
…field config.agents is keyed by the crew's immutable member_id; the free-form name becomes the display_name field. member_id keeps the allocation _allocate_member_id already does (now also reserving every agents key, display name and remembered legacy key), and a rename edits display_name only -- key, members/<id>/, DM slot key, cron member_id, owner_member_id and the avatar files (stemmed by the id) never move. Migration: KiroCrewConfig.load serves the id-keyed view and writes nothing; migrate_member_identity is the one writer -- once, under the config lock, off-loop at gateway boot and in the CLI prologue -- re-keying the document (old key kept in legacy_keys and as display_name when the record had none, default_agent following), moving fork-sidecar private_to owners onto the id (re-derived from legacy_keys on every boot, so a failed sidecar write is retried) and moving every member's picture from any legacy handle onto its id without ever overwriting. Collisions are refused and logged; id-less entries keep their key. Every user-facing handle (API path params, chat/spawn crew=, cron member_id, slot pins, select_crew) resolves through members.resolve_member(handle): key first, then the unique display_name, then a remembered legacy key; unknown -> 404. Roster responses carry member_id + display_name and keep name as an alias of display_name for one release; the picker dispatches member_id so a chat slot survives a rename. Overlay patches land on every alias an overlay still carries; a rename purges its new label from stale team entries; the sync prune judges staleness on binding fields only. Fixes #13688. Predecessor: #11121.
|
🤖 Kiro Crew [operator: dwu96#8c08bee0]: This PR has been inactive for 7+ days. All 89 checks are green and readiness passed, so the only thing standing between it and merge is the conflict — but I measured it before offering to drive it, and the resolution needs your hand rather than mine:
For reference, these conflicts are mechanical and not what I'm asking you for — When you've rebased and settled items 7 and 8, the pipeline will re-assess on its next cycle. Add |
bolichen97
left a comment
There was a problem hiding this comment.
PR triage (automated, against origin/main 5edf2feecb): requesting changes for a breaking change that isn't declared, plus a required rebase
I read the full diff (head a99af92b, merge base 3a770911) and compared it against current main.
- This is a breaking change for anyone with an existing config, but the PR doesn't say so.
migrate_member_identity(config/loader.py) rewrites the user'sconfig.jsononce, soagentsis keyed bymember_id. The## Backwards compatibilitysection itself admits a downgraded release then shows every member under its id, and lookups by the old label miss until the user upgrades again or edits the file. A one-way rewrite of persisted user data is a take-away change underdocs/system-specs/common/take-away-changes.md. The body has zeroReader:lines and noBreaking:line. Please list each reader of the old key shape (chat resume, cronagent, subagent spawn, app bundles,profiles/task binds, Slack channel bindings,crews_wearingindashboard/appearances.py,handlers/files.pyworkspace refs) with a test for each, and add aBreaking:line for the downgrade behaviour. - A public helper is removed while main still calls it. The PR deletes
members.key_new_crew,NewCrewKeyandcrew_id_for_display_name. Since the merge base, #16786 (d167e192b8) moved create intosrc/kiro_crew/dashboard/agent_admin/crew_records.py, which callskey_new_crewat L343. This branch never touches that file. Open PRs #15326 (Captain) and #16200 also importkey_new_crew. The rebase has to re-home the create keying intocrew_records.py. Please also settle First-Principles item 7 there: use one shared create-collision predicate instead of the two divergent copies incli_commands.pyandagents.py. - The branch is stale. It is 1,037 commits behind main and
mergeable_state=dirty(see the operator comment above for the conflict breakdown). Thereadiness: passedresult was measured against the old base.
I found no P0 bug in the diff as written. The relationship to merged #14865 is overlap/replacement: this PR deliberately replaces #14865's create-time keying. It is not a duplicate.
|
@bolichen97 thanks for the review. Where this stands against current main:
Before that rework, a maintainer needs to pick one approach:
Which one should the new PR take? Marking this PR |
|
Superseded by #25805, a fresh branch off current main. Closing this one (branch kept). @bolichen97, on your review:
|
Problem / Motivation
Goal: A crew member's display name is just a label: you can rename it freely and nothing the member owns moves.
Today
config.agentsis keyed by the member's display name, and the stable identifier (member_id) lives inside the record. That is backwards. #11121 made display names free-form (spaces,., non-ASCII), so the key is now presentation text: every rename is a key rewrite, and every lookup path has to re-validate presentation text before it can find the record. The Design Review on #11121 flagged the consequence: a name later judged non-dispatchable strands the member's thread with no non-lossy repair.Why it matters
member_idis already minted once at create time and already binds the durable things:members/<id>/, the DM slot key, the DM thread binding, cronmember_id, and the memory store'sowner_member_id. Leaving the name as the key means a plain rename can orphan all of them, and every one of the ~30config.agents[name]sites is one bad name away from resolving the wrong crew or none.Not a goal
kiro_agentTEMPLATE name; nothing there changes.kiro_agentgrammar is untouched.namealias from API responses (kept for one release).name; the pickers built onAgentSelector(Schedule, Channels, Projects) now storemember_id, and the surfaces that render a stored value resolve it back to the display name through the roster (utils/agentLabel). The chat agent pop-up (AgentDropdownList) is untouched.What changed (motivation → approach → change)
"agents": {"Crew Program Manager": {"member_id": "crew-program-manager", ...}}"agents": {"crew-program-manager": {"member_id": "crew-program-manager", "display_name": "Crew Program Manager", ...}}display_name; identity never movesThe key is the id the allocator already mints;
_allocate_member_idalso reserves every existingagentskey and display name, so a fresh id never equals another member's handle. Create allocates the id first and inserts under it.KiroCrewConfig.loadis read-only for identity: it serves every entry whosemember_iddiffers from its key under the id (old key kept inlegacy_keys, and asdisplay_namewhen the record had none;default_agentfollows) and writes nothing.migrate_member_identityis the one writer: once, under the config lock, it re-keys the document, moves the fork-sidecarprivate_toowners onto the id (only on the template the record is bound to) and every member's picture from its old key onto itsmember_id, never overwriting; a failed sidecar rewrite is retried on every boot fromlegacy_keys. It runs off-loop in the gateway's post-readiness memory worker and in the CLI prologue; idempotent, never raises. A contested id is left as stored and logged.merge_config_documentsfolds overlayagentsentries and both sides'default_agentonto the member's id (a rememberedlegacy_keysentry included), so an overlay-patched member stays one member; an unresolvable default is logged.Migration boundary:
load()= read-only view;migrate_member_identity()= the only identity writer (boot, off-loop, before member handlers; CLI); every other writer patches the raw document where the record is stored (raw_agent_key).Where each piece lives:
src/kiro_crew/members.pyavatars_root/avatar_stem(digest of themember_id) /rekey_avatar_files;resolve_member,resolve_member_id,member_record,member_display_name,same_member;member_sluganswers either handlesrc/kiro_crew/agent_state.pyrekey_private_owners/claim_private_owner: sidecarprivate_tofollows the member idsrc/kiro_crew/config/loader.py,config/migration.py,config/sections.pyplan_member_rekeys,migrate_member_identity(the one-shot writer),raw_agent_key,legacy_key_aliases, in-memory re-key on load,_resolve_agent_selection/resolve_crew_identityresolve handles; thedefault_agentwrite-back canonicalizes a display-name spelling to the key;display_namefield docssrc/kiro_crew/memory_stores.pyowner_member= display name; legacy owner checks accept the labelsrc/kiro_crew/execution_context.py,subagent_manager/admission/gate.py,session_capabilities.py,member_essential_context.py,context.py,acp/session_handle.py,mcp_core.pysrc/kiro_crew/agent_capabilities.py,dashboard/handlers/agent_capabilities.pyprivate_to, spec and config-binding writes all index by it, and the binding write patches the raw document under every key the record is stored under (raw_agent_keys: the id and any legacy-label alias an overlay still carries, so a later-wins merge can neither shadow the write nor keep a stale binding)src/kiro_crew/crew_teams.py,dashboard/handlers/teams.pysrc/kiro_crew/dashboard/handlers/agents.py,handlers/members.py,handlers/messaging.py,handlers/memory_admin.py,chat_handlers.py,chat_persistence.py,openai_compat.pymember_id/display_name/name; rename validation; avatar files keyed bymember_id; the sync prune judges staleness on binding fieldssrc/kiro_crew/cli.py,cli_commands.py,doctor_checks/agents.py,slack/gateway.py,apps/builtins/auto_improvement/backend/crew.pymigrate_member_identity;kirocrew agent create/update/delete/listand the Auto-Improvement role members on the keyed shape (a role adopts the member labelled with its name, andensure_teamrefuses a role name a retired record still holds as its key or a legacy key, naming the record to delete, because key-first resolution would otherwise shadow the replacement); doctor vets BOTH the key it prints and the display name dispatch would use, so a credential-shaped key behind a benign label is counted without being printedconfig-baseline.jsondisplay_nameandlegacy_keyshelp textwebsite/src/utils/agentLabel.ts(new helpers),components/AgentSelector.tsx,pages/SchedulePage.tsx,pages/ChannelPage.tsx,pages/settings/ChatPanel.tsx,api/client.ts,api/defaultAgentQuery.ts,website/src/i18n/locales/*.json(one new string,pages.channelPage.roster_names_failed= "Couldn't load agent names — showing roles only.")crewHandle(row)(=member_id, ornamefor a project row) and matches either handle (isHandleOf); every surface that renders a stored value resolves it to the display name through its roster (agentDisplayLabel/agentOrDefaultLabel(agent, default, agents));KiroCrewAgent/MemberRosterRowgain optionalmember_id;defaultAgentQueryreads the response'sname(label). The channel rail'sAgentControlRowis re-laid out as part of this: the role title and the resolved crew name each take the row's full width and wrap, and no line carries more than two controls -- the title line holds the title and ✕ (remove) alone, so a medium name is never squeezed or fractured mid-word; the line below holds the state badge, the listen-mode trigger and ↺ (clear context), and WRAPS so a wide badge pair never pushes ↺ past the 256px rail. This answers the UX review on this PR, which read the 256px rail with the name beside the state badge as "Cr…" (round 20-21) and, once the name had its own line, the role beside the badge and the two buttons as "R…" (round 22) -- anonymous rows with a live destructive ✕members.resolve_member(handle, config)is the one lookup helper: the key wins, then the unique record whosedisplay_nameequals the handle, then the unique record whoselegacy_keysholds it; anything else isNone. Every user-facing handle goes through it or its wrappers (resolve_member_id,member_record,same_member,member_display_name): the/api/agents/{name}routes,/api/members/{slug}?member=,/api/config/default-agent, teams, capabilities, the DM-thread pin check, chat and OpenAI-compatible member slots,select_crew/route_crew,resolve_crew_identity/_resolve_agent_selection(everycrew=), the CLIagent update/delete, and the essential-context, admission and watchdog lookups.Responses from
GET /api/agents,GET /api/members,select_crewand the create/update routes carrymember_idanddisplay_name;namestays an alias ofdisplay_namefor one release, andGET /api/agentsand the catalog spelldefault_agentlike their rows. A label that would be masked falls back to the key inname. Create and rename validate the label and refuse credential-shaped text or another member's handle. A rename moves no files: the picture is filed under the immutablemember_id; a failed sidecar repair or config write leaves the label unchanged. The picker (AgentSelector) dispatchesmember_id, so a slot stores the identity and survives a rename; an older slot holding the label still matches. Surfaces rendering a stored id resolve it through the roster and wait forsettledfromhooks/useAgents.ts, so the id never flashes. Private-copy (private_to) and memory-store ownership (store_owned_by_member:owner_member_idfirst, the label only for an id-less record) are decided on the id, so a member taking a retired label inherits nothing. Identity text, roster bindings, event-log ownership, team purges and capability overlay reads go by the key, showing the label;docs/system-specs/modules/config.mddescribes the rule.Identity namespace: who may collide with whom, and the guard.
T=test/test_agents_keyed_by_member_id.py.plan_member_rekeys: only a SURVIVING move vacates its key; a refused move (duplicate id, target key stays) re-occupies it and refuses its mover, to a fixed point;rekey_agents_documentnever writes two entries to one keyT::TestPlan::test_refused_move_does_not_vacate_its_key,test_refusal_cascades_along_a_chain_onto_a_staying_key,test_document_rekey_never_drops_an_entry,TestIdentityNamespaceProperty::test_arbitrary_documents_migrate_without_loss_and_idempotently_allocate_member_idreserves everyagentskey (own key exempt)T::TestResolver::test_allocator_reserves_every_key_allocate_member_idreserves every other entry'sdisplay_name, spelled exactly asresolve_membercomparesT::TestResolver::test_allocator_reserves_every_display_name,TestCreateAndDeleteEdges::test_create_never_mints_a_key_that_is_a_live_label, property (b)_allocate_member_idreserves everymemory_stores[*].owner_member_idtest_member_memory_ownership.py::test_deleted_member_identity_stays_reserved_by_retained_storePOST /api/agentsrefuses whenresolve_member(name)orresolve_member(display_name)answers (409agent_exists)T::TestCreateAndDeleteEdges::test_create_refuses_a_handle_that_is_another_members_label,test_config_api.py::test_create_duplicate_returns_409key_new_crewon both create surfaces and keeps its user-facing rules where they fit the id model: a typed name that already IS a member-id slug is the key as sent with no label of its own (the roster shows the key) -- unless that id is reserved (a retired store, a legacy key), in which case the id is suffixed and the typed name stays the label so the crew still answers to what the user typed (test_crew_memory_store_binding.py::test_delete_then_same_name_create_keeps_old_store_and_starts_fresh), any other name -- free-form, or agent-id grammar such asScribe_2that is not slug grammar -- seeds the slug and stays the label; the derived id is suffixed-2,-3... deterministically past every reserved identity before the random tail; an explicitdisplay_name(--display-nameon the CLI) wins as the label; and the collision check is on the handles the crew will CARRY (its shown label and, for a slug-shaped name, the key), so a free-form name another crew shows is free when this crew shows a different label.key_new_crew/NewCrewKey/crew_id_for_display_nameare removed with their tests (no consumer left);is_crew_idstays and backsis_member_id_shapedtest_crew_display_name.py::TestCreateEndpoint(10, adapted: the answer'smember_idis the id,nameechoes the label),test_cli_agent.py::TestAgentCreate(unchanged),test_config_api.py::test_crud_create_round_tripPUT /api/agents/{name}refuses a labelresolve_memberanswers with another member (409)T::TestRename::test_rename_to_another_members_handle_is_refusedpersist_member_config's locked mutation, not by the caller's pre-lock snapshot: a created key and label, and a renamed member's new label, are rechecked withmember_handle_holdersagainst the document under the lock (own keys exempt) and a taken handle raisesMemberAlreadyExists, which the create and rename routes answer 409agent_exists; two writers racing for one spelling (a CLI create beside a dashboard rename, an app'sensure_team) leave one record, never a shadowed duplicateT::TestHandleUniquenessIsDecidedUnderTheLock(6)display_name; id occupied by a staying entry is refused, not guessedT::TestPlan::test_id_already_used_as_a_key_is_refused,TestLoadMigration::test_colliding_id_stays_where_storedresolve_memberanswers a shared label withNone: refused, never guessedT::TestResolver::test_shared_display_name_is_refusedmerge_config_documents/canonicalize_overlay_agentsfold the overlay entry onto the base member's id;_canonical_overlay_agentsin the capability service resolves against the UNMERGED base document, exactly as the merge does -- against the merged view an overlay entry that renames the very label it is keyed by looks like nobody's, and the binding write would land inconfig.jsonunderneath the shadowing overlayT::TestOverlayStaysOneMember(3),TestLabelledMemberSurfaces::test_capabilities_see_an_overlay_entry_filed_under_the_legacy_key,::test_capabilities_resolve_the_overlay_against_the_unmerged_base,test_agent_capabilities.py::test_overlay_entry_that_renames_its_own_label_still_saves_in_the_overlaylegacy_keys(record field, written once by the migration, travels withconfig.json);legacy_key_aliasesfeedscanonicalize_overlay_agents,canonical_agent_keyandresolve_memberrule 3; a live key or label beats a remembered key and a key two records remember answers nobodyT::TestOverlayStaysOneMember::test_overlay_under_the_legacy_key_of_an_explicitly_labelled_member_stays_attached,test_a_live_handle_beats_a_remembered_legacy_key_allocate_member_idreserves everylegacy_keysentry; create and rename refuse a handleresolve_memberanswersT::TestOverlayStaysOneMember::test_allocator_and_create_reserve_a_remembered_legacy_keyload()writes nothing for identity;migrate_member_identityis the only writer, one-shot, under the config lock, off-loop at gateway boot and in the CLI prologueT::TestLoadMigration::test_load_is_read_only_and_the_migration_lands_onceprivate_to× key/labelmembers.member_owns_private_copy, one predicate behind the fork/publish/reset routes and the capability seams; a legacy spelling counts only for the template the record is bound to); the migration moves the sidecar's owners INSIDE the config transaction from that run's plan alone -- a sidecar that cannot be written abandons the config write, so the next boot derives the same plan from the still-unkeyed document and retries -- and NOTHING is ever derived from a record's persistedlegacy_keys, an agent-writable field a record could spell an orphaned owner into to be handed that private copyT::TestPrivateCopyOwnershipIsById(incl.test_a_sidecar_write_that_fails_abandons_the_config_write_and_the_next_boot_retries,test_legacy_keys_never_drive_a_sidecar_owner_move)canonicalize_teams+ handler_Registrystore the key once; create purges an entry left under the label; a rename purges its NEW label the same way (a deleted crew's label whose drop failed would otherwise be inherited by whoever takes it); delete drops both spellingsT::TestTeamsHoldOneIdentityPerMember(2),TestLabelledMemberSurfaces::test_create_purges_a_team_entry_left_under_the_label,test_member_memory_publication.py::test_a_rename_purges_the_new_label_inside_the_locked_mutation_validate_namesbounds the value a write RETAINS (the canonical key) byMEMBER_NAME_MAX_CHARS/ UTF-8, not the handle submitted, so a short label addressing an agent-authored oversize key cannot persist a documentread_teamsthen refuses whole; the read view (canonicalize_teams) keeps the stored spelling over an unbounded key andprune_unknownhides itT::TestTeamsBoundTheRetainedIdentity(2)owner_member_idis authoritative;owner_member(the KEY an earlier layout stamped, when labels were the keys) is read only for an id-less record and as an owner SPELLING throughmember_owns_private_copy-- the member's key or its own unambiguous legacy key, never a display name (a deleted crew's store does not follow its label to whoever wears it next); one predicatememory_stores.store_owned_by_membershared bymember_store_ownership_holds,_store_is_member_owned, the sync prune and the delete routeT::TestLabelledMemberSurfaces::test_labelled_members_store_is_recognised_as_owned,test_legacy_owner_label_is_an_owner_spelling_not_a_display_name,test_members_dm_thread.py::...[store_owner]raw_agent_key: the planned mover for a base document, the LAST folding entry for an overlay, sincecanonicalize_overlay_agentsmerges later-wins;raw_agent_keyslists every folding alias and the capability binding write patches all of them), never beside it under the id; used by the capability binding write,persist_member_config, and everyupdate_config_lockedmutate that starts from a member id (DELETE /api/agents/{name},_rebind_crew_locked, the fork's binding write), andkirocrew agent delete, which otherwise answer 500 / a spurious 409 / a misleadingnot foundon an install whose disk has not migrated yettest_session_capabilities.py::test_capability_write_lands_on_the_legacy_record_when_the_rekey_has_not_persisted,T::TestHandleRoutes::test_delete_before_the_disk_migration_removes_the_legacy_entry,test_rebind_before_the_disk_migration_finds_the_legacy_entry,T::TestOverlayStaysOneMember::test_raw_agent_key_files_a_patch_where_the_record_is,test_raw_agent_key_patches_the_effective_overlay_alias,test_merge_without_a_plan_honours_remembered_legacy_keys,TestLoadMigration::test_member_update_patches_the_legacy_record_before_the_migration,T::TestCliDeleteFindsTheStoredRecord(2)config.jsonwith nomember_idkeeps its authored key, so the roster'smember_idis agent-writable text like every other record value and goes through_roster_mask(a credential- or URL-shaped key arrives EMPTY, never raw and never the sentinel -- see "masked key × picker dispatch");GET /api/membersapplies the same rule, so a pre-existing credential-shaped key behind a benigndisplay_name(legal while labels were unvalidated) passes the row's handle gate without shipping the keyT::TestRosters::test_agent_authored_key_is_masked_like_every_other_row_value,T::TestRosters::test_members_row_never_ships_a_key_the_mask_would_alterapi_member_thread(entry, running-path revalidation, the recheck after the namespaced assignment) issame_member, never an exact key compare: a thread rehydrated from history under the crew's old label opens instead of answering409 member_slot_conflicton every open with nothing left to re-pin it. The entry check then ADOPTS the canonical key ontoslot.agent(the same adoption an empty pin gets): the send path compares the binding'smember, a key, toslot.agentby exact equality, so a legacy spelling merely accepted would 409 the very next turntest_members_dm_thread.py::test_private_thread_reopen_accepts_an_idle_slot_pinned_under_the_labelname--member_roster_handle(showable by_roster_mask, dispatchable, held alone) -- behind/api/agents,/api/members, the team responses and the default marker, so a label the mask leaves alone but that cannot be dispatched (trailing whitespace predating the rename validation) is the key everywhere and a crew is never listed under two namesT::TestSharedLabelsFallBackToTheKey::test_an_undispatchable_label_ships_the_key_on_every_rosterresolve_effective_agent)publish_agent_alias_snapshotpublishes every handle a slot may hold for a member -- the key, itsdisplay_name, eachlegacy_keysentry -- so a pre-upgrade session still pinned under a member's old key reads as that member, never as a substitution that never happenedtest_dashboard_state_ws.py::TestSlotEffectiveAgent::test_a_slot_under_a_members_old_key_is_not_a_substitutionagentinto a label or a roster row goes through the roster (agentOrDefaultLabel(agent, default, installedAgents)/isHandleOf), so a member slot storing the id shows the display name with its source tint and session colour, and the model-pin row finds the member's record; the sidebar rows and the composer / pane chips HOLD the label (blank) until the roster has answered, the same hold the Schedule column and the channel rail apply, so the stored id never flashes before its nameChatSidebar.defaultAgentMarker.test.tsx(member slot named and tinted from the stored id; held blank until the roster settles)config.local.jsonwriterconfig set --localcannot file an entry under that label in the window and find it re-homed onto the new member. The check runs for EVERY contested handle, not only one another record remembers: an overlay entry orphaned by a member delete (delete removes the base record, never the user-owned overlay) would otherwise fold onto the new member at the next load and merge its fields in; the create refuses and names the entry. A handle this record already answers to (its key, label, legacy keys) is its own and is exemptT::TestHandleUniquenessIsDecidedUnderTheLock::test_the_overlay_is_locked_from_the_check_to_the_commit,::test_an_orphaned_overlay_entry_is_never_reassigned_to_a_new_memberprepare_runtimere-reads the record afterreconcile_member_capabilities; a record that is gone by then refuses with the closedcapability_member_missing, the same code the pre-check gives, never an attribute error out of.workspacetest_session_pool.py::TestGetOrCreatePoolIntegration::test_member_deleted_during_reconcile_refuses_with_the_closed_codetaskbind × re-keyed membertaskbind resolves by EXACT id only -- never through a record'sdisplay_nameorlegacy_keys, which are agent-writable config fields a record could spell itself as to select a task profile (which outranks the surface profile). Andprofiles/is never WRITTEN from the migration either: it is the sandbox-read-only governance keystone whileconfig.jsonis agent-writable, so a bind rewrite derived from a key move orlegacy_keyswould be a write primitive from the writable file onto the read-only one (a record spelling a bound id as its own earlier key would have the administrator's profile moved onto its id at the next boot). Fail-secure instead: the re-key REFUSES to move a record whose current key ataskprofile binds (plan_member_rekeysreadsgovernance_profiles.task_bound_snapshot-- the profile store's in-memory snapshot, no filesystem walk on the event loop -- in memory and on disk alike), so the record keeps its key and the ceiling keeps applying; and it refuses EVERY move while that snapshot cannot be trusted (store not yet loaded, or a profile file present but unrecoverable), because a bind it could not read might name the key a record would leave; the refusal names the profile and the exact re-point (profile X binds task:'Old'; re-point it to task:'member-id' and the next boot moves the record). A bind authored against a key the record already left cannot be protected by refusing a done move;stale_task_bindsreports it with the same re-point every boot (summary keystale_task_binds) and says when the report is incomplete. Neither path writesprofiles/test_governance_profiles.py::test_task_binding_never_resolves_through_agent_writable_aliases,::test_stale_task_binds_reports_and_writes_nothing,T::TestLoadMigration::test_a_record_whose_key_a_task_profile_binds_keeps_its_key_until_re_pointed(in-memory and on-disk refusal, then the move once re-pointed),::test_an_unreadable_profile_refuses_every_re_key_until_it_is_fixed,::test_a_profile_bound_after_the_move_is_reported_every_bootname(member_roster_handle/_agent_roster_rowrequire the label to address the record alone), so every row's handle is onePUT/DELETE /api/agents/{name}and the team routes answer instead of a labelresolve_memberrefuses to pick betweenT::TestSharedLabelsFallBackToTheKey(3)_log_owner_handles(key, current label, recorded legacy keys), never the label alone; the reconcile and the rename hook write the keytest_members_eventlog_wiring.py::test_a_renamed_member_keeps_its_projection_and_write_throughmember_id), immutable and unique by construction: a rename moves no file; upload, serve, promote, reap and delete all address the id whichever handle the URL carriedT::TestAvatarFilesAreKeyedByMemberId(5),test_agent_avatar.py::test_crew_delete_removes_avatar_filesmigrate_member_identitysweeps every member on every boot: files under the old key or anylegacy_keysentry move onto the id stem -- never a file under a display name, which no earlier build used as a stem (labels were presentation-only), so such a file belongs to whichever identity once had that spelling as its key -- and only a handle the record owns UNIQUELY: a live key is never a source, the key this run moved a record from is that record's alone, and a legacy key two records remember moves nothing; a variant already present under the id is never overwritten and the legacy source stays in place (logged), as does one that cannot be moved, so nothing is lost and the next boot retriesT::TestLabelledMemberSurfaces::test_picture_filed_under_a_label_is_never_adopted,test_rekey_moves_pictures_filed_under_the_old_key_onto_the_id,test_avatar_rekey_never_overwrites_and_retries_the_source_next_boot,test_avatar_rekey_leaves_an_unmovable_source_in_place,test_avatar_sweep_never_moves_a_live_members_picture,test_avatar_sweep_leaves_a_contested_handle_in_placemember_id(AgentSelector.crewHandle), so the slot stores the identity; an older slot holding the label still matches its row, the server resolves either handle, and the roster's most-used-first sort takes the bestagent_usagetuple across every spelling a session may have pinned (member_id,name, eachlegacy_keysentry), so history recorded before the upgrade still orders the pickerwebsite/src/test/AgentSelector.test.tsx(3: dispatches the id, shows the label for an id slot, matches an older label slot),T::TestUsageSortIsKeyedByMemberId(2)member_id× rendered labelagentOrDefaultLabel(agent, default, agents)), the channel agent rail (label andtitle), the Settings › Chat pinned default (isHandleOf) -- viautils/agentLabel(agentDisplayLabel,isHandleOf,crewHandle); a value the roster does not list renders verbatimwebsite/src/test/agentLabel.storedHandle.test.ts(4)member_id_roster_maskwould alter is shipped EMPTY, not as the sentinel: the picker prefersmember_idovername, and a sentinel there would pin the slot to a handle no member has, while the global row'snamewas left unmasked to stay reachableT::TestRosters::test_agent_authored_key_is_masked_like_every_other_row_valuedefault_agentspelling × deletedocument_default_names_member: the top-level and migration-eraagent.default_agent, expanded bymember_handle_holdersagainst the rawagentsmap, so a defaultkirocrew config set default_agent <display-name>wrote verbatim still refuses the delete (the route maps the in-lock refusal to 409, not 500)T::TestDeleteGuardReadsEveryDefaultSpelling(3)POST /api/agentsallocatesmember_keyBEFORE the foreign-private-copy check and asks about that key -- the one every later ownership question (reset, publish, rebind, capability seams) asks with -- not the requested labelT::TestCreateChecksLineageForTheStoredKeycanonicalize_teamsapplies the cross-team first-wins rule (_parse_teams's) while mapping, so a write never persists one identity in two teams for the next read to drop silentlyT::TestCrossTeamDedupeOnCanonicalizemember_handle_holders(label) == [key], else the key -- the roster's own chooser -- so the agent is never told a name no route resolvescontext.py; existingtest_member_essential_context.py/test_member_turn_context.pygreen)owner_member_idor the keyaname, never the row's reusabledisplay_nametest_agent_sync_prune.py::test_prune_deletes_an_entry_written_by_an_earlier_build,test_prune_entry_unchanged_judges_every_field_both_entries_carry,T::TestPruneOwnershipIgnoresDisplayNamesGET /api/agents/catalogbuilds its member rows with the wholeagentsmap, so two records sharing adisplay_nameboth ship their KEY asname(the roster's rule) instead of one label the picker's fold-by-name would collapse into a single row, dropping a member from the schedule form and channel pagestest_agent_execution_catalog.py::test_catalog_falls_back_to_the_key_for_a_shared_label_do_agents_syncrefuses a discovered agent whose name any Crew Member already holds -- as key,display_nameor alegacy_keysentry (members.member_handle_holders) -- on the snapshot AND again inside the config lock, so a member renamed towriteris never shadowed by a package rowwriterthat the resolver would prefer (key beats label) and that carries no private memory; the refusal is loggedtest_agent_sync_prune.py::TestAgentSyncRefusesMemberHandles(4: display name, legacy key, a free name still registers, a rename landing between scan and lock)default_agent× key/labelcanonical_agent_keyon both documents; unresolvable default logged; a base default spelled as a key the document still holds (a legacy key this load re-keyed in memory only) pends no write-back -- the spelling is right for the disk andmigrate_member_identitymoves it with the record -- so no cache-miss load re-takes the lock to make no progressT::TestDefaultAgentFollowsTheMember(5),T::TestLegacyKeyDefaultIsNotWrittenBackByTheLoaddefault_agentlegacy_keys(and drops a label that becomes live again), so an overlay entry or adefault_agentstill spelled with the prior label folds onto the same member instead of surfacing as a second partial member or a substituted default; a no-op rename writes nothingtest_rename_keeps_the_prior_label_as_an_alias,test_rename_to_the_same_label_records_no_aliasdm.jsonwritten while the record had nomember_idnames the member by its label;read_member_rulesattributes such a payload when the recorded label still answers to THIS member (itsdisplay_nameor a legacy key; a label another member now holds live does not -- the live namespace wins), andread_dm_bindingcanonicalizes the label onto the key on the way in, so the permanent rules keep binding after the upgrade and the bound DM thread keeps its slot keyT::TestLabelledMemberSurfaces(rules under the pre-publication label, under a renamed-from label, under a label another member holds; the context builder reads them; a legacy binding still binds; a binding naming another member's live label is not rewritten)legacy_keysentry is a forwarding address the live namespace beats in every resolver, so a create or rename may publish it as a LABEL (the write retires the alias in the same mutate) while a KEY is still refused when any spelling holds it; the one closed case: an overlay (config.local.json) entry still filed under that label would follow it onto the new member, so the label is refused with a message naming the entry to re-fileT::TestHandleUniquenessIsDecidedUnderTheLock(publishes and retires the alias; overlay entry refuses; the rename route accepts),test_reused_label_does_not_inherit_the_renamed_members_copymember_id× the roster's own lookups/api/memberskeys its binding match, projection and header attribution on the record's real key carried beside the row, and ships the maskedmember_idonly in the payload, so a record whose key the redactors would alter still reports its bound threadtest_a_masked_key_row_still_reports_its_live_bindingconfig.local.jsonas "no entry"; a file that cannot be read or is not JSON refuses the create/rename (409member_memory_unavailable, nothing written, the message names the file), so a repaired overlay never wakes up filed under a member that took the label while the guard could not see itT::TestHandleUniquenessIsDecidedUnderTheLock(malformed overlay refuses; unreadable overlay refuses; rename route 409, nothing written)member_id× every rendering surfacedefault_agentis spelled like its rows'name(the display name, masked for an app token), so the inherited-default chip and the row match read the label; the Schedule Agent column resolves a stored id through the roster and waits for the roster to settle (as the channel rail does) so the id never flashes, and the Schedule filter's haystack carries that resolved label beside the stored handle, so typing the name shown in the column matches the row; Webhooks is left untouched -- a token pins a template, never a crew handle (see Manual verification)test_catalog_default_agent_is_spelled_like_the_default_row,SchedulePage.agentColumnSettled.test(2: settles, filters by the shown name)rekey_private_owners) and the legacy-key read (member_owns_private_copy(..., template=)) both accept a plan key / legacy key as an owner spelling only on the template the record is BOUND to (kiro_agent; a receipt also on the copy it was published from), so a retired member's copy that the delete-time cleanup could not prove safe to drop -- still spelling the label a newcomer was later keyed by -- neither moves onto the newcomer nor reads as theirs at the bind gate; the rename path'sclaim_private_owneralready applied this one-template ruleT::TestPrivateCopyOwnershipIsById::test_migration_leaves_an_orphaned_copy_under_a_reused_label,::test_namesake_cannot_bind_a_deleted_members_orphaned_copy,::test_a_published_templates_receipt_moves_by_the_public_nameAlice -> alicewhilealice -> alice-7f3lands both instead of refusing the first (destination stem occupied) and never attempting the second (source now a live key); staged files a crashed run left are landed on the next bootT::TestAvatarFilesAreKeyedByMemberId::test_avatar_rekey_lands_when_one_crews_old_key_is_anothers_new_keydefault_agent× a retired legacy keylegacy_keys(the parsed-map twin oflegacy_key_aliases) before the existence check, so it names that crew as every other resolver does instead of being substituted and written back; the Schedule Agent column likewise treats a REJECTED catalog fetch as "no roster" and keeps holding the labelT::TestDefaultAgentFollowsTheMember::test_base_default_by_a_retired_legacy_key_still_names_that_member,SchedulePage.agentColumnSettled.test.tsxNone, (d) migration recovers the state and is idempotentT::TestIdentityNamespaceProperty::test_namespace_stays_consistent(hypothesis, 300 examples)Backwards compatibility
Compatible: an old-shape
config.jsonloads unchanged in behaviour (dual-read) and is written back once in the new shape; every handle a client or slot already holds (a display name) still resolves through the resolver;nameremains in every response as the display name. The one tightening is on writes, not reads: adisplay_namethat fails the create-time name validator or collides with another member's handle is now refused with the same 400/409 the create route already returns.Downgrade (new shape read by a release before this PR): the older loader keys
agentsby what it finds, so each member appears under itsmember_id(crew-program-manager) instead of its label,display_nameandlegacy_keysare carried as unknown fields, and a lookup by the old label misses until the user re-upgrades (the dual-read resolver then serves both spellings again) or renames the key by hand. Nothing is lost: no record, store or picture is removed by the rewrite, and the fork sidecar'sprivate_tounder the id is simply foreign to the older code, so the private copy is hidden, not deleted, until the upgrade. The rewrite runs once and is idempotent, so a downgrade-upgrade cycle leaves the document as this PR wrote it. Governance profiles:profiles/is never rewritten. A record whose key ataskprofile binds is NOT re-keyed until the operator re-points the bind to themember_id(the boot log names the file and the exact edit), so the administrator's ceiling never detaches as an upgrade side effect; a bind authored after a move is reported the same way every boot.Tests
test/test_agents_keyed_by_member_id.py(new; alsoTestDeleteGuardReadsEveryDefaultSpelling,TestCreateChecksLineageForTheStoredKey,TestCrossTeamDedupeOnCanonicalize,TestPruneOwnershipIgnoresDisplayNames, a second usage-sort case, and the avatar sweep re-specified so a display-name-stemmed file is never adopted): a load writes nothing and the one-shot migration lands once;raw_agent_keyfiles a patch where the record is and a plan-less merge honours remembered legacy keys; an overlay under the legacy key of an explicitly labelled member stays attached across loads, a live handle beats a remembered key, the allocator reserves remembered keys; a labelled member's store is recognised as owned by the reopen and admission checks and a legacy owner label resolves through the member it names; a picture filed under the label or the old key moves onto the id, never overwriting and leaving an unmovable source in place; a failing sidecar repair during rename leaves the label unchanged; a sidecar write that failed once is retried fromlegacy_keyson the next boot;raw_agent_keynames the effective (last) overlay alias; a labelled crew's roster row reports its DM binding; identity text says the display name; create purges a team entry left under the label; the capability service reads an overlay entry filed under a legacy key; the re-key moves a picture filed under the old key onto the label; a legacy labelprivate_tois rewritten to the id on load, a label owner is foreign to everyone, and a member taking a renamed member's old label cannot bind its private copy; an overlaydefault_agentby legacy key or display name selects the migrated member, a base default by display name is written back as the key, an unresolvable default is logged, and/api/config/default-agentaccepts either handle while/api/agentsspells the default like its rows; a rename moves no avatar file and keeps serving the committed pin, and a failed config write keeps the picture; create refuses a credential-shapeddisplay_name; delete reaps a private copy still owned by label; overlay entries under a legacy key or display name fold onto the member with the overlay left unwritten andmerge_config_documentscanonical on both sides; a team naming a member by id and by display name stores it once, moves it across teams under either spelling, and a legacy display-name document reads as the key; planner (re-key, id-less keeps key, id already a key refused, duplicate id refused, a refused move keeps its key so its mover is refused too, refusals cascade along a chain, the document rewrite never drops an entry); allocator reserves display names and create never mints a key equal to a live label, create refuses a handle held as another member's label; identity-namespace property tests (random create/rename/delete over colliding labels, arbitrary tangled documents); load migration (old shape → keyed by id with old key asdisplay_name,default_agentfollows, write-back lands once and is idempotent, new shape not rewritten, collision stays where stored); resolver (by key and by display name, key beats a display-name spelling, shared display name refused,member_slugfor either handle, allocator reserves keys with own-key exemption); rosters carrymember_id+display_name+namealias on both endpoints; rename keepsmember_id, memory store, slug and DM binding while refusing a taken handle or an invalid name; update by id and by display name hit one record; unknown handle → 404; delete by display name; dispatch identity resolves either handle; a team write refuses a canonical key the reader would not read back and the read view keeps the stored spelling over one; two records sharing a label ship their keys asnameand the shared label is 404 while each key is answered; the usage sort ranks a labelled crew by the key sessions pin;kirocrew agent deleteby id finds the record under its legacy key and still refuses the default under either spelling; a basedefault_agentspelled as a still-stored legacy key pends no write-back and is moved by the one-shot migration; a created or renamed handle taken between the snapshot and the lock is refused inside the lock (409), never written twice; an owner recorded under an unambiguous legacy key still owns their private copy while a live key or a contested spelling owns nothing; the capability service's lineage and receipt checks accept that same unambiguous legacy-key owner and fail closed on a contested one; a fork's publish receiptmemberfollows the re-key;/api/membersships an emptymember_idfor a credential-shaped key behind a benign label. Rules and DM bindings recorded under the pre-re-key label still attribute to the member (and not to a member who now holds that label live); a create or rename takes a label another member only remembers as a legacy key and retires the alias, refuses it while an overlay entry is still filed under it; the masked-key row still reports its live binding.test_cli_doctor_member_memory.py: a credential-shaped key behind a clean label is counted and never printed.test_agent_execution_catalog.py: two members sharing a label ship their keys asname.Updated:
test_governance_profiles.py(a record spelling itself as a bound task id viadisplay_name/legacy_keysselects nothing; the stale-bind report names atask:<old key>bind on a moved record and writes nothing),AgentSelector.test.tsx(the id chip beside a covering label shows themember_id, the handleagent=addresses -- never the roster'sname, which is the label),SchedulePage.agentColumnSettled.test.tsx(a failed catalog fetch leaves the kind cell's tooltip as the model alone, never a bare separator),test_session_capabilities.py(a binding write lands on the legacy record while the re-key has not persisted),test_members_eventlog_wiring.py(a renamed member keeps its projection and config write-through; a label header still proves ownership),test_members_dm_thread.py(the concurrent-ownership fault flipsowner_member_id, the authoritative field),test_session_capabilities.py(members seeded under their ids; a capabilities save through the display name lands under the key and reads back by either handle),test_auto_improvement_members.py(rename is adisplay_nameedit and a legacy re-keyed document loads the same way; the Scout adopted under a distinct id stays governed under that id, not its template; a replacement role member is found by its label; recovering a role whose name a retired record still holds as its key is refused with the config unchanged until that record is deleted),test_crew_memory_store_binding.py/test_member_memory_ownership.py(a recreated member is reached by its name, keyed by a suffixed id),test_member_essential_context.py(a display-name handle selects the member labelled with it),test_crew_routing_and_delegation.py(crewis the key,display_namealongside),test_config_api.py/test_agent_publish_endpoint.py(mocks accept the alias keyword),test_agents_roster_contract.py(member_idjoins the pinned row key set and is identity, not masked content;legacy_keysis classified withheld; fixtures'member_idequals their key),test_crew_display_name.py(rows located bymember_id; masked label falls back to the key inname),test_members_roster_redaction.py(rows keyed bymember_id),test_select_crew.py(crewis the key,display_namerides along),test_agent_sync_prune.py(package sync refuses a name a Crew Member holds by key, display name or legacy key, on the snapshot and inside the lock; a field only the live entry carries keeps the row from a stale prune), theChannelPagesuites (the agent rail's roster fetch is mocked).Manual verification
Isolated worktree gateway (
dev-backend.sh, ownKIROCREW_HOME, port 6789,--no-crons; the live gateway untouched), built SPA from this head. Seeded through the real API:POST /api/agents {"name": "Crew Program Manager"}→member_id: crew-program-manager;POST /api/cronswithagent: "crew-program-manager"(what the Schedule form's picker now stores);POST /api/channelswith a role whoseagentis that id. Then, in headless Chromium against that gateway: the Schedule table's Agent column and the channel agent rail both read Crew Program Manager; agetByText('crew-program-manager', {exact: true})probe on each page counts 0; norole=dialogwas open when either frame was taken. The Webhooks page is untouched by this PR: a webhook token pins a TEMPLATE (GET /api/agents/installed, rows withoutmember_id) and the create route refuses any other destination --POST /api/webhooks/tokens {"agent": "crew-program-manager"}against the same gateway answered400 destination_agent_unavailable-- so no crew handle can ever be stored there and there is nothing to resolve. Old-shape boot, same gateway:config.jsonrewritten by hand to the pre-PR document (agentskeyed by the labelCrew Program Managercarryingmember_id: crew-program-manager, nodisplay_name,default_agent: "Crew Program Manager", the cron's stored agent left as the label), gateway restarted: after boot the document is keyedcrew-program-managerwithdisplay_name: Crew Program Manager,legacy_keys: ["Crew Program Manager"]anddefault_agent: crew-program-manager; a secondmigrate_member_identity()call reportsrekeyed: 0; the Schedule row and its picker still read Crew Program Manager for the label-valued slot. A record with nomember_id(a legacy template-style agent) is deliberately left under its key -- it has no identity to key by. Gateway torn down afterwards.Screenshots / video
The picker stores
member_idfor a crew; both surfaces that render the stored value show the crew's display name, not the id. Dark theme, 1280×800 @2x, captured against the isolated gateway described under Manual verification.Schedule — a job created with the crew picked as "Crew Program Manager" (stored
agent: crew-program-manager) showsagent · Crew Program Managerin the Agent column:Schedule -- the edit form of the second id-stored job ("Weekly program digest",
agent: crew-program-manager) with the crew picker open, the control this PR rewires: the trigger reads Crew Program Manager, and the marked-current row is that crew with its idcrew-program-manageras the small chip beside the label -- the handleagent=in spawn params, crons and the CLI address, kept readable exactly because the label now covers it (a template row such askirocrewhas one handle and no chip). Captured against the repo's dist fixture harness (website/scripts/lib/serve-dist.mjs+stub-dashboard-api.mjs) with a migrated roster; dark theme, 1440×900 @2x:Schedule -- the same table while the roster fetch (
GET /api/agents/catalog) fails: the Agent column shows the kind (agent, the separator belongs to the name line and is withheld with it) with the crew name withheld, no stored id is printed, and the cell's tooltip is the model alone (sonnet) rather than a bare separator; the toolbar'sErrorNoticewith Retry (the form's own recovery, unchanged here) is the one report. Same fixture harness, catalog route answering 500:Channels -- the agent rail, first with the roster fetch (
GET /api/agents/catalog) failing, then after Retry. Each row is the role title (wrapping at word boundaries, never truncated) with the ✕ remove button on one line, the resolved crew name on its own line beneath, and the state badge, the listen-mode badge and the ↺ clear-context button on a third line -- two controls per line at most. While the names are unavailable the standardErrorNoticereads "Couldn't load agent names — showing roles only." -- the vocabulary every sibling surface uses (Schedule's column is "Agent"), saying what still shows: the role names beneath it are the channel's own -- with Retry as its one action beneath it, and the crew line is not rendered (so no stored id is). A Retry that lands resolves the name. This is a failure state, so it is captured against the repo's dist fixture harness (website/scripts/lib/serve-dist.mjs+stub-dashboard-api.mjs) with the catalog route answering 500, then 200 on Retry; dark theme, 1280×820 @2x:Chat -- the sidebar session rows and the composer's agent chip for a session pinned to the member (stored
agent: crew-program-manager): both read Crew Program Manager, the template-pinned sibling readskirocrew, and no stored id is on the page. Held blank until the roster answers, so the id never flashes. Same fixture harness, 1440×900 @2x:No motion or element replacement is introduced, so stills suffice.
Related Issues
Predecessor: #11121 (free-form display names, merged).
Fixes #13688
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)