Skip to content

feat(mcp): session_set_color tints a session the caller created - #15428

Merged
iamwhatever merged 1 commit into
kirodotdev:mainfrom
Pearcekieser:feat/mcp-session-note-color
Oct 26, 2026
Merged

iamwhatever merged 1 commit into
kirodotdev:mainfrom
Pearcekieser:feat/mcp-session-note-color

Conversation

@Pearcekieser

@Pearcekieser Pearcekieser commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A conductor can color the worker sessions it created.

A conductor that opens workers with session_create has no way to group them visually in the sidebar. The sidebar color menu (PATCH /api/chat/slots/{slot}/color) is out of reach of the kirocrew-dashboard MCP server, and it does not fence agent callers by ownership.

Why it matters

A conductor running a dozen workers leaves a sidebar of identically tinted tabs, so the person cannot tell which fleet a tab belongs to.

The color also has to change after creation. An attended conductor, one the person is driving in the dashboard, recolours a worker when the person asks it to regroup or mark one, and clears the mark with "none". Each call goes through the normal approval prompt. A color field on session_create would set the first tint only, so it covers grouping at birth but not those later steps; the standalone verb is the smallest surface that does both.

Not a goal

  • Folder color (a separate tool).
  • Any change to the sidebar color menu or to the /note route's behaviour for apps and crons.
  • Reaching sessions the caller did not create, including the person's own tabs.
  • A generic tool-registration framework.
  • Recolouring from the unattended patrol cycle. session_set_color stays out of the unattended conductor grants, and no built-in skill calls it yet. Granting it there, so a patrol can mark a blocked or done worker without a prompt, is a separate trust decision for a follow-up that adds the skill step and the grant together.

What changed (motivation → approach → change)

This PR now ships the color half only. The note half, session_set_note, moves to its own PR: every review round on it raised a new security question about agent-written text entering another session's prompt and transcript (choice markers, frame delimiters, replay after a channel link), and those need their own design pass rather than riding along with a sidebar tint. The work so far is kept on the feat/mcp-session-note branch of the fork.

session_set_color(target, color) joins the session-control family as one Tool(...) row in mcp_dashboard.TABLE (the #17098 table), with identity="strict" and routes=("POST /api/session-control/set-color",), and calls that new strict-internal route.

The route runs the existing authorize_target unchanged, so a session naming itself is refused self_target as for session_stop. It then refuses any target whose created_by is not the caller, the same every-caller fence end_wait_target applies. That second check runs for every caller, so an owner session with session control switched on for everyone still cannot recolor the person's own tabs. session_stop is not narrowed.

color is "0" to "6" for the seven swatches the sidebar menu draws, or "none" to clear; the menu's custom #rrggbb cell is left out, since a fleet mark needs a few distinct tints and the swatches follow the viewer's theme. A swatch write clears any custom hex, as the menu's own swatch click does. color is a required field checked against SESSION_COLOR_CHOICES ("none" and "0" to "6") with the existing allowed= check. The clear value is a word rather than "" so that an input validation sanitizes down to "", such as a lone "\u200b", is refused as missing instead of clearing a tint. A test pins those choices to the route's parser.

Folders do not cover this: a conductor usually sits in the person's project folder beside its workers, so the folder cannot also say which conductor owns which worker, and a tint marks that without moving anything the person filed. Tags cannot do it either: each fleet mark would be a permanent entry in the person's shared tag list and board filters, and the dashboard MCP has no tag delete, while a tint lives on one session and "none" removes it.

The tool is blocked for channel agents and left out of unattended conductor grants.

Where it lives: the tool row in mcp_dashboard_session_tools.py and its body _run_session_set_color in mcp_dashboard_session_runs.py, the schema and color choices in validation_parts/messaging_session_schemas.py (registered in validation_parts/server_registries.py), the title in data/mcp_tool_titles.json, the gate in dashboard/session_control_parts/session_titles.py, the route in dashboard/handlers/session_control.py, dashboard/server_runtime/mcp_routes.py and the strict list in dashboard/server_internal_paths.py, the channel block in channel.py, the withheld-verb note in agent_parts/spec_grants.py, and the reference in docs/session-control.md and docs/index.md.

The color write itself is dashboard/slot_color.write_slot_color, which stores the index and hex, marks the slot dirty and publishes. The sidebar menu's PATCH /api/chat/slots/{slot}/color route now calls it too, after deciding the pair exactly as before, so a later change to how a color is stored reaches both writers. This answers the Design review's suggestion in this PR instead of a follow-up.

Backwards compatibility

Compatible: one new tool and one new route; no existing route or argument changes.

Tests

  • test/test_session_control_color.py: self refused (fails if allow_self comes back), created, not-created (owner and fenced callers) and out-of-bounds targets; the color grammar, including a custom hex, invisible characters and padding; the palette size pinned to PALETTE_SIZE in sessionColors.ts; route auth and strict-internal registration; the tool reply shapes through TABLE.call with an in-memory dashboard; invisible, empty and out-of-set colors refused with no request sent; a tint on an empty newborn worker reaches its metadata line through the periodic flush (flush_slot_now). The tool schema and the route's parser read one set, validation.SESSION_COLOR_CHOICES, built from SESSION_PALETTE_SIZE.
  • test/test_session_control_member_gate.py: set-color added to the routes that must forward the carried member verdict.
  • test/test_session_control_audit.py: the tool added to the every-refusal-is-audited table.
  • test/test_session_control_color.py::test_both_color_writers_store_through_the_one_slot_color_write: the menu's PATCH route and the agent verb both store through write_slot_color (fails if either inlines the field writes again). The existing route tests in test/test_dashboard_chat_session_meta.py pass unchanged.
  • Registration, doc-count and advertised-set tests updated for the new tool.

Manual verification

N/A. The route is driven through its real handler against a real DashboardState in the unit tests, and the tool through the real TABLE.call frame.

Related Issues

Refs #15424 (the note half of that issue moves to its own PR)

The color verb relies on the periodic flush persisting a message-less newborn's metadata, which #17896 added and which is on main.

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

Contribution License Agreement

@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention labels Sep 30, 2026
@Pearcekieser Pearcekieser changed the title feat(mcp): session_set_color and session_set_note for sessions a caller created feat(mcp): session_set_color and session_set_note for created sessions Sep 30, 2026
@Pearcekieser
Pearcekieser force-pushed the feat/mcp-session-note-color branch from 5f8c52a to eccde2e Compare September 30, 2026 14:46
@Pearcekieser
Pearcekieser marked this pull request as ready for review September 30, 2026 14:47
@Pearcekieser
Pearcekieser requested a review from a team as a code owner September 30, 2026 14:47
@Pearcekieser

Copy link
Copy Markdown
Contributor Author

Intent: Give a conductor two cheap ways to manage the workers it created: tint them in the sidebar, and leave them a note that their next turn reads, without starting a turn.
Not a goal: Reaching any session the caller did not create, changing the sidebar color menu or the /note route for apps and crons, or folder color.

@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5, fork) — ✅ PASS

Design-level review of 4228ae52338cc1ae037f6b70de386be9739688df via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

No design-level concerns. It is one new verb with a creator fence on every caller, and it writes through a shared color writer that the sidebar menu's color route also uses. No surface under website/src/ changes, and nothing is removed.

[DESIGN-REVIEWED] 4228ae5

Description read

[DESCRIPTION-READ] 336eb4200fbaec1fcbb1ea335c2c1992c1f41128800d0902da839cc678c62c11

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 Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5, fork) — ⏭️ skipped

Revision 4228ae52338cc1ae037f6b70de386be9739688df 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 Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5, fork) — ✅ PASS

Premise-level review of 4228ae52338cc1ae037f6b70de386be9739688df via the fork AI-review pipeline — 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 agent-side tint has no existing equivalent (no color in session_create; the only color_index writer is the menu's PATCH route), and the shared write has two real callers.

What this change ships

Inventory (7 items) — 6 justified

Intent: let a conductor color the worker sessions it created so the person can tell fleets apart in the sidebar. ADDITION.

  1. A conductor can set or clear the sidebar tint of a session it created (session_set_color, swatches "0"–"6" or "none") — justified
  2. New strict-internal route POST /api/session-control/set-color behind authorize_target — justified
  3. The creator check applies to every caller, so even an owner session cannot recolor the person's own tabs — justified
  4. Channel agents cannot use the tool, and unattended conductor grants leave it out — justified
  5. The agent cannot set custom hex colors, and a swatch write clears any custom hex the person set — justified
  6. The sidebar menu's PATCH color route now stores through the shared write_slot_color (2 writers) with unchanged behaviour — justified
  7. The session-control metrics counter records this verb as other — undeclared

[FIRST-PRINCIPLES-REVIEWED] 4228ae5

Description read

[DESCRIPTION-READ] 178d6853a9479991f9890907d357e52ef9da0501ea4134edc55f9b7bc44479ec

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 Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review (fork) — ✅ no blocking findings

Reviewed 4228ae52338cc1ae037f6b70de386be9739688df via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 4228ae5

@Pearcekieser
Pearcekieser force-pushed the feat/mcp-session-note-color branch from eccde2e to 6df954c Compare September 30, 2026 15:21
@Pearcekieser

Copy link
Copy Markdown
Contributor Author
  • span=87b6117c9a6b conditional note delivery reported as guaranteed: fixed

Upheld. The tool reply now reads the route's deliveryConditional flag. A held note says it is written when the turn ends unless the tab is rebound to a different conversation first; an immediate note on an unbound tab says its next turn will see it unless the tab is rebound first. A bound, idle target keeps the plain wording.
The tool description and docs/session-control.md say the same. Tests in test_session_control_color_note.py cover all three reply shapes. Fixed in 6df954c.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author
  • span=f906fc39746b set-note carry pinned outside TestEveryRouteForwardsTheCarriedVerdict: fixed

Folded in. set-note is now a ROUTES entry in TestEveryRouteForwardsTheCarriedVerdict; the recorder returns the (slot, note) pair the route unpacks and post_slot_note is stubbed, so only the carry is measured. The separate test in the new file is removed. Fixed in 6df954c.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author
  • span=b6b2f7e1a55f color duplicates folder grouping: rebutted

The Clears-when names a description sentence; the What changed section now carries it. A conductor usually sits in the folder the person made for the project, with its workers filed beside it, so the folder already means "this project" and cannot also say which conductor owns which worker.
Two conductors sharing one folder, or one conductor running a build fleet next to a review fleet, need a mark that works inside a folder. Moving workers into per-conductor subfolders would rearrange what the person filed; a tint changes nothing else.

@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review (fork) — ✅ no blocking findings

Reviewed 4228ae52338cc1ae037f6b70de386be9739688df via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 4228ae5

@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 30, 2026
@Pearcekieser

Copy link
Copy Markdown
Contributor Author
  • span=398dcbd42e4f color duplicates chat_tag_create + chat_tag_assign: rebutted

A tag is an entry in the person's shared tag vocabulary, and the dashboard MCP has no tag delete, by design, so nothing can strip a label from every session at once. Marking a fleet with a tag therefore leaves a permanent tag behind per fleet, and after a few days of dispatch rounds the person's tag list and board filters fill with names like "fleet-1432".
A tint is state on the one session. It needs no vocabulary entry, and "" removes it without touching anything shared, so a conductor can mark a round's workers and clear the mark when the round ends.
The two also mean different things in the UI: tags carry workflow state and filters on the board, while the tint is the sidebar's own at-a-glance grouping, the job this PR names.

@Pearcekieser
Pearcekieser force-pushed the feat/mcp-session-note-color branch 2 times, most recently from 4510db7 to b819c17 Compare September 30, 2026 16:48
@Pearcekieser

Copy link
Copy Markdown
Contributor Author
  • span=ad587cbf686c required=True refuses color="" so the tool cannot clear: fixed

Upheld: validate_field refuses an empty required string, so the documented clear value never reached the route. color is now optional in SESSION_SET_COLOR_SCHEMA, so "" passes validation, and the dispatch refuses a call that omits color with a named error before any request.
Kept "" as the clear value rather than a sentinel: it is what the menu's clear cell sends and what the tool description already documents. Tests pin both cases through _call_tool_inner. Fixed in b819c17.

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Sep 30, 2026
@Pearcekieser
Pearcekieser force-pushed the feat/mcp-session-note-color branch from b819c17 to fa30bb4 Compare September 30, 2026 17:49
@Pearcekieser

Copy link
Copy Markdown
Contributor Author
  • span=ad587cbf686c note schema max_len refuses a raw note whose redacted form fits: fixed

Upheld. Redaction can shorten a note (a flagged URL collapses to one marker), so a 4000 cap on the raw argument refused notes the route would accept. The schema now bounds the raw note at the note route's own 40000-character content cap (MAX_SESSION_NOTE_INPUT_CHARS, pinned to _MAX_CONTEXT_CONTENT by a test), and the 4000 cap stays in _clean_session_note on the redacted form.
Same span id as round 3's color="" finding, a different defect: both are schema bounds in validation.py. New test: a raw note over 4000 that redacts under it passes validation and the route's check. Fixed in fa30bb4.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author
  • span=b674635bf8fe note bubble shows no author: accepted-and-deferred

Tracked in #15508, which names the task: stamp the source into the visible row's meta on both write paths and render a "from ..." label on the note bubble. The gap covers every /note caller, not only this tool, and the held-note path needs the flush's row_meta and the restore sanitizer's fixed key set to carry the new key, a persistence-schema change wider than this PR's goal.
The target's model already sees the author through the [Background context from "session_set_note"] frame.
As a fork contributor I cannot apply the deferred-finding label or an assignee; @kirodotdev maintainers, please add deferred-finding and assign #15508 (Due: 2026-10-14 is in its body).

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

Rebased onto main after #15166 (session_end_wait) merged. Conflicts were tool lists and counts only (docs, agent.py withheld notes, the doc-count test); both tools kept, 26 dashboard tools / 16 session-control verbs. Related tests pass.

@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Sep 30, 2026
@Pearcekieser

Copy link
Copy Markdown
Contributor Author

note: rebased onto main at 212cc94, no behaviour change

Main now includes #22433, which fixed the SLOT_CREATORS entry in test/test_chat_follow_default_slot_kinds.py that failed Backend Tests (3.12, 3) on 93b3680. The rebase applied with no conflicts and no file in this PR changed. 13,091 related tests pass on this head, with 42 skipped, including that test file.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

note: rebased onto main at 23e747d, no behaviour change

Main's #22474 split test/test_dashboard_server_composition_contract.py, and the route-table pin and boot-sequence lists moved to test/test_dashboard_server_composition_contract_reach.py. I took main's split and made this PR's same three edits in the new file: _MCP_TABLE_ROWS = 302 with the digest computed from the actual table, and the one extra _deferred entry in _DASHBOARD_BOOT and _API_BOOT for POST /api/session-control/set-color. No source file changed. 13,092 related tests pass on this head, with 42 skipped, including every test_dashboard_server_composition_contract*.py file.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

note: the two reds on 23e747d are runner time limits, not this diff

Backend Tests (3.12, 2) failed one test, test_facade_mirror_guards.py::test_every_name_the_test_trees_patch_through_a_facade_reaches_its_readers, on Failed: Timeout >120.0s with no assertion. It is the same whole-tree scan that timed out on ac990cd and then passed on the same tree at 3b14cf3 and on every head since. E2E Gateway Boot (ubuntu-latest) was cancelled at 20 minutes inside actions/checkout (14:04Z to 14:24Z) and ran no test. This head changes only the route-table pin and boot lists in test_dashboard_server_composition_contract_reach.py since 212cc94, where both passed. I will let CI finish before deciding on a retrigger.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

note: same-tree retrigger at c30108d, no code change

This head has the same tree as 23e747d; only the commit date changed, so every check reruns. The reds there were the test_facade_mirror_guards.py tree scan hitting the 120 s timeout in Backend Tests (3.12, 2), Coverage Gate downstream of it, and E2E Gateway Boot (ubuntu-latest) cancelled inside actions/checkout (details in my earlier comment). If either recurs here I will report it rather than retrigger again.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

note: the test_facade_mirror_guards.py tree-scan timeout came back on the same-tree retrigger c30108d, so I am reporting it rather than pushing a third time

Backend Tests (3.12, 2) failed one test again: test_every_name_the_test_trees_patch_through_a_facade_reaches_its_readers, Failed: Timeout >120.0s, with 29,790 passed in the same shard. It has now timed out on ac990cd, 23e747d and c30108d, and passed on 3b14cf3 and the four heads after it.

I timed it locally, single-process, on this head and on a clean checkout of main at 8f828d6: 57.96 s and 58.59 s. This PR does not make the scan slower; it adds one source module and a handful of test lines to a tree of several thousand files. Main's own Backend Tests (3.12, 2) passed on its last three CI runs today. My reading is that the test sits within about 2x of its 120 s per-test limit on a loaded runner, and which shard it lands in with which neighbours decides the run, but I have not proved that.

No code change is pending. A re-run of that one job would settle this head; the fork account cannot re-run jobs.

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

Re-reviewed c30108d against 1a46d44, the last head I checked. This is a comment review.

  • Rebase only. The one change to this PR's own lines is the MCP route-table pin (302 rows and its digest), now in test_dashboard_server_composition_contract_reach.py after main's #22474 split. Range-diff and a per-line comparison of the added and removed lines show nothing else moved, so my earlier read of the set-color handler and its gates stands.
  • On the test_facade_mirror_guards.py timeout: main's #22320 raised that test's ceiling from 120 s to 300 s. It merged at 18:07 UTC, four minutes after this head's Backend Tests (3.12, 2) run started, so that run had the 120 s limit, and a re-run of the same job would too. A rebase onto current main (4d5cb47) picks up the 300 s ceiling. A local merge with it is clean, and main's route table still has 301 rows, so the 302 pin stays right.
  • iamwhatever's hold on the security posture is a human maintainer's call and is unchanged by this.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

@cruisercohen thanks, rebased onto main at fdd0434, no behaviour change

Main 4d5cb47 includes #22320, which raised the per-test ceiling for the test_facade_mirror_guards.py whole-tree scan from 120 s to 300 s. That is the limit the scan hit in Backend Tests (3.12, 2) on c30108d. The rebase applied with no conflicts and no file in this PR changed; the route-table pin stays at 302 rows. 13,096 related tests pass on this head, with 42 skipped.

@iamwhatever

Copy link
Copy Markdown
Contributor

HOLD at fdd0434 for maintainer sign-off.

This head is a rebase. git range-diff against c30108d shows the PR commit unchanged. The two red checks from r114 (Sensitive Change Review and Dependency License Gate) pass on this head, every other check is green, and all AI lanes pass. The r111 items are done, so our earlier change request no longer reflects an open code ask.

I still found no defect. set_color_target validates the color first, runs authorize_target with no self waiver, and applies the creator fence to every caller. That fence fails closed on an unowned slot (caller_access.py L336-L342).

The one remaining blocker is a human decision. This adds a strict-internal route, POST /api/session-control/set-color, and lets an agent write to another session on the session-control authorization path. A maintainer accepting the creator fence and the grant posture clears it.

I read the source, the range-diff and CI. I did not run tests.

— crew-pr-reviewer (r116)

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

note: rebased onto main at 85d8ba5, no behaviour change

The only conflict was in docs/feature-map/README.md. Main changed the Work ledger row, which sits next to the Session control row this PR edits. I took main's Work ledger row and kept this PR's set-color additions to the Session control row; the resolver checked that main's Session control row equals this PR's row with the set-color text removed. No source file changed. 13,047 related tests pass on this head, with 42 skipped.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

note: rebased onto main at 82145ff, no behaviour change

The only conflict was in src/kiro_crew/dashboard/server.py. Main moved _STRICT_INTERNAL_API_PATHS into src/kiro_crew/dashboard/server_internal_paths.py, and this PR's one edit to server.py was a single entry in that set. I took main's server.py and added /api/session-control/set-color to the set in its new file, right after set-model as before, so the route stays loopback plus internal-secret only. The route registration merged cleanly. 13,082 related tests pass on this head, with 42 skipped.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

note: rebased onto main at d8e9148, no behaviour change

Real Adapter Contract Tests failed on 82145ff with 6 setup errors in test/test_pi_real_adapter.py (SandboxUnavailableError). This PR touches no sandbox or Pi file. Main fixed that lane in #22951, which merged at 01:47Z, after that head's base. Main 398772f includes it. The rebase applied with no conflicts and no file in this PR changed. 13,091 related tests pass on this head, with 42 skipped.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

note: rebased onto main at 62b11e1, no behaviour change

The only conflict was in src/kiro_crew/agent.py. Main moved the conductor grant notes into src/kiro_crew/agent_parts/spec_grants.py, and this PR's one edit to agent.py was the 3-line comment recording that session_set_color is withheld from unattended conductors. I took main's agent.py and put that comment in spec_grants.py between the session_end_wait and session_reload entries, the same neighbours as before. No code changed. 13,078 related tests pass on this head, with 42 skipped.

@iamwhatever

Copy link
Copy Markdown
Contributor

HOLD at 62b11e1 for maintainer sign-off.

This head is a rebase of fdd0434, our r116 head. The PR's added and removed lines are the same set; the strict-internal entry now sits in server_internal_paths.py and the grant comment in spec_grants.py, following main's own file splits. Every AI lane passes, every check is green, and I still found no defect: set_color_target validates the color, runs authorize_target with no self waiver and applies the creator fence to every caller, and that fence fails closed on an unowned slot (caller_access.py#L336-L342).

The remaining blocker is a human decision. This adds POST /api/session-control/set-color and lets an agent write to another session on the session-control authorization path. A maintainer accepting the creator fence and the grant posture clears it. Our earlier change request no longer reflects an open code ask.

I read the source, compared the diff with the previous head and read CI. I did not run tests.

— crew-pr-reviewer (r120)

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

note: rebased onto main at 9bb82e4, no behaviour change

The only conflict was the MCP route-table pin in test/test_dashboard_server_composition_contract_reach.py. Main added an MCP route of its own and moved the pin from 301 to 302 rows, the same move this PR had made for POST /api/session-control/set-color. The pin is now 303 rows, with the digest computed from server._register_mcp_routes and the set-color route confirmed in that table. No source file changed. 13,085 related tests pass on this head, with 42 skipped.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

note: same-tree retrigger at d412234, no code change

This head has the same tree as 9bb82e4; only the commit date changed, so the fork review lanes run again. On 9bb82e4 two lanes stopped before they reviewed anything. The Opus 5.5 Review check reported "review incomplete" and its PR comment never updated past 62b11e1. The Security Scope Review lane run 39878785278 had its generate job cancelled, so publish failed with [scope-floor:unsettled] and no leg ran. Neither is a finding. GPT 6.1, Design and First Principles reviewed 9bb82e4 with nothing blocking. If either lane fails the same way again I will report it here rather than retrigger a third time.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

note: rebased onto main at fa7520f, no behaviour change

The only conflict was the MCP route-table pin in test/test_dashboard_server_composition_contract_reach.py again. Main added another MCP route and moved its pin to 303 rows. With this PR's POST /api/session-control/set-color the table is 304 rows; the digest is computed from server._register_mcp_routes with the set-color route confirmed present. No source file changed. 13,108 related tests pass on this head, with 42 skipped.

@iamwhatever

Copy link
Copy Markdown
Contributor

HOLD at fa7520f.

This head is a rebase of 62b11e1, our r120 head. The only changed lines are the route-table pin in test_dashboard_server_composition_contract_reach.py. set_color_target still validates the color, runs authorize_target with no self waiver and applies the creator fence. I found no defect, every check is green and the AI lanes pass.

What still blocks:

  1. Merge conflict: GitHub again reports the branch as dirty. The same pin file conflicts with main, which added another MCP route. Please rebase.
  2. Maintainer sign-off: this adds POST /api/session-control/set-color and an agent write to another session on the session-control authorization path. A maintainer accepting the creator fence and the grant posture clears it.

I compared the diff with the previous head and read CI. I did not run tests.

— crew-pr-reviewer (r123)

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

note: rebased onto main at f4dd87b, no behaviour change

The only conflict was the MCP route-table pin in test/test_dashboard_server_composition_contract_reach.py again. Main now registers 307 MCP routes; with this PR's POST /api/session-control/set-color the table is 308 rows. The digest is computed from server._register_mcp_routes with the set-color route confirmed present. No source file changed. 13,112 related tests pass on this head, with 42 skipped.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

note: rebased onto main at 36fe73c, no behaviour change

The only conflict was the MCP route-table pin in test/test_dashboard_server_composition_contract_reach.py again. Main now registers 309 MCP routes; with this PR's POST /api/session-control/set-color the table is 310 rows. The digest is computed from server._register_mcp_routes with the set-color route confirmed present. No source file changed. 13,043 related tests pass on this head, with 42 skipped.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

nitpick (non-blocking): the description's "Where it lives" line still names dashboard/server.py for the strict-path entry

Design is right. Main moved _STRICT_INTERNAL_API_PATHS into dashboard/server_internal_paths.py during rebase 34, and the description wasn't updated. A body edit re-runs the body-reading lanes and needs a fresh maintainer approval, so I'll correct that line together with the next push this PR needs (main has added an MCP route about once a day, and each one moves the pin), rather than on its own now.

@iamwhatever

Copy link
Copy Markdown
Contributor

Hold at 36fe73c for maintainer sign-off.

This head is a rebase of fa7520f, our r123 head. The only changed lines are the route-table pin in test/test_dashboard_server_composition_contract_reach.py, and the branch merges cleanly with main again. set_color_target still validates the color, runs authorize_target with no self waiver and applies the creator fence. I found no defect, every check is green, and the AI lanes pass.

The remaining blocker is a human decision. This adds POST /api/session-control/set-color and lets an agent write to another session on the session-control authorization path. A maintainer who accepts the creator fence and the grant posture clears it. The stale dashboard/server.py mention in the description is a known nit that the author will fix with the next push.

— crew-pr-reviewer (r124)

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

note: rebased onto main at dce124c, no behaviour change

Two edits to test/test_dashboard_server_composition_contract_reach.py. The MCP route-table pin conflicted again: main now registers 310 routes, so with POST /api/session-control/set-color the pin is 311 rows, with the digest computed from server._register_mcp_routes. Main's 071eb5b also added a fifth _deferred entry on the same _DASHBOARD_BOOT and _API_BOOT lines this PR had already extended, and git merged the two identical edits into one, silently dropping this PR's entry; the two boot-order tests caught it, and the entry is restored in both lists. No source file changed. 13,074 related tests pass on this head, with 43 skipped.

I also corrected the description's "Where it lives" line, which Design flagged: the strict list is in dashboard/server_internal_paths.py and the withheld-verb note is in agent_parts/spec_grants.py.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

note: Backend Tests (3.12, 7) red on dce124c is not from this diff

One test failed out of 24,225: test/test_side_readonly_spec_reap.py::test_an_unreadable_or_protected_checkout_keeps_its_variant. No assertion failed. pytest raised an ExceptionGroup of 2 unraisable-exception warnings on worker gw2, each a RecursionError inside sys.unraisablehook while finalizing a half-built PosixPath ('PosixPath' object has no attribute '_str' / '_drv'). That is garbage collected during this test, from an object made elsewhere on the same worker. This PR touches no file under the side-readonly or reap code, and the test file passes locally on this head (31 passed, 1 skipped). Coverage Gate failed downstream of the shard.

I will push one same-tree retrigger (commit date only) at the next clear quarter-hour slot. If the same test fails again there I will report it rather than retrigger again.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

note: same-tree retrigger at 0c0f4ad, no code change

This head has the same tree as dce124c; only the commit date changed, so Backend Tests (3.12, 7) runs again. On dce124c that shard failed one test, test_side_readonly_spec_reap.py::test_an_unreadable_or_protected_checkout_keeps_its_variant, on two unraisable RecursionError warnings from finalizing a half-built PosixPath, with no assertion failing (details in my earlier comment). If that test fails the same way again I will report it here rather than retrigger a third time.

Adds a kirocrew-dashboard tool so a conductor can tint the worker
sessions it created and group a fleet at a glance in the sidebar.

It runs through a new strict-internal route, POST
/api/session-control/set-color. set_color_target gates it with
authorize_target and allow_self, then a creator fence for every
caller, so a person's own tabs are refused even to an owner session.

color is "0"-"6" (the sidebar menu's palette swatches, pinned to
PALETTE_SIZE) or "" to clear; a swatch write clears any custom hex,
as the menu's own swatch click does. The tool is one Tool row in
mcp_dashboard.TABLE. Its schema field is matched verbatim against
those eight literals (new FieldSpec.verbatim, which requires
allowed), so an invisible value is refused instead of sanitizing
into "", the clear value.

Refs kirodotdev#15424
@Pearcekieser

Copy link
Copy Markdown
Contributor Author

note: rebased onto main at 4228ae5, no behaviour change

Main's #19135 added session_handoff to the same lists this PR adds session_set_color to, so six files conflicted: docs/architecture/mcp.md, docs/feature-map/README.md, src/kiro_crew/docs/index.md, src/kiro_crew/docs/session-control.md, test/test_validation_parts_facade.py and the route-table pin. Each now keeps both tools; a word diff against main shows only this PR's set-color additions.

Both sides had raised the same three counts by one, and git merged those lines cleanly at the old value. With both tools the kirocrew-dashboard server has 39 tools (index and the session-control page) and SESSION_CONTROL_TOOLS has 23 (test_session_control_doc.py); two doc tests caught it. The pin is 312 rows, digest computed from server._register_mcp_routes. No source file changed. 13,594 related tests pass on this head, with 43 skipped.

This push also supersedes the 0c0f4ad retrigger, so Backend Tests (3.12, 7) runs again here.

@iamwhatever

Copy link
Copy Markdown
Contributor

HOLD at 4228ae52338cc1ae037f6b70de386be9739688df until a maintainer signs off.

This head is a rebase of 36fe73c, our r124 head. The range-diff touches only doc tool lists, an export list, a doc-count test and the MCP route-table pin, so that main's session_handoff sits beside session_set_color. set_color_target is unchanged. It validates the color, runs authorize_target with no self waiver, and applies the creator fence to every caller. I found no defect. Every check is green, the AI lanes pass, and the branch merges cleanly with main.

What still blocks is a human decision. This adds POST /api/session-control/set-color and lets an agent write to another session on the session-control authorization path. A maintainer who accepts the creator fence and the grant posture clears it. Our earlier change request no longer reflects an open code ask.

I compared the diff with the previous head and read CI. I did not run tests.

— crew-pr-reviewer (r126)

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

APPROVE at 4228ae5. This supersedes our earlier sensitive-file HOLD and our REQUEST_CHANGES at f45434f.

That change request asked for a tracking issue for sharing the swatch write. The PR now does it in place: the sidebar PATCH /api/chat/slots/{slot}/color route and the new verb both call dashboard/slot_color.write_slot_color, so no follow-up is left.

This PR adds a new agent-facing MCP verb and route, so it needed a human decision. A maintainer has now reviewed the deep-check findings and accepts the scope: set_color_target in session_control_parts/session_titles.py (L351-356) validates the color first, runs authorize_target with no self waiver, and applies the creator fence, so a caller can only recolor sessions it created. The verb stays out of channel agents and the unattended conductor grants. CI and the AI review lanes are green on this head, and the last push is the author.

— crew-pr-reviewer (r127 deep)

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

Labels

fork Pull request from a fork (external contributor)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants