# Port Sandbox Test

> End-to-end sandbox test of conversation porting across Claude Code / Codex / OpenCode. Seeds real convos into an isolated store, ports them, verifies visibility + resumability, logs failures as issues without touching real conversations. Use when asked to test porting end-to-end, verify a harness pair, or sweep all conversations.

- Skill: `mem0ai/port-sandbox-test` (Agent Skill)
- Install (CLI): `npx skillmds@latest add mem0ai/port-sandbox-test`
- Raw SKILL.md: https://api.skillmd.com/api/skills/mem0ai/port-sandbox-test/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: mem0ai (https://skillmd.com/u/mem0ai)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/mem0ai/port-sandbox-test

---


# Port Sandbox Test

All commands run from `cli/`. Never write a real store without a backup first.
The sandbox lives at `~/.openmemory-sandbox/` (`OPENMEMORY_SANDBOX_ROOT` overrides).
This flow is a **pure reporter**: on ANY failure, log an issue and CONTINUE — never abort the run.

## Deep flow (one conversation, resumability proof)

1. **Back up everything:** `bun run sandbox:backup --harness all`. Confirm backup dirs printed.
2. **Seed:** `bun run sandbox:seed --projects 3 --convos 5`. Note the seeded session filenames (session id = basename minus `.jsonl`).
3. **Pick source + dest** (ask the user if unspecified; default source claude-code) and ONE seeded session id.
4. **Port under sandbox env** (env vars must be in the SAME shell invocation — they don't persist between Bash calls):
   ```bash
   eval "$(bun run sandbox:reroute --harness <source>)" && \
   eval "$(bun run sandbox:reroute --harness <dest>)" && \
   bun run cli port --from <source> --to <dest> --id <sessionId> --json
   ```
5. **Verify — store:** `sessionExists(dest, ...)` from `scripts/sandbox/store-check.ts` under the same env (or re-discover and match on the ported title/id).
6. **Verify — resume (terminal):** `probeResume(dest, portedDestId, {...writeEnv(dest), ...ledgerEnv()})` from `scripts/sandbox/resume-probe.ts`. Assert the reply contains `ok`.
7. **Verify — desktop app (interactive sessions only):** launch the app binary from `config.appLaunch(dest)` with `appReadEnv(dest)` set, screenshot (`screencapture -x`), confirm the conversation shows in the sidebar and no "failed to open project" popup. Skip in autonomous runs; note the skip in the report.
8. **On ANY failure:** `logIssue({...})` from `scripts/sandbox/issues.ts` with the failed `phase` and captured output, then continue.
9. **Clean up:** `bun run sandbox:clear --harness all` then `bun run sandbox:restore --harness all` (only needed if a real store was written; clear is always safe).

## Bulk sweep (all conversations)

For every seeded session (or `--all` real sessions if the user explicitly says so), port to each destination and verify with `sessionExists` only — no launches. Log an issue per failure, never abort. This surfaces convos that break (e.g. projects that moved).

## Fixing is decoupled

Do NOT fix during the run. After the run:
1. `readIssues()`; group by root-cause signature (harness pair + phase + message).
2. For each distinct root cause, dispatch a `hard-debug` subagent with the issue + captured log.
3. Record outcomes as a decision page under `docs/brain/decisions/`.

