Skip to content

test(messaging): cover the webex spool notice against the real egress gate - #10362

Merged
iamwhatever merged 1 commit into
mainfrom
fix/inbound-spool-five-channels-8912
Sep 13, 2026
Merged

iamwhatever merged 1 commit into
mainfrom
fix/inbound-spool-five-channels-8912

Conversation

@chenmingwei23

@chenmingwei23 chenmingwei23 commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

What is the problem?

WebexTransport.may_send_to checks the room-id arm first (room_id in _allowed_rooms with group rooms on) and grants there, then falls through to principal in _allowed. So a space route with no principal is authorized by its room_id alone. Main has no test for this path: test/test_inbound_spool.py never mentions webex, and no spool test sets _allowed_rooms.

What this PR is

One regression over the real Webex egress gate for a spooled restart notice:

  • test_a_webex_allowed_space_gets_its_notice_at_the_room_root -- an allow-listed space (_allowed = frozenset(), _allowed_rooms = {"SPACE9"}) is delivered at the room root (sent == [("SPACE9", None)]), proving the room-id arm grants a space route that carries no principal.

It uses WebexTransport, WEBEX_CAPABILITIES and the shared replay_spooled only, and the docstring states exactly what the asserts prove and no more.

What was superseded

This PR originally adopted the inbound spool on webex, wecom and imessage. #10047 landed that adoption on main for all remaining channels, so the dispatch-site changes and the spec edit are dropped -- main owns them. What survives is one piece of Webex egress coverage main still lacks.

What tests we did

timeout 900 python3 -m pytest -n0 test/test_inbound_spool.py -x -q against current main: 72 passed (main's 71 plus this one). black, isort, flake8 clean; comment-history gate clean.

Refs #8912 (satisfied by #10047, not by this PR).

@chenmingwei23
chenmingwei23 requested review from a team and patrigao September 12, 2026 11:53
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Sep 12, 2026
@github-actions

github-actions Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — ✅ PASS

Design-level review of 19fc4c7436b6cdaea704f78b068a67500a5416a5 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

A narrow, real gap (the room-id arm had zero spool coverage) pinned through the real may_send_to and replay_spooled — sound and proportionate.

Suggestions

  • WebexTransport.__init__ takes only a stored client plus the two allow-list kwargs, so constructing via the real constructor (with a dummy client) instead of __new__ + private-attr poking would make the "real gate" claim hold end-to-end — e.g. it would catch a future __init__ normalization of room ids that the hand-set frozenset({"SPACE9"}) silently skips.

[DESIGN-REVIEWED] 19fc4c7

@github-actions

github-actions Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — ⏭️ skipped

Revision 19fc4c7436b6cdaea704f78b068a67500a5416a5 ships no reviewable capability (docs, tests or generated files only), so there is nothing to inventory. Advisory — does not block merge.

@github-actions

github-actions Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ no blocking findings

GPT 5.6 completed its review of 19fc4c7436b6cdaea704f78b068a67500a5416a5 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 19fc4c7

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 19fc4c7436b6cdaea704f78b068a67500a5416a5: <one-sentence reason>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 12, 2026
@github-actions

github-actions Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Opus 4.8 Review — ✅ no blocking findings

Reviewed 19fc4c7436b6cdaea704f78b068a67500a5416a5 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 19fc4c7

Verdict parsed from the review's SHA-scoped output markers for commit 19fc4c7436b6cdaea704f78b068a67500a5416a5.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 19fc4c7436b6cdaea704f78b068a67500a5416a5: <one-sentence reason>

@chenmingwei23 chenmingwei23 changed the title feat(messaging): adopt the inbound shutdown spool on five channels feat(messaging): adopt the inbound shutdown spool on teams, webex, wecom and imessage Sep 12, 2026
@chenmingwei23
chenmingwei23 force-pushed the fix/inbound-spool-five-channels-8912 branch from 8386d2e to f414d71 Compare September 12, 2026 13:13
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 12, 2026
@chenmingwei23
chenmingwei23 force-pushed the fix/inbound-spool-five-channels-8912 branch from f414d71 to 74f2381 Compare September 12, 2026 13:48
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 12, 2026
@chenmingwei23
chenmingwei23 force-pushed the fix/inbound-spool-five-channels-8912 branch from 74f2381 to 7d45ac7 Compare September 12, 2026 14:17
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 12, 2026
@chenmingwei23
chenmingwei23 force-pushed the fix/inbound-spool-five-channels-8912 branch 2 times, most recently from 910f477 to f3c64d8 Compare September 12, 2026 14:51
@chenmingwei23 chenmingwei23 changed the title feat(messaging): adopt the inbound shutdown spool on teams, webex, wecom and imessage feat(messaging): adopt the inbound shutdown spool on webex, wecom and imessage Sep 12, 2026
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 12, 2026
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Sep 13, 2026
@chenmingwei23
chenmingwei23 force-pushed the fix/inbound-spool-five-channels-8912 branch from c18c097 to 4ddf4e7 Compare September 13, 2026 19:51
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: passed Eligible automated validation passed for the current revision labels Sep 13, 2026
@chenmingwei23 chenmingwei23 changed the title feat(messaging): adopt the inbound shutdown spool on webex, wecom and imessage test(messaging): cover the webex spool notice against the real egress gate Sep 13, 2026
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

@cixuuz update: the adoption half of this PR was overtaken by #10047, which landed the inbound spool on webex/wecom/imessage (and the rest) on main, so I've reset the branch to main and reduced this PR to just the Webex egress coverage you asked for. Main had none: no webex mention in test/test_inbound_spool.py and no spool test that sets _allowed_rooms.

Two tests against the real WebexTransport gate, as a pair: test_a_webex_allowed_space_gets_its_notice_at_the_room_root shows an allow-listed space delivered at the room root, and test_a_webex_revoked_space_gets_no_notice_from_an_allowed_sender shows a revoked space dropped even with the sender still allow-listed. The allowed case is what makes the revoked case prove revocation is doing the work.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Sep 13, 2026
@chenmingwei23
chenmingwei23 force-pushed the fix/inbound-spool-five-channels-8912 branch from 4ddf4e7 to e662031 Compare September 13, 2026 20:37
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 13, 2026
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Withdrawing the revoked-space test on Design Review's finding, which is correct. A room-root webex space route does carry the sender as principal: the dispatch writes user_id=email unconditionally with an empty thread for the room root, and _route_authorized only withholds the principal for a non-empty thread the sender does not own -- so may_send_to falls through the room-id arm to principal in _allowed and a still-allowed sender grants a revoked room. My test_a_webex_revoked_space_gets_no_notice_from_an_allowed_sender only passed because it spooled with no user_id, so it asserted a guarantee production does not have; removed.

This PR is reduced to the one true test, test_a_webex_allowed_space_gets_its_notice_at_the_room_root, which is the coverage cixuuz asked for. The underlying authorization behaviour is being referred to a maintainer rather than changed here -- it is a security fix and not in scope for this test-only PR. See Design Review's comment for the detail.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Sep 13, 2026
… gate

One regression pinning that WebexTransport.may_send_to grants a spooled space route carrying no principal via its room-id arm, so the restart notice posts at the room root. Main had no webex spool coverage. The deny side is not pinned because a room-root space route does carry a principal today, so that guarantee is not true and the behaviour is with a maintainer. The adoption half of this PR was superseded by #10047.

Refs #8912
@chenmingwei23
chenmingwei23 force-pushed the fix/inbound-spool-five-channels-8912 branch from e662031 to 19fc4c7 Compare September 13, 2026 21:37
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: passed Eligible automated validation passed for the current revision labels Sep 13, 2026

@iamwhatever iamwhatever left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test-only addition of one regression over the REAL Webex egress gate: I verified in src/kiro_crew/webex/transport.py that may_send_to checks the room-id arm (_allow_group_rooms and conversation_id in _allowed_rooms) before the principal arm, so the test's premise holds and only send_message is stubbed. asyncio, Any, spool_home and _spool all pre-exist in the file. No production code touched, all checks green (the 6 CANCELLED entries are superseded duplicates of runs that later succeeded).

@iamwhatever
iamwhatever enabled auto-merge (squash) September 13, 2026 21:38
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Sep 13, 2026
@iamwhatever
iamwhatever merged commit 187e638 into main Sep 13, 2026
79 checks passed
@iamwhatever
iamwhatever deleted the fix/inbound-spool-five-channels-8912 branch September 13, 2026 22:10
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Sep 13, 2026
amadsalmon pushed a commit to amadsalmon/KiroCrew that referenced this pull request Sep 22, 2026
… gate (kirodotdev#10362)

One regression pinning that WebexTransport.may_send_to grants a spooled space route carrying no principal via its room-id arm, so the restart notice posts at the room root. Main had no webex spool coverage. The deny side is not pinned because a room-root space route does carry a principal today, so that guarantee is not true and the behaviour is with a maintainer. The adoption half of this PR was superseded by kirodotdev#10047.

Refs kirodotdev#8912
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants