Repository navigation
feat(crews): key new crews by an id and keep the typed name as label - #14865
Conversation
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsFINDING -- src/kiro_crew/members.py:442 -- False positive or not applicable? A repository writer can comment: |
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Verify that automation creating a free-form [DESIGN-REVIEWED] 4e8cb30 Description read[DESCRIPTION-READ] eb84bf0489dfb32fc003b4092cd9a0e4170f117d30bd30d167b3cf30603c79d3 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) — ✅ human override accepted@buluoray overrode this lane for |
UX Review (Fable 5) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS On the refused-name state, the still-enabled Create crewmate button leaves users unsure whether re-clicking would duplicate — the blind reader "would not dare" press it. Watch
[UX-REVIEWED] 4e8cb30 Description read[DESCRIPTION-READ] 1263b353b6ccd5350c0fd7ef6b21c91ff112bfa0428c90d914bc3f82f958f34b That sha256 names everything this verdict read: the PR description, plus the 7 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 |
Opus 5 Review — ✅ no blocking findingsReviewed Review detailsNo blocking defect; the derived crew id now reaches three places that must show the crew's label. FINDING — website/src/pages/members/NewCrewmateDialog.tsx:399 — after a create whose answer is lost, the reconcile matches the typed name against the roster's key ( FINDING — website/src/pages/members/MembersPage.tsx:2358 — FINDING — src/kiro_crew/members.py:473 — [OPUS-REVIEWED] 4e8cb30 Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
|
Disposition for the reviews of UX Review (BLOCK: no legible evidence). Fixed. The GIF is replaced by four stills in the description: the dialog with a free-form name, the crewmate opened under its derived id with the label shown, the duplicate refusal, and the Agents roster.
While capturing the evidence I found that the seeded first message greeted a new crewmate by its id ("Hi launch-notes"). It now uses the label, with a vitest. Design Review (CONCERNS). Fixed on create. Editing an existing crew's label ( First Principles (CONCERNS).
Backend Tests shard 4 and Coverage Gate. Inherited from main. |
A crew's config key is its identity: routes, crons, teams, spawn and the member directory all address it. Since free-form names were accepted, a label with spaces or CJK text became that identity too, leaning on lossy slugs and name-collision guards everywhere. POST /api/agents and `kirocrew agent create` now keep an id-shaped name as the key and turn a free-form one into the display_name of a derived id (slug, -2 past a taken id, crew-<hash> for a name with no slug characters). The create answer's name is that id, so the New crewmate dialog opens what it made. A free-form name another crew already shows is 409 agent_exists. Crews stored under a free-form key stay readable and are never renamed. The CLI gains --display-name.
The taken check only guarded a free-form name, so an explicit display_name on create could still mint a label another crew shows. members.key_new_crew now decides key, label and refusal for both create surfaces, checking the name the crew will show (explicit label, else the typed name, else the key). The New crewmate dialog refuses a shown label up front, not only a taken key, and greets a new crewmate by the name it shows rather than its derived id. The create answer no longer carries display_name, which nothing read.
18743e7 to
4e8cb30
Compare
|
UX Review (CONCERNS) on |
|
/ai-review override first-principles 4e8cb30: Owner decision: a new crew is keyed by an immutable id (_AGENT_NAME_RE grammar) and the typed name is stored as display_name (added in #13561); free-form keys already stored stay readable and dispatchable and are never renamed. This supersedes the write-side keying #11121 introduced. Why: a key is referenced by crons.json Scope: create paths only (POST /api/agents, |
Human judgment recorded@buluoray marked the first-principles AI finding as false positive, not applicable, or explicitly accepted for
This decision applies only to this commit. A new push requires a new judgment. |
bolichen97
left a comment
There was a problem hiding this comment.
Reviewed on behalf of the maintainers (readiness sweep 2026-09-29): readiness passed, the required PR Readiness check is green on this head, no live CHANGES_REQUESTED, no open blocking review threads; where the PR's files also moved on main since its merge-base, the PR's own tests were run on the main+PR merge tree and passed. Approving and squash-merging.
Problem / Motivation
Goal: New crews are keyed by a stable id while the name the user typed is shown as their display name, without breaking any crew or client that exists today.
A crew's
config.agentskey is its identity:/api/agents/{name}, crons, teams,spawn_run(crew=), slot metadata and the member directory all address it. Since #11121 the key itself accepts free-form text (spaces, CJK), so a label became the identity. That identity then needs a lossy slug for paths (with409 briefing_slug_ambiguouson collisions) and NFC/redaction guards on every read. #13561 already added a presentationaldisplay_name, but nothing routes a typed name into it.Why it matters
Every new crew named in a user's own words gets a free-form identity that every addressing surface has to defend, and two labels that slug alike collide on disk. Keying by an id and showing the label keeps renames and labels cheap and the identity boring.
Not a goal
What changed (motivation → approach → change)
members.key_new_crewmakes that decision for both create surfaces (POST /api/agentsinside the config lock, andkirocrew agent create). An id-shapedname(validation._AGENT_NAME_RE) is kept as the key, as before. A free-formnamebecomes the label (unless adisplay_nameis sent) of a derived id. This keeps old clients that send onlynameworking, instead of refusing them.members.crew_id_for_display_name): slug of the name,-2,-3... past a taken id,crew-<hash>for a name with no slug characters.409 agent_existswhen the key is taken, or when the name the new crew would show (explicitdisplay_name, else the typed free-form name, else the key) is exactly what another crew already shows. Editing an existing crew's label is unchanged and unchecked.nameis the id.--display-name; the success line names the id and the label.learn-cron-dashboard.mdmembers paragraph.Backwards compatibility
Compatible: every name
POST /api/agentsandkirocrew agent createaccept today is still accepted, and id-shaped names are keyed exactly as before. A free-form name now lands as the label of a derived id instead of as the key, and the answer'snamesays which id. Existing free-form keys are untouched by every read path.Tests
test/test_crew_display_name.py: free-form name → derived id + label; explicitdisplay_namewins; id-shaped name unchanged; derived id skips a taken id; a name another crew shows is 409 with nothing persisted, whether it arrives as a free-form name, as an explicit label on an id-shaped name, or as an explicit label on a free-form name; a typed name another crew shows is fine when this crew's explicit label differs; derivation unit tests (slug, truncation, CJK hash, suffixing,is_crew_id). Mutation-checked: dropping the shown-label comparison fails 4 of them.test/test_cli_agent.py: free-form--namekeys a derived id with the label;--display-namelabels an id.test/test_config_api.py: the create round-trip property asserts against the id the answer names and the label the roster serves.MembersPage.test.tsx: a free-form name opens under the answered id and the seeded greeting names the label, not the id; a name another crewmate shows is refused with no request. Mutation-checked: reverting either change fails its test.Manual verification
Built this worktree and ran
kirocrew gateway --test-modeon a throwaway home, then drove the real SPA with Playwright: New crewmate → "Launch Notes" opens/members?member=launch-noteswith the label in the header and the id beside it;/api/agentsreturns["launch-notes","Launch Notes"]; a second "Launch Notes" is refused inline before any request; the Agents page shows the label with its id. The greeting fix landed after these shots and is covered by the vitest above. The test gateway has no kiro-cli, so a chat turn cannot run there.Backend Tests shard 4 (Linux and Windows) and the Coverage Gate that aggregates it are red on
test_pid_reader_ratchet(161 pid-reader sites vs 160 recorded). The same test fails onorigin/mainand on this PR's base; this diff adds no pid reads.Screenshots / video
Free-form name in New crewmate:
Opened under its derived id, label shown:
The same name again is refused before any request:
Agents page: label with the id beside it:
Related Issues
Follows #13561 and #11121.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement