Skip to content

feat(shared-crew): let a relay teammate read a roster Bot's Dashboard - #37385

Merged
adlio merged 1 commit into
mainfrom
feat/shared-crew-bot-dashboard-teammate
Nov 15, 2026
Merged

adlio merged 1 commit into
mainfrom
feat/shared-crew-bot-dashboard-teammate

Conversation

@adlio

@adlio adlio commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A relay teammate on a team Crew sees a roster Bot's Dashboard page instead of "Only this bot's owner can see its dashboard."

A teammate who comes in through the Kiro relay can open a roster Bot's chat and run its turns. Its Dashboard tab still answers 403 owner_only. The Dashboard is often the main thing a Bot produces, such as a garage of generated cars or a leaderboard, so the teammate who asked the Bot to build it cannot see the result.

Why it matters

Shared Crew's promise is that teammates use a team Crew's Bots as they use its sessions. A teammate already has the owner's access to run work on the Bot and can ask it for any value its page shows, so the 403 protects nothing and hides the Bot's output from everyone but the owner.

Not a goal

  • Opening the session Dashboard (GET /api/chat/slots/{slot}/dashboard) or the work ledger board to teammates.
  • Showing a teammate a staged page (?preview=1) or letting them Keep or Discard it.
  • Sending live dashboard field frames to a teammate's socket.
  • Any change for Bots outside the teammate's roster, other non-owners or app tokens.

What changed (motivation → approach → change)

A relay teammate on a Bot in their roster now reads that Bot's applied Dashboard page, as they already open its chat. Everyone else meets the owner gate as before.

Owner Relay teammate, roster Bot Anyone else
GET .../dashboard (applied page) 200 200, audited members.dashboard 403
POST .../dashboard/refetch allowed 403 403
?preview=1, preview apply and discard allowed 403 403

The gate is one helper in member_dashboard.py, _teammate_reader, which refuses a staged page and otherwise calls the same members_access._teammate_admitted check the chat routes use; anyone it does not admit meets _owner_only as before. A teammate's read is a one-shot page of its own, armed and disarmed in one worker call, so it never replaces the live page the owner's tabs are pushed from: that page keeps the owner's language and version counter. A teammate's tab therefore gets no pushed frames and stays current through the tab's own timed re-read, and the refetch that recovers a gap in those pushes stays owner-only. The member-event-log spec says which Dashboard reads a teammate reaches.

Backwards compatibility

Compatible: the owner's answers are unchanged, and the only new answer is a 200 to a relay teammate on a roster Bot who was refused before.

Removes nothing: the change only admits a caller; no route, field or record is hidden, renamed or removed.

Tests

  • test/test_members_roster_relay_teammate.py, over the real relay ingress, header strip and token auth: a relay teammate reads a roster Bot's Dashboard with the same state and template as the owner and leaves an allowed members.dashboard row under relay:<id>; they are refused the refetch (the owner gets the route's own 409), the staged page and its apply and discard, and a Bot outside their roster; a non-owner who is not a relay teammate is refused even when sending the relay user header.
  • test/test_member_dashboard_teammate_read.py, on a real armed package page and the crew-log bus: after the owner reads in English and a teammate in French, the owner's page is the same object, still subscribed, and the next fold pushes one English frame; a teammate's read arms nothing when the owner has none; a teammate's read that cannot be framed keeps the owner's page; and an arm that raises after subscribing leaves the teammate's page unsubscribed.
  • test/test_member_dashboard_routes.py: the route ratchets keep _owner_only on every page route and pin that _teammate_reader refuses ?preview=1 before calling _teammate_admitted, and that the refetch never calls it.
  • Revert checks: with this PR's member_dashboard.py change reverted, the read test fails; with the arm wrapped only in a plain arm-then-disarm, the raising-arm test fails.

Manual verification

Not yet run against a live relay host. The relay ingress, header strip and token auth in the tests are the real middleware chain, driven over a loopback listener.

Related Issues

Closes #37376

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

@adlio
adlio requested review from a team and KiroCrewCaptain as code owners November 14, 2026 22:32
@adlio
adlio requested a review from mbriones98 November 14, 2026 22:32
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 14, 2026
@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 398813cb6cdeb95d307583e6bd8d6f5e1a8e440d 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 14, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 398813cb6cdeb95d307583e6bd8d6f5e1a8e440d — 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 base spec said teammates could not read a Bot's Dashboard because "session counterparts are owner-only too". That reason was only symmetry, and the PR reverses it with a linked issue (#37376).

What this change ships

Inventory (6 items) — 6 justified

Intent: let a relay teammate on a team Crew see the Dashboard page of a Bot in their roster, as they already open its chat — ADDITION.

  1. A relay teammate opening a roster Bot's Dashboard tab now sees the applied page, not 403 owner_only — justified
  2. A teammate's read leaves the owner's live page alone, so the owner keeps their language and version counter — justified
  3. A teammate's tab gets no pushed frames and refreshes through the tab's existing 60s re-read (DASHBOARD_FALLBACK_REFETCH_MS) — justified
  4. The staged page (?preview=1) and its Keep and Discard stay owner-only for a teammate — justified
  5. /refetch stays owner-only — justified
  6. A new allowed members.dashboard audit row is written under relay_teammate for each teammate read — justified

[FIRST-PRINCIPLES-REVIEWED] 398813c

Description read

[DESCRIPTION-READ] fe3a7bf414361d956341f89a3fdc59cb90d24325e920c58643cc83267895c265

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

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Nothing blocks: the teammate read reuses the chat routes' _teammate_admitted gate, cannot touch the owner's live page, and leaves staged-page and refetch writes owner-only.

Notes

  • If a teammate's page asks for a refetch (the kirocrew-dashboard:refetch message), the route answers 403 owner_only. CrewDynamicDashboard.tsx:478 then shows that as a refetchError band, so the teammate sees an error instead of waiting for the 60s re-read. Consider suppressing the refetch on a teammate's tab.
  • A teammate's read arms and folds a full page every time, once per tab every 60s, and nothing caches or shares it. That cost stays bounded only while rosters are small.

[DESIGN-REVIEWED] 398813c

Description read

[DESCRIPTION-READ] f6f332334d91445dff9238a147fe607d670d2933760a7f98db96f7f68a13216e

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

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 398813c

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

@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] 398813c

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

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

@adlio
adlio force-pushed the feat/shared-crew-bot-dashboard-teammate branch from 22b2462 to db368d2 Compare November 14, 2026 22:53
@adlio

adlio commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

self-added: no

  • span=482e0083539c

fixed in db368d2: dashboard-instances.md now describes the one non-owner reader, a relay teammate on a roster Bot, reading the applied page only.
It states the staged page, Keep and Discard stay owner-only, the read is one-shot and never arms or replaces the owner's live page, and /refetch stays owner-only.
The preview section says a teammate admitted to the live page is refused the staged one; member-event-log.md already carried the same rule.

@adlio

adlio commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in docs/system-specs/modules (acp-client, app-kit-platform, governance, messaging, ops-mission-control, platform-context, security, session) and src/kiro_crew/dashboard/handlers (credential_redaction.py, updates.py, updates_streams.py), plus src/kiro_crew/dashboard/warm_task_brief.py and 16 more, since this head went green (46f62de -> b81cf5a); CI re-running.

@adlio
adlio force-pushed the feat/shared-crew-bot-dashboard-teammate branch from db368d2 to a3e2997 Compare November 14, 2026 23:53
@adlio

adlio commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in test/test_member_dashboard_routes.py and same-directory files under docs/system-specs/modules and src/kiro_crew/dashboard since this head went green (b81cf5a -> af94fac); CI re-running.

@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: A person should decide

Why: the decider estimates a 12% chance that this change introduces a defect, within the 12% limit for approving on its own, but it changes 439 lines, more than the 400 it may approve on its own.

The PR lets a relay teammate read a roster Bot's applied Dashboard page through _teammate_reader. It refuses ?preview=1 first, then defers to the existing _teammate_admitted check (relay-verified Kiro human, Bot in their roster, audited as allowed). Every other caller still goes through _owner_only unchanged. Refetch and preview apply/discard stay owner-only. In _serve_package the teammate path never pops or writes the shared live-page store, uses a send callback that does nothing, and arms and disarms inside one worker call with try/finally, so the owner's armed page, version counter and language are untouched; a framing failure also keeps the owner's page. Field frames go only to owner-registered sockets (broadcast_ws_owners, registered via is_owner_dashboard_request), and relay admission gives a teammate a subject distinct from the owner's, so teammate tabs get no pushes. The response tag is scoped to the reader's identity. Specs are updated to match. Tests use the real relay ingress and cover the read, the audit row, every refusal, a Bot outside the roster, a header-spoofing non-owner, and the owner-page invariants, including an arm that raises.

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 a3e2997ea3 · 439 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@adlio

adlio commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

The red Backend Tests (3.12, 8) on this head is main's, not this PR's: test_telegram_sessions_resume.py::TestTelegramColdResume::test_the_live_projection_receives_scrubbed_text_not_raw and test_history.py::TestAMiscomposedHostPersistsAWholeTurn::test_both_rows_persist fail the same way on a clean origin/main worktree at af94fac. Tracked in #37421, fixed by #37423. This PR waits for that fix and is rebased onto it once it lands.

@adlio
adlio force-pushed the feat/shared-crew-bot-dashboard-teammate branch from a3e2997 to 398813c Compare November 15, 2026 01:10
@adlio

adlio commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in test/test_autonudge_row_scrub.py, test/test_history.py, test/test_one_conversation_one_session.py and test/test_telegram_sessions_resume.py (#37423, the red-main fix for #37421) since this head was tested (af94fac -> 8b3a273); CI re-running.

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

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

Looks good. Same admission as Bot chat, a one-shot read that leaves the owner's live page alone, and refetch/staged/apply stay owner-only. One question, not blocking: each teammate tab does a full arm/disarm on the 60s fallback refetch. Fine at a few teammates, but is that OK cost-wise with a dozen or so tabs open?

@adlio
adlio enabled auto-merge (squash) November 15, 2026 05:27
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention labels Nov 15, 2026
@adlio
adlio merged commit 04a5a50 into main Nov 15, 2026
264 of 270 checks passed
@adlio
adlio deleted the feat/shared-crew-bot-dashboard-teammate branch November 15, 2026 06:33
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 15, 2026
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.

Shared Crew: let a relay teammate read a roster Bot's Dashboard

3 participants