Repository navigation
refactor(dashboard): answer the pin routes' slot denial with slot_not_found - #21730
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing to check. [DESIGN-REVIEWED] e5a99e2 Description read[DESCRIPTION-READ] d6c61fa0e5219ab48986d52c95d5d72e95d48e8f5ac7adf16ab3fe621f6ca020 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 (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Check before merge: What this change shipsInventory (4 items) — 4 justifiedIntent: a FIX that makes an app's denied pin-route slot get the shared slot 404 from the one helper, so the denial can't drift into a body that sets it apart from other slot denials.
[FIRST-PRINCIPLES-REVIEWED] e5a99e2 Description read[DESCRIPTION-READ] e3b4020b63e24b7efc8c15618d462902016901891b9c5d19b149696789387237 That sha256 names the PR description this verdict read. Recompute it with |
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: |
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: |
0223d66 to
e5a99e2
Compare
|
self-added: no
[operator: bolichen97] |
[operator: bolichen97] |
|
HOLD at e5a99e2, for the policy reason only. The change reads as correct. The hold: it edits the app-isolation denial path of the pin and resume gates, which our policy reserves for a human unless the change is a pure move. The bytes are identical, so this should be a quick maintainer approval. — crew-pr-reviewer (r110) |
Problem / Motivation
Goal: The chat pin routes answer an app's denied slot with the shared
slot_not_found()404, so every dashboard slot denial comes from one helper.chat_pins._authorize_app_slotstill builds the slot 404 by hand:web.json_response({"error": "not found", "code": missing_code}, status=404). Four of its five callers get theslot_not_foundbody that way. The other two hand-built copies the issue names (chat_fork.pyandhandlers/prompts_caller_gates.py) already call the helper on main since #21711, so this is the last one.Why it matters
If the helper's body ever changes, the pin routes would keep the old body. An app could then tell a pin-route denial from every other slot denial, which is the difference the uniform 404 exists to hide.
Not a goal
pin_not_found404s (they name a pin, not a slot)."slot not found"inhandlers/redaction.pyandmessaging_api/run_control.py.What changed (motivation → approach → change)
The pin routes' slot denial was a copy of the helper's bytes, not a call to it, and the source scan in
test/test_missing_slot_uniform_404.pymisses it because the code is a variable._authorize_app_slotinsrc/kiro_crew/dashboard/chat_pins.pynow returnsslot_not_found()when nomissing_codeis given.api_chat_pins_deletestill passesmissing_code="pin_not_found"and keeps its literal body. Both responses stay byte-identical to main.Resume carries its refusal as data (
ResumeRefusal) until one wrapper builds the response, so it cannot call the helper directly.src/kiro_crew/dashboard/chat_api/resume.pybuilt a second copy of the app refusal by hand; it now returns the shared_RESUME_APP_NOT_FOUNDlike the six other resume branches, and a test pins that refusal's wire bytes toslot_not_found().Backwards compatibility
Compatible: every response keeps the same status, body bytes and content type; only the private pin helper's default changed (all five callers are in the same file), and resume returns an equal refusal value.
Removes nothing: no route, key, record or check is taken away.
Tests
test/test_missing_slot_uniform_404.pygains four tests:test_the_pin_slot_gate_answers_with_the_helper_itselfchat_pins.slot_not_found()(a sentinel swap); red on main, green heretest_the_pin_slot_gate_keeps_both_404_bodiespin_not_founddenial keeps its exact bodytest_the_resume_app_refusal_answers_with_the_helpers_bytestest_resume_spells_its_app_404_only_through_the_shared_refusalresume.pybuilds noResumeRefusal(..., "slot_not_found", ...)of its own; red on main, green hereDeterminism: the four new tests passed 20/20 repeats, and the whole file passed in reversed order. The existing pin suites (
test_dashboard_chat_pins.py,test_dashboard_chat_pins_ownership.py,test_chat_slot_pin_ownership.py) pass unchanged.Manual verification
N/A — unit coverage sufficient: the change is one return path inside a private helper, and the tests compare full response bytes.
Related Issues
Closes #21678
Part of #16523
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)