Repository navigation
Conversation
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Verify the live-record-only ancestry walk is acceptable ops-wise: owner-spawned subagents lose crew reads after gateway restart or run completion, by design. Suggestions
[DESIGN-REVIEWED] c2f92ba |
First Principles Review (Fable 5) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS The entire Not justified as shipped
The zero option is not free — a multi-crew operator answers peer questions by hand today, and teleport (#10288) genuinely does not cover discovery — so this stays advisory, not a block. Verified: What this change shipsInventory (10 items) — 9 justifiedIntent: let an agent search, list, and read a connected peer crew's chat history without a human intermediary — an ADDITION.
[FIRST-PRINCIPLES-REVIEWED] c2f92ba |
GPT 5.6 Review — 🔴 changes requested (blocking)GPT 5.6 found at least one blocking issue that must be resolved before merging This comment is updated in place on each push. BLOCKING -- src/kiro_crew/dashboard/handlers_instances.py:1579 -- Older peers expose incognito transcripts FINDING -- src/kiro_crew/instances/constants.py:311 -- [BLOCK-MERGE] c2f92ba Adjudication (Opus 4.8) — is blocking on each finding proportionate?The adjudicable block is empty; only the fenced finding F1 requires a ruling. F1 — Harm rung: UNBOUNDED (cross-crew exposure of a session explicitly marked incognito/private; once the transcript enters the agent's context the disclosure is irreversible and silent). Conditions confirmed from code opened this run: the read proxy relies solely on the peer honoring False positive or not applicable? A repository writer can comment: |
Opus 4.8 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: |
3e19c28 to
6137380
Compare
6137380 to
5091ee7
Compare
bolichen97
left a comment
There was a problem hiding this comment.
Description / code mismatch
The Description's checklist states existing tests pass, but the new transport wrapper in mcp_tools/sessions.py deterministically fails a pre-existing exhaustiveness gate on every shard that collects it.
1. Diff breaks the internal-secret call-site coverage gate, while the checklist claims existing tests pass
The Description says — > - [x] Existing tests pass and new tests added for new functionality
The code does — the new _crew_query wrapper (def at src/kiro_crew/mcp_tools/sessions.py:194) funnels all three crew tools through a single transport call whose path is a runtime-composed f-string, mcp_core._get(f"{path}?{qs}" if qs else path), at src/kiro_crew/mcp_tools/sessions.py:201. test_every_transport_call_resolves_to_a_path in test/test_mcp_call_site_auth_coverage.py:513 walks every mcp_core._get / transport call site and requires each to resolve to a literal /api head; this one does not resolve, and the site is not in the reviewed _KNOWN_UNRESOLVED exemption set, so the gate fails.
Risk — the failure is platform-independent and deterministic: any shard that collects test_mcp_call_site_auth_coverage.py goes red, which is consistent with the four red Backend Test shards on the head SHA (3.10 shard 2, 3.12 shard 2, Windows shards 1 and 2) plus the Coverage Gate — though the check-run payloads carry no summary text, so that attribution is circumstantial and the reproduced local failure is the blocking fact. The gate exists because registering a dashboard route and granting it internal access are two separate manual edits; its entire value is exhaustiveness. One stray unresolved call site means the suite can no longer vouch for any MCP call path, not just this one. Merging as-is either lands a red gate or invites silencing it by editing the ratchet the test explicitly says not to edit.
Required change — make the transport call resolvable to a literal /api head: build the query string at each call site and pass a concrete path, or drop the wrapper and call mcp_core._get("/api/crew-sessions/search?...") per tool, so test_every_transport_call_resolves_to_a_path passes. If the wrapper is kept, take the reviewed _KNOWN_UNRESOLVED exemption deliberately and state that choice. Either way, the Description's "Existing tests pass" box must reflect the real state.
Open PR relationship auditThis is a consolidated, point-in-time code-level audit note. It compares complete merge-base diffs and current/merged code; it does not treat a shared topic as duplication or partial coverage as completion. Relationship findings
No PR, Issue, label, branch, or review state was changed by the relationship-note portion of this audit. |
|
🤖 Kiro Crew [operator: NicholasRBowers#a942f9ca]: This PR has been inactive for 7+ days. I reviewed the blockers but they require your input:
When you've addressed these, the pipeline will re-assess on its next cycle. |
ab5b8b0 to
b9c5d2f
Compare
|
self-added: yes
|
|
self-added: yes
|
b9c5d2f to
1ac57c6
Compare
|
Maintainer note: PR #11780 (merged 2026-09-19, Already conflicting; when rebasing please also update |
An agent could only ever read the local ConversationLog. This adds an optional crew=<id|name> to search_chat_history, list_sessions and get_chat_session so it can read a named peer crew's sessions, which teleport does not cover: adopt needs a session you can already name and lists live sessions only. The MCP process cannot touch the tunnel, so it calls three MCP-only GET routes on the local gateway (/api/crew-sessions/search|list|read), registered in _register_mcp_routes so a headless gateway exposes them too. Search reuses search_sessions_remote; list/read ride the generic proxy_request carrier, so the credential never leaves the manager and no new peer-request method exists. Authorization is a POSITIVE roster in two tiers, because a namespace proves the gateway minted a key and not for whom. These routes disclose a peer's titles, snippets and whole transcripts under the owner's credential, so _authorize_crew_read requires the internal secret, refuses any app claim, and then requires that a PRESENT X-Session-Key be owner-minted. Written as a denylist this leaked twice, first admitting a channel-born session (which carries no app claim at all, so a Slack participant arrived shaped like the owner) and then admitting the legacy app-platform channel: prefix that CHANNEL_SESSION_NAMESPACES deliberately omits and parse_session_key names as a shape the classifiers do not cover. A flat allowlist then leaked on delegated work: spawn_run mints subagent:<id> identically whether the parent is the person's tab or a Slack participant's thread, so admitting that namespace by prefix handed a channel-parented child the owner's authority. OWNER_MINTED_SESSION_NAMESPACES is (dashboard,) alone - the only namespace whose NAME settles who minted it. DELEGATED_SESSION_NAMESPACES (subagent, side) is permission to ask: _delegated_caller_is_owner_minted walks parent pointers, bounded and cycle-guarded, and admits only a chain ending in the terminal tier. Every unresolvable step refuses, and which steps are unresolvable is the design. A subagent's parent comes from the live in-memory record only, because subagent_persistence writes parent_session into an agent-writable run folder, so a child could name its own parent; a finished run loses the read, matching has_live_shared_session's rule that run records are display state and not session authority. A side chat resolves to the dashboard slot named in its own key with the GENERATION SUFFIX DROPPED: side:<slot>:<gen> is the shape derive_caller_app mishandles - it looks a slot up by everything after the first colon, so <slot>:<gen> matches nothing, an app-owned side chat resolves to no app, and the key reads as the person. Keeping the suffix would both miss the app claim and refuse every legitimate side caller, so a control test pins the ordinary case first. A listed namespace needs an ancestry record that is gateway-held AND outside the agent's write reach. cron satisfies only the first: CronJob.session_key is read from crons.json, which sandbox.py exposes to the crew sandbox as a visible leaf that mcp_cron "both reads and rewrites", so an agent acting for a channel participant can set a job's session_key to a dashboard: value and clear the walk, and a tool-gate text matcher does not fence it because a plain open() write never reaches the shell. That is the same objection that keeps the persisted subagent parent_session out of the resolver, so it is applied to both record classes rather than one. secretary is excluded because it has no construction site in src/ at all; the session-address RFC records that absence and asks whether an external app can mint it, and an app is exactly the minter that must not inherit owner authority, so an unanswered provenance question cannot carry the terminal claim. The workflow family and taskrunner are excluded for the first clause instead: a run's originating key is derived from the request header at the workflow endpoints and documented as spoofable there, so resolving ancestry through it would authorize against a value the caller chose. Adding to the delegated roster without writing a resolver also refuses, and a test pins that. The walk's terminal step refuses an APP-OWNED parent as well as a vanished one. Reaching an owner-minted namespace establishes that the gateway minted the key, not that the person owns it, so a delegated caller whose own app claim is unreadable would otherwise inherit authority from a slot an app owns - the disclosure the door's request["app"] arm exists to stop, which by construction cannot fire for the caller whose claim is the one that went missing. The check reads the slot registry directly rather than through derive_caller_app, whose first-colon lookup is the blind spot in question, and it lives in the shared predicate so it covers subagent as well as side: a subagent record with no app whose parent tab IS app-owned is the same shape, and no lane reported it. Provenance keys on the X-Session-Key namespace, which the broker sets from the calling session and _verify_unix_peer attests, not on the slot's agent-writable channel_origin flag. An absent key stays admissible: that is the gateway, the CLI and a loopback curl, which already hold the internal secret. The rosters are deliberately not derived from messaging.link's telemetry prefixes, which contain channel and would re-open the first hole; homing them in constants.py (stdlib-only) also lets the import be module-level rather than deferred off the gateway boot path. is_owner_dashboard_request cannot be used directly because it requires a dashboard user claim this transport never sets. A key naming a slot that is GONE is refused ahead of the roster on its own arm, because it is the one case where every positive signal still reads as the owner: an app-owned tab popped while a call is in flight loses the app claim that would have refused it while its dashboard: namespace survives. caller_names_a_missing_slot is the existing predicate for that class and now gates these routes with a distinct caller_session_missing refusal, and the ancestry walk's terminal step applies the same predicate through _owner_minted_and_attributable, so a delegated child cannot inherit through a parent whose slot has vanished - a path the door's own check cannot see, since the caller there is subagent:. The predicate is dashboard:-only by its own design, which lines up exactly with the owner roster holding dashboard alone. An absent X-Session-Key stays admissible at the route and must, which is why the caller side must not produce one by accident: _get omits the header entirely when resolution yields empty, so a crew read whose identity degraded would arrive shaped like the gateway itself. Each tool resolves through require_strict_session_key at its entry and that same key is both checked and put on the wire, so no path checks one identity and acts as another - what _get's own contract calls a check-then-use split, since the lenient /proc walk resolves a subagent to its parent slot. The verified key is a required positional parameter on all three crew helpers, so a call site that omits it is a TypeError and not a silent return to lenient resolution, and an end-to-end test drives the real tools rather than the helpers so a dispatch site passing a leniently-resolved key cannot satisfy the signature and pass. The private-memory fence is local to the crew path and reads only the caller's own binding, through private_memory_store_for_session: a non-empty store name is a Crew Member fenced to a private V2 store, which cannot read another crew's history. No local record could adjudicate a peer key - a remote crew's transcript carries no local private-store provenance - so the refusal happens before the tunnel and a test asserts the peer helper is never invoked. An unreadable binding refuses too, since it is indistinguishable from a fenced member whose store could not be confirmed and "unknown" on a cross-crew read has to fail closed. get_chat_session's peer leg sets exclude_incognito=1 so a remote read cannot reach a marked session the local tool also refuses, and that arm's get_metadata runs off the event loop like the read_messages call beside it - it stats the transcript and parses its first line, which was blocking the loop on the one path a remote agent can reach. Each tool spells its own route path as a literal at the _get call site, with only the query dynamic, so the transport-auth guard can resolve every crew call to the endpoint it reaches. The crew selector is bounded at MAX_SHORT_STRING, matching SELECT_CREW_SCHEMA's own crew field, because Instance.validate caps no length at all: a 64-char bound refused a display name the operator can see in the roster. The handlers clamp the query value at the same bound rather than 64 characters, so a registered name longer than that is not silently cut and answered crew_unknown. Adds spec section 16, TestCrewScopedSessionReads, and test_crew_scoped_session_reads.py covering the tool-side crew formatting, error and empty-result paths plus the strict-identity and fail-closed arms. Spec 16.3 links issue #11954 for the one half this does not enforce locally: a transcript array carries no memory_mode, so the incognito exclusion on read is peer-honored while the discovery-path exclusion is enforced here.
1ac57c6 to
c2f92ba
Compare
Open-PR triage (2026-10-05): rebase needed, open security blocker, overlap coordinationCompared head Relationship to main: DISTINCT, not superseded. origin/main has no
Rebase needed. This branch is 2140 commits behind main.
The biggest semantic change since the merge base is in Security blocker is still open. This is the GPT 5.6 lane's fenced BLOCKING finding, so I'm not filing a separate request-changes. Description vs. code mismatch. The description says the Merge discussion (OVERLAPPING, complementary, not duplicate):
Recommendation: CONTINUE-DEVELOPMENT + REBASE. Keep this PR open; it is not a closure candidate. |
cruisercohen
left a comment
There was a problem hiding this comment.
Requesting changes on head c2f92ba. The branch conflicts with main in 5 files (instances.md, handlers/sessions.py, handlers_instances.py, server.py, test_instances.py) and is about 2,840 commits behind; please rebase and re-run CI, as PR Readiness and the review lane are red on this head.
The earlier call-site coverage finding looks addressed on this head. The outstanding changes-requested review from the maintainer still needs a response before this can move forward.
|
Superseded by #23034, which is this same branch rebased onto current Everything raised here is carried into #23034:
Closing this one so there is a single thread. Thank you @bolichen97, @chenmingwei23 and @iamwhatever for the reviews here. |
Pull request was closed
Co-authored-by: Zejiang Guo <zejiangg@amazon.com>
Problem / Motivation
Goal: An agent can search, list and read a named peer crew's chat sessions with the three session read tools, under the same owner-only bar the dashboard's federated search already enforces.
An agent cannot read another crew's chat history.
search_chat_history,list_sessionsandget_chat_sessiononly ever see the localConversationLog.The dashboard can already do this —
/api/instances/search-sessionssearchesevery connected crew. An agent has no equivalent, so "what did chick decide about
the retry budget?" is a question you answer by hand.
Teleport (#10288) does not cover it. Adopting a peer session copies its history
down, so local search finds that one conversation — but you must already know
which session you want and pick its row, and the peer row list is live sessions
only. Discovery across sessions you cannot yet name, and any peer session not
currently open, stay unreachable.
Why it matters
Cross-crew consultation is the one thing a fleet of crews cannot do for itself.
Without it every peer lookup needs a human in the loop — exactly the work a second
crew was supposed to absorb.
Not a goal
before/after/all_workspaces/summarize) in crew mode.readfor an older peer that ignoresexclude_incognito(Crew read: the incognito exclusion on get_chat_session is peer-honored, not enforced #11954).What changed (motivation → approach → change)
crew=<id|name>on the three read tools (validation.py,mcp_tools/sessions.py)MAX_SHORT_STRING, control characters only barred./api/crew-sessions/search|list|read(server.py,handlers_instances.py)_register_mcp_routesso a headless gateway has them too.searchridessearch_sessions_remote;list/readride the genericproxy_requestcarrier._authorize_crew_read+ rosters insrc/kiro_crew/constants.pyX-Session-Keythat is owner-minted (dashboard:) or delegated (subagent:/side:) with an ancestry walk that ends in an owner-minted, still-present, non-app-owned slot. Everything unresolvable refuses.?exclude_incognito=1onapi_session_detail(handlers/sessions.py)readleg sets it. The arm reads throughConversationLog.derive_messages, the same derivation seam the localget_chat_sessionuses: a restricted or unreadable line answers[], a busy lock answers503 transcript_busy. The dashboard's own click-through is unchanged.PEER_SESSIONS_REPLY_MAX_BYTES(instances/constants.py)read_capped_response.The MCP process cannot touch the tunnel, so each tool asks the local gateway.
Each tool spells its route as a literal at the
_getcall site with only thequery dynamic, so
test_every_transport_call_resolves_to_a_pathcan name theendpoint every crew call reaches — no
_KNOWN_UNRESOLVEDentry.Who may call is the load-bearing part: these routes disclose a peer's titles,
snippets and whole transcripts under the owner's credential. A namespace proves
the gateway minted a key, not for whom, so the roster names who MAY call rather
than who may not. A denylist admitted a channel-born session twice; a flat
allowlist admitted a Slack-parented subagent. A subagent's parent comes from the
live in-memory run record only (the persisted one is agent-writable); a side chat
resolves to its dashboard slot with the generation suffix dropped.
cron,secretary, the workflow family and taskrunner are deliberately NOT delegatednamespaces, and adding one without a resolver refuses. A key naming a vanished
slot is refused first (
caller_session_missing), on both the caller and thewalk's terminal step.
Each tool resolves its key once through
require_strict_session_key; that samekey is checked and put on the wire (a required positional on the three crew
helpers). A Crew Member session bound to its own memory store is refused
cross-crew reads before the tunnel, reading only its own binding via
private_memory_store_for_session; an unreadable binding refuses too.Peer replies are untrusted: known keys only, types checked, text redacted before
clamping;
search/listdrop rows whosememory_modeis incognito/temporaryor malformed;
readfilters toRECALL_ROLESand tail-caps. Reads are boundedby
_CREW_PROXY_TIMEOUT(→504).docs/system-specs/modules/instances.md§17 carries the contract.Backwards compatibility
Compatible:
crewis optional on every schema; without it the tools' local paths are unchanged. The three routes are new.api_session_detailwithoutexclude_incognitois unchanged.Tests
test/test_instances.py::TestCrewScopedSessionReadspins the routes: theinternal-secret gate, the unknown-crew 404, key vetting, proxy-error mapping and
reply reshaping; one refusal pin per route for channel-minted, app-minted and
non-owner callers; admission pins so a fail-closed guard cannot over-refuse. The
ancestry walk is pinned as a walk: control first (owner-spawned subagent
admitted), then the Slack-parented subagent refused, absent/
done/reaped/blankparent records, a raising lookup, a cycle (403, not a hang), a chain over
_ANCESTRY_MAX_HOPS, and a delegated namespace declared without a resolver. Thepeer
memory_modeguard is pinned end to end ([]drops the row, sibling stilllisted). The
exclude_incognitoarm is pinned off the event loop on the thread,and its seam arms are pinned:
TranscriptWithheld→[],TranscriptBusy→503, the plainread_messagesnever reached.test/test_crew_scoped_session_reads.py(new) covers the tool-side crewbranches: error, empty and formatting paths, the query builder, the literal-path
property and the strict-identity and fail-closed arms.
test/test_member_memory_runtime.pypins the member-store fence on a realbinding and that the peer helper is never invoked for a fenced caller.
Manual verification
N/A — unit coverage sufficient. The routes have no UI, and the authorization arms
and reply reshaping are exercised directly at the handler.
Screenshots / video
N/A — no user-visible frontend surface is touched.
Related Issues
no linked issue for the capability itself: this adds one rather than fixing a
tracked defect.
Deferred from review, tracked rather than fixed here:
#11954 — the incognito
exclusion on the crew
readpath is peer-honored for an older peer that ignoresexclude_incognito, because a transcript array carries nomemory_modefor thehub to filter on. Linked from §17.3, which is that finding's own clearing condition.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)