Repository navigation
feat(crew): stamp mate_root and mate_dispatched_by on a mate's sessions (inert) - #26952
Conversation
…ns (inert) A crewmate thread (slot mode member) becomes a root of its own kind. The Crew Mode walk in stamp_rows also stamps mate_root (the mate thread key) and mate_dispatched_by (the direct creator) on every session the mate dispatched, directly or through another, past closed creators. A mate thread this gateway saw stays known after its tab closes. The lineage slot_patch carries the two stamps when they move. Kept apart from crew_root, so no Crew Mode rule fires for mates. Inert: no list or client reads the new fields yet. RFC: docs/request-for-change/rfc-crewmate-workers-under-the-crewmate.md (Design 1, migration step 2).
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS No design-level concerns. The new stamps are server-only and no list or client reads them yet. They use separate fields and never touch Notes
[DESIGN-REVIEWED] 4bf644a Description read[DESCRIPTION-READ] 0266a97387b5b8931ed66d4872499d1fd54a3e392ca66ec119af0dfe6f831550 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 |
First Principles Review (Opus 5.5) — ✅ human override accepted@iamwhatever overrode this lane for |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
|
AI-review override not recorded: |
|
/ai-review override first-principles 4bf644a owner-decision: owner accepts inert step-2 stamps ahead of RFC status flip, see #26952 (comment) |
Human judgment recorded@iamwhatever recorded a owner-decision release (class
This decision applies only to this commit. A new push requires a new judgment. |
CrysisDeu
left a comment
There was a problem hiding this comment.
Comment, not approving yet at 4bf644a7. The code is safe: the gateway derives both fields fresh on every list refresh from mode and creator and wipes any caller-supplied stamp, so nothing can be forged; the fields reach only the dashboard lists that already carry parent / created_by, are dropped for remote instances and never written to the crew log.
Two process points before I approve: (1) the First Principles lane went red and was cleared by the author's own /ai-review override ... owner-decision citing the author's own earlier comment. Same rule as on #24692 and #19661: an author cannot be the maintainer on their own PR. Ping a maintainer and let them clear it. (2) The RFC this implements (rfc-crewmate-workers-under-the-crewmate.md) is still status: draft on base and its migration plan says step 2 needs step 1 accepted. Land the RFC acceptance first, or re-scope the body so it does not claim an accepted design.
Also fix in this PR: document in the field spec that mate_dispatched_by names the current holder (an adopt moves it) and is display-only, so a later fence never relies on it (fences keep using member_owns_slot / created_by); spec "missing stamp = unknown" since _known_mate_roots (crew_mode.py:245,470) is memory-only and empties on restart. Nits: _row_is_mate_root (:319) skips the memory_mode check _row_is_root does; a mate thread running a conductor is a Crew Mode root first and gets crew_root, never mate_root (RFC should decide); missing tests for adopt moving the stamp, restart, and fork of a mate worker.
Posted by code-reviewer (Kiro Crew member) on behalf of @CrysisDeu. Full report on file.
…k has landed The RFC index re-audit on main (kirodotdev#37153) fixed most rows this PR first touched. Two are left: rfc-remote-instance-on-microvm still says the MicroVM backend half (kirodotdev#17540, merged 2026-10-14) is open, and rfc-mate-sessions-folder-or-lineage still calls kirodotdev#26952 open. Both rows now say what merged. rfc-app-contribution-points.md lists kirodotdev#26878 and rfc-mate-sessions-folder-or-lineage.md lists kirodotdev#26952 in implementation-prs.
…k has landed The RFC index re-audit on main (kirodotdev#37153) fixed most rows this PR first touched. Two are left: rfc-remote-instance-on-microvm still says the MicroVM backend half (kirodotdev#17540, merged 2026-10-14) is open, and rfc-mate-sessions-folder-or-lineage still calls kirodotdev#26952 open. Both rows now say what merged. rfc-app-contribution-points.md lists kirodotdev#26878 and rfc-mate-sessions-folder-or-lineage.md lists kirodotdev#26952 in implementation-prs.
Problem / Motivation
Goal: The server marks every session a crewmate (mate) thread dispatched as belonging to that mate, as the first step toward moving a mate's sessions under the mate.
The crewmate workers RFC (merged in #26643) moves a mate's dispatched sessions out of the person's sidebar and under the mate. Every later part of that rollout needs the server to say which sessions a mate thread dispatched. Today the slot list stamps only Crew Mode trees (
crew_root), and a mate thread is never a Crew Mode root.Why it matters
Without this stamp, no later RFC step (client hiding behind the preview flag, the mate's Sessions tab, approvals reaching the mate chat, AI cleanup) has a server-side answer to "whose session is this". This is migration step 2 of the RFC.
Not a goal
chat-*slot bound to a member store (RFC: out of scope).What changed (motivation → approach → change)
Goal → reuse the Crew Mode walk with a separate root kind, as RFC Design 1 specifies, so no
crew_rootconsumer fires for mates → this change:crew_mode.stamp_rowsstampsmate_root(the mate thread key) andmate_dispatched_by(the direct creator) on every descendant of a slot whosemodeisDM_SLOT_MODE("member") and that has no creator. Same walk, same pass, stopping at the nearest root of either kind; a closed creator is walked past the way Crew Mode stamping does (live ancestor, then persisted lineage).known_mate_roots), so its sessions keep their mate after its tab closes, the same rule asknown_roots.crew_mode.live_stamp_rowsis the one live-slot pass;live_stampskeeps its shape on top of it. The lineageslot_patchframe (slots_push.push_lineage_patch) restatesmate_root/mate_dispatched_byonly when they move.docs/system-specs/modules/crew-mode.md.Inert: no list and no client reads the new fields. A mate root has no creator by definition, so a Crew Mode walk never passed through one: every
crew_root/crew_mode_root/crew_dispatched_bystamp, and everylist_viewresult, is the same as on main.Backwards compatibility
Compatible: two additive fields on slot rows and lineage patches;
live_stampskeeps its return shape and every Crew Mode stamp is unchanged.Removes nothing: the diff only adds fields and helpers; no row, field, key or function is hidden, removed or renamed.
Tests
test/test_crew_mode_mate_stamps.py:list_viewmatch the walk with mate detection off (main's behavior) over a mixed Crew Mode + mate + plain fixture;live_stamp_rows/live_stampsshape;slot_patchcarries the two fields only when they move.Local pre-push GPT and Opus reviews on this head: no findings.
Proof: not provable -- other: new inert feature, not a fix; no production hunk to revert against a failing test.
Manual verification
N/A — unit coverage sufficient: pure stamping logic over slot rows, with no reader yet.
Related Issues
Part of #26949
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributed under the project's Apache-2.0 license.