Skip to content

feat(dashboard): a crewmate's own page goes live on apply - #20974

Merged
iamwhatever merged 2 commits into
mainfrom
fix/20354-dashboard-package-live
Oct 17, 2026
Merged

iamwhatever merged 2 commits into
mainfrom
fix/20354-dashboard-package-live

Conversation

@iamwhatever

@iamwhatever iamwhatever commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A crewmate's own dashboard page goes live as soon as it is saved, dashboard_write keeps 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_apply of a staged package and its ?preview=1 read both answer 409 package_display_pending. Binding a package by any other route freezes every dashboard_write for that crewmate, and no verb undoes that. Today the only workaround is for a person to copy a template folder into panel-templates by 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

  • Loosening frame containment: sandbox="allow-scripts" only, CSP with connect-src 'none', the model allowlist, values as text.
  • Letting a worker write another crewmate's package, or rendering a sender's page.
  • Packages for root sessions. The hosted-page reader resolves crewmate bindings only.
  • The 128 KiB view.html cap.

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").

  • Decision 1: apply makes a page live, as a version.
    • dashboard_save stores the caller's own package and does not move the page.
    • dashboard_apply with no arguments puts that package live.
    • dashboard_apply with a template_id puts a builtin or operator template live.
    • Neither apply needs a preview first. dashboard_preview stays only as a look; it changes nothing.
    • Every apply and every rollback writes an instance version. A template apply releases the package.
    • dashboard_rollback restores each version's own page in force, so one call goes back to an earlier package or to a template.
  • One answer for the page and the write.
    • A package apply pins a gateway-owned snapshot of the page: crew-panels/<slug>.dashboard-page.<digest>.json. That folder is outside the crewmate's shell-writable members/ tree, and the instance version pins its digest.
    • instance.pinned_package and instance.keeps_older_package_rule answer both member_dashboard._serve and dashboard_package.read_package_model.
    • So dashboard_write is checked against the package's own model.types and keeps working once a package is live.
    • An enum field in a package keeps its declared choices as its write shape (Shape(kind, enum=tuple(choices))), so dashboard_write refuses a value outside them.
    • Later artifact writes, a delete-and-save under the same slug, or artifact version pruning cannot move or drop a pinned page.
    • An older record under the lock keeps its template, for the page and the write alike.
  • Decision 3, unchanged:
    • RENDERABLE_SOURCES is still {builtin, user}.
    • AUTHORED_PAGE_REFUSAL stays, reworded to name dashboard_apply.
    • Frame containment: allow-scripts only, connect-src 'none'.
    • The owner write gate: bound_to comes from the vetted caller, and binding_refusal refuses a page bound elsewhere.
    • The layout lock refuses apply and rollback.
    • Route auth: the strict-internal /api/agent-panel prefix, and the owner-only page read.
  • Decision 4, the guard.
    • catalog.PAGE_SINKS is the one list of value-to-code calls: innerHTML, outerHTML, insertAdjacentHTML, document.write, document.writeln, eval(, Function(, createContextualFragment, DOMParser, parseFromString, setHTMLUnsafe, parseHTMLUnsafe, srcdoc, and setTimeout/setInterval with a string.
    • A test holds every shipped template page and gallery package to it.
    • The catalog scan reports an operator (user) page that uses one as a problem and does not serve it.
  • Docs: the dashboard skill, the tool descriptions, the member and dashboard-manager prompts, docs/system-specs/modules/artifacts.md and the feature map.
  • A root session cannot save or apply a package (session_package_unsupported). The hosted-page reader resolves crewmate bindings only.
  • The 128 KiB view.html cap 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_save answers saved instead of staged, and is followed by dashboard_apply.
  • dashboard_apply with no arguments applies the caller's saved package instead of a staged template preview.
  • A root-session package save is refused.
  • An operator page that uses a PAGE_SINKS call 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: _commit now calls discard_preview(slug), so any new instance version (an adopt, an apply, an edit or a rollback) drops a staged preview, and Keep or Discard after that finds nothing staged.

  • Reader: src/kiro_crew/mcp_panel.py:dashboard_save/dashboard_apply -- chat -- updated to the new reply and argument; test_the_tool_sends_only_the_three_declarations
  • Reader: src/kiro_crew/dashboard/handlers/member_dashboard.py:_serve (staged-package preview branch removed) -- crew page -- a package is never staged; test_a_package_left_staged_by_an_older_gateway_is_nothing_to_preview
  • Reader: src/kiro_crew/dashboard_templates/instance.py:stage_package_preview/staged_package_preview/PackagePreview (removed) -- chat -- only callers were the save and apply routes in this diff
  • Reader: src/kiro_crew/dashboard_agentic.py:PACKAGE_DISPLAY_PENDING/display_pending_refusal (removed) -- chat -- only caller was the write guard removed here; test_a_live_package_checks_the_write_against_its_own_model
  • Reader: src/kiro_crew/dashboard_templates/catalog.py:list_templates -- crew page -- a user page with a sink becomes a listed problem; test_an_operator_page_with_a_sink_is_a_problem_and_not_served
  • Reader: src/kiro_crew/dashboard_package.py:_from_package -- chat -- returns the package Model; TestTheRealPackagePath, TestTheRealGateAndStore
  • Reader: test/test_session_dashboard.py root-session apply -- chat -- applies by template_id; test_a_root_session_writes_its_own_page

Tests

  • test/test_dashboard_template_sink_ban.py:
    • every shipped page and gallery package passes catalog.page_sink
    • each kind of sink is caught
    • an operator page with a sink is a problem and is not served
  • test/test_dashboard_save_tool.py:
    • save stores and apply puts it live
    • a second save updates the same package under its read
    • one rollback goes back to a package or to the template
    • the page read follows the record (pinned, locked, released)
    • a pinned page survives artifact delete-and-recreate
    • only pinned snapshots are kept
    • an older locked record checks writes against its template
    • a template applies without a preview
    • a locked layout refuses the apply
    • a root session is refused
    • dashboard_write is checked against the package model
  • Updated pins:
    • prompt hashes in test_context_composition_contract.py
    • test_agent_refactor_spec_bytes.py goldens, which can only be taken from CI's output
    • staging-era assertions in test_dashboard_tools.py, test_dynamic_dashboard.py, test_member_dashboard_routes.py, test_agent_panel_routes.py and test_session_dashboard.py
  • Ran the dashboard, panel, MCP-panel, skill, validation and contract test files locally: 7,423 passed. flake8, isort, black and mypy are clean on the changed files. I did not run the full suite.

Manual 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 existing atomic_write and crew-panels helpers, 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

  • 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

Contribution License Agreement

Contributed under the project's Apache-2.0 license.

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

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 1fedfef65c0f73c986dffc23a65cbb828fadd9ee 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 15, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ human override accepted

@iamwhatever overrode this lane for 1fedfef65c0f73c986dffc23a65cbb828fadd9ee via /ai-review override (this commit only).

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — 🟡 CONCERNS

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

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

  • Rollback differs from the RFC. The 2026-10-15 amendment's Decision 1 table says a package goes back with ``artifact_revert (package). The PR pins a gateway-owned snapshot (`crew-panels/.dashboard-page..json`) and moves package rollback to `dashboard_rollback`. As a result, `artifact_revert` no longer changes the page, but the RFC still says it does. `rfc-crewmate-dynamic-dashboard.md` is not in this diff. The next change that builds the person-facing apply/rollback buttons the RFC promises will build on the wrong verb. The pin design looks like the better one. It still needs to be written down.
    `Clears when: a maintainer-accepted RFC amendment records `dashboard_rollback` as the package rollback verb and says `artifact_revert` does not move a live page, or the PR is changed to match the RFC.`
  • The old rule has no exit. keeps_older_package_rule keeps the old lookup ("binding plus newest version a person cut") for any unlocked record that has no package key. Both _serve and read_package_model now branch three ways: pinned, released, or the old rule. Nothing ever migrates an older record off the old path. So two rules for "which page is live" stay in the page read and the write check indefinitely, and every later change has to keep them in step.
    Clears when: the PR names what retires the old rule (for example, rewriting old records to pin or release on first read or on gateway start), or records why keeping it forever is intended.

[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 .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 15, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

Two 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 — read_instance (and _read_page in dashboard_agentic.py:831) only looks at the package when if getattr(record, "package_slug", ""): is true. A record written before this change, with no lock, has no package_slug but stays on the older rule (keeps_older_package_rule). If its bound package has a version a person cut, _serve draws that package and dashboard_write checks values against the package's Model. Meanwhile dashboard_fields lists the template's fields, and the [DASHBOARD] block says "template X" and names the template's fields. The agent then writes to fields the page in force does not declare, and those writes are refused. → Fix: in both readers, call read_package_model(slug) whenever package_slug is set or keeps_older_package_rule(record) is true, and use its Model when from_package is set.

[OPUS-REVIEWED] 1fedfef

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

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

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 1fedfef

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

@iamwhatever

Copy link
Copy Markdown
Contributor Author

Review dispositions for a6967cad32. Fixed in 493ef68296. I verified each finding in the code before fixing it.

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: crew-panels/<slug>.dashboard-page.<digest>.json, beside the person's lock and outside the shell-writable members/ tree. The instance version pins {slug, version, digest}, and the page read and the write check both read that snapshot through instance.pinned_package.

  • F1 (instance.py:341, recreated artifact replaces a locked page). Fixed. A pinned page is served from the snapshot and its digest is checked, so deleting the artifact and saving it again under the same slug cannot change the page. Test: test_the_pinned_page_survives_whatever_happens_to_the_artifact.
  • F2 (dashboard_package.py:209, older locked record checked against another model). Fixed. instance.keeps_older_package_rule is false under the lock, so an older locked record uses its template copy for both the page read and the write check. Test: test_an_older_locked_record_checks_writes_against_its_template.
  • F3 (instance.py:1253, artifact pruning drops a pinned page). Fixed. A pinned page no longer depends on artifact versions. A save prunes only the snapshots that no kept version, current record or lock pins. Test: test_only_pinned_pages_are_kept_after_a_save.

Opus advisories, both fixed:

  • dashboard_package.py:233, falling back to the current version. Dropped. An older record with no person-cut version now answers empty, so the write falls to the template, matching what the page draws. A broken current package still answers error.
  • dashboard_package.py:273, instance_version=pinned. instance_version now comes from the instance record. The artifact version is carried in manifest.version.

Also re-pinned test_agent_refactor_spec_bytes to CI's digests for the updated dashboard-manager prompt.

@iamwhatever
iamwhatever force-pushed the fix/20354-dashboard-package-live branch from 493ef68 to f6a9122 Compare October 15, 2026 23:36
@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 16, 2026
@iamwhatever
iamwhatever force-pushed the fix/20354-dashboard-package-live branch 2 times, most recently from c050132 to d57fc0e Compare October 16, 2026 00:09
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Review dispositions for f6a9122b72. Both findings are fixed in d57fc0ea9d. I checked each one in the code before fixing it.

  • Design BLOCK: a commit leaves the staged preview behind. Fixed. instance._commit now discards the staged preview under the instance lock on every committed version: adopt, a package apply, rollback and edit. The tab therefore never offers a Keep for a page that is not the next step. Test: test_any_apply_drops_a_preview_left_staged.
  • GPT 6.1 BLOCK at instance.py:1363: a concurrent apply can delete the page it commits. Fixed. apply_package now writes the snapshot, commits the version that pins it, and prunes, all inside one _locked(instance_dir(slug)) section. A concurrent prune can no longer see a snapshot before the record that pins it. Test: test_a_concurrent_prune_never_drops_the_page_being_committed.

Also in this push:

@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 16, 2026
@iamwhatever
iamwhatever force-pushed the fix/20354-dashboard-package-live branch from d57fc0e to 0d51ed6 Compare October 16, 2026 00:38
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Review disposition for d57fc0ea9d, fixed in 0d51ed63a4. I checked the finding in the code before fixing it.

  • GPT 6.1 BLOCK at dashboard_package.py:221: package writes discard declared enum constraints. Fixed. member_dashboard_fields.package_manifest now keeps an enum field's choices as the Shape(enum=...) of its FieldSpec. dashboard_agentic.check_write already enforces a shape's enum, so a value outside the declared choices is refused before it lands. Test: test_a_package_enum_keeps_its_choices_for_the_write_check.

Also in this push:

  • Fixed the mypy error in mcp_panel.py (a variable name was reused).
  • Re-pinned the test_agent_refactor_spec_bytes goldens to the digests CI printed for the updated dashboard-manager prompt.

@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 16, 2026
@iamwhatever
iamwhatever force-pushed the fix/20354-dashboard-package-live branch from 0d51ed6 to dd82bec Compare October 16, 2026 01:06
@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 16, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Review dispositions for 0d51ed63a4, fixed in dd82beca89. I checked each finding in the code.

  • GPT 6.1 BLOCK at instance.py:1304: an incomplete version scan deletes still-pinned pages. Fixed. _referenced_digests is now complete or it raises. It raises when the versions directory cannot be listed, when a kept version cannot be read, or when a lock record cannot be read. _prune_page_snapshots already catches that and prunes nothing, so a transient read failure leaves every snapshot in place. Test: test_a_scan_that_cannot_read_a_kept_version_prunes_nothing.

  • First Principles CONCERNS: item 4, the snapshot store duplicates artifact versions. I am keeping it, and this reply is the evidence the "Clears when" line asks for. Pinning {package_slug, package_version} and reading those bytes from the artifact store was this PR's first design (head a6967cad32). GPT 6.1 upheld three fenced blocking findings against it, and each is an artifact version moving or vanishing under a pin:

    • F1, instance.py:341: deleting the artifact and saving it again under the same slug re-mints version 1, so a locked page is replaced by a different page.
    • F3, instance.py:1253: ArtifactStore keeps at most MAX_VERSIONS = 50 (artifacts_disk.py:65), so 50 layout-changing artifact_update calls prune the pinned version, and the page in force is lost.
    • Both are now tests that fail against an artifact-version pin: test_the_pinned_page_survives_whatever_happens_to_the_artifact and test_only_pinned_pages_are_kept_after_a_save.

    The RFC's "one new package version, now bound and live" still holds: the apply records the artifact version it put live (package.version). The snapshot is what keeps that version's bytes from moving, which the artifact store does not promise.

    artifact_revert still works on the package. But on its own it does not change the page in force; dashboard_apply puts the reverted package live. dashboard_rollback is the one-call way back for both packages and templates.

@iamwhatever
iamwhatever force-pushed the fix/20354-dashboard-package-live branch from dd82bec to dc266ec Compare October 16, 2026 01:41
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Review disposition for dd82beca89, fixed in d1d72e0f14. I checked the finding in the code.

  • GPT 6.1 BLOCK at agent_panel.py:2160: recheck ownership on the token-bearing read. Fixed. The save now parses the record read with its token and refuses, writing nothing, unless that read still carries the caller's own bound_to. The update is then fenced on that same read's token. _apply_own_package makes the same check on the bytes it puts live. Test: test_a_package_rebound_before_the_fenced_read_is_not_written.

  • First Principles BLOCK: the snapshot store and package rollback depart from the amendment's "artifact_revert (package)". This needs a maintainer decision; I am not overriding it. The trade-off:

    • Keeping it: GPT 6.1 upheld three fenced findings against pinning artifact versions directly. A recreated artifact replaces a locked page, and MAX_VERSIONS = 50 pruning drops the pinned page.
    • Removing it: going back by artifact_revert matches the RFC text, but a page that artifact_revert moves cannot be held by the person's lock, and those findings come back.

    Either an override recording this as the chosen design, or a direction to remove the snapshot and accept the two residual risks, settles it.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

Correction to the disposition above: the fix is in head dc266ec5d1881a73c537bce05b627f43c73328c9, not d1d72e0f14.

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 16, 2026
iamwhatever pushed a commit that referenced this pull request Oct 16, 2026
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
@iamwhatever

Copy link
Copy Markdown
Contributor Author

GPT 6.1 dispositions for 04a6ba2fc1, fixed in 72818af317. I checked both findings in the code. Both are real.

  • F1 agent_panel.py:2204: two first saves at once bind two packages. Fixed. The binding lookup and the create or update it decides now run under a per-crewmate lock, instance.package_save_lock. It uses its own lock file beside the instance lock, so a save never waits on an apply. Test: test_two_first_saves_at_once_bind_one_package. It holds the first lookup until a second one arrives, and it reddens without the lock (two artifacts, fleet-crew-dashboard and fleet-crew-dashboard-2).
  • F2 member_dashboard.py:550: the ?preview=1 read lost its exception boundary. Fixed. A store refusal there answers through _refusal again (dashboard_failed), not aiohttp's bare 500. Test: test_a_preview_read_the_store_refuses_answers_in_the_stores_words. It reddens without the boundary.

The PR is still two commits. The fixes are folded into the second one.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 16, 2026
@iamwhatever
iamwhatever force-pushed the fix/20354-dashboard-package-live branch from 72818af to 10bcfcd Compare October 16, 2026 19:46
@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 16, 2026
iamwhatever pushed a commit that referenced this pull request Oct 16, 2026
#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
iamwhatever pushed a commit that referenced this pull request Oct 16, 2026
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
@iamwhatever

Copy link
Copy Markdown
Contributor Author

GPT 6.1 disposition for 72818af317 (its verdict was withheld from the PR by a publish failure; read from the run artifact), fixed in 10bcfcde01.

  • dashboard_package.py:295: a recreated artifact between the two reads. Real, and new in this PR. The write check now compares record identity (_record_identity) between the binding read and the person-cut versioned read, as _serve_package already does, and refuses with state: error on a mismatch. Test: test_the_write_check_refuses_a_package_replaced_between_its_two_reads, which reddens without the guard.

Also on this head: the Backend Lint line cap. instance.py is back under 2,000 lines, and the new save tests moved to test/test_dashboard_save_tool_older_rule.py so test_dashboard_save_tool.py stays under the cap.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: checking Automated validation is still running labels Oct 16, 2026
@iamwhatever
iamwhatever force-pushed the fix/20354-dashboard-package-live branch from 10bcfcd to a1bcbee Compare October 16, 2026 21:30
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: passed Eligible automated validation passed for the current revision merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Oct 16, 2026
Joe Guo added 2 commits October 16, 2026 22:34
…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.
@iamwhatever

Copy link
Copy Markdown
Contributor Author

/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.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@iamwhatever marked the first-principles AI finding as false positive, not applicable, or explicitly accepted for 1fedfef65c0f73c986dffc23a65cbb828fadd9ee.

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.

This decision applies only to this commit. A new push requires a new judgment.

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.

Regression: a crewmate's dashboard page can be saved but never previewed or kept

3 participants