Repository navigation
feat(dashboard): serve the package page and push what moved - #18847
chenmingwei23 wants to merge 1 commit into
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS The goal ("fresh numbers the moment a fold advances") depends on server pushes reaching an already-mounted tab, and no one has watched that happen in a browser. Watch
[DESIGN-REVIEWED] 2814563 Description read[DESCRIPTION-READ] 695fe6c78698fc336fc01a749dcc238c2eb4c670b9ca04fae0d6e8d9f660c0d6 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) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS The package page re-runs checks this same request already ran, and Not justified as shipped
What this change shipsInventory (8 items) — 6 justifiedIntent: a crewmate's package dashboard is served and stays current over the WebSocket without a repaint or a cross-crewmate leak. ADDITION.
[FIRST-PRINCIPLES-REVIEWED] 2814563 Description read[DESCRIPTION-READ] 58de0445f352c4bb4dde68e0ffe17c060ce3058a6c981436d136377999a76726 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 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: |
GPT 6.1 Review — 🔴 changes requested (blocking)GPT 6.1 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/member_dashboard.py:378 -- Credential-shaped artifact slugs bypass dashboard redaction
Adjudication (Opus 5.5) — is blocking on each finding proportionate?No findings were adjudicable (total=0). I ruled UPHOLD-FENCED on the one fenced finding, F1. The artifact slug check ( False positive or not applicable? A repository writer can comment: |
34162a1 to
014b357
Compare
014b357 to
5c8b966
Compare
c553bb1 to
6aeec47
Compare
5c8b966 to
c75e19e
Compare
75fc29d to
2f6be4e
Compare
3a556b4 to
9ecbdbf
Compare
2f6be4e to
bc1d575
Compare
9ecbdbf to
64fa858
Compare
64fa858 to
b1330da
Compare
bc1d575 to
a192e65
Compare
b1330da to
d9ec8cb
Compare
|
Fixed on Reproduced first: a number field's So the egress scrub DID run and DID match -- it masked the The fix is the one you named: Test: 945 passed across the ten related files; |
A crewmate bound to a dashboard package is served from the existing dashboard route: the full read, which blocks hold which fields, and the minted document under rendered_html -- refused unless its CSP carries the required directives and every block type is in the catalogue. A crewmate with no package takes the unchanged template branch; one bound to a package is no longer handed a builtin template instance, not even when its package is bound but unreadable. Mounting that document in the tab, and listening for its patches, are still to come, so the feature-map row marks both pending. Each fold advance sends a dashboard_block_patch frame built by the renderer's own block_patch, which narrows to the blocks reading the moved fields through blocks_reading -- the one place that mapping lives. Every frame carries a version, so a replay and a gap are distinguishable; a rebind or a layout change sends a refetch with no values, and a layout change drops the replaced Model's subscriptions with it. The push subscribes by the crewmate's DM slot, resolved off-loop by the derivation that creates the thread: the slug names a different, empty slot, and two names that slugify together would read one. At most 32 pages push at once, least recently armed evicted first, and dashboard_block_patch is classified owner-only. LivePage and DashboardFeed stay separate feeds, because they resolve a field from different documents -- a TemplateManifest and the package DashboardModel -- and the template line is being retired. What they genuinely share, the per-fold cache cell and the revision rule ordering it, is imported rather than copied. The renderer is imported directly instead of resolved by name: it ships on this branch's base, so the absent-renderer fallbacks were unreachable and a rename is now an ImportError rather than a silently empty page. Refs #18642
Problem / Motivation
Goal: a crewmate's dashboard page shows fresh numbers the moment a fold advances, without repainting the page or leaking another crewmate's values.
The stack below renders a package to a document, but nothing serves it and nothing keeps it current. The only refresh is the full read, which re-initialises every block, so a canvas-owning block gets a second one.
Why it matters
Every failure mode here is silent: a stale dashboard reads as current, and a frame sent after a rebind hands one crewmate's crew-log values to whoever the page belongs to now.
Not a goal
CrewDynamicDashboard.tsx:271declines a body with norendered_htmland:273mounts it -- the field this route serves.What changed (motivation -> approach -> change)
Goal: serve the package page, and push only what moved. Assembling the patch here would put the formatting and redaction rules in two places, so this forwards the renderer's
block_patch()output.The dashboard route serves the package page.
GET /api/members/{slug}/dashboardreads the binding first: a crewmate with a readable package gets a branch carrying the full read, the blocks and the minted document underrendered_html; one without falls through to the template branch. On this route rather than its own, so the owner gate and the redaction keep one home each.That document is refused unless it may execute. It runs
script-src 'unsafe-inline', so the handler verifies the composed CSP and re-checks every blocktypeagainst the catalogue, serving norendered_htmlif either fails.A package-bound crewmate is served from it. The empty-record template fallback stays, scoped -- see Backwards compatibility.
Its write is checked once and kept. The display-pending refusal is lifted: this route composes the page from the same package the write is checked against, so one declaration decides both halves. The package-to-manifest translation arrives with it --
_manifest_of, its type mapping, thepackagemanifest source -- held out of the write-model PR as unreachable behind that refusal, since the lift is the first place its output is checked against anything.Two fold feeds, deliberately.
LivePageanddashboard_feed.py:151resolve a field from different documents, so neither builds on the other; they converge with the template line.The push narrows in the renderer.
send()patches throughblock_patch, which resolves blocks byblocks_reading, the one place that mapping lives. No second copy of a value:blocksnames which moved,readcarries each once.dashboard_block_patchis classified owner-only inws_event_scope; it ships throughbroadcast_ws_owners, so the classification stops a later literal broadcast reaching an app token.ImportErrorrather than a silently empty page.docs/feature-map/README.mdrow names both branches, the new frame and the tab that draws them.Backwards compatibility
Compatible for a crewmate with no package and no scan failure: the template branch answers the same body.
member_dashboard_push.pyis new with no prior callers.The builtin-template fallback is SCOPED, not removed.
member_dashboard.py:271isfallback = None if packaged.bound else ..., so a package-bound crewmate gets no template composed under it. Removing it outright was tried and reverted: FOUR readers resolve an empty record to the default, and removing two is worse than all four agreeing.The scope includes a failed scan, so
_read_packageanswersbound=Truewhen the store scan raises and a crewmate who may have no package gets the empty state; the trade is stated in that branch. The other three readers keep the unscoped rule, so on a scan failure the four disagree, and all four leave with the template line (drop-templates).Redaction covers the formatter's OUTPUT, and a NAME it would rewrite refuses the read. A display string is built from the field's SPEC as well as its value, and a spec is agent-authored --
format_valueappends aunit-- soread()andpatch()pass the formatted payload through the redactor too -- necessary and NOT sufficient: the pattern for an assignment does not match what the join produces, so the SPEC is redacted before the renderer reads it too. A declared name is the other half:[a-z][a-z0-9_]{0,63}admitsghp_plus 36 lowercase characters, and names travel as KEYS --missing,read.agentic,blocks, a manifest's own -- the identifiers the page joins its cells by. So both reads refuse whole rather than rewrite one. Both, because the template manifest's grammar is the same.Removed, all unreachable and all shipped in this stack:
DashboardModel.declares,.subscribers,.block_foldsandLivePage.blocks()'sfolds=, all with zero callers; the lazy renderer seam and its six names; a duplicate_Cell; andclose_allandlive_page, re-implemented in the test that wanted them.The display-pending refusal is lifted here, with the factory behind it.
Reader: src/kiro_crew/dashboard_agentic.py:display_pending_refusal -- crew page -- absent from origin/main, and its one caller is the gate this change lifts -- test_a_live_package_write_lands_because_the_display_reads_that_package
Tests
Added: a credential planted in a field's
unitreaches neither the document nor the response, asserted on the key BODY alone; a package-bound write is CHECKED against the package's own declaration, a string refused against a declarednumberthrough the mapping; a credential-shaped name is refused rather than served, from a package AND from a template manifest; a package-bound write lands and its value is on the served page; the field the tab mounts, scraped out of the component, is a key this read carries; a page with no resolved DM slot is refused.Changed or deleted, each because it asserted what the design reversed: one pinned
parse_packageat two calls, one required the bus key to BE the slug, two seam tests collapse into one calling the real renderer, and the write route's package case asserts the write is kept.Gates all exit 0:
flake8,black,isort,mypy, comment-history with its self-test, feature-map, fold-catalogue, take-away.Manual verification
N/A -- unit coverage is sufficient.
Screenshots / video
N/A -- no
website/src/change.Related Issues
Refs #18642. Depends on #18784 (base) and #18760 (merge order); the T3 one-pager is approved.
Checklist
Contribution License Agreement
Made under Apache-2.0, per CONTRIBUTING.md.