Repository navigation
fix(slack): name the manifest slash command after the alias - #18550
Conversation
Sensitive Change ReviewSensitive files changed:
|
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ✅ human override accepted@iamwhatever overrode this lane for |
Design Review (Opus 5.5) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS New CLI installs now register Watch
Suggestions
[DESIGN-REVIEWED] 867f259 Description read[DESCRIPTION-READ] 16db8c572b54ede193c7043246f5be09676cf3e1d213bac8f97a243c52fe66d3 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 |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
Sensitive change review
|
|
|
|
|
|
|
Security Scope Review -- 🟡 CONCERNSWhich legitimate operations does Verdict basis: the reviewer's own judgement; no confirmed regression. Security scope review -- adjudicated candidates
No candidate flipped from allowed to refused. Scope-Verdict: CONCERNS TIGHTENING: The Slack app-create deep-link carve-out in the exfil URL classifier ( ADJUDICATED: 14 candidates, 0 confirmed newly-refused (the deterministic fold has not reported yet; no verdicts were handed to this review). None of these rows reach the tightened code. The carve-out is not in the shell deny composite: PLATFORM COVERAGE: Rows were written for
The diff itself assumes nothing about the platform. Its only new assumption is about argv and string shape: a lowercase UNADJUDICATED:
[SCOPE-REVIEWED] 867f259 |
6d63bdc to
f249423
Compare
Sensitive change review
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@buluoray new head Why there is no step in Settings → Slack
What answers the
Non-blocking points taken, unchanged from the last head
Left as they are in this PR: reading |
|
|
|
|
|
|
|
/ai-review override first-principles 867f259: scoped fix for #11386 (Enterprise Grid slash-command collisions). Only apps generated by 'kirocrew manifest' get /kirocrew-; the dashboard one-click install and every existing install keep /kirocrew, so no current user is affected. This head returns the manifest's command from the dashboard endpoint, as buluoray asked; the default call is unchanged. An RFC is disproportionate for a manifest naming rule. |
Human judgment recorded@iamwhatever 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. |
buluoray
left a comment
There was a problem hiding this comment.
🤖 Kiro Crew Auto-Pipeline [operator: buluoray#38930179]:
APPROVE at 867f259. This supersedes my earlier REQUEST_CHANGES reviews.
Correction to my previous review: Settings → Slack does not offer an alias input. Its getSlackManifest() calls /api/slack/manifest without an alias, both on the previously reviewed head 3f631c0 and on this head. That path continues to register /kirocrew, matching the unconfigured gateway. My earlier claim that the Settings flow lets the user type an alias was incorrect.
The original upgrade blocker is addressed: a manifest-shaped command that differs from slack.command runs nothing, logs a WARNING, and gives an allowed owner an ephemeral reply with the matching config-set command and the required restart. The reinstall hint and setup guide now explain the rename before it happens. For API callers explicitly supplying ?alias=, the endpoint returns command alongside the manifest and URL without writing config. The new TestDashboardManifest cases cover the alias response and its agreement with the default gateway command.
I read the full diff and checked the actual Settings caller, manifest emitter, mismatch handling and regression-test assertions. Check-runs for this head: 91 success, 12 skipped, 0 failed, 0 pending; the separate PR Readiness commit status is success. No local tests, mutation tests or real Slack/Grid run were performed during this re-review.
Non-blocking scope and follow-ups: CLI-created apps still require the printed slack.command configuration step and, for a running gateway, restart. Dashboard-created apps retain the generic command, so their Grid collisions are not solved here. Alias case/truncation collisions are documented. The missing-command-slot fail-closed test and a truncation warning remain follow-ups, not blockers.
Auto-merge is enabled; the operator explicitly authorized this approval.
Problem / Motivation
Goal: Each new Kiro Crew Slack app registers its own slash command, so installs in one Enterprise Grid org stop stealing each other's
/kirocrew.The bundled Slack manifest names the app
KiroCrew-<alias>but hard-codescommand: /kirocrew. Slack resolves slash-command names across a whole Enterprise Grid org. When two people install Kiro Crew there, both apps register/kirocrew, and Slack sends the command to the wrong app (invalid_service).Why it matters
Anyone in a Grid org with a second Kiro Crew install loses slash commands (
/kirocrew dashboard,/kirocrew sessions, ...) with no clear error.Not a goal
slack.commandkeeps today's command.kirocrew, so it keeps/kirocrew./{slack.command}only).What changed (motivation → approach → change)
Slack routes
/kirocrewto whichever Grid app claimed it, because every install registers the same name. The fix names the command after the alias, like the app name already is, and every path that hands out an alias-named command also tells the person whichslack.commandthe gateway needs.slack.commandstepkirocrew manifest(stdout,--url,-o)/kirocrew-<alias>kirocrew config set slack.command ...line (stderr when stdout is the manifest)GET /api/slack/manifest?alias=<x>/kirocrew-<x>command/kirocrewslack.commandanswers it, as on mainkirocrew setup --slackkirocrewor the configured command)The command in
src/kiro_crew/slack-manifest.yamlis a{{COMMAND}}slot filled byslash_command(alias)insrc/kiro_crew/slack_manifest.py: lowercase, cut to Slack's 32-character limit.src/kiro_crew/cli_setup.pyprints the hint and labels the wizard promptSlash command name (must match your Slack app, e.g. kirocrew-<alias>); the wizard's default does not move, because it cannot know which alias the app was created with. The exfil deep-link validator insecurity/exfil.pyreads that slot as a group and requires it to equalslash_command(alias), so the exempted link still carries nothing beyond the alias.The dashboard writes no config, so its one-click link keeps the generic command. Settings → Slack sends no alias, and its app registers
/kirocrew, which an unconfigured gateway answers on the first try. An alias-named command there would go unanswered until the person ran a terminal step, so dashboard installs in one Grid org still share/kirocrew; a Grid user who needs a distinct command creates the app withkirocrew manifest. A caller that passes?alias=toapi_slack_manifestinsrc/kiro_crew/dashboard/handlers/messaging.pygets/kirocrew-<alias>, and the response'scommandfield names theslack.commandvalue it needs.An older install that re-imports the bundled manifest, as the scope-probe hint and the setup guide's upgrade note advise, gets
/kirocrew-<alias>whileslack.commandstayskirocrew. Both notes (slack/scope_probe.py,docs/guides/slack-setup.md) name that rename and the config line. If it happens anyway,_handle_slashinsrc/kiro_crew/slack/events.pystill runs nothing, and matching is unchanged. A name the manifest can register (/kirocrewor/kirocrew-<alias>) gets a WARNING log and, for the owner only, an ephemeral reply: "⚠ Kiro Crew is set up for/kirocrew, so/kirocrew-<alias>did nothing. To use/kirocrew-<alias>, runkirocrew config set slack.command kirocrew-<alias>and restart the gateway." Any other name is dropped.The setup guide and the security, slack-gateway and messaging specs describe the default, the
commandfield and the reply.Default design call, needs maintainer sign-off: apps created with
kirocrew manifestget/kirocrew-<alias>, and the user runs the printedconfig setline; existing installs keep their configuredslack.command. This changes a default and no RFC records it, so First Principles asks for a maintainer ruling, which binds one head.Backwards compatibility
Compatible: no stored
slack.commandchanges, the wizard's default is unchanged, and the dashboard's one-click link registers/kirocrewas before; only a newly created CLI app registers the alias command.GET /api/slack/manifestkeeps every field and addscommand. The gateway runs the same commands as before; a mismatched manifest-shaped command gets a reply where it got none.Removes nothing: the manifest gains a slot, the endpoint a field and the gateway a reply; no key, path, or accepted input goes away.
Tests
test/test_slack_manifest_command.py(16 tests):/kirocrew-<alias>, differs per alias, is lowercase and at most 32 characters atALIAS_MAX; aliaskirocrewkeeps/kirocrew;kirocrewfor an unconfigured install;kirocrew manifest --urlprints the matchingconfig setline, and plainkirocrew manifestprints it on stderr with a clean manifest on stdout;?alias=JDoereturnscommandkirocrew-jdoe, the one command in its manifest; the request Settings → Slack makes (no alias) returns theSlackConfigdefaultslack.command, so that app works on the first try;/kirocrew-<alias>and thekirocrew config set slack.commandline;/kirocrew-jdoe: the owner gets one ephemeral reply namingkirocrew config set slack.command kirocrew-jdoe, a WARNING names the same line, nothing runs or is audited; a non-owner gets no reply;/otherand/kirocrew-x;idget no reply.Red-before on the previous head
3f631c0d9d: both endpoint tests fail (KeyError: 'command') and the reinstall-notice test fails (no/kirocrew-<alias>in the notice). On569df44d53the owner-reply test failed (assert 0 == 1); mutations of that reply (no reply, no owner gate, astartswithin place of the shape match, no shape match, WARNING downgraded to DEBUG, thereturndropped) each redden it.Determinism: the three new tests 20 runs each at
-n0; the file 10 runs at-n 2 --dist loadgroupbesidetest/test_slack_scope_probe.py,test/test_slack_config_handlers.pyandtest/test_slack_manifest_scopes.py; the whole file once with its 16 node ids in a shuffled order (seed 24601): all green. The new tests share no state: each builds its own request, orchestrator stand-in or probe client.Scoped suites green here: 797 backend tests (the Slack, manifest-endpoint, messaging-handler and CLI-setup suites,
TestKiroCrewSlackAppCreateLink); isort, flake8, black and mypy on the changed Python, and the comment-history, brand-name, feature-map and docs-lint gates and the flake-pattern and wait-discipline ratchets.Manual verification
N/A — unit coverage drives the real emitters (
render,deep_link,_manifest,_setup_slash_command), the realapi_slack_manifestand the real_handle_slashwith only the Slack HTTP post stubbed; creating a Slack app needs a Grid org. No dashboard UI changes.Related Issues
Closes #11386
Taskei: CREW-19831. Takes over #11398 by @DcXiaoBing (credited as co-author).
Pattern harvest
Not generalizable: a single hard-coded org-global name in a per-install template.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)