Repository navigation
feat(dashboard): a crewmate's own page goes live on apply - #20974
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ✅ human override accepted@iamwhatever overrode this lane for |
Design Review (Opus 5.5) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS Package rollback in this PR contradicts the accepted RFC amendment, and older records keep a second "which page is live" rule with no end date. Watch
[DESIGN-REVIEWED] 1fedfef Description read[DESCRIPTION-READ] 6a6f39fac7289188e3952cf72dc7d17797aa4f1c5086bb0502372dfba2fb769c 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 |
Opus 5.5 Review — ✅ no blocking findingsReviewed Review detailsTwo dashboard readers still show a crewmate's template page when an older record's page is a package. FINDING — src/kiro_crew/dashboard/handlers/agent_panel.py:1537 — [OPUS-REVIEWED] 1fedfef 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: |
|
Review dispositions for The three GPT 6.1 blocking findings share one root cause: the pin named an artifact version, which the artifact store can replace or prune. The fix changes what is pinned. The page in force is now a gateway-owned snapshot of the saved bytes:
Opus advisories, both fixed:
Also re-pinned |
493ef68 to
f6a9122
Compare
c050132 to
d57fc0e
Compare
|
Review dispositions for
Also in this push:
|
d57fc0e to
0d51ed6
Compare
|
Review disposition for
Also in this push:
|
0d51ed6 to
dd82bec
Compare
|
Review dispositions for
|
dd82bec to
dc266ec
Compare
|
Review disposition for
|
|
Correction to the disposition above: the fix is in head |
Review on #20974 (buluoray) listed these: the dashboard_apply schema comment, the page-check docstrings in agent_panel and member_dashboard_fields, and the credential-name rule's docstring. A composed page is saved and applied now, not staged. Not changed: the website comments and the dashboard-instances spec's Keep/Discard section. They describe the template preview, which still stages a page for a person to look at. Refs #20354
|
GPT 6.1 dispositions for
The PR is still two commits. The fixes are folded into the second one. |
72818af to
10bcfcd
Compare
#20974 lets a crewmate put a page live without a person's yes. Six agent-facing strings still told it to stage, ask first, or describe the page instead of applying it: - dashboard_templates description: list, apply; preview only on request - dashboard_save failed-verification reply: fix, save, then apply - _render_preview docstring - members preview-keep refusal: no 'after they say yes' - kirocrew-dashboard-manager description: no 'asks before keeping it' - dashboard GALLERY.md: save and apply, not 'stage it' Re-pins the dashboard-manager spec digests and the save-reply test. Refs #20354
Review on #20974 (buluoray) listed these: the dashboard_apply schema comment, the page-check docstrings in agent_panel and member_dashboard_fields, and the credential-name rule's docstring. A composed page is saved and applied now, not staged. Not changed: the website comments and the dashboard-instances spec's Keep/Discard section. They describe the template preview, which still stages a page for a person to look at. Refs #20354
|
GPT 6.1 disposition for
Also on this head: the Backend Lint line cap. |
10bcfcd to
a1bcbee
Compare
…rollback Follows the merged amendment in #20963. dashboard_save stores the crewmate's own package and dashboard_apply puts it live with no preview step; a template applies by template_id. Every apply writes an instance version that pins a gateway-owned snapshot of the page, so dashboard_write is checked against the package's own model and one dashboard_rollback reaches any earlier package or template version. catalog.PAGE_SINKS is the one list of value-to-code calls: a test holds every shipped page and gallery package to it, and the catalog scan does not serve an operator page that uses one. Frame containment, the owner write gate and the layout lock are unchanged. Fixes #20354
… page Review (buluoray, b7cc668): on a record with no `package` key -- every crewmate adopted before this change, and every never-adopted one -- the older rule looks the package up by binding. `dashboard_save` now binds the package, and with no version a person cut the route answered `_nothing_to_serve`, so a save without an apply blanked the tab. The write check and the turn block already fell back to the template, so the three readers disagreed. The older rule now finds only a bound package a person cut a version of (`dashboard_agentic.has_person_cut_version`). A bound package with no such version is the crewmate's saved draft, and the tab keeps the page it had until `dashboard_apply` pins it. One rule for all three readers: the route, the write check (unchanged; it already folded an uncut package into the template), and the turn block and suggestions decision (`dashboard_agentic.package_on_screen`, replacing their bare binding read). A slug the caller NAMES with `?dashboard=` still answers as before. GPT 6.1 (04a6ba2), both upheld and fixed: - Two first saves at once both found no package and created two with one binding, which every later save and apply refused as ambiguous. The lookup and the write it decides now run under a per-crewmate lock (`instance.package_save_lock`, its own lock file beside the instance lock). - The `?preview=1` read lost its exception boundary when the package precheck went. A store refusal there answers through `_refusal` again, not aiohttp's bare 500. GPT 6.1 (72818af, upheld and fixed): under the older rule the write check reads the person-cut version in a second read, and a slug deleted and saved again in between answered with another record's version. It now compares record identity as the page read does, and refuses. Also: `SUGGESTIONS_LINE`, read every turn, no longer says the person applies a preview. Tests: a pre-change record and a never-adopted crewmate each save without applying, and the write check and turn block still name the template; at the route, a bound draft serves the template page; two first saves at once bind one package; a refused preview read answers `dashboard_failed`. Each reddens with its fix reverted. `fake_devtools_browser` now reads only whole lines of its record file: the added tests shifted timing enough to expose a read landing mid-append.
|
/ai-review override first-principles 1fedfef: Maintainer decision: the page in force is a gateway-owned snapshot instead of artifact_revert, because artifact_revert lets a recreate bypass the lock and lets the 50-version prune drop the pinned page (both GPT-upheld). Rollback stays one call, as RFC #20963 requires. The enum-choice refusal stays: it is the write check a live package page needs. |
Human judgment recorded@iamwhatever 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 own dashboard page goes live as soon as it is saved,
dashboard_writekeeps working on it, and one call rolls it back.A crewmate can compose its dashboard page as a
kind="dashboard"package, but the page can never reach the Dashboard tab.dashboard_applyof a staged package and its?preview=1read both answer 409package_display_pending. Binding a package by any other route freezes everydashboard_writefor that crewmate, and no verb undoes that. Today the only workaround is for a person to copy a template folder intopanel-templatesby hand.Why it matters
Every crewmate-written page is stuck. The person cannot see it, and the crewmate cannot fill its fields. The maintainer ruling on #20354 (iamwhatever) is that a preview/approve step adds no security, because a person cannot see an exfiltration script by looking at a page. So the gate costs a click and protects nothing.
Not a goal
sandbox="allow-scripts"only, CSP withconnect-src 'none', the model allowlist, values as text.view.htmlcap.What changed (motivation → approach → change)
Symptom: the page cannot go live, and writes freeze once a package is bound. Root cause: the page read and the write check had no shared answer to "which page is in force". So the write path refused every package-bound write, and the apply refused rather than freeze it.
This follows the accepted RFC amendment merged in #20963 (
rfc-crewmate-dynamic-dashboard.md, "Amendment 2026-10-15 -- a page goes live on apply, with no preview step").dashboard_savestores the caller's own package and does not move the page.dashboard_applywith no arguments puts that package live.dashboard_applywith atemplate_idputs a builtin or operator template live.dashboard_previewstays only as a look; it changes nothing.dashboard_rollbackrestores each version's own page in force, so one call goes back to an earlier package or to a template.crew-panels/<slug>.dashboard-page.<digest>.json. That folder is outside the crewmate's shell-writablemembers/tree, and the instance version pins its digest.instance.pinned_packageandinstance.keeps_older_package_ruleanswer bothmember_dashboard._serveanddashboard_package.read_package_model.dashboard_writeis checked against the package's ownmodel.typesand keeps working once a package is live.enumfield in a package keeps its declaredchoicesas its write shape (Shape(kind, enum=tuple(choices))), sodashboard_writerefuses a value outside them.RENDERABLE_SOURCESis still{builtin, user}.AUTHORED_PAGE_REFUSALstays, reworded to namedashboard_apply.allow-scriptsonly,connect-src 'none'.bound_tocomes from the vetted caller, andbinding_refusalrefuses a page bound elsewhere./api/agent-panelprefix, and the owner-only page read.catalog.PAGE_SINKSis the one list of value-to-code calls:innerHTML,outerHTML,insertAdjacentHTML,document.write,document.writeln,eval(,Function(,createContextualFragment,DOMParser,parseFromString,setHTMLUnsafe,parseHTMLUnsafe,srcdoc, andsetTimeout/setIntervalwith a string.user) page that uses one as a problem and does not serve it.docs/system-specs/modules/artifacts.mdand the feature map.session_package_unsupported). The hosted-page reader resolves crewmate bindings only.view.htmlcap is untouched, and this PR edits none of feat(dashboard): raise the hand-written page cap to 3 MiB #20790's lines.Backwards compatibility
Breaking:
dashboard_saveanswerssavedinstead ofstaged, and is followed bydashboard_apply.dashboard_applywith no arguments applies the caller's saved package instead of a staged template preview.PAGE_SINKScall is no longer served.Writer sweep on origin/main @ 93617e9: the only callers of the save and apply routes are
mcp_panel(updated) and the tests (updated). No website code reads the save reply. The person's Keep and Discard routes for a staged template preview change in one way:_commitnow callsdiscard_preview(slug), so any new instance version (an adopt, an apply, aneditor a rollback) drops a staged preview, and Keep or Discard after that finds nothing staged.userpage with a sink becomes a listed problem; test_an_operator_page_with_a_sink_is_a_problem_and_not_servedTests
test/test_dashboard_template_sink_ban.py:catalog.page_sinktest/test_dashboard_save_tool.py:dashboard_writeis checked against the package modeltest_context_composition_contract.pytest_agent_refactor_spec_bytes.pygoldens, which can only be taken from CI's outputtest_dashboard_tools.py,test_dynamic_dashboard.py,test_member_dashboard_routes.py,test_agent_panel_routes.pyandtest_session_dashboard.pyManual verification
Not done on a dev pod. The route tests cover save, apply, rollback, the lock and the pointer read against the real instance store and a real
ArtifactStore. The code adds no OS-specific paths: snapshots use the existingatomic_writeandcrew-panelshelpers, so Linux, macOS and Windows take the same code path.Related Issues
Fixes #20354
RFC: #20963 (merged)
Pattern harvest
Not generalizable: the defect was two readers of one state, the page read and the write check, each choosing the page in force on its own. The fix gives them one pair of functions on the instance record, and those are specific to this feature.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributed under the project's Apache-2.0 license.