Skip to content

feat(slack): per-row PR and CI, the combined Code tab and wrap-up outcomes on the work board - #38181

Merged
kyleseaman merged 2 commits into
mainfrom
feat/slack-code-channel-board-diff
Nov 17, 2026
Merged

kyleseaman merged 2 commits into
mainfrom
feat/slack-code-channel-board-diff

Conversation

@kyleseaman

@kyleseaman kyleseaman commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Head commit: 5064b8f (base main)

Problem / Motivation

Goal: In a conductor-led Slack code channel, show each helper agent's PR and CI on the work board, its commits in the channel's Code tab, and its outcome in the wrap-up, and make the idle !stop reply link each running helper agent.

#21993 put the work board in the channel; it was split at the owner's decision (board message first), and this PR is the second half: Kyle's ask was "we need to show all the sub-session states for conductor, the diff, make the integration GREAT". Today the board names each helper agent and what it is doing, but not its PR or CI; the Code tab shows only the channel's own diff, so a helper agent's committed work is invisible in Slack; and the wrap-up lists the channel's own PR but not the helper agents'. The UX review of #21993 also found that the idle !stop reply sent people to the board for a link that only a waiting row carries.

Why it matters

Without these, the owner still opens each helper agent's session in the dashboard to see whether its PR is open, green or merged, and what it changed. The !stop reply promised a link the board does not have.

Not a goal

  • Links on every board row (the signed-off plan look keeps "Open in dashboard" on a waiting row only).
  • Context-bar items per helper agent (feat(slack): code-channel bar actions, canvas comments, view tabs #22370's Workers item replaces them).
  • Filing helper agents into the channel's folder (session_create alone files them; the board writes no folder_id).
  • Stopping helper agents from a channel Stop.
  • A "stopped" word on the Slack board to match the dashboard Board (recommended separately below).
  • Changing the needs-you reply. It still names only the approval's kind ("approve a command"), because the call stays on the board alone and a page that notifies never carries it. The feat(slack): conductor work board in code channels #21993 UX note asking the reply to name the call is not taken: it would reverse that recorded decision, which is the owner's to make.

What changed (motivation → approach → change)

The idle !stop reply (commit 1). It named a count and said "open it from the work board", where only a waiting row has a link. It now names each running helper agent by its board title, linked to its chat with the board's own link builder (no click token, a URL the redaction would change or that breaks a link is not linked, titles escaped), up to 5; the rest, and any the board has no row for, fold into "and N more", pointed at the lead session (linked when it can be). With no dashboard address it names them and says to open them from the lead session in the dashboard. The helpers are read under the board's scope check after the link builder's await, right before the send.

Idle and waiting rows keep sharing the empty circle: Slack's plan block has only four task statuses (pending, in progress, complete, error) and a waiting row is none of the other three (the spinner would say it is moving, the error mark that it failed), so the difference is carried in words a screen reader also announces: "Waiting on you: " leads the title, and the threaded reply pages the owner.

Per-row PR and CI (commit 2, workspace/worker_prs.py). A row's PR is the number its worker reported, then each refresh reads that PR (a URL built from the channel's own repository, so a number can only name a PR there) or, with no number, its branch's PR, for every row either look can show, concurrently, off the channel lock, cached 60 s (900 s once merged or closed). A worker whose session works in another repository (host and owner/name compared case-insensitively), or one whose origin the channel cannot compare, gets no branch, PR or CI. The row shows PR #12 (linked only when https and left whole by the redaction), its state when not open, and CI 4/6 passing · 2 running (or · 1 failing) for a live PR (from an internal ciCounts marker of the dashboard's check read, stripped before the chip cache). The summary line adds · N PRs open. A forge failure leaves the rows without PR and CI; the board still goes out.

The combined Code tab (workspace/worker_diff.py, service._build_diff). With a board, the tab is the channel's own diff, then one group per helper agent with commits of its own, under Helper agent 2 of 5: <title> · branch <b> · PR #12 open · working. Each group is merge-base(channel HEAD, branch) .. branch, read from the channel checkout's object database, only for a branch name git accepts as a branch and only when its tip is reachable from that worker's own tree (a claimed branch shows nothing), through the channel diff's whole-file screen and the outbound redaction. One raw read budget is shared by the helper agents' reads (the channel's own read keeps its own); a worker left out adds the truncation note. setView now takes a required send gate that CodeChannelsClient._call asks last, after every await (a gate that raises refuses): refused there, the channel's own diff goes instead. The workspace record keeps whether the tab up may carry helper agents' commits (diff_workers): written to disk before a send built with the board, kept across a restart, a rebind and a lost answer, and cleared only on Slack's word (a channel-only tab or a removal answered, or a send that never left). While it is set and the board is refused (shared, Off, Review), the tab is replaced by the channel's own or removed; one whose id was never learned is replaced by one fixed line (This Code tab was withdrawn.) and that id removed. A takedown Slack refuses stays owed and is retried at most every 60 s doubling to 30 minutes (the watch re-arms it after a restart), and the owner gets one dashboard notice; nothing is retried while Slack has the channel's views off. A channel Slack no longer lists us as the agent of has its owed tab taken down just after it is unbound (so no refresh's send gate, which reads the stored binding, admits helper agents' content past it), best effort: Slack may already refuse that write, and nothing retries it while the channel is unbound. When nothing can be built, such a tab is taken down once the board's scope refuses it, and kept while it admits it, the pass re-armed until it builds. A tab that carries helper agents, or must replace one, and did not land (a refusal, a failed send or removal, a build that raised) leaves the pass unsent and re-armed, with or without a board read.

Wrap-up outcomes (board.outcome_lines, wrapup.py). The wrap-up lists one line per helper agent (• Fix login: PR #12 merged, rejected, PR #9 closed, lost, no PR), from the board this process published for this conductor or a fresh scope-checked read filled as a refresh fills it, capped at 1,800 characters then +N more. The lines are left out when the board's scope refuses the channel at the post, and on every re-send of the message (the retire edit, the archive edit and its restore).

Carried from #21993's review. Three board tests passed with redaction removed (M1-M3); each now fails under an identity redactor. M4: the dashboard Board says "stopped" for a run with open items and no active patrol, the Slack board does not; I recommend adding it in its own change, not here.

Backwards compatibility

Compatible: a channel with no board keeps the plain single diff and its bar; the new WorkerRow fields and Facts.workers have defaults; set_diff_view's new gate is keyword-only and both its callers pass it (the withdrawal's fixed line passes gate=None).

Removes nothing: only the idle !stop reply's wording changes; no key, record, route or caller is removed.

Tests

test/test_slack_code_channel_board_diff.py (new): the combined diff (headers, order, a key edited inside a PEM, whole-file reads whatever the repo's diff config, the shared raw budget, a claimed branch, the plan's rows, settled rows past the view), the Code tab's scope (refused after the build and at the send, a tab taken down when no channel-only diff can be built, a takedown owed after a refused read retried until it lands, and still owed after a restart, a build that raised or a failed removal re-armed, a transient build failure keeping an admitted tab, git listing no tree, the client's gate asked last and failing closed), per-row PR and CI (by number over a reused branch, by branch, cache per host, off the lock, another repository, an origin the channel cannot compare, one differing only in case, a failing rollup, both looks, the ciCounts marker kept out of the chip cache, a failing forge read), and the wrap-up (outcome lines, the cap, the scope at the post and at every re-send, a Stop in the retire task, the fallback read filled like a refresh, a replaced conductor). test_slack_code_channel_commit_point.py: set_diff_view requires a gate, the client asks it last with no await before the send, and every caller passes one; no board module nor the new worker readers assigns a folder_id. The idle !stop tests sit with the board and routing suites (including a scope change during the link builder's await), and the routing suite takes an owed Code tab down once a revoked channel is unbound, and unbinds when that takedown raises. The needs-you reply and its tests are main's, unchanged. Every test added after the first review round failed on the head before its fix. Mutation checks: removing the send gate, the PR fill, the unsent-on-failed-tab rule or the take-down-on-refusal rule each fails a named test.

This head is de08c6c69af7b0aad4d22771f8c74da2aabc53e0 rebased onto main 537166e, identical in git range-diff. On it every test_slack_code_channel* suite, the chip and source-provider files, every test_*ratchet*.py gate with the PR base set and the config-baseline, content-scan and facade-mirror gates pass (2,879 tests). Two main commits earlier, on the same two commits: every test/test_slack*.py with those gates and 38 more test files that name a module this PR changes (9,559 tests), three repeat passes of the 6 files CI's stability check selects (677 each), docs lint and the source gates all pass. Local checks before that rebase, on de08c6c69af7b0aad4d22771f8c74da2aabc53e0 (two commits on main 8cc64c0, identical in git range-diff to the previous local head on 084b4c1): the full pre-push gate (source gates, docs lint, static and flake ratchets, flake8, isort, black, mypy, line cap, the changed-plus-importer test files) passes; every test/test_slack*.py file plus the chip files and the other changed test file (196 files, 7,392 tests) pass; three repeat passes of the 9 changed test files (902 tests each), as CI's stability check runs them, pass; CI's new-test stability replay (the 6 files scripts/new_test_stability_scope.py lists, three passes with -n auto) passes five rounds in a row with eight busy loops loading the 16-CPU host; every ratchet and tree-scan test file with the PR base set as CI sets it (224 files) gives 12,612 passed and 3 failed, and those three fail the same on a clean main 8cc64c0 on this host (test_client_bindings.py and test_runtime_bindings.py, from the local Python 3.13's pathlib._local, and the test_sandbox_launcher_program_parts.py tree scan). Every test changed in this round failed first: the Windows fixes under a simulated CRLF checkout, a tied clock or a slow host, the restored needs-you pins on the previous head, and the revocation takedown on the previous head. Local Opus-lane and GPT-lane reviews of the change since the last pushed head pass (GPT blocked once on a revocation race, fixed by taking the tab down after the unbind). No Sensitive Change Review path is touched and no website file changes.

Manual verification

None on a live Slack workspace for this PR. Two points are unverified locally because no harness speaks to Slack:

  • Slack accepting the fixed-line setView (type=diff, content This Code tab was withdrawn.) that replaces a tab whose id was never learned.
  • The view id staying the same when setView replaces the channel's one diff tab, which the takedown of that replacement relies on.

Screenshots / video

No new screenshots: no local harness renders Slack's plan block, the Code tab or a posted reply, and no live workspace was used. The rows' PR output, the Code tab's groups and the wrap-up lines are pinned as rendered text in test_slack_code_channel_board_diff.py.

Related Issues

Follows #21993.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • 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

@kyleseaman
kyleseaman requested review from a team and KiroCrewCaptain as code owners November 16, 2026 23:56
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 16, 2026
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 5064b8f81a59d3dda07fc61c4f820ec93be9949e 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 Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

No design-level blockers. The new diff_workers record and the gated send close the case where a tab carrying helper agents' commits stays up after the board's scope refuses the channel. The PR removes nothing that any reader outside the patch depends on.

Notes

  • workspace/service.py grows from 1,806 to 1,925 lines; it was already past the 1,600-line split threshold, and routing.py is at 1,985. The takedown and retry state machine (owed tab, WITHDRAWN_TAB, the 60 s to 30 min backoff) is its own job. Moving it into a sibling workspace/ module would stop it piling up in a file that is near the 2,000-line cap.

[DESIGN-REVIEWED] 5064b8f

Description read

[DESCRIPTION-READ] a0c666abd5d2a71ffdbf29b020e860ba6aa9ae04ae724c92c7a05500c1d66592

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 Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 5064b8f81a59d3dda07fc61c4f820ec93be9949e — 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: every item is one the base RFC rfc-slack-code-channels.md (status partial) lists as still to build, and each scope-refusal takedown guards the audiences a shared or Off/Review channel admits.

What this change ships

Inventory (9 items) — 9 justified

Intent: in a conductor-led Slack code channel, see each helper agent's PR, CI, commits and outcome without opening the dashboard. This is an ADDITION.

  1. Each work-board row shows its helper agent's PR number, its state and its CI counts — justified
  2. The board's counts line adds · N PRs open — justified
  3. A helper agent working in another repository shows no branch, PR or CI — justified
  4. The Code tab adds one group of commits per helper agent below the channel's own diff — justified
  5. When the board's scope refuses the channel, a Code tab carrying helper agents' commits is replaced or taken down, retried with backoff — justified
  6. The owner gets one dashboard notice when that takedown fails — justified
  7. The wrap-up lists one outcome line per helper agent, and later edits drop those lines once the scope refuses — justified
  8. The idle !stop reply names and links up to five running helper agents instead of giving a count — justified
  9. The dashboard's check fetch carries an internal ciCounts marker that it strips before caching — justified

[FIRST-PRINCIPLES-REVIEWED] 5064b8f

Description read

[DESCRIPTION-READ] 35966756e72fa4b2590193c5ecacb61d506bc328116801bce3850656c8e24d2e

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 Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 5064b8f81a59d3dda07fc61c4f820ec93be9949e — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 5064b8f

Verdict parsed from the review's SHA-scoped output markers for commit 5064b8f81a59d3dda07fc61c4f820ec93be9949e.

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

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 5064b8f81a59d3dda07fc61c4f820ec93be9949e and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 5064b8f

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 5064b8f81a59d3dda07fc61c4f820ec93be9949e 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 Nov 17, 2026
@kyleseaman
kyleseaman force-pushed the feat/slack-code-channel-board-diff branch from ea16bae to 2f366a3 Compare November 17, 2026 02:19
@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 Nov 17, 2026
@kyleseaman
kyleseaman force-pushed the feat/slack-code-channel-board-diff branch from 2f366a3 to 1523fc3 Compare November 17, 2026 06: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 labels Nov 17, 2026
Kyle Seaman added 2 commits November 17, 2026 12:10
The idle !stop reply sent people to the work board for a link only a
waiting row carries. It now names each running helper agent by its board
title, linked to its chat with the board's own link builder (no click
token), up to five, the rest folded into one line pointed at the lead
session. With no dashboard origin it names them and points at the lead
session. The helpers are read under the board's scope check after the
link builder's await, right before the send.
…comes on the work board

The second half of the work board, split from #21993.

Each board row now shows its helper agent's PR and CI: the number the
worker reported, read from the channel's own repository (by number, else
by branch), cached, concurrent and off the channel lock, with CI counts
from the dashboard's check read. A worker whose session works in another
repository shows no branch, PR or CI.

The Code tab shows the combined change: the channel's own diff, then each
worker's own commits under a header naming it, read from the channel
checkout's object database only for a tip reachable from the worker's own
tree, screened and redacted as the channel's diff is. setView takes a
required send gate the client asks last, right before the raw send; a
refused or failed worker tab is replaced by the channel's own or taken
down, and leaves the pass unsent.

The wrap-up lists one outcome line per helper agent, left out when the
board's scope refuses the channel at the post or any re-send.

Workers are not filed into folders, and the context bar carries no worker.
Three board tests now fail under an identity redactor (they passed with
redaction removed).
@kyleseaman
kyleseaman force-pushed the feat/slack-code-channel-board-diff branch from 1523fc3 to 5064b8f Compare November 17, 2026 12:16
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 17, 2026
@kyleseaman
kyleseaman enabled auto-merge (squash) November 17, 2026 13:39
@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

This changes behaviour users already rely on, so it needs a design sign-off from a maintainer before it can merge. A maintainer will post the decision here.

To propose a design, follow the request-for-change process in CONTRIBUTING.md (docs/request-for-change/).

Review result on head 5064b8f: no blocking findings. The review read the full source diff and checked every caller of the changed signatures (set_diff_view now takes gate, running_helpers returns a list, ciCounts is popped before the chip cache). Helper agents' commits are read only between two full SHAs from the channel checkout. A reported branch must be reachable from that helper's own registered worktree. Each group goes through the same secret screen and outbound redaction as the channel's own diff. Mutation runs confirmed the client send gate, the post-time wrap-up gate, the ciCounts strip and the M1 to M3 redaction tests each fail a test when removed. Well done: the send gate is checked last in CodeChannelsClient._call with no await before the raw send, and an AST test pins that.

Optional:

  • The Code tab takedown (diff_workers, _withdraw_unknown, WITHDRAWN_TAB, and the two backoff ladders in code_tab.py and service.py) is not in the RFC, which specifies retraction only for the wrap-up. The send gate plus the channel-only fall-back already replaces the combined tab in the common case. Either record the takedown in the RFC, or drop it and keep a single retry ladder.
  • The archive-click re-sends in wrapup.py:915 and :939 have no test. Replacing _shown(binding, original) with original at both sites leaves the code-channel suite green. A test with _workers_still_admitted returning False would pin both.
  • test_ci_counts_reach_the_board_but_never_the_dashboard_chip_cache runs the real _refresh_check_status without the isolation used in test_chip_ci_pending.py. It schedules a gh repo view call and leaves entries in _check_flap and _visibility_force_gen. Copying that file's fixture fixes it.

@kyleseaman
kyleseaman merged commit c8c236a into main Nov 17, 2026
102 of 107 checks passed
@kyleseaman
kyleseaman deleted the feat/slack-code-channel-board-diff branch November 17, 2026 16:39
@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 readiness: checking Automated validation is still running labels Nov 17, 2026
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