Move-Bundle Cross-Provider E2E Checklist
Use this checklist to verify cross-broker bundle transfer (scion reincarnate <agent> --broker <target>, transferMode: "bundle") end-to-end across compute providers before graduating hub.agent_move_bundle or cutting a release that touches move-bundle code.
For user and operator documentation of the transfer-mode ladder, limits, exclusions, and refusal reasons, see Moving an Agent to Another Runtime Broker.
Prerequisites
Section titled “Prerequisites”- A Hub configured with GCS object storage (
server.storage.provider: gcs, bucketBUCKET_NAME, Hub IDHUB_ID) and the recommended 7-day lifecycle rule onmove-bundles/(see Deploy on GCP — 1c. GCS Bucket). - The
hub.agent_move_bundleexperiment enabled on the Hub (andhub.k8s_nfs_homeenabled whenever testing Kubernetes NFS in pairs 2 and 3, with each Kubernetes agent started after enabling it):Terminal window scion hub experiments enable hub.agent_move_bundle# Required for Kubernetes NFS pairs (2 and 3):scion hub experiments enable hub.k8s_nfs_home - Online Runtime Brokers for the provider pairs under test, each linked to the test project and advertising
agentMoveandagentMoveBundle:Terminal window scion hub brokers info <broker-name> --json | jq '{name, status, capabilities: {agentMove: .capabilities.agentMove, agentMoveBundle: .capabilities.agentMoveBundle}}' - A Hub-managed git project using
clone-per-agent(--workspace-mode per-agent) and a Hub-managed non-git project usingempty-per-agent(--workspace-mode per-agentwithout a git remote). - A file-type Hub secret scoped to the test project (for example targeting
~/.config/scion-e2e/secret.txt) so you can verify that injected secrets are excluded from the bundle and re-injected on the target. - A handoff file that instructs the new generation to stay idle so the agent does not modify
/workspaceor$HOMEbefore verification runs:Terminal window printf 'Do not modify any files in /workspace or $HOME. Run `sciontool status idle "awaiting E2E verification"` and wait.\n' > /tmp/move-handoff.md
Standard Source Seed & Target Verification
Section titled “Standard Source Seed & Target Verification”Run these scripts inside the source agent before each happy-path move, and run the verification script inside the target agent after the move completes (before sending any work that modifies /workspace or $HOME).
How to run scripts in an agent container:
- Where Conduit SSH is enabled (
hub.conduit): pipe the heredoc throughscion ssh <agent> -- bash -euo pipefail -s(shown below). - Docker / Podman fallback:
docker exec -i <container> bash -euo pipefail -s(orscion attach <agent>and paste the body). - Kubernetes fallback:
kubectl exec -i <pod> -n <namespace> -- bash -euo pipefail -s(orscion attach <agent>). - Cloud Run fallback: when SSH and exec are unavailable, use
scion attach <agent>to run the checks interactively, or inspect the agent’sworkspace/andhome-<agentID>/directories directly on the Runtime Broker’s NFS mount.
Seed state on source agent
Section titled “Seed state on source agent”scion ssh <agent> -- bash -euo pipefail -s <<'EOF'cd /workspace# 1. Unpushed git commit (skip for empty-per-agent projects)if [ -d .git ]; then echo "unpushed-commit-data" > unpushed.txt git add unpushed.txt git -c user.name="E2E" -c user.email="e2e@example.com" commit -m "e2e unpushed commit"fi
# 2. Uncommitted change, untracked file, modes, empty dir, symlinksecho "uncommitted-edit" >> README.mdecho "untracked-content" > untracked.txtprintf '#!/bin/sh\necho ok\n' > run.sh && chmod 0755 run.shprintf 'private-key-material\n' > private.key && chmod 0600 private.keymkdir -p empty-dirln -s untracked.txt internal-link.txtln -s /etc/hosts escaping-link.txt
# 3. $HOME files: preserved vs excluded (plant unique source markers so targets# that legitimately inject their own ADC/config still pass verification)printf 'echo move-bundle-history-marker\n' >> "$HOME/.bash_history"printf 'keep-me-in-home\n' > "$HOME/notes.txt"mkdir -p "$HOME/.config/gcloud" "$HOME/.docker" "$HOME/.kube" "$HOME/.cache"printf 'source-adc-do-not-copy\n' > "$HOME/.config/gcloud/application_default_credentials.json"printf '{"auths":{"source-docker-marker":{}}}\n' > "$HOME/.docker/config.json"printf 'apiVersion: v1\n# source-kubeconfig-marker\n' > "$HOME/.kube/config"printf 'cache-bytes\n' > "$HOME/.cache/e2e-cache.bin"
# Record source token digest so we can verify it does not travelsha256sum "$HOME/.scion/scion-token" | awk '{print $1}'EOFSave the printed source token SHA-256 on your workstation:
export SRC_TOKEN_SHA="<paste-sha256-here>"Verify state on target agent
Section titled “Verify state on target agent”Pass $SRC_TOKEN_SHA as $1 so no local shell expansion happens inside the heredoc:
scion ssh <agent> -- bash -euo pipefail -s -- "$SRC_TOKEN_SHA" <<'EOF'SRC_TOKEN_SHA="$1"cd /workspace
# 1. Workspace content, modes, empty dir, symlinksif [ -d .git ]; then git log -1 --oneline | grep -q "e2e unpushed commit" test -f unpushed.txtfigrep -q "uncommitted-edit" README.mdgrep -q "untracked-content" untracked.txttest "$(stat -c %a run.sh)" = "755"test "$(stat -c %a private.key)" = "600"test -d empty-dirtest "$(readlink internal-link.txt)" = "untracked.txt"test ! -L escaping-link.txt
# 2. Preserved $HOME filesgrep -q "move-bundle-history-marker" "$HOME/.bash_history"grep -q "keep-me-in-home" "$HOME/notes.txt"
# 3. Source-only credentials and caches did NOT travel from source# (uses marker checks so targets that inject their own ADC/config still pass)! grep -qs "source-adc-do-not-copy" "$HOME/.config/gcloud/application_default_credentials.json"! grep -qs "source-docker-marker" "$HOME/.docker/config.json"! grep -qs "source-kubeconfig-marker" "$HOME/.kube/config"test ! -e "$HOME/.cache/e2e-cache.bin"
# 4. Target issued its own Hub token and re-injected secretstest -f "$HOME/.scion/scion-token"test "$(sha256sum "$HOME/.scion/scion-token" | awk '{print $1}')" != "$SRC_TOKEN_SHA"test -f "$HOME/.config/scion-e2e/secret.txt"echo "TARGET VERIFICATION PASSED"EOFProvider-Pair Checklists
Section titled “Provider-Pair Checklists”1. Docker ↔ Docker
Section titled “1. Docker ↔ Docker”Covers local-disk Runtime Brokers (docker, podman, or Apple container) that do not share an NFS export.
- Dry run selects
bundle:Expected output includes:Terminal window scion reincarnate <agent> --broker <docker-b> --dry-runTransfer mode:bundle (workspace and home are copied through hub storage (~...))workspace_storage_reported,same_export,workspace_on_exportmarkedwaived(without(--force)).bundle_experiment,workspace_bundleable,bundle_storage,capability,bundle_sourcemarkedpassed.- Consequences show
workspaceandhomecarried,harness-sessionandcredentialsrecreated, and nolocal-workloss.
-
--forcestill selectsbundle(never downgrades torecreate):Expected output includesTerminal window scion reincarnate <agent> --broker <docker-b> --dry-run --forceTransfer mode: bundle (...)and:--force was not needed: the workspace and home are copied through hub storage. - Execute Docker A → Docker B (
clone-per-agent):Wait for the agent to reachTerminal window scion reincarnate <agent> --broker <docker-b> --handoff-file /tmp/move-handoff.mdrunningon<docker-b>(scion list), then run the Verify state on target agent block. - Execute Docker B → Docker A (return leg): repeat
--dry-run, real move, and target verification back to<docker-a>. -
empty-per-agentproject: repeat--dry-run, real move, and target verification for an agent in a non-gitempty-per-agentproject. - Staging cleanup: verify the GCS staging prefix is empty (see Staging Cleanup & Orphan Sweep).
2. Docker ↔ Kubernetes (NFS)
Section titled “2. Docker ↔ Kubernetes (NFS)”Covers moving between a local-disk Runtime Broker (docker) and a Kubernetes Runtime Broker configured with hub.k8s_nfs_home enabled (with the agent started after enabling it) and server.project_storage with backend: nfs, homes: nfs, homes_options.allow_incomplete_phases: true (see Agent home storage), and a share with pv_name.
- Docker → Kubernetes (NFS):
Terminal window scion reincarnate <agent> --broker <k8s-nfs-broker> --dry-runscion reincarnate <agent> --broker <k8s-nfs-broker> --handoff-file /tmp/move-handoff.md- Dry run reports
Transfer mode: bundle (...). - After start on
<k8s-nfs-broker>, run the Verify state on target agent block. - Confirm
home-prepareran in seed-over mode (target-rendered harness config andagent-info.jsonare present alongside preserved~/notes.txtand~/.bash_history) and file ownership inside the pod allows the container user (uid 1000) to read and write both/workspaceand$HOME.
- Dry run reports
- Kubernetes (NFS) → Docker:
- Seed new markers on the Kubernetes NFS agent (including verifying an existing
/scion-staging/...secret symlink in NFS home does not fail precheck or export).
Terminal window scion reincarnate <agent> --broker <docker-a> --dry-runscion reincarnate <agent> --broker <docker-a> --handoff-file /tmp/move-handoff.md- Dry run reports
Transfer mode: bundle (...). - After start on
<docker-a>, run the Verify state on target agent block.
- Seed new markers on the Kubernetes NFS agent (including verifying an existing
- Staging cleanup: verify the GCS staging prefix is empty.
3. Kubernetes (NFS) ↔ Cloud Run (NFS)
Section titled “3. Kubernetes (NFS) ↔ Cloud Run (NFS)”Covers moving between a Kubernetes NFS Runtime Broker (hub.k8s_nfs_home enabled, homes: nfs, homes_options.allow_incomplete_phases: true, pv_name) and a Cloud Run Instances Runtime Broker configured with NFS server.project_storage (backend: nfs, nfs.mount_root, shares[0]).
- Kubernetes (NFS) → Cloud Run (NFS):
Terminal window scion reincarnate <agent> --broker <cloudrun-nfs-broker> --dry-runscion reincarnate <agent> --broker <cloudrun-nfs-broker> --handoff-file /tmp/move-handoff.md- Dry run reports
Transfer mode: bundle (...). - After start on
<cloudrun-nfs-broker>, run the Verify state on target agent block. - Confirm
provisionCloudRunHomeseeded target-rendered home files over the imported leaf without overwriting~/notes.txtor~/.bash_history, and workspace/home ownership matchesnfs.uid:nfs.gid.
- Dry run reports
- Cloud Run (NFS) → Kubernetes (NFS):
- Seed new markers on the Cloud Run NFS agent.
Terminal window scion reincarnate <agent> --broker <k8s-nfs-broker> --dry-runscion reincarnate <agent> --broker <k8s-nfs-broker> --handoff-file /tmp/move-handoff.md- Dry run reports
Transfer mode: bundle (...). - After start on
<k8s-nfs-broker>, run the Verify state on target agent block.
- Staging cleanup: verify the GCS staging prefix is empty.
Refused Cases & Ladder Precedence
Section titled “Refused Cases & Ladder Precedence”Run each case with --dry-run and confirm the move is refused (or selects export) with no side effects on the running agent:
- Same-export eligible move still selects
export(even with--force):Expected:Terminal window scion reincarnate <k8s-agent> --broker <same-export-k8s-broker> --dry-runscion reincarnate <k8s-agent> --broker <same-export-k8s-broker> --dry-run --forceTransfer mode: export (the workspace is carried through the shared NFS export)and--force was not needed: the workspace is carried through the shared NFS export. - Plain Kubernetes pod (non-NFS workspace, pod-local home, or
hub.k8s_nfs_homeoff when agent started):Expected: refused withTerminal window scion reincarnate <plain-k8s-agent> --broker <docker-b> --dry-runbundle transfer unavailable: workspace and home live only in the pod and are deleted on stop(oragent home lives only in the pod and is deleted on stop, orbroker <name> does not support bundle move; upgrade itwhen the Runtime Broker has no NFS home configured), plus the--forcehint. - Cloud Run Sandbox:
Expected: refused with
Terminal window scion reincarnate <sandbox-agent> --broker <docker-b> --dry-runbundle transfer unavailable: Cloud Run Sandbox workspace and home are not durable for bundle moves(orbroker <name> does not support bundle move; upgrade iton a sandbox-only Runtime Broker). - Experiment disabled:
Expected while off: refused with
Terminal window scion hub experiments disable hub.agent_move_bundlescion reincarnate <agent> --broker <docker-b> --dry-runscion hub experiments enable hub.agent_move_bundlebundle transfer unavailable: bundle transfer requires the hub.agent_move_bundle experimentand the--forcehint. - Hub object storage unconfigured:
On a Hub with no
server.storageconfigured:Expected: refused withTerminal window scion reincarnate <agent> --broker <docker-b> --dry-runbundle transfer unavailable: hub object storage is not configured. - Non-GCS Hub storage (for example
local): On a Hub configured withserver.storage.provider: local:Expected: refused withTerminal window scion reincarnate <agent> --broker <docker-b> --dry-runbundle transfer unavailable: hub object storage provider "local" cannot issue signed URLs a remote broker can use. - Shared-plain or worktree-per-agent workspace:
Expected: refused (
Terminal window scion reincarnate <shared-or-worktree-agent> --broker <docker-b> --dry-runworkspace_modefor worktree-per-agent;bundle transfer supports clone-per-agent and empty-per-agent workspaces; this agent's workspace is <mode>for shared-plain). - Missing start-time home-exclusion record:
For an agent that has not started since
.scion-move-bundle-home.jsonrecording shipped (or after removing that file on a test Runtime Broker):Expected: refused withTerminal window scion reincarnate <agent> --broker <docker-b> --dry-runbundle transfer unavailable: restart the agent once to enable bundle moves.
Failure Injection & Rollback
Section titled “Failure Injection & Rollback”1. Limit exceeded (precheck before stop, and during export or import)
Section titled “1. Limit exceeded (precheck before stop, and during export or import)”- Caught at precheck / recheck (before stop): On a test Hub with a small
server.reincarnate.move_bundle.workspace_max_bytes(or by writing a file larger than the configured limit inside the source agent’s/workspace):Expected:Terminal window scion reincarnate <agent> --broker <target> --dry-run- Refused with
bundle transfer unavailable: bundle exceeds limit: workspace bytes (...) exceed configured limit. - If triggered between dry run and worker start, the worker fails from
pendingbefore stopping the agent (TestMoveBundleWorker_PrecheckOverLimitFailsBeforeStop). - The source agent remains running on the source Runtime Broker with its workspace intact, and no objects exist under
move-bundles/in GCS.
- Refused with
- Caught during export or import (post-stop): If a file crosses a limit after precheck (for example written just before stop, or enforced against a forged/oversized manifest during import), export fails from
stoppingwithbundle exceeds limit:(source intact, staging deleted) and import rolls back to source (target deleted, staging deleted). Because racing precheck vs. stop is timing-sensitive to inject manually, this path is also covered automatically bypkg/transfer/bundleT4 (TestT4_Limits_WriterAndReader) and Hub T11 (TestMoveBundleWorker_ManifestVerifySizeMismatch).
2. Export failure (source intact, no target touched)
Section titled “2. Export failure (source intact, no target touched)”- Start a bundle move (
scion reincarnate <agent> --broker <target> --handoff-file /tmp/move-handoff.md) and restart the source Runtime Broker whilescion listshowsmigrating: uploading snapshot(so the Hub status poll gets404). - Verify the outcome (also covered by T11
TestMoveBundleWorker_ExportFailures):- The reincarnation record fails from
stoppingwith an error starting withbundle export failed:. - The agent remains assigned to the source Runtime Broker, stopped, in
errorphase, with status message:move failed: <err>; agent state is intact on <src>; \scion start` to resume` - No target agent directory was created on
<target>. - No staging objects remain in GCS for that reincarnation ID.
- Running
scion start <agent>resumes cleanly on the source Runtime Broker with all seeded files intact.
- The reincarnation record fails from
3. Import failure → marker-guarded rollback
Section titled “3. Import failure → marker-guarded rollback”- Start a bundle move (
scion reincarnate <agent> --broker <target> --handoff-file /tmp/move-handoff.md) and inject an import failure on the target Runtime Broker whilescion listshowsmigrating: restoring snapshot(for example, restart the target Runtime Broker quickly so the Hub poll gets404, or block target egress to GCS). - Timing caveat: the Hub polls every 2 seconds and tolerates only 3 consecutive transient transport/5xx errors (~6 seconds total). If the target Runtime Broker stays down longer than ~6 seconds, the move fails on transport errors and rolls back while the target is still unreachable; the Hub then logs
move rollback: could not remove the agent's state on the target broker; left in place, and target cleanup must be verified (or cleaned up manually) after the target Runtime Broker comes back online. - Verify the rollback outcome (also covered by T11
TestMoveBundleWorker_ImportFailuresRollBack):- The agent is restored to the source Runtime Broker in
errorphase, stopped, and its reincarnation record error starts withbundle import failed:. - When the target Runtime Broker was reachable during rollback (fast restart returning
404, or GCS egress block), the target has no leftover agent directory and no.bundle-*staging siblings (marker-guarded rollback delete cleaned them up). If the target was unreachable during rollback, check the Hub log formove rollback: could not remove the agent's state on the target broker; left in placeand clean up stale target state after the target returns. - Running
scion start <agent>resumes cleanly on the source Runtime Broker with all seeded workspace and$HOMEfiles intact. - No staging objects remain in GCS for that reincarnation ID.
- The agent is restored to the source Runtime Broker in
4. Definitive start failure → marker-guarded rollback
Section titled “4. Definitive start failure → marker-guarded rollback”- Trigger a definitive start failure on the target after import succeeds (for example, pass
--image <nonexistent-image>with--broker <target>so container start fails definitively without leaving a container). - Verify the rollback outcome (also covered by T11
TestMoveBundleWorker_DefinitiveStartFailureRollsBack):- The target agent directory and
.bundle-*staging siblings are removed by marker-guarded rollback delete. - The agent is restored to the source Runtime Broker with its previous image/config and source files intact.
- No staging objects remain in GCS for that reincarnation ID.
- The target agent directory and
5. Signed-URL redaction
Section titled “5. Signed-URL redaction”- Inspect the failed reincarnation records, Hub logs, and both Runtime Brokers’ logs from the failure-injection runs above. Confirm no GCS signed URL query parameters (
X-Goog-Signature,X-Goog-Credential) appear in any log line orerrorfield.
Staging Cleanup & Orphan Sweep
Section titled “Staging Cleanup & Orphan Sweep”- List staging prefix after moves:
Expected: no objects remain after completed or failed moves.
Terminal window # When server.hub.hub_id is set:gcloud storage ls "gs://${BUCKET_NAME}/hubs/${HUB_ID}/move-bundles/"# When server.hub.hub_id is unset:gcloud storage ls "gs://${BUCKET_NAME}/move-bundles/" - Orphan sweep (including while experiment is off):
- Upload a dummy object to a synthetic missing-record prefix:
Terminal window printf 'orphan-test\n' | gcloud storage cp - "gs://${BUCKET_NAME}/hubs/${HUB_ID}/move-bundles/00000000-0000-0000-0000-000000000000/manifest.json" - Optionally disable
hub.agent_move_bundleto confirm cleanup is ungated. - Wait for the next 5-minute
reincarnation-sweeptick and re-list the prefix. - Expected: the synthetic orphan prefix is deleted (and any concurrently running non-terminal move’s prefix is untouched). Re-enable
hub.agent_move_bundleif disabled.
- Upload a dummy object to a synthetic missing-record prefix:
- GCS bucket lifecycle backstop:
Expected: a
Terminal window gcloud storage buckets describe "gs://${BUCKET_NAME}" --format="json(lifecycle)"Deleterule withage: 7matchinghubs/${HUB_ID}/move-bundles/(and/ormove-bundles/).