Repository navigation
fix(members): accept free-form display names - #11121
Conversation
|
👋 Hi! This PR's description is missing some required sections from our PR template. Workflow runs won't be auto-approved until the description is updated. Missing sections:
Please update your PR description to include these sections, then push or re-save the description. The workflows will be approved on the next cycle. |
8733dfa to
b2092de
Compare
Design Review (Fable 5, fork) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS A stored member name that turns non-dispatchable strands its DM thread permanently — no rename exists, and the only remedy discards the thread's history. Watch
Suggestions
[DESIGN-REVIEWED] a1db504 |
GPT 5.6 Review (fork) — ✅ no blocking findingsReviewed Review detailsFINDING -- docs/system-specs/modules/learn-cron-dashboard.md:1221 -- " |
First Principles Review (Fable 5, fork) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS The period-only name refusal patches one spelling of "display name is a URL path segment" while the tests deliberately bless Not justified as shipped
What this change shipsInventory (10 items) — 9 justifiedIntent: FIX — a configured free-form crew name (
More restructures ride along (openai-compat guard ordering, idempotent template rebind); none ships new surface. [FIRST-PRINCIPLES-REVIEWED] a1db504 |
Opus 5 Review (fork) — 🔴 changes requested (blocking)Reviewed Blocks: the create-route name-refusal ratchet in BLOCKING — test/test_config_api.py:268 A draw the new route still refuses (e.g. FINDING — src/kiro_crew/dashboard/handlers/agents.py:4924 — |
b2092de to
dd3c9ba
Compare
dd3c9ba to
fa5882c
Compare
fa5882c to
90f89aa
Compare
90f89aa to
1756959
Compare
1756959 to
5891d17
Compare
|
|
|
|
|
|
|
|
|
|
Backend Lint & Type Check red on The |
|
|
Crew Member display names get their own bounded validator instead of the agent-template identifier regex. Roster, thread, activity, rules, CLI and dashboard creation, pinned-slot chat, same-name reset, and the OpenAI-compatible paths accept the exact display name; path and route identity still use the derived slug. kiro_agent, new slots, and subagent addressing keep the strict grammar. Display names are scrubbed before prompt interpolation.
|
|
Problem / Motivation
Crew Member names are display text, but several member paths applied the strict agent-identifier grammar. A configured member such as
dr. eggbotdisappeared from the roster, and its activity, rules, chat, panel, and restore paths rejected or mishandled the exact name.Why it matters
Members with spaces, periods, international text, or emoji could be configured but not managed from the Members page. Mixed name domains also created unsafe fallback paths for malformed legacy bindings, prompt assembly, event-log ownership, template policy lookup, and operator recovery.
What changed
Crew Member display names now use
members.validate_member_name. The exact display name remains separate from the stable member ID, derived path slug, slot key, andkiro_agenttemplate identifier.Roster, thread, activity, rules, briefing, teams, CLI creation, dashboard creation, panel, pinned chat, reset, resume, and OpenAI-compatible paths preserve safe free-form names. The teams registry view (
handlers/teams.py) applies the roster's own eligibility filter, andcrew_teams.MEMBER_NAME_MAX_CHARSis the display-name cap, so every crew the roster lists can be placed on a team. The agent-choice guards (chat send, slot agent switch, OpenAI-compatiblemodel) admit a configured, dispatchable free-form member on an ordinary slot throughmembers.is_configured_dispatchable_member; an off-grammar string that is not a configured member is still refused.is_dispatchable_member_namerejects stored names that fail display-name validation or require external-text redaction. Legacy NFD spellings remain dispatchable when NFC normalization is their only validation difference and neither form requires redaction. The stored identity and pin comparison remain byte-exact.Activity and rules require dispatch eligibility because those routes return or store member data used by dispatch. Panel reads use the broader
is_readable_member_namepredicate. The exact panel name is used only for byte-exact ownership-digest comparison, and every returned panel field is already scrubbed, so a credential-shaped legacy owner can recover its panel without exposing the raw name.Chat, OpenAI-compatible requests, slot-agent updates, boot restore, explicit resume, and
_run_chatenforce dispatch eligibility before model execution. The post-resolution_run_chatguard also covers a non-dispatchable default member selected for an ordinary slot. It returns before execution-context publication, provider acquisition, or prompt construction. Both refusal warnings redact slot keys through the companion-aware log chain.Security and ownership guards now fail closed. Startup event-log reconciliation counts every slug claimant before filtering unsafe names. It mutates only a uniquely owned member log and emits bounded diagnostics without display names, foreign headers, or exception text. SEL assignment events and startup restore warnings redact stored identities before logging. Dotted template identifiers resolve through every read-side policy consumer while writes keep the bounded template grammar. The
agentfields ofspawn_run,spawn_continue,cron_addandcron_update, and the spawn roster (subagent.visible_agent_names), admit the same registered-agent grammar (validation.REGISTERED_AGENT_NAME_RE), so a published dotted template can be spawned and scheduled; Crew Members are still named throughcrew/member_id, never throughagent._AGENT_NAME_REand the consolidatedTEMPLATE_NAME_REanchor with\Z(a trailing newline no longer matches), and a template identifier may not end in.,-, or_; this tightens identifier validation for every consumer of those regexes, not only members.A stored name can become non-dispatchable after the redaction policy changes.
kirocrew doctornow reports the affected count without printing names or slugs. On a host whose platform failed to compose, where doctor is the one command still allowed to run, both member sections printnot checkedand defer to the Platform section instead of aborting the report. It directs the operator to create a safe replacement in Crew Manager, change the default if needed, and delete the old record. The replacement gets a new member identity and does not inherit the old member key's DM history.Tests
git diff --check, and documentation checks pass. Documentation lint also passed its self-test and scanned 364 Markdown files.Manual verification
The original failure reproduced as an empty Members roster and HTTP 400 responses for a configured
dr. eggbot. The corrected API tests round-trip that exact name through roster, thread, activity, rules, chat, reset, panel, and OpenAI-compatible requests. Legacy NFD tests also exercise activity, rules, and panel access. A credential-shaped legacy owner can read only its scrubbed panel, while ordinary-slot default-member dispatch fails before model access.Review findings were reproduced before each fix. The tests observed lost dotted-template MCP grants, skipped startup reconciliation, credential-shaped prompt egress, unsafe SEL values, pre-refusal resume mutations, a live resume bypass, and doctor output with no recovery path. The current tests prove that each path fails closed without model execution, disclosure, or hidden resume writes.
Known baseline
Both Linux and Windows backend shard 7 currently fail
test/test_crew_log_exc_info_sites.py::test_no_exc_info_site_anywhere_in_kiro_crew_holds_a_crew_log_handlebecausesrc/kiro_crew/apps/builtins/issue_radar/backend/crew_store.pyhas two existingexc_info=Truesites. This PR does not touch Issue Radar, and the same test fails onmain.Related Issues
N/A. No issue is linked.
Pattern harvest
Rule candidate: keep user-facing display text separate from path, route, slot, and template identifiers. Derive each identifier at the boundary that requires it.
Place safety guards at the shared egress boundary. Keep earlier protocol checks only when they preserve stable errors or prevent side effects.
Checklist
Contribution License Agreement