Skip to content

feat(crew): stamp mate_root and mate_dispatched_by on a mate's sessions (inert) - #26952

Merged
kyleseaman merged 1 commit into
mainfrom
feat/mate-root-stamps
Nov 2, 2026
Merged

kyleseaman merged 1 commit into
mainfrom
feat/mate-root-stamps

Conversation

@iamwhatever

@iamwhatever iamwhatever commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Hiding anything: no list or client reads the new fields (RFC step 3+).
  • Frontend changes.
  • Folder tools (RFC Design 6).
  • Mates running from an ordinary 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_root consumer fires for mates → this change:

  • crew_mode.stamp_rows stamps mate_root (the mate thread key) and mate_dispatched_by (the direct creator) on every descendant of a slot whose mode is DM_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).
  • A mate thread this gateway saw is remembered in memory (known_mate_roots), so its sessions keep their mate after its tab closes, the same rule as known_roots.
  • crew_mode.live_stamp_rows is the one live-slot pass; live_stamps keeps its shape on top of it. The lineage slot_patch frame (slots_push.push_lineage_patch) restates mate_root / mate_dispatched_by only when they move.
  • System spec row added in 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_by stamp, and every list_view result, is the same as on main.

Backwards compatibility

Compatible: two additive fields on slot rows and lineage patches; live_stamps keeps 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:

  • a mate thread is a root (no stamp on itself); its child and grandchild carry the mate;
  • a conductor a mate opened, and its workers, are mate descendants;
  • a closed intermediate creator still resolves (persisted lineage and live ancestor);
  • a closed mate thread still holds its sessions;
  • ordinary sessions get no mate stamp; a stale stamp is cleared;
  • pair test: Crew Mode fields and list_view match the walk with mate detection off (main's behavior) over a mixed Crew Mode + mate + plain fixture;
  • live_stamp_rows / live_stamps shape;
  • the lineage slot_patch carries 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

  • 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

Contributed under the project's Apache-2.0 license.

…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).
@iamwhatever
iamwhatever requested review from a team and KiroCrewCaptain as code owners November 1, 2026 06:30
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 1, 2026
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 4bf644a70462f321764cdbc50974b009720158f9 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 1, 2026

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

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 crew_root, and the pair test pins that Crew Mode stamping is unchanged.

Notes

  • mate_root and mate_dispatched_by now go out in the /api/chat/slots and slot_patch payloads. That makes them public wire fields before anything reads them, so keep their names and meaning fixed until the next RFC step uses them.
  • A mate thread running a conductor is both kinds of root. The walk checks Crew Mode roots first, so its sessions get crew_root and never mate_root. The RFC's next step should decide whether that order is what it wants.

[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 .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 1, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ human override accepted

@iamwhatever overrode this lane for 4bf644a70462f321764cdbc50974b009720158f9 via /ai-review override (this commit only).

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] 4bf644a

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

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

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 4bf644a

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 4bf644a70462f321764cdbc50974b009720158f9 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 1, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author

/ai-review override first-principles 4bf644a zero-consumers: RFC #26643 merged; step 1 is inert groundwork for steps 2-8

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

AI-review override not recorded: zero-consumers is not a release class. Use /ai-review override <fable|gpt|design|ux|first-principles|scope|all> <current-sha> <class>[ #N]: <reason, 20 to 500 characters>, where <class> is one of false-positive, not-applicable, pre-existing, evidence-supplied, infra-failure, reissue, deferred, owner-decision. What each class needs: docs/ci/ci-and-reviews.md#risk-release-records.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

/ai-review override first-principles 4bf644a owner-decision: owner accepts inert step-2 stamps ahead of RFC status flip, see #26952 (comment)

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Human judgment recorded

@iamwhatever recorded a owner-decision release (class owner-decision) for the first-principles AI finding on 4bf644a70462f321764cdbc50974b009720158f9.

owner accepts inert step-2 stamps ahead of RFC status flip, see #26952 (comment)

This decision applies only to this commit. A new push requires a new judgment.

@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 1, 2026

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

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.

iamwhatever pushed a commit to JiaDe-Wu/KiroCrew that referenced this pull request Nov 17, 2026
…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.
iamwhatever pushed a commit to JiaDe-Wu/KiroCrew that referenced this pull request Nov 18, 2026
…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.
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