Repository navigation
feat: apply the bundled built-in dashboard when importing a Bot - #36569
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the step reuses the existing owner-only, card-only import-step shape, adopts only into an empty slot, and Undo is fingerprinted and fails safe (keeps the page) where it cannot pin the removal walk. Notes
[DESIGN-REVIEWED] b551187 Description read[DESCRIPTION-READ] 6eea48c0d8a8736dc1da184491c9323f06552cb76fa432cc311a851c73b40031 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) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Fixes #35701. The base RFC already covers the shape: What this change shipsInventory (10 items) — 9 justifiedIntent: when someone imports a shared Bot, it should arrive with the built-in dashboard the sender chose, and Undo should take that dashboard back. This is an ADDITION.
[FIRST-PRINCIPLES-REVIEWED] b551187 Description read[DESCRIPTION-READ] 4402396e1c715dd5d8d2d68441dcfbaf2f44ed50f5031ca90db63435b8afede8 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 — ✅ 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: |
|
VERDICT CHANGES at ce1f783 Non-author review, read-only. Head read by GraphQL at 2026-11-13T10:55:30Z (DRAFT, 2 commits, base b9ddf79). I ran the tests and mutation checks locally (Python 3.12.16, CI pins, pytest -n 0). One blocking finding, everything else is fixed. BLOCKING
NON-BLOCKING
CHECKED AT THIS HEAD
TESTS (python 3.12.16, CI pins, -p no:cacheprovider -n 0)
MUTATIONS (each applied alone, file restored, git status clean): lock removed, template compare, version compare, O_NOFOLLOW, record unlink, preview/history/versions kept, versions open moved after unlink, versions link guard, Windows fallback to 409, card-only check, builtin-origin check (handler and bundle), card hook flag, stale check and after-written compare, undo step without version, slug guard, three broadcasts, three log lines: each caught by at least one test. None survive. CI at 10:55:30Z (rollup FAILURE): red are GPT 6.1 Review (text not read by me) and New-test stability (windows-latest) (cause reproduced above, finding 1). Backend Tests (3.12 and Windows), Windows Fail-Closed Sandbox Contract, Electron Shell Tests, E2E and PR Readiness were still running or queued. Source Gates, Flake Pattern Ratchet, Await Fast Gate and Coverage Gate are green. I did not read CI logs. NOT CHECKED: full CI results beyond the above; the GPT 6.1 text; the 52-file local run in the PR body; merge with the current main tip (9807bdd); an end-to-end double import. |
ce1f783 to
afd0b4c
Compare
|
VERDICT APPROVE at afd0b4c (previous reviewed head ce1f783) Non-author review, read-only. The head moved by a force-push onto a newer main (base ca95636). I fetched both heads by sha and compared the trees of the 14 PR files: the only changes since ce1f783 are the two below. WHAT CHANGED (ce1f783 -> afd0b4c)
OPEN ITEMS (all non-blocking, none new)
CHECKED AT THIS HEAD (python 3.12.16, CI pins, pytest -n 0)
CI at 11:28:37Z (GraphQL, rollup FAILURE, 46 success, 20 skipped, 19 in progress, 7 failed): red are Dependency License Gate, Design Review, First Principles Review, GPT 6.1 Review, Opus 5.5 Review, Publish readiness signal and UX Review. I have not read their text. All seven turned red together on the new head, while the Backend Tests (Linux and Windows), Build Desktop and E2E were still running, so they may be a bot or quota error rather than code; the author should read them. Source Gates, Flake Pattern Ratchet, Await Fast Gate and Coverage Gate are not in the red list. My verdict covers code and tests only. NOT CHECKED: the text of the seven red checks; the 53-file local run in the PR body; an end-to-end double import. |
bolichen97
left a comment
There was a problem hiding this comment.
Requesting changes on one part. I read the whole diff, tests and docs included. The card step, the card-only gate, the shipped-template check, the pinned removal and the Undo guard all look right to me, and all 104 checks are green.
The part to change: the dashboard step can replace a dashboard the owner already has, with no consent.
instance.adoptover an existing instance is allowed and is an ordinary version bump (its docstring on main says so).api_member_import_dashboardcalls it without checking whether the new Bot's slug already holds a page.- The PR's own
remove_adopteddocstring names this case: "the adopt landed on a leftover instance of an older Bot with the same slug". A plain Bot delete leaves the dashboard behind (test_a_plain_bot_delete_and_a_create_undo_leave_the_dashboardpins that), so importing a Bot onto such a slug replaces that page with the built-in one. The card only shows thedashboard_templaterow, so pressing it does not say a page will be replaced. - Undo then removes the leftover's retained versions too, and the docstring marks that "accepted". So a page the owner built is both replaced on apply and gone after Undo.
Please keep an existing page. Either:
- Skip the adopt when the slug already holds a page (answer 200 and record no
instance_version, so the import goes on and the Undo plan, which already leaves the page out without a recorded version, has nothing to remove)._import_after_is_writtenneeds to accept that case. Or - Show on the card that an existing dashboard will be replaced, so the press is the consent, and have the Undo restore the previous version instead of removing the history.
A test for an import onto a slug that already holds a page would pin either choice.
I will look again when the head moves.
4708a65 to
9421646
Compare
|
The head moved to 9421646 (still two commits). Option 1 was taken: an import onto a slug that already holds a dashboard now keeps that page and its versions (no adopt, answer 200 with kept_existing, no instance_version), and Undo leaves it alone. Tests cover the occupied slug, the Undo after it, and the empty slug. |
|
VERDICT CHANGES at 9421646 (old reviewed head afd0b4c) Non-author, read-only delta review. Head read by GraphQL at 2026-11-13T15:42:55Z: DRAFT, OPEN, 2 commits (4889162 tests, 9421646 fix), base d4b0a0b. I read the whole diff against the merge base and the delta against the old head (trees, history was rewritten), and ran the code. The human reviewer's concern is FIXED for every page the gateway can read. One hole of the same kind is left, with a small fix. 1. BLOCKING: an unreadable record is still replaced (same class as the human finding)src/kiro_crew/dashboard_templates/instance.py:1221 keeps a page only when 2. The human reviewer's concern: FIXED (ran it)
3. Non-blockinga. Same helper duplicated (see 1); two functions named adopt_if_empty now exist in dashboard_templates. 4. Earlier findings re-checked at this headBroadcast in POST and in DELETE-removed only (B1, B2, B3 caught; none on kept_existing, B4 caught): FIXED. history.json and preview.json unlinked (M6a, M6b caught): FIXED. Record unlinked last (R1 caught, retry test): FIXED. caplog assertions for the log lines (L1, L2, L3, L5 caught): FIXED. Windows-safe tests (needs_pinned_walk, stale request inside the guard): FIXED, with supports_pinned_walk patched False: 64 passed, 9 skipped, 0 failed. Pinned versions folder opened before the first unlink (V1 caught; the order test passes): FIXED. Lock (M1 caught): FIXED. Undo after an edit refused (M10, M11 caught): FIXED. Idempotent remove / adopt after remove starts at v1: FIXED. Pins on the new base: the reach file passes. Naming: no added prose line names the product. Not done by design (unchanged, non-blocking): no card line on Windows keep; older same-slug versions are removed when the import's own page is undone (now only the import's own history, since an occupied slug is never adopted over). 5. Tests run (python 3.12.16, CI pins, kc-heavy, nice 10, -n 0, -p no:cacheprovider)
6. Mutations (each alone, file restored with git checkout, git status clean at the end)CAUGHT: M1 no lock; M2 no version compare; M3 no template compare; M4b walk follows links; M5 keep versions; M6a keep preview; M6b keep history; M7 Windows 409; M9 no built-in origin check; M11 no version compare in after-is-written; M13 ships-builtin always true; M14 no card flag; M15 no slug guard; M16 no record unlink; B1-B4; L1, L2, L3, L5; V1; R1 (record first); N1 no occupied-slug guard (test_adopt_if_empty..., :719 page replaced v3); N2 guard on an empty slug (KeyError instance_version); N3 occupied answers a version so Undo removes it (KeyError kept_existing); N4 Undo step planned without a version; N5 kept case fails after-is-written; N6 handler uses plain adopt. 7. CI at 2026-11-13T15:42:55Z (GraphQL, head unchanged since the 15:24:11Z read)Rollup FAILURE. Red: Design Review, First Principles Review, GPT 6.1 Review, Opus 5.5 Review, Publish readiness signal, UX Review (the bot comments on the PR are for the old head afd0b4c, none for this head: likely re-run needed, cause not read), and a NEW red: Backend Tests (3.12, 3) (cause not read; I made no REST or log call). In progress: Backend Tests 3.12 shards 1, 4-8, Windows 1-8, E2E (stub ACP). Pending: PR Readiness (a gate). 48 success, 21 skipped. Gates ci-summary and PR Gate Summary not decided yet. The author should read shard 3 first. 8. Not checkedFull 53-file suite (CI runs it), a real Windows run, merge with the current main tip e995d0b (the pin file had no overlap at the base; not merged here), the card UI, the red CI bot texts. |
9421646 to
52e4ded
Compare
|
The head moved to 52e4ded (still two commits, rebased onto current main). Since 9421646: a slug whose dashboard record exists but cannot be read (a newer schema, or no template) is now kept byte-identical, using the same emptiness test as adopt_if_empty on main; tests cover both shapes, a page from an earlier import, and the kept log line. |
|
Holding this PR as a draft. On b790a48 the GPT 6.1 lane and the Windows new-test stability job both fail on one line: test/test_crewmate_import_dashboard.py:212 expects 409 for an Undo naming another template, but native Windows cannot pin the directory walk, so the route answers 200 with kept: true (the page is correctly left alone). Production code is not affected. The test fix branches on pinned_fs.supports_pinned_walk() (409 when pinned, otherwise 200 with kept: true); it is prepared locally and not pushed. Opus 5.5 reports no findings on this head. |
b790a48 to
c4add91
Compare
|
Re: GPT 6.1 finding at test/test_crewmate_import_dashboard.py:212. The head is now c4add91 (still two commits, same base as before). The only change is in that test: the mismatched-template Undo expects 409 when the platform can pin the directory walk, and 200 with kept: true otherwise (native Windows), which is what the route answers. No production code changed. |
Code change approver recommendation: A person should decideWhy: the decider thinks the change is probably fine but estimates a 14% chance that this change introduces a defect, above the 12% limit for approving on its own. Importing a Bot now applies the shipped built-in dashboard it names, through an owner-only step that runs only from the import card, and the card's Undo removes only that template at the version it adopted. Old cards keep their plan, recorded results and Undo, because whether the step is present depends on the card's stored "Not brought over" list. A slug that already holds a page, or a record this build can't read, is kept, the step records no version and the Undo leaves it. The page's template and version are part of what both the first Undo step and a resumed Undo compare. The removal opens every folder without following links and holds the instance lock; it opens Tier: 2, held for a person: changes requested. An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
|
This PR needs a maintainer before it can merge. Two things are open. The change request from @bolichen97 (posted at afd0b4c, about the dashboard step replacing an existing page) is still open. The PR also edits design docs (docs/feature-map/README.md, the crewmate share RFC and the dashboard instances spec). @bolichen97, please look at the current head again. It appears to take your option 1: the step adopts only onto an empty slug and answers 200 with kept_existing and no instance_version. Its Undo then leaves the page alone. Review result on this head: no blocking finding. The review checked these points:
Security: the new write and delete paths are reachable only by the owner through an armed import card. They never widen an agent-facing dashboard route, and they cannot remove a page the card did not adopt. Done well: the tests that replace a member or dashboard folder with a link after the folder is opened show that nothing behind the link is read or changed. Optional:
|
bolichen97
left a comment
There was a problem hiding this comment.
Re-reviewed head c4add91. My earlier change request (at afd0b4c: an existing page could be replaced without consent) is resolved. The step now goes through instance_adopt.adopt_if_empty, keeps any existing page or unreadable record, records no instance_version, and the Undo leaves it alone.
Also checked:
- It merges cleanly onto current
main(60d432d, 358 commits past this base). The code it depends on (instance,instance_adopt, the card catalog and plans,crewmate_bundle,change_cards_readers) has not changed onmainsince the base. - On the merged tree, this PR's tests pass (124), and so do the related suites: route table, boot chain pins, facade, feature map and line caps (2675).
- Both routes need an owner write plus the card-only flag that only the card hook sets. Only shipped templates are accepted. The removal works through pinned descriptors, opens
versionsbefore any delete, and deletes the record last. The Undo fingerprint covers both template and version.
I have no blocking findings. The code change approver asks for a person to decide, because of the size and the design-doc edits, so a maintainer signs off before I approve.
AI-assisted, sent by Bolin Review bot
…t card Red tests for an import card that adopts the bundle's built-in dashboard on the new Bot and takes that page back on Undo, only at the version it adopted: - the plan gets a dashboard apply step and a card-only DELETE undo step ahead of the Bot delete; both routes are hooked and write no memory line - Undo with a dashboard changed after the import is refused (409) and the page stays; an untouched one is removed before the Bot delete - the adopt and the removal tell open Dashboard tabs (dashboard_instance_changed); a refusal or a kept page does not - remove_adopted refuses another template or version, holds the instance lock, takes one path segment only, and leaves nothing but the lock file (history and preview go too) - where the page cannot be removed through directory descriptors (native Windows) the Undo still completes, the Bot is deleted and the page stays - a template the catalog gives under another origin is neither applied nor removed; an Undo without a recorded adopted version leaves the page out - a plain Bot delete and a create Undo leave a dashboard instance alone - a card stored before this step still undoes - the routes' log lines are constant text (no slug, path, template or error text) - a removal that stops half way keeps the record, so the Undo can be retried and finish - an import onto a slug that already holds a dashboard keeps that page and its versions: the step adopts nothing, answers no version, and the Undo has nothing of the import's to remove - the same holds for anything stored for the slug that this build cannot read (a newer-schema record, a record with no template): kept byte-identical, answered kept_existing, no broadcast, left by the Undo; a page from an earlier import (version 1) is kept; the kept line logs once
An import card whose bundle names a built-in dashboard the receiver ships
now ends its plan with a card-only step that adopts that page on the new Bot,
and the card's Undo takes it back before it deletes the Bot.
- POST/DELETE /api/members/{slug}/dashboard/template (owner-only, card-only,
shipped templates only); POST answers the adopted instance_version; both
tell open Dashboard tabs (dashboard_instance_changed) when the page changed
- the handler applies the page through instance_adopt.adopt_if_empty
- instance.remove_adopted removes the page only while the record still names
the adopted template at the adopted version, under the instance lock,
through directory descriptors (no rmtree by name); the record, versions,
staged preview and history file all go, so a later adopt on the slug starts
again at version 1; the record goes last, so a removal that stops half way
can be retried
- where directory descriptors are unavailable (native Windows) it raises
PinUnsupported and the DELETE answers 200 with kept: true, so the Undo
completes and the page stays, as after a plain Bot delete; the refusals and
the kept case log one line each (no slug)
- the dashboard {template_id, instance_version} joins the import card's
fingerprint (state read, after-write check, resumed-undo check); a card
stored before this step has no such key and is not compared
- deleting a Bot on its own does not touch its dashboard
- pins: MCP route table, two boot chain-order pins, facade manifests for the
new functions; feature-map row and RFC note
- an import onto a slug that already holds a dashboard keeps that page and all its
versions: the step adopts nothing (instance_adopt.adopt_if_empty, the one emptiness test: anything stored counts, readable or not), answers kept_existing with no
instance_version, and the card's Undo has nothing of the import's to remove
c4add91 to
b551187
Compare
bolichen97
left a comment
There was a problem hiding this comment.
Approving b551187 as the maintainer sign-off. Since my re-review at c4add91 this is a rebase onto current main; the only code-line difference is the pinned boot-chain baseline (_deferred count), which follows main. My earlier findings stand: an existing page is never replaced, only shipped templates are accepted, and the Undo leaves a kept page alone.
AI-assisted, sent by Bolin Review bot
Draft. Replaces #36544, #36499, #36469 and #36016 (each stays untouched by this PR). The two commits of this PR were rewritten once (force-with-lease on this draft branch, as the repository owner allows for a draft) to fold in the review findings below. They were rewritten again to keep an existing dashboard on import, per the review (option: skip the adopt when the slug already holds a page), and once more to keep a record this build cannot read as well (a newer-schema record, a record with no template), by using the repository's existing
instance_adopt.adopt_if_emptyinstead of a second emptiness test. The last rewrite is also rebased onto a main that carries #36652: the previous head failedtest_mate_conductor_parity.py::test_every_shared_rule_has_an_ultra_counterpart_or_a_named_gap(thegoal_planrule), a test this PR does not touch.Ticket: none
Problem / Motivation
Goal: Importing a Bot file that names a built-in dashboard sets that dashboard on the new Bot in the same import card, and the card's Undo takes it back.
Today the card shows a Dashboard row and lists the page under "Not brought over", so the receiver must open the new Bot's Dashboard tab and pick the same built-in page by hand. Follow-up issue: Fixes #35701.
Why it matters
A shared Bot arrives looking different from the one that was sent. The sender chose that page on purpose, and the receiver has no hint which page to pick.
Not a goal
user:) dashboards: still refused at import, unchanged.builtin:<id>text as before.What changed (motivation -> approach -> change)
The import plan had no dashboard step, so the row was display-only. Approach: reuse the existing owner-only, card-only step shape (as the import-files step) for both the apply and the Undo, instead of widening any agent-facing route or changing Bot deletion.
crewmate_bundle.py:dashboardTemplateis added to "not imported" only when the receiver's shipped catalog lacks that id.change_card_catalog_plans.py: when the page is applied, the plan gets aPOST /api/members/{slug}/dashboard/templatestep after the files step and before the crons; the Undo gets aDELETEof the same path, placed before the files, rules and Bot steps, only when the dashboard step was applied and answered the version it adopted.handlers/member_import_dashboard.py: owner-only, answers only an admitted import-card step, accepts only a shipped template. POST callsinstance_adopt.adopt_if_emptyand returnsinstance_version; DELETE callsinstance.remove_adopted. Both senddashboard_instance_changedwhen the page changed (not on a refusal, not when the page is kept). Registered inmcp_routes.py, listed inHOOKED_ROUTES(no memory line) and armed by the existing card hook inchange_cards.py.instance.remove_adopted: holds the instance lock, removes the page only while the record still names the adopted template at the adopted version, and removes the record, the staged preview, the history file and every retained version through directory descriptors pinned oneO_NOFOLLOWstep at a time from the data home (never by name, neverrmtree). A link anywhere on the way is refused and nothing outside is touched. Only the empty directory and its lock file stay, so a later adopt on the slug starts again at version 1 with no row of the removed import. It can only ever see the history the import itself began, because the step never adopts over an existing page.O_NOFOLLOW),remove_adoptedraisesPinUnsupported; the DELETE handler answers200 {"ok": true, "kept": true}and leaves the page, as a plain Bot delete does, so the Undo never refuses as a whole.change_cards_readers.py: the dashboard{template_id, instance_version}is part of the import card's fingerprint in_import_state,_import_after_is_written(the step response's version must equal the after-read) andresumed_undo_is_stale. A page changed after the import makes Undo refuse with 409 and a message that says what to do. A card stored before this step has nodashboardkey in its after-state and is not compared.test_dashboard_server_composition_contract_reach.pyon this base; facade manifests for the new helpers.Review findings carried over from #36499, #36469 and #36016:
instance.py, Opus 5.5 and GPT 6.1 on feat: apply the bundled built-in dashboard when importing a Bot #36469): fixed, see the Windows bullet; testtest_undo_completes_and_keeps_the_page_where_the_walk_cannot_be_pinned.dashboard_instance_changedafter adopt (member_import_dashboard.py, GPT 6.1 on feat: apply the bundled built-in dashboard when importing a Bot #36499) and after the removal (independent review of feat: apply the bundled built-in dashboard when importing a Bot #36499): fixed.history.jsonbehind (independent review of feat: apply the bundled built-in dashboard when importing a Bot #36499): fixed.remove_adopteddeleted the record, preview and history before it openedversionspinned, so a symlinkedversionsfolder ended in an uncaught error (a 500) after a partial removal (GPT 6.1 on feat: apply the bundled built-in dashboard when importing a Bot #36544,instance.py:1277): fixed. The folder is opened pinned before the first delete; a refused open is a 409 and nothing is lost. Teststest_remove_adopted_pins_the_versions_folder_before_it_deletes_anythingandtest_a_refused_versions_folder_is_a_409_not_a_500, both red on feat: apply the bundled built-in dashboard when importing a Bot #36544's code.K19-short-literal-duration-arg,test_remove_adopted_holds_the_instance_lock): fixed with a# flake-okreason on that line. Source Gates on feat: apply the bundled built-in dashboard when importing a Bot #36544 failed on a docs-lint error already on main (an RFC missing from its index, fixed by docs(rfc): restore the third-party agent tools grant row to the RFC index #36504); this branch is cut after it andscripts/docs-lint.shpasses locally.remove_adoptedraisesPinUnsupportedthere before it compares the version (GPT 6.1 on this PR,test/test_crewmate_import_dashboard.py, the stale-version DELETE assertion intest_the_undo_route_tells_open_tabs_only_when_it_removed_the_pageandtest_a_changed_page_logs_one_plain_line): fixed. The first now checks the stale-version 409 only where the walk can be pinned and still checks the kept case everywhere; the second is skipped where it cannot. The whole test file also passes with the pinned walk forced off (28 passed, 8 skipped).remove_adoptedremoved the record first, so a removal that failed part way could not be retried (reviewer of this PR,instance.py, non-blocking): fixed. The record is now removed last, so the Undo can run again and finish. Testtest_a_removal_that_stops_half_way_can_be_retried, red on the earlier order.caplogtest for each of the four lines (constant text at INFO, no slug, path, template id or error text).sandbox_argv.py(GPT 6.1 on feat: apply the bundled built-in dashboard when importing a Bot #36469): not applicable, it was base drift of an old branch; this diff touches 14 files, none of them that one.Non-blocking points from the review of #36499:
instance_adopt.adopt_if_empty, the existing helper: check and write under one lock, empty means no stored record at all). When the slug already holds anything, a page or a record this build cannot read (a newer-schema record, a record with no template; found by the reviewer of the previous head), it adopts nothing and leaves the stored bytes untouched, answers200withkept_existingand noinstance_version, sends no tab update, and the Undo plan, which leaves the page out when no version was recorded, has nothing of the import's to remove: the page and all its versions stay. The card result line stays the generic "Done" line and does not claim a dashboard was applied. Tests:test_the_adopt_step_keeps_a_page_the_slug_already_holds,test_an_import_onto_a_slug_with_a_page_keeps_it_and_its_undo_leaves_it,test_the_adopt_step_keeps_a_record_this_build_cannot_readandtest_an_import_onto_an_unreadable_record_keeps_it_and_its_undo_leaves_it(both for a newer schema and for no template, the record bytes compared before and after),test_the_adopt_step_keeps_a_page_from_an_earlier_import(version 1),test_the_adopt_step_that_keeps_what_the_slug_holds_logs_one_plain_line; the empty-slug apply and Undo tests are unchanged.logger.infoline (no slug). A card line saying the page stays: not done, UI wording is out of scope for this PR (the result line stays the generic one and claims no dashboard).adoptitself is not pinned, so a symlinkedmembers/<slug>ordashboardlets the POST write through the link: pre-existing, the other dashboard routes on main do the same; not changed here.test_remove_adopted_holds_the_instance_lock), the staged-preview and history removal, the not-shipped-origin refusal on both routes, an Undo without a recorded version, the origin check in_ships_builtin, and the one-path-segment guard.Backwards compatibility
Compatible: nothing that works today stops working. The new routes and plan steps are additive, deleting a Bot does not touch its dashboard (as before), and an import card stored before this step still undoes: it has no dashboard role and no
dashboardfingerprint to compare.Removes nothing: the only removal is of the page this card adopted, and only at the version it adopted.
Tests
Commit 1 holds only the tests; run against main's code (before commit 2) it gives 42 failed and 36 passed across
test_crewmate_import_dashboard.pyandtest_change_card_crewmate_import.py(4 of the 36 tests in the first file pass on main: they are guards, see below). Commit 2 holds the change and the pin updates.Local runs (pytest -n0, one file at a time, under 2 minutes each):
test_crewmate_import_dashboard.py+test_change_card_crewmate_import.py: without the change 42 failed / 36 passed; with it all pass (test_crewmate_import_dashboard.py: 45 passed, 78 with the card test file); the unreadable-record tests (both shapes, handler and card flow), the kept-line log test and the refused-adopt test also fail against the previous head of this PR (6 failed / 72 passed). The 4 tests that pass on main are guards for behaviour that must not change: a card stored before this step, a plain Bot delete and a create Undo leaving the dashboard alone, an id the receiver does not ship, and a page the catalog gives under another origin.test_change_card*,test_crewmate_*,test_dashboard_instance*,test_dashboard_templates*, template flow and manifest, the composition contract files including the pins, page offer, agent create template, b64 routes, client route contract, member goals cards, work-ledger facade, andtest_flake_pattern_ratchet.py).test_dashboard_server_composition_contract_reach.pypasses on this base (354 MCP route rows, digest unchanged, chain pins +2_deferredeach).scripts/docs-lint.shexits 0; black, isort and flake8 are clean on the changed files.test_facade_mirror_guards.pydoes not finish in 2 minutes as one file, so each of its tests is run alone: all 31 passed, none failed, on the final tree. Local mypy on the changed modules (Python 3.14) shows one error incli_gateway_boot.py:126(asyncio.PidfdChildWatcher), outside this diff; CI uses 3.12. The no-pin simulation (pinned directory walk forced off) gives 69 passed / 9 skipped for the two import test files.New in
test/test_crewmate_import_dashboard.py:test_a_shipped_builtin_dashboard_gets_an_apply_step_and_leaves_not_brought_over,test_a_builtin_id_the_receiver_does_not_ship_stays_out,test_the_step_is_in_the_import_undo_roles,test_the_route_is_hooked_and_writes_no_memory_line(POST and DELETE)test_the_card_step_sets_the_dashboard_on_the_new_bot(alsoinstance_version),test_only_the_card_step_and_only_a_shipped_template_are_accepted,test_the_adopt_tells_open_dashboard_tabs_and_a_refusal_does_nottest_undo_removes_an_untouched_dashboard_before_the_bot_delete,test_undo_with_an_edited_dashboard_is_refused_and_the_page_stays,test_undo_completes_and_keeps_the_page_where_the_walk_cannot_be_pinned,test_the_undo_route_is_card_only_and_names_a_shipped_template,test_the_undo_route_tells_open_tabs_only_when_it_removed_the_page,test_a_template_that_is_not_shipped_is_refused_by_both_routestest_a_refused_adopt_logs_one_plain_line,test_a_changed_page_logs_one_plain_line,test_a_kept_page_logs_one_plain_line,test_a_refused_removal_logs_one_plain_line(each drops out when its log line is removed)test_a_removal_that_stops_half_way_can_be_retried,test_remove_adopted_pins_the_versions_folder_before_it_deletes_anything,test_a_refused_versions_folder_is_a_409_not_a_500,test_remove_adopted_refuses_another_template_or_version_and_removes_nothing,test_remove_adopted_never_follows_a_member_directory_swapped_for_a_link,test_remove_adopted_leaves_only_the_lock_and_a_later_adopt_starts_clean,test_remove_adopted_holds_the_instance_lock,test_remove_adopted_takes_one_path_segment_onlytest_a_resumed_undo_compares_the_dashboard_only_when_the_card_recorded_one,test_an_edit_saved_while_the_import_ran_is_never_the_undo_baseline,test_an_undo_without_a_recorded_adopted_version_leaves_the_page_out_of_its_plantest_adopt_if_empty_adopts_an_empty_slug_and_keeps_a_page_it_finds,test_the_adopt_step_keeps_a_page_the_slug_already_holds,test_an_import_onto_a_slug_with_a_page_keeps_it_and_its_undo_leaves_ittest_an_old_import_card_without_a_dashboard_step_still_undoes,test_a_plain_bot_delete_and_a_create_undo_leave_the_dashboard,test_a_page_the_catalog_gives_under_another_origin_is_not_appliedAlso:
test_import_shares_the_create_state_read_and_partial_lineasserts the "its dashboard" partial line. Tests that need a pinned directory walk are skipped where the platform lacks it.Manual verification
N/A - unit coverage sufficient: the route, the plan, the Undo and the removal are exercised end to end in the tests above. The card text changes in one place (a shipped page no longer appears under "Not brought over"); it is the existing row renderer, with no new component, so no screenshot is attached.
Related Issues
Fixes #35701
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license.