Skip to content

feat(slack): code-channel bar actions, canvas comments, view tabs - #22370

Merged
bolichen97 merged 2 commits into
mainfrom
feat/slack-code-channel-api-gaps
Nov 18, 2026
Merged

bolichen97 merged 2 commits into
mainfrom
feat/slack-code-channel-api-gaps

Conversation

@kyleseaman

@kyleseaman kyleseaman commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A Slack code channel uses the Slack Code API the way Slack documents it: buttons on its context bar, plan-canvas comments that reach the agent, tabs that never fail at Slack's cap, the PR as the channel's resource, a live summary, and a clear notice when Slack refuses.

Kyle's brief for this PR (10-20, then "do the smaller things too, get this REALLY polished"): close three Slack Code API gaps (context-bar action buttons, canvas comment read-back, view-tab cleanup), then agent_resource, a live summary_message, a decision on message.session and slash_command_url, and a docs-conformance pass over everything sent to Slack Code.

On main today every context-bar item is a link (nothing handles code_channel_action), comments people leave on the comment-only Plan canvas are never read, listViews is used only by the scope probe and removeView has no caller, so a sixth tab fails with too_many_views.

Why it matters

People in a code channel can't act from the bar (open the PR, stop the turn, jump to the session), their plan feedback goes nowhere, and a busy channel silently stops getting new tabs. Smaller mismatches with Slack's docs (the status during a tool approval, silent refusals) make the channel read wrong.

Not a goal

  • Per-worker PRs on the bar. The bar's one PR slot is the channel's own PR; each worker's PR is on the work board. PR B (the board's combined diff, per-row PR and CI, and the wrap-up's worker outcomes) owns per-row PR data and adds a worker-PR slot when it lands.
  • PR tabs, tab links and the Workers tab. They are their own follow-up PR, built on this one.
  • Trust this channel on the bar: it stays on the approval card, the first-message picker and /kirocrew trust.
  • An HTTP events endpoint (slash_command_url): Kiro Crew runs Socket Mode only.
  • Issues as agent_resource (only the channel's PR is tracked; there is no issue binding to read).

Backwards compatibility

Compatible: every new surface and workspace record field has a default, so stored records load unchanged, and a record written by a build that filed workers still reads; an install whose Slack app does not yet subscribe code_channel_action gets no clicks (the bar still renders), and the Settings update panel lists the new event like any manifest change. The separate CI item is folded into the PR item's label (five slots cannot hold repo, branch, PR, CI and the actions).

Premise (for the maintainer override)

First Principles blocks the context-bar action items because Slack documents code_channel_action's trigger but not its body, and RFC open question 2 said Phase 3 ships link items only. Kyle's ruling (10-23): ship Create PR and Stop on the documented trigger, and keep the bar's Stop next to Slack's own.

  • Action items: RFC open question 2 records the decision and exactly how actions.parse reads a click (channel, person, key, workspace, de-dup id). A click it can't read is refused and audited, never guessed; two different users in one body make it nobody's. Each key runs an existing path with that path's own checks and audit (/create-pr; Slack's own Stop handler, owner or allowed user), so no action adds a way in. The first click's field names (never values) are logged so the live shape can be pinned.

  • The bar's Stop: shown only while the channel's own turn runs. It builds the same agent_session_stopped Slack's button sends and goes through session_events.handle_stopped, so it is the same Stop: routing._stop_bound marks main's stop fence first, then stop_helpers.stop_channel stops the channel's session, its helper agents and their sub-agents and says in the channel how many it stopped, and an idle channel's status is set back to active, exactly as for Slack's button and !stop. The click's own private reply "Nothing is running." goes out only when nothing it stops was running: not the channel's session, its helper agents, or a live or queued sub-agent of either. It is the same Stop as Slack's button: it is asked exactly the checks Slack's own Stop event is, none in front of them and none left out, so with slack.code_channels switched off mid-turn it still stops the running session.

    Gate the click handler asks before other keys Slack's Stop asks it The bar's Stop
    slack.code_channels on yes, or the bound session still running (session_events._feature_on) the same check, through session_events.admits
    Redelivery (event_id) yes, by its own event_ts its own de-dup key, then Slack's
    One clicking user yes (_may_use_bot refuses none) the same
    Workspace origin yes (session_events.admits) the same
    channels inbound ceiling, per-channel ceiling no not asked
    A bound code channel yes (stop_from_channel; otherwise not ours) the same
    Archive, rebind, the code channel's toggle (act_refusal) the channel's and origin's activation only (channel_and_origin_permit) the same
  • Known limits (wording only; the Stop itself is unchanged): a Stop that stops only sub-agents waiting in the task store, or continuation runs, still tells the presser "Nothing is running." beside the channel's "Stopped" reply; and on an idle channel where only other board sessions run, the presser is told "Nothing is running." while the channel's reply names those sessions as still running.

What changed

1. Context-bar actions (workspace/context_bar.py, new actions.py, events.py, manifest). Budgeted to Slack's five items: setProperties keeps only the first five of a longer list (with a too_many_context_bar_items warning), so the bar is built in priority order instead of losing whatever came sixth:

  1. Workers (conductor channels): the board's tally (board.model.bar_label: "2 working · 1 needs you", "3 of 3 done"), linked to the pinned board message (chat.getPermalink, read once per board message and cached on the surface record).
  2. repo, 3. branch.
  3. Stop (action) while the channel's own session has a turn running, decided when the bar is sent, so a refresh racing a turn start or end never sends a stale Stop; a turn start adds it from the last published state with no git read. A turn someone stopped still schedules no refresh (main's rule), but its end takes Stop off the bar: one bar send from the last state, in a pass of its own (own_pass()), no git read.
  4. One PR slot: the channel's own PR with its CI ("PR fix(sync): MeshClaw beta sync 2026-07-18/19 batch-41 addendum (1 frontend ported; cumulative 61: 37 backend + 25 frontend) #42 is open · tests passing"), else Create PR when there is no PR, /create-pr's capability holds and the branch has commits past the Code tab's base.

The agent's own items, then Open in dashboard (a deep link, never a sign-in token; https only), take only a slot left free. Stop and Open in dashboard follow the channel's live session: the workspace record takes the binding's session on every turn start, whatever the worktree (a non-git project included). The Workers item rides only a bar sent with the channel's binding and is scope-checked right before that send; main's refresh order is kept (the channel's own bar and diff, then the board) and the bar is sent again once the pass's board is known (a digest match sends nothing). A bar matching the last send that landed is never resent. Action items never carry a url, and set_context_bar refuses a list outside Slack's schema before sending. A click arrives as code_channel_action (now subscribed). Stop goes first and is asked exactly what Slack's own Stop event is (session_events.admits, then session_events.handle_stopped); every other key gets the feature gate, de-dup by event id, the per-workspace origin gate and the channels inbound ceiling, and Create PR runs commands.run_command for /create-pr (same gates, audit row with via=action).

2. Plan-canvas comments (new comments.py). Slack sends no canvas-comment event, so agents.conversations.getCanvas (open threads) is read at each normal turn end of the bound session and by a 60 s poll over idle channels with a plan canvas (25 a pass, every skipped channel stamped). New comments and replies (never our own) become one message per commenter, routed through routing._route_to_slot like a typed message, framed as feedback and redacted with the channel's redactor. Only a delivery the route answers ROUTED is marked seen, and so is one it answered with a refusal in the channel (REFUSED), so that refusal is never posted again; an unrouted one is read again next time. A comment delivered once is never delivered again, whatever a listing shows: Slack lists only the newest 100 threads and 100 replies of each, and no resolved thread, so nothing is forgotten because a listing left it out; the record is bounded at 10,200 instead, dropping the oldest by Slack ts behind a floor that only rises, so nothing dropped reads as new. Commenters who may not use Kiro Crew are skipped and audited. A stopped turn's unwinding reads nothing (main's stop fence); once the slot is idle the poll reads as a pass of its own (own_pass() plus admit()), so a comment left after a Stop arrives, and only a Stop during that read holds it back. The route itself runs outside that pass, so a turn it starts is fenced by its own start only.

3. View tabs (new views.py). Every tab this gateway opens is recorded with its view id. On too_many_views the live list is read, entries Slack no longer lists are dropped, and the least recently written view whose recorded id is listed is removed (never the Plan tab or the Code tab, never another agent's), then the write is sent once more under the same write fence.

4. agent_resource follows the channel's PR ({url, resource_type: "pull_request", title: "Fix the flaky login test (#42[, merged|closed|draft])", provider: "github"}), redacted, resent only when it changes; the PR shown is only this checkout's (main's pr_for identity).

5. Live summary_message: the work board message is recorded as code_channel.summary_message once per message; a current wrap-up for the same session is never displaced.

6. message.session: not added (message.channels / message.groups already deliver code-channel messages). 7. slash_command_url: omitted (Socket Mode).

8. Docs conformance (each with a test): suspended while a tool approval waits on the bound session, by request id; one dashboard notice per channel when Slack answers not_agent_channel / not_authorized; plain tool errors for too_many_sections / content_too_large; html sized after redaction; an ambiguous click refused.

9. The client's commit point carries each site's fence. SurfaceClient._call awaits the outbound policy before every send. Each write this PR adds hands its own synchronous fence (activation, a rebind, the board's scope) to that commit point (surface.send_fence), so an Off, a Review or a scope change during that await sends nothing: view writes, removals and resends, the bar, the Code tab and the resource, the live summary, the command set, the canvas read, and every send a tool makes (run_tool).

10. The route's own commit point carries the caller's gate. route_linked_thread awaits after its caller's gate (the agent read, the window load, the image copy). It now takes an optional admit, asked last, right before the row is appended or the turn starts; a refusal answers LinkedRoute.HELD, silent in the router, and its caller speaks. A typed channel message passes none, as on main. Every path this PR adds that appends to or starts a session:

Path Gate at the route's commit point On HELD
Plan-canvas comments (turn-end read, idle poll) the read's act gate, in a copy of the read's context (the poll's Stop fence holds) nothing said; the comment stays unseen and is read again
/summarize, /wrap-up, /create-pr, the bar's Create PR the command's live fences (admitted) the existing refusal reply; a /wrap-up is disarmed
The bar's Stop none needed: it stops, starts nothing n/a

On main's changes since the last round: main's stop fence and its Stop of helper agents and sub-agents (stop_helpers.py, #38243) decide every Stop (Slack's button, !stop, the bar's Stop) and this PR adds no Stop mechanism of its own; main's refresh / _refresh (under own_pass() / admit()), its pr_for identity and its board are used as they are; publishing.py is re-derived from them. The stop-fence commit-point guard (test_slack_code_channel_commit_point.py) now also scans views.py, comments.py, actions.py, notices.py and workspace/publishing.py, with a reason recorded for each write it allows.

Sensitive change

src/kiro_crew/security_posture.py is the one Sensitive Change Review path: 3 added lines in NON_EGRESS_REDACTION_MODULES (commit fix(security): classify plan-canvas comment read-back as capture-side). The hunk is byte-identical to the one on the previous head 5c6a3159a5 (same 3 lines after slack/thread_replies.py). Filled reasoning for the owner to post (a worker never posts it):

## Sensitive change review
- Head commit: 9dfb3e0d2f5ecb4311181e1b02c9ef5024979152
- What rule changed: One classification entry in security_posture.py's redaction-call-site inventory: slack/code_channels/comments.py is added to NON_EGRESS_REDACTION_MODULES with a one-line capture-side reason, beside slack/thread_replies.py. No gate, policy, allow or deny rule, or redactor changed.
- Before -> after (what was allowed/blocked, now): Before, the new canvas comment read-back calls a redactor but is unclassified, so test_every_redactor_call_site_is_a_registered_sink_or_allowlisted fails. After, it is classified as capture-side: it redacts canvas comments as they are READ from Slack (getCanvas) before they reach the session, and owns no output of its own. Nothing becomes allowed or blocked at runtime.
- Worst case if wrong (breaks commands / leaks secret / locks user out): The security panel would undercount output boundaries if comments.py ever gained its own egress, which would then hide behind the allowlist. No command breaks and no user is locked out; the redaction itself still runs on every comment regardless of this classification.
- Evidence checked (which sandbox result proves it): test/test_security_posture.py passes on this head, the omission test included; test_comment_text_goes_through_the_channel_redaction proves a GitHub token and a channel ping in a comment are redacted before delivery, and reverting that redaction fails it.
- No regression:
  - Tools still work (which tools/commands were run, result): No tool path is touched by this entry; on this head every ratchet gate (453 tests), test_security_posture.py (57 tests) and prepush (81 test files) pass, and every test/test_slack*.py (7,606 tests) passes on the same two commits two main commits earlier (identical in git range-diff).
  - Backward compatible (old config / old data / old callers still work, how checked): An additive frozenset entry only; no stored data or config is read; existing sinks and allowlist entries are unchanged (+3 lines, 0 removed).
  - Existing tests (which suites passed on this head): test_security_posture.py (all), test_slack_code_channel_api_gaps.py, the test_slack_code_channel* and test_slack_code_channels* suites, test_slack_code_channel_commit_point.py, test_slack_code_channel_stop_fence.py and test_slack_code_channel_stop_helpers.py.
- How to undo: Revert the commit "fix(security): classify plan-canvas comment read-back as capture-side"; the omission test then fails again until comments.py is classified another way or stops redacting.

Tests

  • test/test_slack_code_channel_api_gaps.py: bar order, Create PR only without a PR and with capability, actions never link, every bar within Slack's schema, the dashboard link with no token; clicks (Create PR runs /create-pr's path, Stop runs Slack's Stop handler, strangers refused privately, redelivery once, every inbound gate, unknown keys, two-user bodies); comments (attributed and framed delivery, once across a restart, retry after a failed delivery, strangers and our own bot skipped, redaction, the per-read bound, 720 comments each delivered exactly once, the legacy baseline, a stopped turn delivers nothing); views (stalest of ours removed, never Plan or Code, never another agent's); agent_resource; the live summary; suspended during an approval; refusal notices once; plain tool errors.
  • test/test_slack_code_channel_bar_budget.py: Slack's first-five truncation against the builder's worst case, the client refusing six, the priority order, the PR slot (the channel's own PR only, no worker item ever, Create PR needing commits from the Code tab's base), the Workers label table, every icon and label within Slack's limits, the permalink read once per board message, one setProperties per real change, Stop at turn start with no git read and across a racing refresh, and Stop taken off when a stopped turn ends.
  • test/test_slack_code_channel_board_scope.py and test/test_slack_code_channel_fences.py: the Workers item and every bar, diff, resend and summary write re-check their scope or activation right before sending; a Stop during a refresh or a bar build sends nothing; an Off or scope change inside the client's own policy read sends nothing at each commit-point site; after a Stop, an idle channel's poll delivers (and the turn it starts carries no poll admission) and a Create PR click corrects the command set; a refused comment is answered once; a comment, /summarize, /wrap-up or a Create PR click refused at the route's own commit point is held (through the real route_linked_thread with the Off inside its agent read, and each pinned re-entry asking the gate once); the bar's Stop still stops a running session with the feature switched off, and it and Slack's own Stop agree in all 144 cases of feature, the code channel's toggle, presser, origin, workspace and running or idle; on an idle conductor channel with a running helper agent, a click stops that helper and its sub-agent through session_events.handle_stopped with the same channel reply as Slack's Stop, and is not told "Nothing is running." (fails when the click is routed around handle_stopped); a click that stops only an idle session's sub-agent is not told so either.
  • Updated main tests: the commit-point guard's module list and allow-list; test_slack_code_channels_routing.py (the bar's Stop settles like Slack's); test_slack_code_channel_stop_fence.py (the turn-end hook's stub carries the bar's turn set).

This head is rebased onto main f05269b1bb, after #38243 (a code channel's Stop also stops its helper agents and their sub-agents) merged. Two hunks were resolved by hand: the spec's Stop row (main's sentence plus the bar's Stop) and test_slack_code_channel_board.py (main's removal of the idle-Stop reply tests, this PR's bar-label test kept); everything else is unchanged in git range-diff except the bar's Stop reply fix (actions._anything_running), its two tests and two doc lines. Before that, after #38181 (per-row PR and CI, the combined Code tab) merged: the hand-merged files keep both sides (the Code tab is main's CodeTab, sent with this PR's activation fence and view-cap room; PullRequest has main's checks and this PR's title; the client asks this PR's send fence, then main's send gate). routing.py is 1,912 lines: _route_to_slot moved whole into route_gate.py, re-exported from routing.

Run on head 9dfb3e0d2f5ecb4311181e1b02c9ef5024979152 (on main f05269b1bb):

  • This PR's 17 changed test files plus every test_slack* / code-channel test file importing a module main changed since the last full run (50 files, 2,049 tests): pass.
  • Every ratchet and tree-scan gate with GITHUB_BASE_REF=main (224 files, 453 tests): pass.
  • prepush (Source Gates, docs lint, flake8, isort, black gate, mypy, line cap, static and flake-pattern ratchets, and the 81 test files changed by this PR or importing a module it changes): all pass. No website/ file changes, so the frontend steps have nothing to run.
  • test_security_posture.py: 57 pass.

On 3a597c9fa5, the same two commits two main commits earlier (identical in git range-diff):

  • Every test/test_slack*.py plus every other test file that drives route_linked_thread or LinkedRoute (198 files, 7,606 tests): pass.
  • test_slack_code_channel_api_gaps.py, the one test file the sub-agent reply fix changes, collected twice and run in 3 shuffled orders: 180 of 180 every time.
  • Opus's review prompt on the delta since 5c6a3159a5 (the conflict resolution, the edits after it, and this PR's Stop paths read against main's stop_helpers.py), rerun after the sub-agent reply fix: no findings. GPT's review prompt on that fix alone (9056399af9..3a597c9fa5, read against stop_helpers and the sub-agent manager's reads): no findings.

On 9056399af9, the head before the sub-agent reply fix:

  • The 17 changed test files, each collected twice and run in 3 shuffled orders: 1,888 of 1,888 every time.
  • GPT's review prompt on the same delta since 5c6a3159a5: no findings. Opus's found that the click's private reply ignored sub-agents (a Stop that stopped only an idle session's sub-agent was also told "Nothing is running."), now fixed with a test that fails without it.
  • The repo's own GPT review prompt on the whole diff against main, assembled as CI assembles it (discovery, then falsification), two independent fresh runs: no findings.

On a4b3179d7b (before #38243; three test fixtures differ since):

  • The repo's own GPT review prompt on the whole diff against main, assembled as CI assembles it, four independent fresh runs: no findings.
  • Each finding on b6dfe1f188, e86c4173bb and a3b518cb0e has a test that fails without its fix.

Manual verification

Still required on a live Slack Code workspace (not reachable from this host):

  • Slack accepts code_channel_action under bot_events when the updated manifest is saved, and a click arrives with the fields actions.parse reads (the gateway logs the first body's field names).
  • A click on the bar's Stop stops the turn and the channel's helper agents and shows idle, as Slack's own Stop does.

Screenshots / video

Scripted capture from the real builders (build_items, pr_resource, comments.feedback_text, the refusal and notice strings), rendered in a Slack-like page because Slack itself is not reachable from this host.

The context bar

The context bar: the bar for a conductor channel with three helper agents and a running turn, the same channel idle with its own PR, all helper agents done, and Create PR; then agent_resource after the PR merged.
Replies and notices

Replies and notices: the private replies to a bar click, three agent tool errors, and a Plan-canvas comment as the session receives it (the ⛔ shows as a box: the capture host has no emoji font).

Related Issues

Builds on #21993 (the conductor work board, merged). Follow-ups: PR B (per-row PR and CI on the board, the combined diff, the wrap-up's worker outcomes) and the tabs PR (PR tabs, tab links, the Workers tab). Slack docs: Code channel properties, Lifecycle, setProperties, getCanvas, listViews, removeView, setView, setStatus.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license.

@kyleseaman
kyleseaman requested review from a team and KiroCrewCaptain as code owners October 20, 2026 02:19
@kyleseaman
kyleseaman requested review from cruisercohen and removed request for a team October 20, 2026 02:19
@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 9dfb3e0d2f5ecb4311181e1b02c9ef5024979152 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Sensitive Change Review

Sensitive files changed:

  • src/kiro_crew/security_posture.py

  • @kyleseaman posted a complete reasoning template for 9dfb3e0.

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 20, 2026
@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 9dfb3e0d2f5ecb4311181e1b02c9ef5024979152 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks. Every new inbound path (bar clicks, canvas comments) goes through the existing allow-list, origin, channel-policy and Stop gates, and dropping the separate CI item is declared in Backwards compatibility.

Notes

  • The PR ships five separable features (bar actions, comment read-back, tab reconciliation, agent_resource, refusal notices) in one change. If the undocumented code_channel_action body turns out to be shaped differently in production, reverting it also reverts unrelated work. Keep actions.py and its manifest subscription in their own commit so that piece can be reverted alone.

[DESIGN-REVIEWED] 9dfb3e0

Description read

[DESCRIPTION-READ] 50d8f66acd2dd2444ea8215485a553a99176bbaa3035819b8674dcc14a3488de

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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 9dfb3e0d2f5ecb4311181e1b02c9ef5024979152 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks. The base RFC (partial) records each product-shape item as decided but not yet built: the bar's action items, plan-canvas comments, the tab limit and the suspended status during approval. Only the resource and live-summary item rests on Slack-docs conformance alone.

Notes

  • Item 7 — inherited: the brief's "a docs-conformance pass over everything sent to Slack Code" is its only support. The base RFC never names agent_resource or summary_message, and without them only Slack's resource and summary slots stay empty. Subtraction: defer set_agent_resource, set_summary_message and the record fields summary_message_ts and the resource digest until a reported need exists.

What this change ships

Inventory (9 items) — 8 justified

Intent: let people in a Slack code channel act from its context bar and give feedback on the plan that reaches the agent, and stop tab and refusal failures from going unnoticed. This is an ADDITION.

  1. The context bar gets Stop and Create PR buttons; clicks arrive as the newly subscribed code_channel_action — justified
  2. The bar gets a Workers tally item linked to the pinned board, plus a budgeted priority order — justified
  3. CI moves into the PR item's label instead of having its own item — justified
  4. Open in dashboard goes on the bar when a slot is free — justified
  5. Comments on the Plan canvas reach the agent as feedback from the person who wrote them — justified
  6. When Slack's tab limit is hit, the least recently written tab this gateway opened gives way and the write is retried once — justified
  7. The channel's PR becomes its Slack resource and the work board becomes its live summary — undeclared provenance, Slack docs only
  8. The channel shows suspended while a tool approval waits — justified
  9. The dashboard says once per channel when Slack refuses the channel's updates — justified

[FIRST-PRINCIPLES-REVIEWED] 9dfb3e0

Description read

[DESCRIPTION-READ] 63a1002c6a4949fca53a3970896b793e150fd058ffc86310ae37b910bdc218dd

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 9dfb3e0d2f5ecb4311181e1b02c9ef5024979152 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 9dfb3e0

Verdict parsed from the review's SHA-scoped output markers for commit 9dfb3e0d2f5ecb4311181e1b02c9ef5024979152.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 9dfb3e0d2f5ecb4311181e1b02c9ef5024979152 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 9dfb3e0d2f5ecb4311181e1b02c9ef5024979152 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 9dfb3e0

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 9dfb3e0d2f5ecb4311181e1b02c9ef5024979152 false-positive: <reason, 20 to 500 characters>

@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 Oct 20, 2026
@kyleseaman
kyleseaman force-pushed the feat/slack-code-channel-api-gaps branch from f25d025 to d2a4c58 Compare October 20, 2026 15: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 Oct 20, 2026
@kyleseaman
kyleseaman force-pushed the feat/slack-code-channel-work-board branch from beab93b to 0d23e0a Compare October 20, 2026 16:34
@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 20, 2026
@kyleseaman
kyleseaman force-pushed the feat/slack-code-channel-api-gaps branch from d2a4c58 to f3e263f Compare October 20, 2026 16:53
@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 merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Oct 20, 2026
@kyleseaman
kyleseaman force-pushed the feat/slack-code-channel-work-board branch from 0d23e0a to cc01bfb Compare October 20, 2026 17:37
@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 20, 2026
@kyleseaman
kyleseaman force-pushed the feat/slack-code-channel-work-board branch from cc01bfb to a4dfdbe Compare October 20, 2026 21:45
@kyleseaman
kyleseaman force-pushed the feat/slack-code-channel-api-gaps branch from f3e263f to a277a54 Compare October 20, 2026 22:00
@kyleseaman
kyleseaman force-pushed the feat/slack-code-channel-work-board branch from 5da454b to 8291cb0 Compare November 2, 2026 15:31
kyleseaman pushed a commit that referenced this pull request Nov 2, 2026
GPT 6.1 and Opus 5.5 (both upheld at 2ea3dfe): the "Stopped by" note read
the worker slot's turn generation after awaiting the stop and the Slack reply,
so a queued follow-up turn that started meanwhile was shown as stopped and lost
its Stop button. Fixed as a class, each with a test that fails without it:

- the final gate reads the stopped turn's generation before the stop awaits;
  stops.note takes it and keeps nothing for a turn the slot has moved past,
  and never erases a later turn's note;
- the repeat mark is per turn, so a Stop on the next queued turn is a new stop;
  a stop that raises (cancellation included) leaves no repeat mark;
- stops.reconcile drops a stale "Stopped by" line right before the board and
  the Workers tab render, and before the one-time edit-gap skip is taken; a
  stale stop's skip is dropped with it.

The board's scope rule from #22370 (a channel that turned shared, or whose slot
was relinked, is not shown the conductor ledger's content), now asked again
across every await of this PR's own surfaces, each with a test that fails
without it:

- every Workers-tab and PR-tab write and removal (tabs._may_write, asked right
  before each send and each removal);
- the board message, after the Workers tab's awaits and again right before
  each send and before each needs-you mention (publisher.publish in_scope);
- the wrap-up: built and, again, right before each post (the retry without
  tab links included), without the workers' outcomes and their PR tabs (the
  channel's own PR tab stays);
- the Workers-tab Stop: its final gate refuses a channel out of scope, and a
  stop whose channel left the scope while it ran names no worker and notes no
  "Stopped by" line.

GPT 6.1 (upheld at 55817e1): with worker hand-off off (the default) the
scope check refused the channel's OWN PR tab too. The own PR (the channel's
workspace record, not the ledger) now takes the channel fences only; worker PR
tabs keep the scope check right before each write, and a sync that starts out
of scope uses only the own PR. Tests fail without it.
@kyleseaman
kyleseaman force-pushed the feat/slack-code-channel-work-board branch from 8291cb0 to f777357 Compare November 2, 2026 15:33
@kyleseaman
kyleseaman force-pushed the feat/slack-code-channel-api-gaps branch from 7dd25c1 to c9c10de Compare November 2, 2026 16:14
@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 merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 2, 2026
kyleseaman pushed a commit that referenced this pull request Nov 2, 2026
GPT 6.1 and Opus 5.5 (both upheld at 2ea3dfe): the "Stopped by" note read
the worker slot's turn generation after awaiting the stop and the Slack reply,
so a queued follow-up turn that started meanwhile was shown as stopped and lost
its Stop button. Fixed as a class, each with a test that fails without it:

- the final gate reads the stopped turn's generation before the stop awaits;
  stops.note takes it and keeps nothing for a turn the slot has moved past,
  and never erases a later turn's note;
- the repeat mark is per turn, so a Stop on the next queued turn is a new stop;
  a stop that raises (cancellation included) leaves no repeat mark;
- stops.reconcile drops a stale "Stopped by" line right before the board and
  the Workers tab render, and before the one-time edit-gap skip is taken; a
  stale stop's skip is dropped with it.

The board's scope rule from #22370 (a channel that turned shared, or whose slot
was relinked, is not shown the conductor ledger's content), now asked again
across every await of this PR's own surfaces, each with a test that fails
without it:

- every Workers-tab and PR-tab write and removal (tabs._may_write, asked right
  before each send and each removal);
- the board message, after the Workers tab's awaits (the publisher's own
  per-send and per-mention re-check is #22370's ``admits``, passed through);
- the wrap-up: built and, again, right before each post (the retry without
  tab links included), without the workers' outcomes and their PR tabs (the
  channel's own PR tab stays);
- the Workers-tab Stop: its final gate refuses a channel out of scope, and a
  stop whose channel left the scope while it ran names no worker and notes no
  "Stopped by" line.

GPT 6.1 (upheld at 55817e1): with worker hand-off off (the default) the
scope check refused the channel's OWN PR tab too. The own PR (the channel's
workspace record, not the ledger) now takes the channel fences only; worker PR
tabs keep the scope check right before each write, and a sync that starts out
of scope uses only the own PR. Tests fail without it.
@kyleseaman
kyleseaman force-pushed the feat/slack-code-channel-api-gaps branch from c9c10de to 5c0d705 Compare November 2, 2026 16:32
kyleseaman pushed a commit that referenced this pull request Nov 2, 2026
GPT 6.1 and Opus 5.5 (both upheld at 2ea3dfe): the "Stopped by" note read
the worker slot's turn generation after awaiting the stop and the Slack reply,
so a queued follow-up turn that started meanwhile was shown as stopped and lost
its Stop button. Fixed as a class, each with a test that fails without it:

- the final gate reads the stopped turn's generation before the stop awaits;
  stops.note takes it and keeps nothing for a turn the slot has moved past,
  and never erases a later turn's note;
- the repeat mark is per turn, so a Stop on the next queued turn is a new stop;
  a stop that raises (cancellation included) leaves no repeat mark;
- stops.reconcile drops a stale "Stopped by" line right before the board and
  the Workers tab render, and before the one-time edit-gap skip is taken; a
  stale stop's skip is dropped with it.

The board's scope rule from #22370 (a channel that turned shared, or whose slot
was relinked, is not shown the conductor ledger's content), now asked again
across every await of this PR's own surfaces, each with a test that fails
without it:

- every Workers-tab and PR-tab write and removal (tabs._may_write, asked right
  before each send and each removal);
- the board message, after the Workers tab's awaits (the publisher's own
  per-send and per-mention re-check is #22370's ``admits``, passed through);
- the wrap-up: built and, again, right before each post (the retry without
  tab links included), without the workers' outcomes and their PR tabs (the
  channel's own PR tab stays);
- the Workers-tab Stop: its final gate refuses a channel out of scope, and a
  stop whose channel left the scope while it ran names no worker and notes no
  "Stopped by" line.

GPT 6.1 (upheld at 55817e1): with worker hand-off off (the default) the
scope check refused the channel's OWN PR tab too. The own PR (the channel's
workspace record, not the ledger) now takes the channel fences only; worker PR
tabs keep the scope check right before each write, and a sync that starts out
of scope uses only the own PR. Tests fail without it.
@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 Nov 2, 2026
@kyleseaman
kyleseaman force-pushed the feat/slack-code-channel-api-gaps branch from 5c0d705 to 7355586 Compare November 2, 2026 17:28
@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 Nov 2, 2026
@kyleseaman
kyleseaman force-pushed the feat/slack-code-channel-work-board branch from f777357 to 64cc0b6 Compare November 2, 2026 17:29
Kyle Seaman added 2 commits November 18, 2026 00:35
…tabs

Closes the Slack Code API gaps on top of the conductor work board.

- Context bar, budgeted to Slack's five items (a longer list is kept to its
  first five with only a warning): a Workers item with the board's tally
  ("2 working · 1 needs you") linked to the pinned board's permalink
  (chat.getPermalink, cached per board message), repo, branch, Stop while
  the channel's own turn runs (decided at send time, so a refresh racing a
  turn start never drops it), and ONE PR slot: the channel's own PR with
  its CI, else Create PR when the branch has commits past the Code tab's
  base. Each worker's PR is on the board. The Workers item rides only a bar
  sent with the channel's binding and is scope-checked right before that
  send; a refresh sends the bar again once its board is known. Open in
  dashboard takes a free slot only; an unchanged bar is not resent.
  Create PR and Stop are action items (code_channel_action, now
  subscribed): Create PR runs commands.run_command for /create-pr, Stop is
  Slack's own Stop handler, so both run routing._stop_bound and its stop
  fence. Bars outside Slack's schema are refused before sending; the agent
  cannot take a channel-action key.
- Plan-canvas comments are read with agents.conversations.getCanvas at a
  normal turn end and by an idle-channel poll (Slack sends no comment
  event), and reach the session as the commenter's message: authorized
  like a typed message, redacted, framed as feedback, de-duplicated
  against Slack's own listing across restarts, bounded. Only a ROUTED
  delivery is marked seen.
- View tabs: every tab we open is recorded; at Slack's five-view cap the
  stalest of OURS by recorded id (never the Plan tab or the diff, never
  another agent's) is removed and the write sent once more.
- agent_resource follows the channel's PR (renames, merge, close); the work
  board is the live summary_message until a wrap-up replaces it.
- Docs conformance: suspended while a tool approval waits (by request id);
  one dashboard notice when Slack answers not_agent_channel /
  not_authorized; plain tool errors for too_many_sections /
  content_too_large; html sized after redaction; an ambiguous click is
  refused.
- The stop-fence commit-point guard now also scans views, comments,
  actions, notices and workspace/publishing.
slack/code_channels/comments.py redacts canvas comments as they are read
from Slack (agents.conversations.getCanvas), before they reach the session,
like slack/thread_replies.py does for thread replies. It owns no output of
its own, so it joins NON_EGRESS_REDACTION_MODULES.
@kyleseaman

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: 9dfb3e0
  • What rule changed: One classification entry in security_posture.py's redaction-call-site inventory: slack/code_channels/comments.py is added to NON_EGRESS_REDACTION_MODULES with a one-line capture-side reason, beside slack/thread_replies.py. No gate, policy, allow or deny rule, or redactor changed.
  • Before -> after (what was allowed/blocked, now): Before, the new canvas comment read-back calls a redactor but is unclassified, so test_every_redactor_call_site_is_a_registered_sink_or_allowlisted fails. After, it is classified as capture-side: it redacts canvas comments as they are READ from Slack (getCanvas) before they reach the session, and owns no output of its own. Nothing becomes allowed or blocked at runtime.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): The security panel would undercount output boundaries if comments.py ever gained its own egress, which would then hide behind the allowlist. No command breaks and no user is locked out; the redaction itself still runs on every comment regardless of this classification.
  • Evidence checked (which sandbox result proves it): test/test_security_posture.py passes on this head, the omission test included; test_comment_text_goes_through_the_channel_redaction proves a GitHub token and a channel ping in a comment are redacted before delivery, and reverting that redaction fails it.
  • No regression:
    • Tools still work (which tools/commands were run, result): No tool path is touched by this entry; on this head every ratchet gate (453 tests), test_security_posture.py (57 tests) and prepush (81 test files) pass, and every test/test_slack*.py (7,606 tests) passes on the same two commits two main commits earlier (identical in git range-diff).
    • Backward compatible (old config / old data / old callers still work, how checked): An additive frozenset entry only; no stored data or config is read; existing sinks and allowlist entries are unchanged (+3 lines, 0 removed).
    • Existing tests (which suites passed on this head): test_security_posture.py (all), test_slack_code_channel_api_gaps.py, the test_slack_code_channel* and test_slack_code_channels* suites, test_slack_code_channel_commit_point.py, test_slack_code_channel_stop_fence.py and test_slack_code_channel_stop_helpers.py.
  • How to undo: Revert the commit "fix(security): classify plan-canvas comment read-back as capture-side"; the omission test then fails again until comments.py is classified another way or stops redacting.

@bolichen97 bolichen97 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.

Reviewed head 9dfb3e0. CI is green (80 pass, 18 skipped), the branch merges cleanly into current main (46 behind), and the changed backend suites plus test_security_posture.py and test_slack_code_channel_stop_helpers.py pass locally (1033 passed). Design, First Principles, Opus and GPT lanes all pass on this head.

What I checked by hand:

  • Both bar actions reuse existing paths. Stop builds the same agent_session_stopped event and goes through session_events.admits + handle_stopped, so it gets Slack's Stop checks and nothing more. Create PR goes through commands.run_command after the feature gate, de-dup, the workspace-origin gate, channel_inbound_permitted + channel_refusal, a bound-channel check and a live act_refusal. parse (src/kiro_crew/slack/code_channels/actions.py:83) treats two different user ids as nobody, which fails closed.
  • Canvas comments go through is_allowed_user, the channel redactor and routing._route_to_slot with an admit gate at the route's commit point. Our own comments are skipped, so a turn-end read cannot loop on the agent's own output.
  • In route_linked_thread, note_channel_sender now runs after the new admit check and right before the append, with no await between (src/kiro_crew/slack/handler_runtime/inbound.py). The recursive re-route still records the sender, so the owner-only dispatch exemption is not widened.
  • Views are removed only by the view id this gateway recorded, never the Plan or Code tab, and the retry is one write under the same fence.
  • The dashboard link comes from board.links.link_builder, https only, with no click token.

Non-blocking:

  1. File size. test/test_slack_code_channel_board_diff.py goes from 1,580 to 1,603 lines, past the 1,600-line target that AGENTS.md says a change should split in the same PR. The new test/test_slack_code_channel_api_gaps.py starts at 1,901. src/kiro_crew/slack/code_channels/workspace/service.py (1,934), routing.py (1,912) and src/kiro_crew/slack/events.py (1,965) grow further toward the 2,000 cap. check_file_line_cap.py only reports these, but a follow-up split would keep the next code-channel PR from hitting the cap.
  2. Revertability, as Design Review notes. code_channel_action's body is still undocumented, and actions.py plus its manifest subscription share the large first commit with the four other features. Moving them into their own commit, or a follow-up that can be reverted alone, would make a production shape mismatch cheap to back out.
  3. src/kiro_crew/slack/code_channels/comments.py:80-81: _locks and _last_read are keyed by channel id and never pruned when a channel is unbound or archived. This is small in practice, but poll_once (line 431) stamps every due channel each pass, so the dicts only grow over a gateway's lifetime.

Approving.

AI-assisted, sent by Bolin Review bot

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