Repository navigation
feat(dashboard): a layout lock only the person can set on a crewmate's Dashboard tab - #18687
Conversation
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: |
c6528fd to
f141d39
Compare
First Principles Review (Opus 5.5) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS The record snapshot defends against a shell-rewrite attack the Goal never names. The stated harm is an agent mistakenly calling Not justified as shipped
What this change shipsInventory (10 items) — 8 justifiedIntent: let the person freeze a crewmate's Dashboard page so the agent cannot swap or roll it back. This is an ADDITION.
[FIRST-PRINCIPLES-REVIEWED] 314958a Description read[DESCRIPTION-READ] fb445a0e86f36fc157517a78f4eee171f4e55039b552ac998764498adeb245e5 That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS The locked badge is half status notice, half link, and the blind reader only guessed that clicking it opens Profile rather than unlocking the board. Watch
Suggestions
[UX-REVIEWED] 314958a Description read[DESCRIPTION-READ] 5e440492ecef4b85d25260c1ca4961c20d9f34074ab1d2400b16e7ade957a051 That sha256 names everything this verdict read: the PR description, plus the 12 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) — ✅ PASSDesign-level review of Design-Verdict: PASS Check what unlock shows: it reads [DESIGN-REVIEWED] 314958a Description read[DESCRIPTION-READ] fed499cf869affd2b10abd2929fa3b312b515e23c34bf3738b1d8e1f9b03343e 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 Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
f141d39 to
8dacef0
Compare
fe1f6f2 to
ba32438
Compare
ba32438 to
29f774a
Compare
|
![dashboard-badge-dark] |
|
![dashboard-badge-light] |
|
![profile-switch-locked-dark] |
|
![profile-switch-locked-light] |
|
![profile-switch-unlocked-dark] |
|
![switch-error-dark] |
|
![switch-flip-error-dark] |
|
UX fixes on ea4dcd2:
|
|
|
|
…-button links there Moves the "Lock dashboard layout" toggle from the Dashboard tab to the crewmate's Profile card, and adds a badge-button on the Dashboard tab that links directly to the Profile tab. Re-pins dashboard/headless boot sequences for the lock route; fixes UX Review by mocking /api/sandbox-doc so badge-working screenshots show live content; adds flip-error screenshot; drops redundant title attr from badge button.
|
|
|
|
Self-review (crew-pr-reviewer, read-only): RECOMMEND APPROVE This adds a person-only lock that stops a crewmate from swapping or rolling back its Dashboard page, and it fixes the real problem at the store: |
buluoray
left a comment
There was a problem hiding this comment.
LGTM. I re-checked this at head 314958a. My approval on 7a7b302 was dismissed by the rebase; the earlier conclusions still hold.
What changed since then: the lock switch moved to the crewmate's Profile card (the Dashboard tab shows a "Layout locked" badge), the agent may preview while locked, and the new session: key class from #18105 is handled.
Checked at this head:
_commitrefuses onis_locked(instance.py:912), so adopt, edit, rollback and apply_preview are all gated. Previewing never went through_commit, so allowing it while locked changes nothing the store keeps.- An unreadable lock or a store that cannot answer still reads as locked (fail-closed).
- The lock route still refuses internal-secret and internal-auth callers with 403
human_onlyand audits it. lock_pathrefuses a session key and_lock_snapshotreturnsNonefor one (instance.py:1189,:1205), so a root session's page is never locked.
Mutations: removing the is_locked check in _commit reddens 9 tests (e.g. test_adopt_is_refused_and_the_page_stays, test_apply_is_refused_and_the_preview_stays_staged, test_rollback_is_refused); failing open on an unreadable lock reddens test_a_lock_file_that_cannot_be_read_reads_as_locked; dropping the internal-secret refusal reddens test_an_internal_secret_caller_cannot_flip_the_lock; removing the session-key exemption reddens test_a_session_page_has_no_lock_even_when_the_store_cannot_answer and 7 tests in test_session_dashboard.py; a no-op Profile toggle reddens "flips the lock through the owner route...".
Non-blocking follow-ups:
- When the display starts rendering a bound dashboard package, binding a package becomes a structure change that does not pass through
_commit; that path will need its ownis_lockedcheck (#18851 is the current candidate). - The Profile switch only renders with
PREVIEW_DASHBOARDon, while the refusal text tells the agent to ask for an unlock "on your Profile card". dashboard-instances.mdcould say a root session's page has no structure lock.- The squashed commit message now describes only the move; the PR body / squash message should still describe the lock, since that is what lands in main's history.









Problem / Motivation
Goal: The person can lock their crewmate's Dashboard page so the crewmate cannot swap it or roll it back until the person unlocks it.
A crewmate's Dashboard tab is its own copy of a template. Today
dashboard_applyanddashboard_rollbackchange that page whenever the agent calls them. The only thing asking the agent to check first is prose in thedashboardskill.Why it matters
A person who has settled on a page has no way to keep it. One misread "show me another" and the agent replaces the page they were using, and they have to notice and ask for it back.
Not a goal
dashboard_writeand fold-driven numbers keep updating.What changed (motivation → approach → change)
The person needs a switch the agent cannot reach. So the lock is a file in a store only the gateway can write, and every way to make a new page version is refused while it exists.
dashboard_templates/instance.py)crew-panels/<slug>.dashboard-lock, never ininstance.json(which the crewmate's shell can write) and never in a version. Locking snapshots the current record into that file, the setter serializes on its own lock file increw-panelsand writes nothing undermembers/<slug>/.readserves the snapshot until unlock._commitrefuses withInstanceLockedunder the instance lock, so adopt, apply, edit and rollback all stop._updated_mscoerces any non-integerupdated_msto 0 so a shell-rewritten record never crashesread. A session's page has no lock (session key guard added). Only a missing lock file is unlocked; any other read error reads as locked.handlers/agent_panel.py)dashboard_locked(423) with a sentence telling the agent to ask the person to unlock it on the Profile card.handlers/member_dashboard.py)POST /api/members/{slug}/dashboard/lockwith{"locked": bool}. Refuses an internal-secret caller (human_only) first, then the owner gate. Registered inserver_runtime/mcp_routes.py.dashboard_agentic.py)[DASHBOARD]block carries a LOCKED line: do not apply, roll back or propose another page; ask the person to unlock it on the Profile tab. The agent can still preview a page for the person to look at. Values and folds still update.member_slug, which IS the immutablemember_idwherever one is persisted, so a rename keeps it. It lives increw-panels, apart from DM sessions andmembers/<slug>/, so a cleared chat, a new DM, a wiped member folder and a restart all leave it set. The member record does not grow.members/<slug>/dashboardwould let an agent symlink-redirect the gateway's write. The lock file in the sandbox-maskedcrew-panelsstore is the record.pages/members/CrewProfileSettings.tsx,api/client/agents.ts)GET /api/members/{slug}/dashboardbody the Dashboard tab already fetches; invalidating its query key refreshes both surfaces at once. Only shown when the Dynamic Dashboard preview flag is on. Strings inlocales/en.jsonand every other catalog,en-XA.jsonregenerated.pages/members/CrewDynamicDashboard.tsx)onOpenProfileTab→openProfile('profile')), so the person can unlock from one tap. No toggle on the tab itself — the switch is on the Profile tab so the Dashboard tab stays uncluttered. The badge appears in EVERY view that has a read (broken, empty and unrenderable included). A staged preview carries no badge.mcp_panel.pytool descriptions and thedashboard/SKILL.mdskill say what the lock does and that only the person can lift it from the Profile card.docs/feature-mapanddocs/system-specs/modules/dashboard-instances.mddescribe it.capture/dashboard-lock.tsxandcapture/profile-dashboard-lock.tsxmount the respective surfaces in isolation;scripts/capture-dashboard-lock.mjsdrives both, asserts each branch and writes the shots below.Backwards compatibility
Compatible: no lock file means unlocked,
instance.jsonis unchanged, and every existing route and tool keeps its arguments.Removes nothing: the lock only adds a refusal while a person has set it.
Tests
test/test_dashboard_structure_lock.py:updated_ms(string, null, float, bool, list) never breaks the read, the lock or the unlock.[DASHBOARD]block says LOCKED for an adopted page and for a crewmate with no page, and names every forbidden page change and points at the Profile card.member_id; the realreset-conversationroute on the mate's DM slot leaves it locked; wipingmembers/<slug>/dashboardkeeps the lock; a fresh process reads it from disk.lock_pathraises,_lock_snapshotreturns None,is_lockedreturns False).instance.jsonneither lifts it nor changes the locked page, the file is in the sandbox-masked, tool-fencedcrew-panels, and an unreadable lock file or store reads as locked and serves the error state.members/<slug>/dashboardreplaced by a symlink to a decoy, a lock and an unlock leave every file in the decoy untouched.dashboard_locked(423).X-Internal-Secretcaller, for aninternal_authgrant even with the owner subject, for a non-owner, and for a non-boolean.Mutation check: removing each guard turns its tests red.
website/src/pages/members/CrewProfileSettings.test.tsx(newCrewProfileSettings dashboard locksuite):website/src/test/CrewDynamicDashboard.test.tsx(newthe lock badgesuite):ApiClient.refactor.surface.test.tsandtest_dashboard_server_composition_contract.pyre-pin for the one new endpoint and route;test_agent_panel_routes.py's store stub gainsInstanceLocked.Manual verification
Verified with
capture-dashboard-lock.mjs(runs both entries in a real browser, asserts each branch before writing the PNG):aria-checked=true/falseat the right states — dark and light.Screenshots / video
All shots captured and assertion-verified with
capture-dashboard-lock.mjs:Dashboard tab — badge above a live rendered page (dark):
Dashboard tab — badge above a live rendered page (light):
Profile tab — "Lock dashboard layout" switch ON (locked), dark:
Profile tab — switch OFF (unlocked), dark:
Profile tab — switch ON (locked), light:
Profile tab — failed flip (lock mutation returns error), dark:
Profile tab — lock-read failure (switch hidden), dark:
More: Dashboard tab badge (compact view, dark + light)
Related Issues
Closes #18683
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)