Repository navigation
feat(dashboard): host an agent-written dashboard page and let it subscribe - #19060
Conversation
UX Review (Opus 5.5) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS The dispatch-tree gallery page hides what its numbers mean: the right-hand counts have no label, and "on a cycle" / "unresolved" are unexplained jargon. Watch
Suggestions
[UX-REVIEWED] ea2a76a Description read[DESCRIPTION-READ] 004c7f7155810cc57c5c757973fa149d2bd5d445a90068faf4f6cb1a3cb02d16 That sha256 names everything this verdict read: the PR description, plus the 5 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 |
Design Review (Opus 5.5) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS The amendment that lets agent-written script run unwrapped depends on "only the owner agent writes the page", but that holds only for writes through the artifact API. Watch
Suggestions
[DESIGN-REVIEWED] ea2a76a Description read[DESCRIPTION-READ] b47e15e79437beca3a6ab3b6e1129f3c871736781f87fc2838cfc34c056d3495 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@chenmingwei23 overrode this lane for |
Opus 5.5 Review — ✅ no blocking findingsReviewed Review detailsI checked all five candidates against the code. Only candidate 2 survived, as an advisory finding: candidate 1 is blocked by the store, 3 can't show a wrong page in practice, 4 is a documented locking trade-off with no measured stall, and 5 has no input that makes No blocking findings. FINDING — website/src/pages/members/CrewDynamicDashboard.tsx:265 — the push listener runs in [OPUS-REVIEWED] ea2a76a 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: |
a8a3ca9 to
80c502f
Compare
80c502f to
554cfb3
Compare
…cribe A kind=dashboard package can now carry view.html -- one page its owner wrote -- beside the block list, exactly one of the two. The frame gains window.kirocrew.subscribe(name, cb), which fires on first load and on every push that carries the field, so a page that draws a tree or a scene redraws from the field that moved rather than diffing a whole read. subscribed_fields reads the push allowlist off the model, and the save gate refuses a binding the model does not declare.
a8d7ac0 to
e1f2ce0
Compare
e1f2ce0 to
621fab7
Compare
621fab7 to
e0e1f3e
Compare
e0e1f3e to
6ec8920
Compare
6ec8920 to
e426270
Compare
229b267 to
7768539
Compare
7768539 to
b44f883
Compare
b44f883 to
9782d7a
Compare
9782d7a to
b138d5e
Compare
…r only
The controller resolves every value through the manifest it builds from the
package model, so a field the model does not declare has no path to the page.
A frame carries the fields whose value differs from the last one sent, each
patch stepping a version by one; a page that cannot place one asks for a whole
read.
GET /api/members/{slug}/dashboard?dashboard=<slug> serves the page through the
frame and arms the live page. It is also the production caller of
read_tree_projection: a tree-keyed fold has no bus scope, so the controller
reads it on arm and on refetch and resolves its fields out of that read, which
is how the dispatch-tree page gets a fleet's shape. The fold event reaches the
owner's socket as a dashboard_fields frame and the tab posts it into the iframe.
Writing a package is refused unless the caller is the crewmate or session its
bound_to names, and the refusal says to work_report instead.
|
/ai-review override first-principles ea2a76a: Maintainer decision by Mingwei on 2026-10-11 (option c): owner-written dashboard pages render in the opaque sandbox with no navigation wrapper, recorded as the dated RFC amendment in this PR that supersedes precondition P2; only the owner agent writes the page, pushed values are text-only, and the frame holds only the subscribed fields. |
Human judgment recorded@chenmingwei23 marked the first-principles AI finding as false positive, not applicable, or explicitly accepted for
This decision applies only to this commit. A new push requires a new judgment. |
Problem / Motivation
Goal: a crewmate's dashboard can be a page its owner wrote, which redraws itself when a value moves, instead of a layout assembled from host-drawn blocks.
A
kind="dashboard"package can only describe its page asview.blocks-- a list of block types out of a closed catalog that host code draws. The pages this surface exists for are not in that catalog and never will be: a dispatch tree, a chart over a fold, a scene. A catalog that grew a type per picture would be the host writing every page anyway.A page also has no way to HEAR a change. A value reaches it either as a text binding the host fills or through
window.kirocrew.fields, a snapshot read once. The only signal of a refill is a generic event that says something landed, leaving the page to diff a whole read.Why it matters
The dashboard is where a person reads what a long-running crew is doing. A page that cannot draw the shape of the work -- who dispatched whom, what is blocked on what -- answers the question with a table of numbers instead of the picture. And a page that cannot tell which field moved either redraws everything on every push or polls, so the surface that exists to show live progress is the one that shows it late.
Not a goal
resolve_bound_slugreplaces it in two lines.dashboard_saveis feat(dashboard): dashboard_save stages a composed page an agent builds #18851).What changed (motivation -> approach -> change)
Goal: let the owner write the page, and let the page hear what moved.
dashboard_framealready composes a page it did not write -- text-only bindings,connect-src 'none',allow-scriptsover an opaque origin -- but had no way to tell the page's script that one field moved.view.htmlin the package: eitherhtmlorblocks, never both nor neither. Checked for the frame's own refusals and for bindings naming an undeclared field. Nothing looks for a dangerous construct -- containment is the CSP and the sandbox.window.kirocrew.subscribe(name, cb), firing at subscribe time and on every push carrying that field; returns a disposer.LivePageresolves values through the manifest built frommodel.types, sends only fields that changed, steps a version by one per frame, and a page that cannot place a patch asks for a whole read. Frames and the refetch name their package, so two pages for one crewmate cannot cross-feed.GET /api/members/{slug}/dashboardresolves the crewmate's binding, serves the page, arms the live page. It is the production caller ofread_tree_projection: a tree fold has no bus scope, so it is read on arm and on refetch.bound_tonames, and an app refused outright; the write then lands under the token of the snapshot the gate judged, so a rebind arriving in between is refused rather than overwritten.worktreefold, plus thearrayandobjectdata typesworktree.boardsneeded.A dated maintainer amendment in
docs/request-for-change/rfc-crewmate-dynamic-dashboard.mdsupersedes the recorded P2 precondition: only the owner agent writes the page; values reach it as text, so crew-log content cannot add code or a URL; the frame carries only the model's allowlist; and that agent already reaches the network through its own tools. Sandbox staysallow-scripts, pinned by test.Backwards compatibility
Compatible:
view.blocksis unchanged and every stored package still parses --viewadmits a second key and requires exactly one of the two.read_payload,composeandcompose_bodykeep their signatures. The route is unchanged for a crewmate whose binding resolves to no package.Breaking: an agent or app write to a
kind="dashboard"artifact bound to a different crewmate or session is refused 403 where it previously stored. Writer sweep onorigin/feat/18642-tree-fold@554cfb300c: the three paths indashboard/handlers/artifacts.pyare the only ones reachingArtifactStore.create/.updatewith caller-supplied content, and all three are gated;dashboard_savedoes not exist on this base.git grep 'kind="dashboard"'finds only the store's rules, the validator and tests, so no cron script, app bundle or skill writes one today. The sweep covers the write arriving over the API; bytes put straight into the stored file are outside it and outside any check this handler could make, that writer being our own OS user -- named at the parse site, bounded by the frame's missing network.Reader:
handlers/member_dashboard.py:api_member_dashboard-- crew page -- serves a template instance unchanged when no package is bound --test_member_dashboard_package_route.pyReader:
artifact_store/dashboard_package.py:validate_package-- agent write via MCP -- a block view validates identically --test_dashboard_package_html_view.pyReader:
dashboard_feed.py:DashboardFeed.subscribe-- crew page -- gains an optionalextra_folds, default empty --test_dynamic_dashboard.py::TestTheFeedReader:
handlers/artifacts.pythree write paths -- agent and app via MCP -- a non-package write is untouched --test_dashboard_package_owner_gate.pyTests
Each red-first unless noted. The five security fixes are re-proven by breaking each guard and requiring its tests to fail: escaped
kind4, app token 2, live source 2, lost update 1, cross-feed 5 failed; baseline and restored 50 passed.test_dashboard_frame_subscribe.py(31): the bootstrap is EXECUTED in Node; one case breaks it and requires the probe to report the silence.test_member_dashboard_package_route.py(46): end to end over the real route, store, bus and broadcast -- the tree read, the gallery page's subscriber, and the resolver arming a page on an ordinary GET.test_dashboard_gallery_real_tree.py(5): plants real work entries and folds with the realread_tree_projection, pinning the page's read keys and their types. Founditemsis an integer count, which three fixtures had got wrong.dashboardFields.test.ts(13) suites.658 passed; vitest 15; every gate exits 0 (black, flake8, isort, mypy, comment-history, docs-lint, feature-map,
tsc,gen:ui --check).Manual verification
Captures come from the real composed output of
render_package_page; each asserts the rows the page's script drew. One drives a single patch through a live page and fails unless the row count rises.Screenshots / video
The dispatch-tree gallery page, one example an owner may copy: five boards mid-run -- who dispatched whom, each goal and item count.
The stale-values band, raised when a gap recovery never arrives, with its own sentence and a Retry -- distinct from the kept-last-good band, which says a newer version did not load.
Light theme, empty state and a cycle:
screenshots/18642-host.Related Issues
Refs #18642. First consumer of #18777 (the
worktreetree fold), which this PR is stacked on.Checklist