Skip to content

feat(mcp): session_set_note leaves a note in a session you created - #31405

Merged
bolichen97 merged 1 commit into
mainfrom
fix/15424-session-set-note
Nov 11, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/15424-session-set-note

Conversation

@bolichen97

@bolichen97 bolichen97 commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A conductor can leave a note in a worker session it created, which the worker's next turn reads, without starting a turn there.

A conductor that opens workers with session_create can send them a whole turn with session_send, but it cannot drop a short note that a worker reads later without waking it. The note route crons and apps already use, POST /api/chat/slots/{slot}/note, is out of reach of the kirocrew-dashboard MCP server, and it has no caller-ownership fence for agent callers. session_set_color (#15428) shipped the other half of this issue.

Why it matters

A conductor that learns something a busy worker needs ("the base moved", "PR 12 merged") must either interrupt the worker with a turn or leave it working on a stale picture. A note lands now and is read at the worker's next turn, the way a cron's note already is, and the person sees it in the worker's transcript.

Not a goal

  • Reaching a session the caller did not create, including the person's own tabs.
  • Any change to the /note route's behaviour for apps and crons.
  • Granting the tool to an unattended conductor or to a channel agent.
  • Filtering the note's transcript line out of later replays: once written it is transcript history, like a delivered session_send message.
  • Folder color, or a generic tool-registration framework.

What changed (motivation → approach → change)

A conductor can leave a note in a worker session it created: the worker reads it once at its next turn, and no turn starts there, so a busy worker learns what changed without being interrupted. The note takes the /note route's own code, behind the gate session_set_color uses.

Piece What it does
session_set_note(target, note) One Tool row in the session-control family, strict identity, calling POST /api/session-control/set-note
The route authorize_created_target runs authorize_target (the caller itself is refused), then the creator fence for every caller; session_set_color now uses the same gate. write_slot_note then writes the note with nothing suspending in between
write_slot_note The rest of the /note route after its own checks (deliver_note, its audit row and its reply), moved into a function the route calls, with deliver_note taking the admission for the context half, so both routes share the transcript line, the next-turn context half, the hold while a turn runs, the limits, redaction and reply. A note is labelled session_set_note on both halves, so the person sees who wrote it
Late containment The context half carries the containment the gate admitted (admission, a key only write_slot_note sets). Before the drain, drop_session_notes_out_of_reach compares it with the worker's containment now and drops the half when a constraint authorize_target refuses newly holds (a mirror or link gained, a workspace move), as the queue drain drops a waiting session_send message. A mirror seen when that admission is read refuses the note, as the gate does. A half the turn keeps (and has not expired) is recorded as that turn's audience admission, so a channel linked before the reply withholds the reply. A half held across a restart keeps its admission key with only the admitted workspace (slot_buffers._sanitize_restored_context), so the drain still judges it. A note_containment_drop SEL row records each drop
The transcript line An inject row like any /note line: it stays when the half is dropped, history replay carries it, and its hold retires with its committed row

The issue asks for the note to take the /note route's own code path, so that route's handler is split where its own checks end and the new route joins it there after its gate. The two concerns the earlier attempt in #15428 raised are answered by structure, not by matching text: a note's look-alike frame lines are neutralized by the drain, as every producer's are, so a note cannot close its own frame; a waiting note's context half is never read by a turn whose audience or workspace changed from the one it was admitted for, and a reply that used it is not published to an audience it was not admitted for. The tool is blocked for channel agents and withheld from unattended conductor grants, as session_set_color is.

Where it lives: the tool row in mcp_dashboard_session_tools.py and its body in mcp_dashboard_session_runs.py (bound by mcp_dashboard.py); the schema in validation_parts/messaging_session_schemas.py, registered in validation_parts/server_registries.py and validation.py; the title in data/mcp_tool_titles.json; the gate in session_control_parts/session_titles.py, exported by dashboard/session_control.py; the route in handlers/session_control.py, server_runtime/mcp_routes.py and dashboard/server_internal_paths.py; the shared note body in chat_api/slot_note.py, exported by dashboard/chat_handlers.py; the late drop in chat_turn/turn_context.py, called from chat_turn/prompt_assembly.py; the restored admission in slot_buffers.py; the channel block in channel.py and the withheld-grant note in agent_parts/spec_grants.py; the reference in docs/session-control.md and docs/index.md, the spec row in docs/system-specs/modules/session-control.md, the tool list in docs/architecture/mcp.md and the row in docs/feature-map/README.md.

Backwards compatibility

Compatible: one new tool and one new route; no other route, argument or reply changes. The /note route's code moved into a function it calls, and its tests pass unchanged, so its behaviour for apps and crons is the same, a note under the session_set_note label included. The background-context frame every producer gets is unchanged from main.

Removes nothing: no route, key, field or capability is taken away.

Tests

  • test/test_session_control_note.py: a note reaches a created session as a transcript line plus a session_set_note context entry, with no turn started; the person's own tab (not_creator), the caller itself (self_target) and a channel-linked session (linked_session_target) are refused with nothing written; an empty note is refused before the gate; a running target holds the note; the route is strict-internal and loads a lazily restored target off the loop before its gate; a note quoting an end marker drains as one plain, neutralized frame; a note still waiting when the session gains a mirror, or moves to another workspace, is not read while its transcript line stays; a mirrored session drops the context half while history replay carries the row; a note held across a restart is read, and is still dropped after a workspace move, when the session is now mirrored even if the saved line was edited to claim the mirror was admitted, and when the saved admission lost its workspace; an app's /note under the session_set_note label is accepted and read as plain context; a note the turn read withholds the reply from a channel linked afterwards, and an expired note withholds nothing; a mirror linked between the gate and the admission read refuses the note (mirrored_target) with nothing written; the tool sends the verified key and reports the immediate, held, context-skipped and refused outcomes.
  • test/test_session_control_member_gate.py: set-note is one of the routes that must forward the carried member verdict.
  • Raw HTML in a note is sanitized the way an app note's is: it renders through the same MarkdownRenderer, whose website/src/test/MarkdownRenderer.sanitize.test.tsx pins that scripts, event handlers and javascript: links are stripped. This PR changes no frontend file.
  • Registration, doc-count, audit, metrics, route-table, boot-trace and slot-reader pins count the new tool, route and write_slot_note.
  • Determinism: test/test_session_control_note.py passed 20 repeated runs at -n0, 10 runs at -n 4 --dist loadgroup --max-worker-restart=2 beside test/test_session_control_color.py and test/test_gateway_appkit_endpoints_note.py, and a shuffled order (seed 41405).

Manual verification

N/A: the route runs through its real handler against a real DashboardState, the drain through chat_runner.drain_pending_context, the restart through the hold's own serialize_deferred_notes and sanitize_restored_deferred_notes, the replay through build_session_replay, and the tool through the real TABLE.call frame.

Screenshots / video

N/A: no frontend file changes. The note line renders through the existing note bubble an app or cron note uses.

Related Issues

Closes #15424

Sibling sweep

N/A: a feature, not a defect fix.

Pattern harvest

Not generalizable: a new tool, not a fixed defect.

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

Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 6, 2026 12:14
@bolichen97
bolichen97 requested a review from Zedmor November 6, 2026 12:14
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision f8b8ededc804d1fff207f76d8b92b063b966738c 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 6, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Nothing blocks: the tool reuses the /note route's own write path behind session_set_color's creator gate, and it takes nothing away.

Notes

  • An admission key on context entries is now how the code tells a session note apart. Persistence (_sanitize_restored_context) and the drain (drop_session_notes_out_of_reach) both rely on that key surviving, so if any later code rewrites _pending_context and drops it, the note silently passes as plain context. Pin the round trip in one place.

[DESIGN-REVIEWED] f8b8ede

Description read

[DESCRIPTION-READ] 3b0009af05ec33c0b74fb850287efdb259c5d4a941c1e096eebcf9f0c28b1e29

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 6, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of f8b8ededc804d1fff207f76d8b92b063b966738c — 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 new tool reuses the /note route's own delivery code and the existing containment checks (newly_held_constraints and its siblings), so it adds no second implementation of either.

What this change ships

Inventory (10 items) — 9 justified

Intent: A conductor can leave a note that a worker session it created reads on its next turn, without starting a turn there. This is an ADDITION.

  1. Agents get a session_set_note tool that leaves a note in a session they created, read at its next turn — justified
  2. A new strict-internal route, POST /api/session-control/set-note, behind the creator-only gate — justified
  3. The /note route's delivery code moved into write_slot_note, which both routes call — justified
  4. session_set_color's creator gate is now authorize_created_target, which both verbs use — justified
  5. A waiting note is dropped if the session gains a mirror or link or moves workspace; its transcript line stays and an audit row records the drop — justified
  6. A note held across a restart keeps only its admitted workspace — justified
  7. A reply that used a note is withheld from a channel linked after the note was read — justified
  8. The tool is blocked for channel agents and withheld from unattended conductor grants — justified
  9. The /note audit row now records slot.key instead of the URL slot name — undeclared
  10. Reference, spec, MCP tool list and feature-map docs updated — justified

[FIRST-PRINCIPLES-REVIEWED] f8b8ede

Description read

[DESCRIPTION-READ] 70982c551c5ece9a2355ce43482f2ee7c7dac7f9f115814ff01c2480562cbe10

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 6, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] f8b8ede

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

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

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] f8b8ede

False positive or not applicable? A repository writer can comment:
/ai-review override gpt f8b8ededc804d1fff207f76d8b92b063b966738c 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 6, 2026
@bolichen97
bolichen97 enabled auto-merge (squash) November 6, 2026 12:43
@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 6, 2026
@bolichen97
bolichen97 force-pushed the fix/15424-session-set-note branch from a61537d to 1c9c2a9 Compare November 7, 2026 02:12
@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 7, 2026
@bolichen97
bolichen97 force-pushed the fix/15424-session-set-note branch from 1c9c2a9 to 12331e7 Compare November 7, 2026 02:54
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Nov 7, 2026
@bolichen97
bolichen97 force-pushed the fix/15424-session-set-note branch from 12331e7 to 6855c93 Compare November 7, 2026 04:03
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Nov 7, 2026
@bolichen97
bolichen97 force-pushed the fix/15424-session-set-note branch from 6855c93 to 23d2cff Compare November 7, 2026 05:00
@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 7, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: late containment drop of a session note's context half

  • span=cb64b1daaf9d Restored held notes lose their next-turn delivery

needs-a-decision: a note held across a gateway restart loses its admission in the restore sanitizer, so the drop fails closed and the note is not delivered; with replay leaving note rows out, nothing else carries it.
Persisting a validated admission through restoration is a new contract on the durable hold, so it waits for the maintainer ruling on the open note-reach item above. No override is posted.

[operator: bolichen97] AI-assisted, posted on behalf of bolichen97

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 7, 2026
@bolichen97
bolichen97 force-pushed the fix/15424-session-set-note branch from 1ad7d90 to 4c9a2de Compare November 9, 2026 00:41
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in docs/feature-map/README.md, test/test_dashboard_server_composition_contract_reach.py and src/kiro_crew/dashboard/chat_turn/turn_context.py, which conflicted with this branch (6f786d9 -> b358303); CI re-running on 4c9a2de. Both sides are kept: the session-control feature-map row has main's text plus set-note, the MCP route-table pin counts main's routes plus set-note, and a background-context frame both neutralizes look-alike frame lines in its content (#33416) and ends at this PR's tagged end marker; the frame tests that matched the untagged marker or verbatim forged lines match the tagged marker and the neutralized text, and the strip tests still pin the raw-text case.

AI-assisted, posted on behalf of bolichen97 [operator: bolichen97]

@bolichen97

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: late containment drop of a session note's context half
resolution: narrowed

  • span=cb64b1daaf9d Restored held notes lose their next-turn delivery

fixed in 4c9a2de: the restore keeps a held note's admitted workspace and only that (validated; any other field on disk is dropped, so a forged constraint is never carried back), and the drain compares it as before, so a note held across a restart is read unless its session left reach.
A missing or malformed admission still fails closed; test_a_note_held_across_a_restart_is_read_unless_its_session_left_reach round-trips the hold through the saved form and covers the kept, workspace-move and forged-mirror cases.

AI-assisted, posted on behalf of bolichen97 [operator: bolichen97]

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge 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 readiness: checking Automated validation is still running labels Nov 9, 2026
@bolichen97
bolichen97 force-pushed the fix/15424-session-set-note branch from 4c9a2de to 795f7e6 Compare November 9, 2026 17:23
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in test/test_dashboard_server_composition_contract_reach.py, which conflicted with this branch (b358303 -> 0c52318); CI re-running on 795f7e6. The MCP route-table pin counts main's routes plus set-note. The same head carries the fixes for the GPT restart/cancel finding and the First Principles end-marker tag finding; each has its own disposition below.

AI-assisted, posted on behalf of bolichen97 [operator: bolichen97]

@bolichen97

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: session note kept in the durable hold until a turn reads it
resolution: narrowed -- reuses the durable hold and the merge-card put-back the base already has; no new store, key or flag

  • span=f41ed4eb9597 Unread notes lose their recoverable delivery copy

fixed in 795f7e6: set-note writes through the durable hold (deliver_note durable=True), the flush stamps the context half with its noteId, and build_full_line keeps that hold while _pending_context or _inflight_session_notes still holds the half, so a restart before the next turn queues it again (committed_merge_card_contexts) under its admitted workspace.
A turn that drained a note but whose prompt the model did not keep (a cancel during prompt assembly, a Stop) puts it back at the queue front in _turn_record_outcome, as merge cards are; the containment check and the replay exclusion are unchanged.
test_an_unread_note_survives_a_restart_and_retires_once_read and test_a_turn_cancelled_before_the_model_kept_its_prompt_puts_the_note_back pin both triggers.

AI-assisted, posted on behalf of bolichen97 [operator: bolichen97]

@bolichen97

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: tagged background-context end marker
resolution: removed

  • span=1e662dfb696e Frame tag duplicates the existing end-marker neutralizer

fixed in 795f7e6: the tag and its contract-line sentence are gone from _drain_pending_frames, so every producer's frame is the same as on main and neutralize_background_context_frame is the one mechanism; strip_session_note_frames matches the plain [End of background context].
test_a_note_quoting_an_end_marker_is_one_plain_frame_the_strip_removes_whole pins a note that quotes the marker draining as one neutralized frame.

AI-assisted, posted on behalf of bolichen97 [operator: bolichen97]

@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 9, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in test/test_dashboard_server_composition_contract_reach.py, which conflicted with this branch, and in test/test_dashboard_server_composition_contract.py, whose red lazy-import pin main fixed in #34010 (0c52318 -> fd5d9ef); CI re-running on 2d3d8fc. The MCP route-table pin counts main's routes plus set-note. The same head removes the replay exclusion and the keep-until-read chain the First Principles review blocked on, so a written note is transcript history as the frozen Not-a-goal states, and the late containment drop of a waiting note's context half stays; each span has its own disposition below.

AI-assisted, posted on behalf of bolichen97 [operator: bolichen97]

@bolichen97

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: session note hold kept past its committed row
resolution: removed -- the frozen Not-a-goal keeps a written note in replay, so the hold-until-read chain has no job left

  • span=e44f8c90a170 the unread_note_ids hold extension in build_full_line

removed in 2d3d8fc: build_full_line is main's again; a session note's hold retires with its committed row, as every /note line's does.
The replay exclusion it made up for is removed in the same head, so history replay carries the note's row, as the frozen Not-a-goal states.

AI-assisted, posted on behalf of bolichen97 [operator: bolichen97]

@bolichen97

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: noteId stamp on a session note's context half for the unread hold
resolution: removed -- no reader of the stamp remains once the unread hold is gone

  • span=27af2f0eb02b the noteId stamping in slot_buffers (2 sites)

removed in 2d3d8fc: both flush sites are main's again; only merge cards carry noteId, as before this PR.
Its one reader was the unread hold in build_full_line, removed in the same head.

AI-assisted, posted on behalf of bolichen97 [operator: bolichen97]

@bolichen97

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: restore re-queue of a committed session note's context half
resolution: removed -- a committed note's row reaches a cold start through replay, as a /note row does

  • span=2c11eb4a7f7e re-queueing notes after a restart in committed_merge_card_contexts

removed in 2d3d8fc: committed_merge_card_contexts is main's again and re-queues merge cards only.
A note still in a running target's hold across a restart keeps its admission (only the admitted workspace), so the late containment drop judges it.

AI-assisted, posted on behalf of bolichen97 [operator: bolichen97]

@bolichen97

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: set-note writes through the durable merge-card hold
resolution: removed -- the note holds and retires like an app or cron /note, as the goal states

  • span=d364a0b3d04d durable=True on the route

removed in 2d3d8fc: the set-note route calls write_slot_note without durable, and write_slot_note no longer takes it.
A note to a running target is held by the /note route's own hold, the same as an app's or a cron's.

AI-assisted, posted on behalf of bolichen97 [operator: bolichen97]

@bolichen97

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: verbatim retry strips note frames and puts the notes back
resolution: removed -- a note a turn read is delivered history, so a retry carries it as it carries every delivered message

  • span=3ab8d375c0dc Retry stripping deletes matching text from the user's request

removed in 2d3d8fc: strip_session_note_frames and its call in _queue_recovery are gone; a retry re-queues the request text unchanged, as on main.
The seat reservation that served the put-back (_inflight_session_notes) is removed with it.

AI-assisted, posted on behalf of bolichen97 [operator: bolichen97]

@bolichen97

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: session note hold kept until a turn reads its half
resolution: removed -- no hold outlives a committed note row, so nothing can re-queue a consumed note

  • span=7486ca8f96da Consumed notes replay after their visible row leaves the live window

removed in 2d3d8fc: the unread hold in build_full_line and the restore re-queue are gone, so a note's hold retires with its committed row and a restart re-queues no session note.
The note's row stays transcript history that replay carries, as the frozen Not-a-goal states.

AI-assisted, posted on behalf of bolichen97 [operator: bolichen97]

@bolichen97

Copy link
Copy Markdown
Contributor Author

Re-sync budget reset

This PR is inside its 48-hour watch window. Main has moved into its files again since 2d3d8fc was pushed: docs/feature-map/README.md and docs/system-specs/modules/session-control.md now conflict with it, so it needs one more re-sync before CI can run.

AI-assisted, posted on behalf of bolichen97 [operator: bolichen97]

Adds a kirocrew-dashboard tool so a conductor can leave a note in a
worker session it created without starting a turn there: a note line
in the transcript, labelled session_set_note, which the worker's next
turn reads once as background context.

The new strict-internal route POST /api/session-control/set-note
gates with authorize_created_target, the gate session_set_color now
shares (authorize_target, then the creator fence for every caller),
and writes through write_slot_note, the body of
POST /api/chat/slots/{slot}/note, so the limits, redaction, hold
during a running turn and reply are that route's.

The note's context half carries the containment the gate admitted.
Before the drain it is dropped when the target now holds a constraint
authorize_target refuses, such as a channel mirror gained meanwhile,
as a queued session_send message is; its transcript line stays. A
half held across a restart keeps only its admitted workspace.

Closes #15424
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in docs/feature-map/README.md, docs/system-specs/modules/session-control.md and test/test_dashboard_server_composition_contract_reach.py, which conflicted with this branch (fd5d9ef -> dcd4830); CI re-running on f8b8ede.

The code is the same as 2d3d8fc. The two doc rows keep main's text and add the set-note entries. The MCP route-table pin goes from main's 348 rows to 349, which is main's table plus the one set-note route.

[operator: bolichen97]

@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: A person should decide

Why: the decider thinks the change is probably fine but estimates a 15% chance that this change introduces a defect, above the 12% limit for approving on its own.

I'd approve this one; nothing in it blocks.

What I checked:

  • Gate and fence. The new session_set_note route goes through authorize_created_target, the same gate set_color now uses: authorize_target (the caller itself is refused), then the creator fence for every caller. Nothing suspends between the gate and write_slot_note, and a mirror read right after the gate is refused.
  • The /note refactor. The /note handler was split cleanly where its own checks end. The only behaviour difference is the SEL resources string, which is equivalent.
  • The admission key. Only write_slot_note sets it. It survives serialize_deferred_notes (which copies the dict) and the flush.
  • Restart. The restore sanitizer keeps only the admitted workspace and always keeps the key, so it fails closed.
  • Late drop. drop_session_notes_out_of_reach runs right before the only drain call, take_turn_context. Slack inbound turns also go through _run_chat. Alias adoption moves only merge cards. It reuses the existing newly_held_constraints and record_audience_admission semantics.
  • Registries. Every registry, grant set, channel block, doc count and route table th

An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit f8b8ededc8 · 877 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@buluoray buluoray 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 on f8b8ede. session_set_note lets a conductor leave a next-turn note in a session it created. It is gated like session_set_color, reuses the /note write path, drops the note's context half when the target gains a mirror or moves workspace, and the MCP tool is stateless. No defect found. Decisive lines: src/kiro_crew/dashboard/session_control_parts/session_titles.py:323 (authorize_created_target: authorize_target, then the creator fence), src/kiro_crew/dashboard/handlers/session_control.py:859 (strict-internal set-note route, mirror re-check after the gate, write_slot_note with no await between), src/kiro_crew/dashboard/chat_turn/turn_context.py:814 (drop_session_notes_out_of_reach), src/kiro_crew/dashboard/chat_turn/prompt_assembly.py:810 (wired before the only drain), src/kiro_crew/mcp_tools/table.py:255 (strict key resolved per call)

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.

Dashboard MCP: session_set_color and session_set_note for sessions a conductor created

3 participants