Skip to content

feat(dashboard): a Dashboard tab for every crewmate, and the twelve pages it can show - #17507

Merged
iamwhatever merged 1 commit into
mainfrom
dyndash/backend
Oct 8, 2026
Merged

iamwhatever merged 1 commit into
mainfrom
dyndash/backend

Conversation

@chenmingwei23

@chenmingwei23 chenmingwei23 commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: every crewmate gets a Dashboard tab that answers "what did you do, what did it cost, what needs me" from the record itself, and a person can change which page it shows by asking the crewmate in chat.

A crewmate's own state was only readable by scrolling its chat. There was no surface that said what it is working on, what that has cost, or what is waiting on a human -- and nothing a person could point at and say "show me a different view of this". The numbers a reader wanted existed in the crew log already; nothing drew them.

Why it matters

A reader who has to reconstruct a crewmate's state from a transcript does not do it. They ask the crewmate, which spends a turn and a model call to restate a number the record already holds -- and the answer is true only at the moment it is typed. An operator running several crewmates has no way to see which one needs them without opening each conversation.

Not a goal

  • No template picker in the UI. A person asks the crewmate for another page; the crewmate carries it out.
  • No custom templates. A page an agent or a sender wrote cannot be previewed, adopted or rendered. See "What changed".
  • No snapshots, no sharing, no export.
  • No change to how an agent publishes a panel document (panel_publish is untouched).

What changed (motivation -> approach -> change)

Decision recorded in docs/request-for-change/rfc-crewmate-dynamic-dashboard.md. This PR is its P1.

The contract. A template is one manifest.json (each field, its type, the fold path its value comes from) plus one template.html. The HTML's data-dashboard-field names and the manifest's fields must be the same set in both directions, so a page binding a field nothing fills is refused rather than drawn with an empty cell. A number read from a fold is true tomorrow; a number an agent typed is true once. Twelve pages ship and project-report is the default.

Agent-authored HTML is refused -- a correction inside this PR. The first design let an agent pass a manifest and html pair to dashboard_preview and saved a kept page to a writable directory. Review found the hole: a rendered page runs its own script against the crewmate's task titles and summaries inside a frame whose frame-src admits the hosts artifact previews need, so it can navigate itself to one with those values in the URL. Scripts are the format, so the only signal is the author. Now stage_preview takes a template_id only (it still accepts the two parameters and refuses them with AUTHORED_PAGE_REFUSAL, which is what makes the refusal total), RENDERABLE_SOURCES holds builtin alone, the registry scans one directory in this repo, and apply writes to no catalog. Custom templates are P2 behind a gateway-minted wrapper document.

Three defects found on a live pod, all fixed here. kirocrew-dashboard-manager declared @kirocrew-panel in tools with mcpServers empty, so kiro-cli mounted nothing and the subagent had no way to answer; it now builds the entry through managed_mcp._managed_opt_in_entry. That subagent is also now optional: the panel tools resolve identity per calling session, which a member DM has and a subagent does not, so the base prompt was corrected to let the crewmate drive its own page with the verbs it already holds. Second, on a crewmate keyed Atlas the write resolved member_id and the read fell through to slug_for_name("atlas"), so one crewmate had two directories and the tab showed an empty page over real spend; members.canonical_member_key recovers the roster's spelling, and an ambiguous case-fold returns the name unchanged rather than guessing. Third, the store carried its own 64 KiB page ceiling while the frame's is 1,000,000, so project-report -- 147,345 bytes, and the default -- was refused at preview: a crewmate that switched away could never come back to the page every crewmate starts on. MAX_INSTANCE_HTML_BYTES now reads dashboard_frame.MAX_PAGE_BYTES, so there is one number and it belongs to the layer that pays for it.

Where each piece lives:

Area What it holds
src/kiro_crew/crew_log/ the folds (workstreams, work, usage, timeline, mistakes) and their entry types; absent is not zero, and a truncated list reports what it dropped
src/kiro_crew/dashboard_templates/ manifest format, registry, instance store, versions, rollback
src/kiro_crew/dashboard_agentic.py an agent's typed write, checked against the manifest, refusals recorded
src/kiro_crew/dashboard_feed.py the per-slot fold read behind one page
src/kiro_crew/dashboard_frame.py the sandboxed document: scripts on, network blocked
src/kiro_crew/dashboard/handlers/ the six agent routes and the owner-only read
src/kiro_crew/mcp_panel.py, validation.py the six tools and their argument schemas
src/kiro_crew/agent.py, agent_files.py, agent_materialization/, context.py, context_assembly/member.py, members.py the manager spec, the grants, base-prompt item 7, canonical slug resolution
src/kiro_crew/builtin_skills/dashboard/ the skill the crewmate loads to run the flow
src/kiro_crew/security_posture.py, MANIFEST.in, setup.cfg posture entry, template packaging, test paths
website/src/pages/members/ the Dashboard tab and the frame that mounts a page
website/src/api/client/agents.ts, app-sdk/index.ts, hooks/useWebSocket.ts, hooks/websocket/serverState.ts the client call, and the dashboard_instance_changed socket frame the tab refetches on
website/src/lib/widgetSrcdoc.ts the srcdoc shared with the widget frame
website/src/i18n/locales/ each tab state's string in all thirteen locales

Backwards compatibility

Compatible: every route and tool is new, and the Dashboard tab is behind the PREVIEW_DASHBOARD feature preview, off by default.

The diff does take two things away relative to earlier commits on this branch, neither of which ever reached main:

Reader: src/kiro_crew/mcp_panel.py:dashboard_preview -- subagent/chat -- a manifest+html call is refused with AUTHORED_PAGE_REFUSAL naming dashboard_templates as the remedy; test_dashboard_tools.py::TestAnAgentWrittenPageCannotBeStaged covers all five argument shapes.
Reader: src/kiro_crew/dashboard_templates/instance.py:staged_preview -- crew page -- a preview file naming no template reads as nothing staged, the same answer the four other unusable-preview cases get; test_a_preview_file_naming_no_template_reads_as_nothing_staged.
Reader: src/kiro_crew/dashboard/handlers/agent_panel.py:api_dashboard_apply -- subagent -- saved_template_id is gone from the response; no caller read it except mcp_panel's own renderer, changed with it.
Reader: src/kiro_crew/agent_materialization/service_agents.py:_install_dashboard_manager_agent -- release -- the spec is rewritten on every rebuild, so an installed copy is replaced rather than migrated.
Reader: src/kiro_crew/dashboard_templates/instance.py:MAX_INSTANCE_HTML_BYTES -- crew page -- the ceiling is RAISED to the frame's, not removed, so nothing a crewmate stored stops loading and the per-version bound still exists; test_a_page_over_the_shared_ceiling_is_still_refused holds the check in place.

members.member_slug now folds case when resolving a roster key. Two keys that differ only in case already derived one slug before this change, and the ambiguity gate that refuses that slug is unchanged -- so no pair that worked separately starts colliding.

Tests

31 new test files. The ones that lock in the decisions above:

  • test/test_dashboard_tools.py -- the three phrases, and every refusal an agent reads. TestAnAgentWrittenPageCannotBeStaged parametrises five shapes of an authored page (both halves, each half alone, beside a template_id, and one claiming source: "builtin" -- the case a source check alone would pass) and asserts the one sentence plus that nothing was staged.
  • test/test_dashboard_template_manifest.py, test_dashboard_templates_builtin.py -- the format, and all twelve pages through one loader.
  • test/test_workstreams_fold.py, test_workstreams_spans.py, test_crew_log_fold_eager.py -- the folds, including absent-is-not-zero and the truncation counts.
  • test/test_member_dashboard_routes.py -- the read route. TestOneCrewmateResolvesToOneSlug reproduces the pod bug: a roster keyed Atlas, a write under the slug the member owns, a read asked for as ?member=atlas, and the page it finds. Before the fix that answered 404 member_not_found.
  • test/test_dashboard_manager_agent.py -- test_every_declared_server_is_also_configured asks it as a rule over every @ ref the spec declares, not about the one name, so the next server added to tools cannot repeat it.
  • test/test_dashboard_templates_builtin.py -- TestEveryBuiltinSurvivesPreviewAndApply takes every shipped template through preview and apply, pins the ceiling as identity against the frame's constant, keeps a case that an oversized page is still refused, and walks the reader's own journey: adopt the default, switch away, roll back to it. Asked over the whole set rather than about project-report, because the next template somebody writes is the one that trips a ceiling nothing states.
  • website/src/test/projectReportPage.test.ts (85 cases) -- the default page's own script against fixture folds.
  • website/src/test/CrewDynamicDashboard.test.tsx -- the tab's six states.

Determinism: the suites above were run with -p no:randomly and again under the default random order, same results; the frontend files run under vitest run. The three mutations behind the two pod fixes each failed a different test -- empty mcpServers and a hollow entry fail the two spec cases separately; dropping the canonical lookup from member_slug fails the slug case, dropping it from the route fails the end-to-end case with the original 404, and letting an ambiguous fold pick a winner fails the ambiguity case. The two project-report script fixes were mutation-proved the same way, and so was the ceiling: restoring the private 64 KiB number fails four cases with the original "the page is 147342 bytes" refusal, and removing the size check altogether fails the oversized-page case.

Manual verification

Driven on a live pod: a crewmate's tab rendered project-report from its real folds, dashboard_write filled an agentic field and the open tab showed it with no reload, and dashboard_templates -> dashboard_preview -> dashboard_apply swapped the page and dashboard_rollback put it back. The two defects in "What changed" were both found that way, after the unit suites were green -- which is why each one shipped with a test that fails without its fix.

Screenshots / video

Taken on a live pod built from this branch, with Settings -> Developer -> Feature Previews -> Dynamic Dashboard on. Real gateway, real model turns, real crew-log data.

project-report, with three Needs-you cards the crewmate wrote through dashboard_write
project-report with three Needs-you cards

After one card is answered
Needs-you desk after a card is answered

One turn: work-kanban previewed then applied, go back restores project-report, an invented page is refused by name
switch, rollback and refusal in one turn

Switch to office, then straight back to project-report
office then project-report re-adopted

Known limitation: the kirocrew-dashboard-manager subagent is refused by the existing one-slot ownership check in agent_panel.py (unchanged by this PR; the crewmate's own direct route works)
subagent refusal

Walkthrough video (46 s): 12-walkthrough-0bbf5f5.mp4

Related Issues

Fixes #17261

Pattern harvest

Rule candidate: review-prompt
Pattern: an agent spec declares an @server in tools while leaving mcpServers empty and includeMcpJson false -- a grant that is dead with no local error, visible only on a running host. The spec-level rule is "every @ ref a spec declares is configured in the same spec", which test_dashboard_manager_agent.py::test_every_declared_server_is_also_configured now asserts for this one spec and which generalizes to every installer that grants an opt_in server.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title
  • 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

I confirm this contribution is made under the project's Apache-2.0 license.

@chenmingwei23
chenmingwei23 requested a review from a team as a code owner October 6, 2026 19:53
@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 6, 2026
@chenmingwei23
chenmingwei23 force-pushed the dyndash/backend branch 2 times, most recently from 71f5e4f to df3a906 Compare October 6, 2026 20:55
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Oct 6, 2026
@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Sensitive Change Review

Sensitive files changed:

  • src/kiro_crew/security_posture.py

  • @iamwhatever approved beb5c74 with a complete reasoning template.

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

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

@chenmingwei23 overrode this lane for beb5c74e8854614129553cc1fa68734a70b58ee2 via /ai-review override (this commit only).

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ human override accepted

@chenmingwei23 overrode this lane for beb5c74e8854614129553cc1fa68734a70b58ee2 via /ai-review override (this commit only).

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ human override accepted

@chenmingwei23 overrode this lane for beb5c74e8854614129553cc1fa68734a70b58ee2 via /ai-review override (this commit only).

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ human override accepted

Human judgment by @chenmingwei23 overrides the GPT 6.1 finding for beb5c74e8854614129553cc1fa68734a70b58ee2; the recorded reason is authoritative for this commit.

[GPT-OVERRIDE] beb5c74

This comment is updated in place on each push.

The model was not re-run because an authorized human decision supersedes it.

False positive or not applicable? A repository writer can comment:
/ai-review override gpt beb5c74e8854614129553cc1fa68734a70b58ee2: <one-sentence reason>

@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 Oct 7, 2026
@chenmingwei23
chenmingwei23 force-pushed the dyndash/backend branch 2 times, most recently from d0d4786 to 9207130 Compare October 7, 2026 01:07
@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 Oct 7, 2026
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ human override accepted

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

Human judgment by @chenmingwei23 overrides the Opus 5.5 finding for beb5c74e8854614129553cc1fa68734a70b58ee2; the recorded reason is authoritative for this commit.

[OPUS-OVERRIDE] beb5c74

Verdict recorded from an authorized human decision for commit beb5c74e8854614129553cc1fa68734a70b58ee2.

False positive or not applicable? A repository writer can comment:
/ai-review override fable beb5c74e8854614129553cc1fa68734a70b58ee2: <one-sentence reason>

@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 Oct 7, 2026
@chenmingwei23
chenmingwei23 force-pushed the dyndash/backend branch 2 times, most recently from 16624c4 to e93cc6c Compare October 7, 2026 02:48
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 7, 2026
@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 Oct 7, 2026
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Human judgment recorded

@chenmingwei23 marked the first-principles AI finding as false positive, not applicable, or explicitly accepted for b86b3e733414742c53210f01b4effddd40af1e24.

the premise objection is to the in-PR RFC itself; the feature is agreed with the maintainer (issue #17261), ships behind a default-off preview flag, and the agent surface was cut to six verbs with no delete.

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: 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 merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 7, 2026
…ages it can show

Each crewmate gets one page that answers what it did, what that cost and
what needs a human, read from the crew log's own folds rather than from a
model call. Twelve built-in templates ship; project-report is the default.
A person asks the crewmate in chat for another page, and six MCP tools
carry it out: search the catalog, stage a preview, ask, apply, roll back.

Only a template that shipped with the product can be previewed or adopted.
A rendered page runs its own script against the crewmate's task titles and
summaries inside a frame that can navigate itself, so a page nobody here
reviewed could carry them out; RENDERABLE_SOURCES therefore holds one
value and the registry scans one directory. Custom templates are a later
change needing a gateway-minted wrapper document.

The instance store's page ceiling is the frame's own MAX_PAGE_BYTES rather
than a second number, so every shipped template can be adopted -- including
the 147 KB default, which a private 64 KiB ceiling made unreachable to any
crewmate that had switched away from it.

The Dashboard tab is behind the PREVIEW_DASHBOARD feature preview, off by
default.

Fixes #17261
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

/ai-review override fable beb5c74: Opus 5.5 failed closed on PR size (combined backend + 12 templates over its line cap), no verdict on the code; GPT 6.1 covers the code review on this head.

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Human judgment recorded

@chenmingwei23 marked the fable AI finding as false positive, not applicable, or explicitly accepted for beb5c74e8854614129553cc1fa68734a70b58ee2.

Opus 5.5 failed closed on PR size (combined backend + 12 templates over its line cap), no verdict on the code; GPT 6.1 covers the code review on this head.

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

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

/ai-review override design beb5c74: Design Review failed closed on the 1 MB diff cap before reading evidence; the design is the in-PR RFC agreed with the team.

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Human judgment recorded

@chenmingwei23 marked the design AI finding as false positive, not applicable, or explicitly accepted for beb5c74e8854614129553cc1fa68734a70b58ee2.

Design Review failed closed on the 1 MB diff cap before reading evidence; the design is the in-PR RFC agreed with the team.

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

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

/ai-review override ux beb5c74: UX Review failed closed on the 1 MB diff cap; fresh pod screenshots and a 46 s video are in the PR body, and the tab ships behind the PREVIEW_DASHBOARD flag, off by default.

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Human judgment recorded

@chenmingwei23 marked the ux AI finding as false positive, not applicable, or explicitly accepted for beb5c74e8854614129553cc1fa68734a70b58ee2.

UX Review failed closed on the 1 MB diff cap; fresh pod screenshots and a 46 s video are in the PR body, and the tab ships behind the PREVIEW_DASHBOARD flag, off by default.

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

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

/ai-review override gpt beb5c74: Accepted risk: the only writer of those manifest keys and template ids is the dashboard tool path itself, built-in templates carry none, crew-log text is already redacted at emit, and the whole tab ships behind PREVIEW_DASHBOARD off by default; full-body key redaction is tracked as a follow-up.

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Human judgment recorded

@chenmingwei23 marked the gpt AI finding as false positive, not applicable, or explicitly accepted for beb5c74e8854614129553cc1fa68734a70b58ee2.

Accepted risk: the only writer of those manifest keys and template ids is the dashboard tool path itself, built-in templates carry none, crew-log text is already redacted at emit, and the whole tab ships behind PREVIEW_DASHBOARD off by default; full-body key redaction is tracked as a follow-up.

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

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

/ai-review override first-principles beb5c74: The RFC ships with its implementation in this PR by team agreement (no standalone RFC PRs); the feature is behind PREVIEW_DASHBOARD, off by default.

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Human judgment recorded

@chenmingwei23 marked the first-principles AI finding as false positive, not applicable, or explicitly accepted for beb5c74e8854614129553cc1fa68734a70b58ee2.

The RFC ships with its implementation in this PR by team agreement (no standalone RFC PRs); the feature is behind PREVIEW_DASHBOARD, off by default.

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

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Sensitive change review for head beb5c74, for the approving reviewer to confirm.

Sensitive change review

  • What rule changed: no rule changed; two redaction sinks registered in _REDACTION_SINKS (member_dashboard.py and dashboard_agentic.py).
  • Before -> after (what was allowed/blocked, now): dashboard page strings were not scrubbed, now they pass through the shared redactors; nothing newly allowed or blocked.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): a dashboard string is over-redacted and shows ***; no command breaks and no user is locked out.
  • Evidence checked (which sandbox result proves it): pod run on this head, screenshots and 46 s video in the PR body, dashboard renders with redacted strings.
  • No regression:
    • Tools still work (which tools/commands were run, result): dashboard_fields, dashboard_write, dashboard_apply and dashboard_rollback were run on the pod and all worked.
    • Backward compatible (old config / old data / old callers still work, how checked): the tab is behind PREVIEW_DASHBOARD, off by default, and the old panel still shows with the flag off.
    • Existing tests (which suites passed on this head): test_security_posture.py and test_member_dashboard_routes.py, 94 passed on beb5c74.
  • How to undo: revert the two _REDACTION_SINKS tuples in security_posture.py.

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

Sensitive change review

  • What rule changed: no rule changed; two redaction sinks registered in _REDACTION_SINKS (member_dashboard.py and dashboard_agentic.py).
  • Before -> after (what was allowed/blocked, now): dashboard page strings were not scrubbed, now they pass through the shared redactors; nothing newly allowed or blocked.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): a dashboard string is over-redacted and shows ***; no command breaks and no user is locked out.
  • Evidence checked (which sandbox result proves it): pod run on this head, screenshots and 46 s video in the PR body, dashboard renders with redacted strings.
  • No regression:
    • Tools still work (which tools/commands were run, result): dashboard_fields, dashboard_write, dashboard_apply and dashboard_rollback were run on the pod and all worked.
    • Backward compatible (old config / old data / old callers still work, how checked): the tab is behind PREVIEW_DASHBOARD, off by default, and the old panel still shows with the flag off.
    • Existing tests (which suites passed on this head): test_security_posture.py and test_member_dashboard_routes.py, 94 passed on beb5c74.
  • How to undo: revert the two _REDACTION_SINKS tuples in security_posture.py.

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.

Dynamic Dashboard for crewmates: backend, agentic writes and the Dashboard tab host

2 participants