Skip to content

feat(dashboard): serve an operator's own pages from the panel-templates folder - #19656

Merged
chenmingwei23 merged 1 commit into
mainfrom
feat/dashboard-operator-pages
Oct 13, 2026
Merged

chenmingwei23 merged 1 commit into
mainfrom
feat/dashboard-operator-pages

Conversation

@iamwhatever

@iamwhatever iamwhatever commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: An operator can put their own dashboard page in the data home's panel-templates folder, and a crewmate's Dashboard tab can show it.

Today the dashboard catalog serves only the pages that ship with the product. A person who writes their own page has no place to put it. The only way to show it is to drop it into the source tree.

Why it matters

Decision 3 of the second 2026-10-12 amendment in docs/request-for-change/rfc-crewmate-dynamic-dashboard.md says an operator's own page renders, from one folder. Without this change that decision has no code. A page kept in the source tree is lost on the next clean checkout or package upgrade.

Not a goal

  • Removing the Dynamic Dashboard preview flag.
  • Porting the conductor's board to a dashboard page, or reading the panel fold per owner.
  • Any change to the sandbox, the file-tool gate, or security/paths.py.
  • Letting an agent write, stage or import a page. That stays refused.

What changed (motivation → approach → change)

A page the operator writes can show on a crewmate's Dashboard tab. They put it in the data home's panel-templates folder, the one the panel's own template overrides already use. No agent can write that folder, so a page there is one a person put there. The dashboard catalog reads it as a second root.

Root Origin Who put the page there
dashboard_templates/builtin/<id>/ builtin shipped and reviewed
<data home>/panel-templates/<id>/ user the operator

A page there is a directory with manifest.json and template.html, in the shipped format. Panel overrides stay <id>.html files. The two never collide: panel discovery reads only .html files, and the catalog reads only directories.

catalog.py scans both roots. An operator page must say "source": "user"; the existing source check refuses anything else. Each refusal goes into the catalog's problems list, and the other pages still load:

  • A shipped id wins. An operator page with the same id is reported, not served.
  • A linked folder is refused, through agent_panel.override_templates_dir.
  • A linked page directory, manifest.json or template.html is refused.

instance.py makes RENDERABLE_SOURCES hold builtin and user. shared stays out. The page bytes still come from the catalog by id, never from the crewmate's stored copy, and the frame, CSP and sandbox are the same for both origins. _trusted_page in dashboard/handlers/member_dashboard.py refuses a page whose catalog origin differs from the stored record's source. So if a release ships an id an operator page already uses, the tab shows nothing instead of a different page.

The decision is decision 3 of the second 2026-10-12 amendment in docs/request-for-change/rfc-crewmate-dynamic-dashboard.md, on main since #19609.

The folder's existing fences already cover a page one level down. The new tests pin each of them. The registry rules in docs/system-specs/modules/dashboard-instances.md and dashboard_templates/builtin/README.md describe the two roots.

Backwards compatibility

Compatible: every shipped page loads and renders as before. An operator folder that holds only <id>.html panel overrides adds no dashboard page and no problem.

Removes nothing: the change adds a root and a renderable source; no page, key, route or record goes away.

Tests

test/test_dashboard_operator_pages.py is new. It runs on a scratch data home only. It locks in:

  • an operator page is served with origin user; an absent folder is empty, not a problem;
  • a builtin claim in the operator folder is refused, and a user claim in the shipped folder too;
  • a shipped id wins a clash, and the clash is reported;
  • a linked folder, a linked page directory and a linked file are each refused;
  • a page directory and a panel .html override do not see each other;
  • _trusted_page serves the operator page from the folder, not from a tampered stored copy, and refuses one that was removed or whose id a shipped page later takes;
  • the rendered body equals a shipped page's with the same markup, and the frame uses one sandbox and one CSP for every page;
  • an agent file-tool write under panel-templates/<id>/ is refused and a read is allowed, and the sandbox read-only seal, pre-create, no-alias and classification entries cover the folder.

test/test_dashboard_tools.py pins the two-value renderable set and keeps a shared record refused at adopt.

Determinism: the new file passed 3 times in a row with -n0, once with its tests in reverse order, and once under -n 4. 13 of its 20 tests failed on the tree before the change.

Manual verification

N/A — unit coverage sufficient: the change is backend catalog logic and its fences, and the tests drive the real catalog, store and render path.

Related Issues

Part of #18642

Merge order: this PR does not depend on the default-page PR or the flag-removal PR, and it can land any time after #19609.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • 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

@iamwhatever
iamwhatever requested review from a team and KiroCrewCaptain as code owners October 13, 2026 02:36
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 13, 2026
@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision a7b959c6c8c6218ae78fe3f7f11d6bc313f79800 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Advisory — does not block merge.

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of a7b959c6c8c6218ae78fe3f7f11d6bc313f79800 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Check that every sandbox mode, including Windows and off, seals panel-templates. Where an agent shell can write it, it now picks the dashboard page's script.

[DESIGN-REVIEWED] a7b959c

Description read

[DESCRIPTION-READ] 0ddac2fa184c1e4459581aa6e8ca6388f7a84448bd812b3cc875544dccef594b

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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of a7b959c6c8c6218ae78fe3f7f11d6bc313f79800 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: PASS

Nothing to check.

What this change ships

Inventory (7 items) — 7 justified

Intent: let an operator put their own dashboard page in the data home's panel-templates folder and have a crewmate's Dashboard tab render it. This is an ADDITION, licensed by Decision 3 of the second 2026-10-12 amendment in rfc-crewmate-dynamic-dashboard.md, which is partial on the base.

  1. The catalog now also lists page directories from <data home>/panel-templates/<id>/, with origin user. — justified
  2. A page from that folder can now be previewed, adopted and rendered, because RENDERABLE_SOURCES now holds {builtin, user}. — justified
  3. An operator page that reuses a shipped id is reported in problems and not served. — justified
  4. A linked page directory, manifest.json or template.html is refused and reported. — justified
  5. A linked panel-templates folder is reported, and the shipped pages still load. It reuses agent_panel.override_templates_dir. — justified
  6. The tab now shows nothing when the stored record's source differs from the catalog entry's origin, for example when a release later ships an operator page's id. — justified
  7. The adopt-refusal wording changed, and the catalog, instance-spec and builtin README prose now describe two roots. — justified

[FIRST-PRINCIPLES-REVIEWED] a7b959c

Description read

[DESCRIPTION-READ] 15876646028ad7e72d52e2916ebb5adaffc1db21383d3bd41b30a2f01d7db762

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] a7b959c

Verdict parsed from the review's SHA-scoped output markers for commit a7b959c6c8c6218ae78fe3f7f11d6bc313f79800.

False positive or not applicable? A repository writer can comment:
/ai-review override fable a7b959c6c8c6218ae78fe3f7f11d6bc313f79800: <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 13, 2026
@iamwhatever
iamwhatever force-pushed the feat/dashboard-operator-pages branch from cccfa05 to 9706834 Compare October 13, 2026 03:16
@iamwhatever

iamwhatever commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor Author
  • span=b049d24f44fe fixed in 9706834

fixed: the markup-call refusal is removed from catalog.py, its test, the spec and the README.
Decision 3 records only "never shadows a shipped id" and "a linked entry is refused"; both stay.
self-added: yes
mechanism: optional sink substring screen on operator pages

@iamwhatever

Copy link
Copy Markdown
Contributor Author

Disposition: rebutted (answer to the PASS punchline).

The operator page and the panel <id>.html override sit in the same panel-templates folder.
They share every fence: read-only seal, pre-create, no-alias, file-tool write gate.
So an unsandboxed shell has the same reach over both; this PR adds no new residual.
The PR edits no sandbox or file-gate entry; test_dashboard_operator_pages.py pins each fence for <id>/template.html.

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of a7b959c6c8c6218ae78fe3f7f11d6bc313f79800 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] a7b959c

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

@iamwhatever
iamwhatever force-pushed the feat/dashboard-operator-pages branch 2 times, most recently from 5777f83 to 88a2db3 Compare October 13, 2026 03:50
@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=f1c11a74f48a fixed in 88a2db3

fixed: catalog.operator_dir is removed; list_templates calls agent_panel.override_templates_dir directly.
self-added: yes
mechanism: one-caller alias of override_templates_dir

@iamwhatever

Copy link
Copy Markdown
Contributor Author

Answer to the PASS punchline: rebutted, no new residual.

The seal is the same one the panel <id>.html overrides in this folder already rely on; this PR edits no sandbox or file-gate entry.
Beyond the seal, the file-tool write gate and the no-alias refusal also hold for <id>/template.html; test_dashboard_operator_pages.py pins all five fences.
A harness with no sandbox has the same reach over the panel overrides today; that residual is unchanged here.

@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 13, 2026
@iamwhatever
iamwhatever force-pushed the feat/dashboard-operator-pages branch from 88a2db3 to a7b959c Compare October 13, 2026 04:24
@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=271c07ee6a0c fixed in a7b959c

fixed: _trusted_page refuses when the catalog entry's origin differs from the record's source; test_trusted_page_refuses_when_a_shipped_page_takes_an_adopted_operator_id.
self-added: no
mechanism: origin check in _trusted_page

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=83ff70cffd12 fixed in a7b959c

fixed: the id may still resolve to the shipped page in the catalog, but _trusted_page refuses to run it for a user record.
self-added: no
mechanism: origin check in _trusted_page

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=10f948876fef fixed in a7b959c

fixed: the shipped script never runs under the operator's manifest: origin mismatch returns None, so the tab draws its unavailable state.
self-added: no
mechanism: origin check in _trusted_page

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • span=6af0856b3537 fixed in a7b959c

fixed: the refusal is logged with slug, id and both origins, and the tab no longer shows a page the operator did not adopt.
self-added: no
mechanism: origin check in _trusted_page

@iamwhatever

Copy link
Copy Markdown
Contributor Author

Answer to the PASS punchline: confirmed, and intended.

_check accepts a user manifest, but every executed byte comes from catalog.load_one by id via _trusted_page.
An agent-authored page never reaches the catalog: stage_preview refuses authored html/manifest (AUTHORED_PAGE_REFUSAL), and panel-templates is fenced from agent writes.
_trusted_page also refuses when the catalog origin differs from the record's source.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

Answer to the PASS punchline: rebutted, no new residual.

The seal on panel-templates is unchanged here; the panel <id>.html overrides in the same folder already depend on it in every sandbox mode.
Where a harness runs with no sandbox, an agent shell already reaches those overrides; this PR adds the same reach, not a new one.
The file-tool write gate and the no-alias refusal hold in every mode; test_dashboard_operator_pages.py pins them for <id>/template.html.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Oct 13, 2026
@chenmingwei23
chenmingwei23 merged commit 76ccd4c into main Oct 13, 2026
102 checks passed
@chenmingwei23
chenmingwei23 deleted the feat/dashboard-operator-pages branch October 13, 2026 05:31
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 13, 2026
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.

2 participants